diff --git a/CHANGELOG.md b/CHANGELOG.md index c373b8d0..cf0f1070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## (WIP) v0.22.0 +- Sync Admin UI collection changes across browser tabs. + - Added `jsvm.Config.OnInit` optional config field to allow registering custom Go bindings to the JSVM. - Other minor improvements (updated the `ghupdate` plugin to use the configured executable name, fixed Admin UI vertical image preview scroll, etc.) diff --git a/ui/dist/assets/AuthMethodsDocs-E8qGD5-5.js b/ui/dist/assets/AuthMethodsDocs-7RQCHeOb.js similarity index 62% rename from ui/dist/assets/AuthMethodsDocs-E8qGD5-5.js rename to ui/dist/assets/AuthMethodsDocs-7RQCHeOb.js index 7347a43f..797d8358 100644 --- a/ui/dist/assets/AuthMethodsDocs-E8qGD5-5.js +++ b/ui/dist/assets/AuthMethodsDocs-7RQCHeOb.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-ohPVsOF0.js";import{S as Ke}from"./SdkTabs-ZFbexUF1.js";import{F as qe}from"./FieldsQueryParam-pO449pwf.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` +import{S as Se,i as ye,s as Ae,O as G,e as c,v as w,b as k,c as se,f as p,g as d,h as a,m as ae,w as U,P as ve,Q as Te,k as je,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,A as Qe,q as L,r as Ne,N as qe}from"./index-MkGUixqr.js";import{S as He}from"./SdkTabs-7yshYvVF.js";import{F as Ke}from"./FieldsQueryParam-N-1EL4Av.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,q=n[0].name+"",E,ie,I,P,J,T,Y,$,H,ce,K,j,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,A,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); @@ -14,7 +14,7 @@ import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as ... final result = await pb.collection('${(ke=n[0])==null?void 0:ke.name}').listAuthMethods(); - `}}),T=new qe({});let D=G(n[2]);const pe=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description',ue=k(),te=c("tbody"),se(T.$$.fragment),le=k(),O=c("div"),O.textContent="Responses",oe=k(),S=c("div"),F=c("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description',ue=k(),te=c("tbody"),se(A.$$.fragment),le=k(),O=c("div"),O.textContent="Responses",oe=k(),S=c("div"),F=c("div");for(let e=0;eo(1,f=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Fe.getApiExampleUrl(Qe.baseUrl)),o(2,i=[{code:200,body:` + `),P.$set(r),(!y||t&1)&&z!==(z=e[0].name+"")&&U(X,z),t&6&&(D=G(e[2]),g=ve(g,t,pe,1,e,D,he,F,Te,$e,null,Pe)),t&6&&(N=G(e[2]),je(),b=ve(b,t,_e,1,e,N,fe,Q,Be,Me,null,Ce),Oe())},i(e){if(!y){W(P.$$.fragment,e),W(A.$$.fragment,e);for(let t=0;to(1,f=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Fe.getApiExampleUrl(Qe.baseUrl)),o(2,i=[{code:200,body:` { "usernamePassword": true, "emailPassword": true, @@ -61,4 +61,4 @@ import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as } ] } - `}]),[_,f,i,s,h]}class Ve extends Se{constructor(l){super(),ye(this,l,De,ze,Te,{collection:0})}}export{Ve as default}; + `}]),[_,f,i,s,h]}class Ve extends Se{constructor(l){super(),ye(this,l,De,ze,Ae,{collection:0})}}export{Ve as default}; diff --git a/ui/dist/assets/AuthRefreshDocs-MSIqKvjR.js b/ui/dist/assets/AuthRefreshDocs-MKJO-QLX.js similarity index 73% rename from ui/dist/assets/AuthRefreshDocs-MSIqKvjR.js rename to ui/dist/assets/AuthRefreshDocs-MKJO-QLX.js index 2a79633f..83466e64 100644 --- a/ui/dist/assets/AuthRefreshDocs-MSIqKvjR.js +++ b/ui/dist/assets/AuthRefreshDocs-MKJO-QLX.js @@ -1,4 +1,4 @@ -import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-ohPVsOF0.js";import{S as Ze}from"./SdkTabs-ZFbexUF1.js";import{F as et}from"./FieldsQueryParam-pO449pwf.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function xe(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,Q=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` +import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,v as k,b as p,c as K,f as b,g as d,h as o,m as I,w as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,A as Xe,q as G,r as Ye}from"./index-MkGUixqr.js";import{S as Ze}from"./SdkTabs-7yshYvVF.js";import{F as et}from"./FieldsQueryParam-N-1EL4Av.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,z,ue,Q,M,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],qe=new Map,q;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); @@ -24,15 +24,15 @@ import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b print(pb.authStore.isValid); print(pb.authStore.token); print(pb.authStore.model.id); - `}}),R=new Qe({props:{content:"?expand=relField1,relField2.subRelField"}}),A=new et({props:{prefix:"record."}});let j=J(r[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eReturns a new auth response (token and record data) for an + `}}),R=new Ue({props:{content:"?expand=relField1,relField2.subRelField"}}),A=new et({props:{prefix:"record."}});let x=J(r[2]);const Be=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eReturns a new auth response (token and record data) for an already authenticated record.

This method is usually called by users on page/screen reload to ensure that the previously stored - data in pb.authStore is still valid and up-to-date.

`,g=p(),K(v.$$.fragment),w=p(),M=s("h6"),M.textContent="API details",X=p(),S=s("div"),x=s("strong"),x.textContent="POST",ue=p(),z=s("div"),q=s("p"),pe=k("/api/collections/"),Y=s("strong"),Z=k(Q),he=k("/auth-refresh"),fe=p(),U=s("p"),U.innerHTML="Requires record Authorization:TOKEN header",ee=p(),D=s("div"),D.textContent="Query parameters",te=p(),T=s("table"),oe=s("thead"),oe.innerHTML='Param Type Description',be=p(),F=s("tbody"),C=s("tr"),le=s("td"),le.textContent="expand",me=p(),ae=s("td"),ae.innerHTML='String',_e=p(),f=s("td"),ke=k(`Auto expand record relations. Ex.: + data in pb.authStore is still valid and up-to-date.

`,g=p(),K(v.$$.fragment),w=p(),B=s("h6"),B.textContent="API details",X=p(),S=s("div"),z=s("strong"),z.textContent="POST",ue=p(),Q=s("div"),M=s("p"),pe=k("/api/collections/"),Y=s("strong"),Z=k(U),he=k("/auth-refresh"),fe=p(),j=s("p"),j.innerHTML="Requires record Authorization:TOKEN header",ee=p(),D=s("div"),D.textContent="Query parameters",te=p(),T=s("table"),oe=s("thead"),oe.innerHTML='Param Type Description',be=p(),F=s("tbody"),C=s("tr"),le=s("td"),le.textContent="expand",me=p(),ae=s("td"),ae.innerHTML='String',_e=p(),f=s("td"),ke=k(`Auto expand record relations. Ex.: `),K(R.$$.fragment),ge=k(` Supports up to 6-levels depth nested relations expansion. `),ve=s("br"),$e=k(` The expanded relations will be appended to the record under the `),se=s("code"),se.textContent="expand",ye=k(" property (eg. "),ne=s("code"),ne.textContent='"expand": {"relField1": {...}, ...}',Se=k(`). `),we=s("br"),Te=k(` - Only the relations to which the request user has permissions to `),re=s("strong"),re.textContent="view",Ce=k(" will be expanded."),Pe=p(),K(A.$$.fragment),ie=p(),O=s("div"),O.textContent="Responses",ce=p(),P=s("div"),H=s("div");for(let e=0;ea(1,_=g.code);return r.$$set=g=>{"collection"in g&&a(0,m=g.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Le.dummyCollectionRecord(m)},null,2)},{code:401,body:` + `),v.$set(c),(!q||t&1)&&U!==(U=e[0].name+"")&&de(Z,U),t&6&&(x=J(e[2]),y=Ee(y,t,Be,1,e,x,Re,H,Ke,ze,null,Ve)),t&6&&(L=J(e[2]),Ie(),$=Ee($,t,Me,1,e,L,qe,E,We,Qe,null,Ne),Ge())},i(e){if(!q){N(v.$$.fragment,e),N(R.$$.fragment,e),N(A.$$.fragment,e);for(let t=0;ta(1,_=g.code);return r.$$set=g=>{"collection"in g&&a(0,m=g.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Le.dummyCollectionRecord(m)},null,2)},{code:401,body:` { "code": 401, "message": "The request requires valid record authorization token to be set.", @@ -76,4 +76,4 @@ import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b "message": "Missing auth record context.", "data": {} } - `}])},a(3,n=Le.getApiExampleUrl(Xe.baseUrl)),[m,_,i,n,h]}class nt extends Ue{constructor(l){super(),je(this,l,ot,tt,Je,{collection:0})}}export{nt as default}; + `}])},a(3,n=Le.getApiExampleUrl(Xe.baseUrl)),[m,_,i,n,h]}class nt extends je{constructor(l){super(),xe(this,l,ot,tt,Je,{collection:0})}}export{nt as default}; diff --git a/ui/dist/assets/AuthWithOAuth2Docs-RDXOM2lB.js b/ui/dist/assets/AuthWithOAuth2Docs-wpInYmBQ.js similarity index 78% rename from ui/dist/assets/AuthWithOAuth2Docs-RDXOM2lB.js rename to ui/dist/assets/AuthWithOAuth2Docs-wpInYmBQ.js index 621b04d3..1b81331c 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-RDXOM2lB.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-wpInYmBQ.js @@ -1,4 +1,4 @@ -import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Ne,k as Qe,R as ze,n as Ie,t as L,a as x,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-ohPVsOF0.js";import{S as Xe}from"./SdkTabs-ZFbexUF1.js";import{F as Ye}from"./FieldsQueryParam-pO449pwf.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,E,be,J,R,me,Z,N=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,v as k,b as h,c as I,f as p,g as r,h as a,m as K,w as pe,P as Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,A as Ke,q as X,r as Ge}from"./index-MkGUixqr.js";import{S as Xe}from"./SdkTabs-7yshYvVF.js";import{F as Ye}from"./FieldsQueryParam-N-1EL4Av.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,m;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(m=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,m()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,m){r(d,n,m),K(i,n,null),a(n,f),g=!0},p(d,m){l=d;const _={};m&4&&(_.content=l[5].body),i.$set(_),(!g||m&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,m,_,v,O,P,Y,A,J,me,N,R,be,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,b,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); @@ -45,18 +45,18 @@ import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p // "logout" the last authenticated model pb.authStore.clear(); - `}}),C=new Le({props:{content:"?expand=relField1,relField2.subRelField"}}),q=new Ye({props:{prefix:"record."}});let Q=z(s[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthenticate with an OAuth2 provider and returns a new auth token and record data.

For more details please check the + `}}),C=new Le({props:{content:"?expand=relField1,relField2.subRelField"}}),q=new Ye({props:{prefix:"record."}});let x=z(s[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthenticate with an OAuth2 provider and returns a new auth token and record data.

For more details please check the OAuth2 integration documentation - .

`,_=h(),I(v.$$.fragment),O=h(),P=o("h6"),P.textContent="API details",Y=h(),A=o("div"),E=o("strong"),E.textContent="POST",be=h(),J=o("div"),R=o("p"),me=k("/api/collections/"),Z=o("strong"),ee=k(N),fe=k("/auth-with-oauth2"),te=h(),M=o("div"),M.textContent="Body Parameters",ae=h(),W=o("table"),W.innerHTML=`Param Type Description
Required provider
String The name of the OAuth2 client provider (eg. "google").
Required code
String The authorization code returned from the initial request.
Required codeVerifier
String The code verifier sent with the initial request as part of the code_challenge.
Required redirectUrl
String The redirect url sent with the initial request.
Optional createData
Object

Optional data that will be used when creating the auth record on OAuth2 sign-up.

The created auth record must comply with the same requirements and validations in the + .

`,_=h(),I(v.$$.fragment),O=h(),P=o("h6"),P.textContent="API details",Y=h(),A=o("div"),J=o("strong"),J.textContent="POST",me=h(),N=o("div"),R=o("p"),be=k("/api/collections/"),Z=o("strong"),ee=k(Q),fe=k("/auth-with-oauth2"),te=h(),M=o("div"),M.textContent="Body Parameters",ae=h(),W=o("table"),W.innerHTML=`Param Type Description
Required provider
String The name of the OAuth2 client provider (eg. "google").
Required code
String The authorization code returned from the initial request.
Required codeVerifier
String The code verifier sent with the initial request as part of the code_challenge.
Required redirectUrl
String The redirect url sent with the initial request.
Optional createData
Object

Optional data that will be used when creating the auth record on OAuth2 sign-up.

The created auth record must comply with the same requirements and validations in the regular create action.
The data can only be in json, aka. multipart/form-data and files - upload currently are not supported during OAuth2 sign-ups.

`,le=h(),U=o("div"),U.textContent="Query parameters",ne=h(),S=o("table"),oe=o("thead"),oe.innerHTML='Param Type Description',ge=h(),B=o("tbody"),y=o("tr"),se=o("td"),se.textContent="expand",ke=h(),ie=o("td"),ie.innerHTML='String',_e=h(),m=o("td"),ve=k(`Auto expand record relations. Ex.: + upload currently are not supported during OAuth2 sign-ups.

`,le=h(),U=o("div"),U.textContent="Query parameters",ne=h(),S=o("table"),oe=o("thead"),oe.innerHTML='Param Type Description',ge=h(),B=o("tbody"),y=o("tr"),se=o("td"),se.textContent="expand",ke=h(),ie=o("td"),ie.innerHTML='String',_e=h(),b=o("td"),ve=k(`Auto expand record relations. Ex.: `),I(C.$$.fragment),we=k(` Supports up to 6-levels depth nested relations expansion. `),$e=o("br"),Oe=k(` The expanded relations will be appended to the record under the `),re=o("code"),re.textContent="expand",Ae=k(" property (eg. "),ce=o("code"),ce.textContent='"expand": {"relField1": {...}, ...}',Se=k(`). `),ye=o("br"),Te=k(` - Only the relations to which the request user has permissions to `),de=o("strong"),de.textContent="view",Ce=k(" will be expanded."),qe=h(),I(q.$$.fragment),ue=h(),F=o("div"),F.textContent="Responses",he=h(),T=o("div"),H=o("div");for(let e=0;e<$.length;e+=1)$[e].c();Pe=h(),j=o("div");for(let e=0;en(1,g=_.code);return s.$$set=_=>{"collection"in _&&n(0,f=_.collection)},s.$$.update=()=>{s.$$.dirty&1&&n(2,d=[{code:200,body:JSON.stringify({token:"JWT_AUTH_TOKEN",record:Be.dummyCollectionRecord(f),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png",accessToken:"...",refreshToken:"...",rawUser:{}}},null,2)},{code:400,body:` + `),v.$set(u),(!D||t&1)&&Q!==(Q=e[0].name+"")&&pe(ee,Q),t&6&&(x=z(e[2]),$=Ue($,t,Me,1,e,x,De,H,Qe,je,null,He)),t&6&&(V=z(e[2]),xe(),w=Ue(w,t,We,1,e,V,Re,j,ze,Ve,null,Fe),Ie())},i(e){if(!D){L(v.$$.fragment,e),L(C.$$.fragment,e),L(q.$$.fragment,e);for(let t=0;tn(1,g=_.code);return s.$$set=_=>{"collection"in _&&n(0,f=_.collection)},s.$$.update=()=>{s.$$.dirty&1&&n(2,d=[{code:200,body:JSON.stringify({token:"JWT_AUTH_TOKEN",record:Be.dummyCollectionRecord(f),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png",accessToken:"...",refreshToken:"...",rawUser:{}}},null,2)},{code:400,body:` { "code": 400, "message": "An error occurred while submitting the form.", @@ -114,4 +114,4 @@ import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p } } } - `}])},n(3,i=Be.getApiExampleUrl(Ke.baseUrl)),[f,g,d,i,b]}class nt extends xe{constructor(l){super(),Ee(this,l,et,Ze,Je,{collection:0})}}export{nt as default}; + `}])},n(3,i=Be.getApiExampleUrl(Ke.baseUrl)),[f,g,d,i,m]}class nt extends Ee{constructor(l){super(),Je(this,l,et,Ze,Ne,{collection:0})}}export{nt as default}; diff --git a/ui/dist/assets/AuthWithPasswordDocs-RVIqELew.js b/ui/dist/assets/AuthWithPasswordDocs-WYTGSxgx.js similarity index 72% rename from ui/dist/assets/AuthWithPasswordDocs-RVIqELew.js rename to ui/dist/assets/AuthWithPasswordDocs-WYTGSxgx.js index 0597f8f0..94d68a36 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-RVIqELew.js +++ b/ui/dist/assets/AuthWithPasswordDocs-WYTGSxgx.js @@ -1,4 +1,4 @@ -import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as m,g as r,h as t,m as se,x as De,P as pt,Q as Pt,k as Rt,R as Ct,n as Ot,t as Z,a as x,o as c,d as ie,C as ft,p as At,r as re,u as Tt}from"./index-ohPVsOF0.js";import{S as Ut}from"./SdkTabs-ZFbexUF1.js";import{F as Mt}from"./FieldsQueryParam-pO449pwf.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&De(g,i),C&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,Be,he,V,be,M,me,qe,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ce,Qe,k,je,q,Je,Ke,ze,Oe,Ge,Ae,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,A=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` +import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,v as p,b as d,c as ne,f as m,g as r,h as t,m as se,w as De,P as pt,Q as Pt,k as Rt,R as At,n as Ct,t as Z,a as x,o as c,d as ie,C as ft,A as Ot,q as re,r as Tt}from"./index-MkGUixqr.js";import{S as Ut}from"./SdkTabs-7yshYvVF.js";import{F as Mt}from"./FieldsQueryParam-N-1EL4Av.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,A){r(R,a,A),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,A){l=R,A&16&&i!==(i=l[8].code+"")&&De(g,i),A&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,A,C,q,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,qe,he,V,be,M,me,Be,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ae,Qe,k,je,B,Je,Ke,ze,Ce,Ge,Oe,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,O=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); @@ -36,17 +36,17 @@ import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as // "logout" the last authenticated account pb.authStore.clear(); - `}});let v=s[1]&&mt(),w=s[1]&&s[2]&&_t(),y=s[2]&&kt();q=new vt({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Mt({props:{prefix:"record."}});let ae=oe(s[4]);const st=e=>e[8].code;for(let e=0;ee[8].code;for(let e=0;eParam Type Description',qe=d(),Q=n("tbody"),D=n("tr"),_e=n("td"),_e.innerHTML='
Required identity
',Fe=d(),ke=n("td"),ke.innerHTML='String',He=d(),$=n("td"),Ye=p(`The + `}});let v=s[1]&&mt(),w=s[1]&&s[2]&&_t(),y=s[2]&&kt();B=new vt({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Mt({props:{prefix:"record."}});let ae=oe(s[4]);const st=e=>e[8].code;for(let e=0;ee[8].code;for(let e=0;eParam Type Description',Be=d(),Q=n("tbody"),D=n("tr"),_e=n("td"),_e.innerHTML='
Required identity
',Fe=d(),ke=n("td"),ke.innerHTML='String',He=d(),$=n("td"),Ye=p(`The `),v&&v.c(),ge=d(),w&&w.c(),Se=d(),y&&y.c(),ve=p(` - of the record to authenticate.`),Ne=d(),we=n("tr"),we.innerHTML='
Required password
String The auth record password.',ye=d(),j=n("div"),j.textContent="Query parameters",$e=d(),E=n("table"),Pe=n("thead"),Pe.innerHTML='Param Type Description',Ie=d(),J=n("tbody"),W=n("tr"),Re=n("td"),Re.textContent="expand",Ve=d(),Ce=n("td"),Ce.innerHTML='String',Qe=d(),k=n("td"),je=p(`Auto expand record relations. Ex.: - `),ne(q.$$.fragment),Je=p(` + of the record to authenticate.`),Ne=d(),we=n("tr"),we.innerHTML='
Required password
String The auth record password.',ye=d(),j=n("div"),j.textContent="Query parameters",$e=d(),E=n("table"),Pe=n("thead"),Pe.innerHTML='Param Type Description',Ie=d(),J=n("tbody"),W=n("tr"),Re=n("td"),Re.textContent="expand",Ve=d(),Ae=n("td"),Ae.innerHTML='String',Qe=d(),k=n("td"),je=p(`Auto expand record relations. Ex.: + `),ne(B.$$.fragment),Je=p(` Supports up to 6-levels depth nested relations expansion. `),Ke=n("br"),ze=p(` The expanded relations will be appended to the record under the - `),Oe=n("code"),Oe.textContent="expand",Ge=p(" property (eg. "),Ae=n("code"),Ae.textContent='"expand": {"relField1": {...}, ...}',Xe=p(`). + `),Ce=n("code"),Ce.textContent="expand",Ge=p(" property (eg. "),Oe=n("code"),Oe.textContent='"expand": {"relField1": {...}, ...}',Xe=p(`). `),Ze=n("br"),xe=p(` - Only the relations to which the request user has permissions to `),Te=n("strong"),Te.textContent="view",et=p(" will be expanded."),tt=d(),ne(F.$$.fragment),Ue=d(),K=n("div"),K.textContent="Responses",Me=d(),L=n("div"),z=n("div");for(let e=0;ea(3,_=O.code);return s.$$set=O=>{"collection"in O&&a(0,u=O.collection)},s.$$.update=()=>{var O,B;s.$$.dirty&1&&a(2,g=(O=u==null?void 0:u.options)==null?void 0:O.allowEmailAuth),s.$$.dirty&1&&a(1,b=(B=u==null?void 0:u.options)==null?void 0:B.allowUsernameAuth),s.$$.dirty&6&&a(5,f=b&&g?"YOUR_USERNAME_OR_EMAIL":b?"YOUR_USERNAME":"YOUR_EMAIL"),s.$$.dirty&1&&a(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:ft.dummyCollectionRecord(u)},null,2)},{code:400,body:` + `),T.$set(h),(!H||o&1)&&le!==(le=e[0].name+"")&&De(fe,le),e[1]?v||(v=mt(),v.c(),v.m($,ge)):v&&(v.d(1),v=null),e[1]&&e[2]?w||(w=_t(),w.c(),w.m($,Se)):w&&(w.d(1),w=null),e[2]?y||(y=kt(),y.c(),y.m($,ve)):y&&(y.d(1),y=null),o&24&&(ae=oe(e[4]),O=pt(O,o,st,1,e,ae,lt,z,Pt,gt,null,bt)),o&24&&(X=oe(e[4]),Rt(),S=pt(S,o,it,1,e,X,ot,G,At,St,null,ht),Ct())},i(e){if(!H){Z(T.$$.fragment,e),Z(B.$$.fragment,e),Z(F.$$.fragment,e);for(let o=0;oa(3,_=C.code);return s.$$set=C=>{"collection"in C&&a(0,u=C.collection)},s.$$.update=()=>{var C,q;s.$$.dirty&1&&a(2,g=(C=u==null?void 0:u.options)==null?void 0:C.allowEmailAuth),s.$$.dirty&1&&a(1,b=(q=u==null?void 0:u.options)==null?void 0:q.allowUsernameAuth),s.$$.dirty&6&&a(5,f=b&&g?"YOUR_USERNAME_OR_EMAIL":b?"YOUR_USERNAME":"YOUR_EMAIL"),s.$$.dirty&1&&a(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:ft.dummyCollectionRecord(u)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -95,4 +95,4 @@ import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as } } } - `}])},a(6,i=ft.getApiExampleUrl(At.baseUrl)),[u,b,g,_,R,f,i,C]}class Yt extends wt{constructor(l){super(),yt(this,l,Bt,Lt,$t,{collection:0})}}export{Yt as default}; + `}])},a(6,i=ft.getApiExampleUrl(Ot.baseUrl)),[u,b,g,_,R,f,i,A]}class Yt extends wt{constructor(l){super(),yt(this,l,qt,Lt,$t,{collection:0})}}export{Yt as default}; diff --git a/ui/dist/assets/CodeEditor-AgADv186.js b/ui/dist/assets/CodeEditor-rWx4HUVf.js similarity index 99% rename from ui/dist/assets/CodeEditor-AgADv186.js rename to ui/dist/assets/CodeEditor-rWx4HUVf.js index 242acc76..ea43cb8d 100644 --- a/ui/dist/assets/CodeEditor-AgADv186.js +++ b/ui/dist/assets/CodeEditor-rWx4HUVf.js @@ -1,4 +1,4 @@ -import{S as wt,i as yt,s as xt,e as Yt,f as Wt,U as H,g as Tt,y as De,o as jt,J as vt,K as qt,L as _t,I as Rt,C as Vt,M as Gt}from"./index-ohPVsOF0.js";import{P as Ct,N as zt,v as Ut,D as Et,w as je,T as Oe,I as ve,x as J,y as o,z as At,L,A as K,B as _,F,G as qe,H as M,u as C,J as YO,K as WO,M as TO,E as q,O as jO,Q as m,R as It,U as Nt,V as vO,W as Dt,X as Bt,a as z,h as Jt,b as Lt,c as Kt,d as Ft,e as Mt,s as Ht,t as ea,f as Oa,g as ta,r as aa,i as ra,k as ia,j as sa,l as na,m as oa,n as la,o as ca,p as Qa,q as Be,C as ee}from"./index-u64XbdBO.js";var Je={};class ie{constructor(e,a,t,r,s,i,n,l,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=n,this.bufferBase=l,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new ie(e,[],a,t,t,0,[],0,r?new Le(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[n-4]==0&&i.buffer[n-1]>-1){if(a==t)return;if(i.buffer[n-2]>=a){i.buffer[n-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new ie(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sl&1&&n==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let n=(i>>19)-s;if(n>1){let l=i&65535,Q=this.stack.length-n*3;if(Q>=0&&e.getGoto(this.stack[Q],l,!1)>=0)return n<<19|65536|l}}else{let n=t(i,s+1);if(n!=null)return n}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Le{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class pa{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class se{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new se(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new se(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let l=i-32;if(l>=46&&(l-=46,n=!0),s+=l,n)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class te{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ke=new te;class da{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ke,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ke,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;qO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class ne{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(qO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}ne.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class k{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function qO(O,e,a,t,r,s){let i=0,n=1<0){let f=O[p];if(l.allows(f)&&(e.token.value==-1||e.token.value==f||ha(f,e.token.value,r,s))){e.acceptToken(f);break}}let d=e.next,c=0,u=O[i+2];if(e.next<0&&u>c&&O[Q+u*3-3]==65535){i=O[Q+u*3-1];continue e}for(;c>1,f=Q+p+(p<<1),P=O[f],S=O[f+1]||65536;if(d=S)c=p+1;else{i=O[f+2],e.advance();continue e}}break}}function Fe(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function ha(O,e,a,t){let r=Fe(a,t,e);return r<0||Fe(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class fa{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Me(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Me(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof Oe){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class ua{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new te)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),n=e.curContext?e.curContext.hash:0,l=0;for(let Q=0;Qc.end+25&&(l=Math.max(c.lookAhead,l)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return l&&e.setLookAhead(l),!t&&e.pos==this.stream.end&&(t=new te,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new te,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(n>>1)){n&1?e.extended=n>>1:e.value=n>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new fa(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(n);else{if(this.advanceStack(n,t,e))continue;{r||(r=[],s=[]),r.push(n);let l=this.tokens.getMainToken(n);s.push(l.value,l.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return g&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw g&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return g&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((n,l)=>l.score-n.score);t.length>i;)t.pop();t.some(n=>n.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((n.score-Q.score||n.buffer.length-Q.buffer.length)>0)t.splice(l--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(je.contextHash)||0)==d))return e.useNode(c,u),g&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof Oe)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof Oe&&c.positions[0]==0)c=p;else break}}let n=s.stateSlot(e.state,4);if(n>0)return e.reduce(n),g&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(n&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let Q=0;Qr?a.push(f):t.push(f)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return He(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(n.deadEnd&&(s||(s=!0,n.restart(),g&&console.log(d+this.stackID(n)+" (restarted)"),this.advanceFully(n,t))))continue;let c=n.split(),u=d;for(let p=0;c.forceReduce()&&p<10&&(g&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)g&&(u=this.stackID(c)+" -> ");for(let p of n.recoverByInsert(l))g&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>n.pos?(Q==n.pos&&(Q++,l=0),n.recoverByDelete(l,Q),g&&console.log(d+this.stackID(n)+` (via recover-delete ${this.parser.getName(l)})`),He(n,t)):(!r||r.scoreO;class _O{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Ct{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let n=0;ne.topRules[n][1]),r=[];for(let n=0;n=0)s(d,l,n[Q++]);else{let c=n[Q+-d];for(let u=-d;u>0;u--)s(n[Q++],l,c);Q++}}}this.nodeSet=new zt(a.map((n,l)=>Ut.define({name:l>=this.minRepeatTerm?void 0:n,id:l,props:r[l],top:t.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Et;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new R(i,n):n),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new $a(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],n=i&1,l=r[s++];if(n&&t)return l;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=x(this.data,s+2);else break;r=a(x(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=x(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(n=>n.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=eO(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const Za=54,ma=1,ga=55,ba=2,ka=56,Xa=3,OO=4,wa=5,oe=6,RO=7,VO=8,GO=9,CO=10,ya=11,xa=12,Ya=13,fe=57,Wa=14,tO=58,zO=20,Ta=22,UO=23,ja=24,Xe=26,EO=27,va=28,qa=31,_a=34,Ra=36,Va=37,Ga=0,Ca=1,za={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ua={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},aO={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ea(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function AO(O){return O==9||O==10||O==13||O==32}let rO=null,iO=null,sO=0;function we(O,e){let a=O.pos+e;if(sO==a&&iO==O)return rO;let t=O.peek(e);for(;AO(t);)t=O.peek(++e);let r="";for(;Ea(t);)r+=String.fromCharCode(t),t=O.peek(++e);return iO=O,sO=a,rO=r?r.toLowerCase():t==Aa||t==Ia?void 0:null}const IO=60,le=62,_e=47,Aa=63,Ia=33,Na=45;function nO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new nO(we(t,1)||"",O):O},reduce(O,e){return e==zO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==oe||r==Ra?new nO(we(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),Ja=new k((O,e)=>{if(O.next!=IO){O.next<0&&e.context&&O.acceptToken(fe);return}O.advance();let a=O.next==_e;a&&O.advance();let t=we(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Wa:oe);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ya);if(r&&Ua[r])return O.acceptToken(fe,-2);if(e.dialectEnabled(Ga))return O.acceptToken(xa);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Ya)}else{if(t=="script")return O.acceptToken(RO);if(t=="style")return O.acceptToken(VO);if(t=="textarea")return O.acceptToken(GO);if(za.hasOwnProperty(t))return O.acceptToken(CO);r&&aO[r]&&aO[r][t]?O.acceptToken(fe,-1):O.acceptToken(oe)}},{contextual:!0}),La=new k(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(tO);break}if(O.next==Na)e++;else if(O.next==le&&e>=2){a>=3&&O.acceptToken(tO,-2);break}else e=0;O.advance()}});function Ka(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Fa=new k((O,e)=>{if(O.next==_e&&O.peek(1)==le){let a=e.dialectEnabled(Ca)||Ka(e.context);O.acceptToken(a?wa:OO,2)}else O.next==le&&O.acceptToken(OO,1)});function Re(O,e,a){let t=2+O.length;return new k(r=>{for(let s=0,i=0,n=0;;n++){if(r.next<0){n&&r.acceptToken(e);break}if(s==0&&r.next==IO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&n){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ma=Re("script",Za,ma),Ha=Re("style",ga,ba),er=Re("textarea",ka,Xa),Or=J({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),tr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[Or],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=n.type.id;if(Q==va)return ue(n,l,a);if(Q==qa)return ue(n,l,t);if(Q==_a)return ue(n,l,r);if(Q==zO&&s.length){let d=n.node,c=d.firstChild,u=c&&oO(c,l),p;if(u){for(let f of s)if(f.tag==u&&(!f.attrs||f.attrs(p||(p=NO(d,l))))){let P=d.lastChild,S=P.type.id==Va?P.from:d.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==UO){let d=n.node,c;if(c=d.firstChild){let u=i[l.read(c.from,c.to)];if(u)for(let p of u){if(p.tagName&&p.tagName!=oO(d.parent,l))continue;let f=d.lastChild;if(f.type.id==Xe){let P=f.from+1,S=f.lastChild,X=f.to-(S&&S.isError?0:1);if(X>P)return{parser:p.parser,overlay:[{from:P,to:X}]}}else if(f.type.id==EO)return{parser:p.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ar=99,lO=1,rr=100,ir=101,cO=2,BO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],sr=58,nr=40,JO=95,or=91,ae=45,lr=46,cr=35,Qr=37,pr=38,dr=92,hr=10;function N(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function fr(O){return O>=48&&O<=57}const ur=new k((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(N(s)||s==ae||s==JO||a&&fr(s))!a&&(s!=ae||r>0)&&(a=!0),t===r&&s==ae&&t++,O.advance();else if(s==dr&&O.peek(1)!=hr)O.advance(),O.next>-1&&O.advance(),a=!0;else{a&&O.acceptToken(s==nr?rr:t==2&&e.canShift(cO)?cO:ir);break}}}),$r=new k(O=>{if(BO.includes(O.peek(-1))){let{next:e}=O;(N(e)||e==JO||e==cr||e==lr||e==or||e==sr&&N(O.peek(1))||e==ae||e==pr)&&O.acceptToken(ar)}}),Pr=new k(O=>{if(!BO.includes(O.peek(-1))){let{next:e}=O;if(e==Qr&&(O.advance(),O.acceptToken(lO)),N(e)){do O.advance();while(N(O.next));O.acceptToken(lO)}}}),Sr=J({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),Zr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},mr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},gr={__proto__:null,not:132,only:132},br=T.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[$r,Pr,ur,1,2,3,4,new ne("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:O=>Zr[O]||-1},{term:58,get:O=>mr[O]||-1},{term:101,get:O=>gr[O]||-1}],tokenPrec:1200});let $e=null;function Pe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const QO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),pO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),W=/^(\w[\w-]*|-\w[\w-]*|)$/,Xr=/^-(-[\w-]*)?$/;function wr(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const dO=new YO,yr=["Declaration"];function xr(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function LO(O,e,a){if(e.to-e.from>4096){let t=dO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let n of LO(O,i.node,a))s.has(n.label)||(s.add(n.label),r.push(n));while(i.nextSibling());return dO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(yr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let n=O.sliceString(s.from,s.to);r.has(n)||(r.add(n),t.push({label:n,type:"variable"}))}}),t}}const Yr=O=>e=>{let{state:a,pos:t}=e,r=C(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:Pe(),validFor:W};if(r.name=="ValueName")return{from:r.from,options:pO,validFor:W};if(r.name=="PseudoClassName")return{from:r.from,options:QO,validFor:W};if(O(r)||(e.explicit||s)&&wr(r,a.doc))return{from:O(r)||s?r.from:t,options:LO(a.doc,xr(r),O),validFor:Xr};if(r.name=="TagName"){for(let{parent:l}=r;l;l=l.parent)if(l.name=="Block")return{from:r.from,options:Pe(),validFor:W};return{from:r.from,options:kr,validFor:W}}if(!e.explicit)return null;let i=r.resolve(t),n=i.childBefore(t);return n&&n.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:QO,validFor:W}:n&&n.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pO,validFor:W}:i.name=="Block"||i.name=="Styles"?{from:t,options:Pe(),validFor:W}:null},Wr=Yr(O=>O.name=="VariableName"),ce=L.define({name:"css",parser:br.configure({props:[K.add({Declaration:_()}),F.add({"Block KeyframeList":qe})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Tr(){return new M(ce,ce.data.of({autocomplete:Wr}))}const jr=309,hO=1,vr=2,qr=3,_r=310,Rr=312,Vr=313,Gr=4,Cr=5,zr=0,ye=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],KO=125,Ur=59,xe=47,Er=42,Ar=43,Ir=45,Nr=60,Dr=44,Br=new _O({start:!1,shift(O,e){return e==Gr||e==Cr||e==Rr?O:e==Vr},strict:!1}),Jr=new k((O,e)=>{let{next:a}=O;(a==KO||a==-1||e.context)&&O.acceptToken(_r)},{contextual:!0,fallback:!0}),Lr=new k((O,e)=>{let{next:a}=O,t;ye.indexOf(a)>-1||a==xe&&((t=O.peek(1))==xe||t==Er)||a!=KO&&a!=Ur&&a!=-1&&!e.context&&O.acceptToken(jr)},{contextual:!0}),Kr=new k((O,e)=>{let{next:a}=O;if((a==Ar||a==Ir)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(hO);O.acceptToken(t?hO:vr)}},{contextual:!0});function Se(O,e){return O>=65&&O<=90||O>=97&&O<=122||O==95||O>=192||!e&&O>=48&&O<=57}const Fr=new k((O,e)=>{if(O.next!=Nr||!e.dialectEnabled(zr)||(O.advance(),O.next==xe))return;let a=0;for(;ye.indexOf(O.next)>-1;)O.advance(),a++;if(Se(O.next,!0)){for(O.advance(),a++;Se(O.next,!1);)O.advance(),a++;for(;ye.indexOf(O.next)>-1;)O.advance(),a++;if(O.next==Dr)return;for(let t=0;;t++){if(t==7){if(!Se(O.next,!0))return;break}if(O.next!="extends".charCodeAt(t))break;O.advance(),a++}}O.acceptToken(qr,-a)}),Mr=J({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),Hr={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},ei={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Oi={__proto__:null,"<":143},ti=T.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EjQ08SO1G0{O#>wQ08SO1G0{O#@uQ08SO1G0{O#CuQ(CYO'#ChO#EsQ(CYO1G1^O#EzQ(CYO'#JjO!,lQWO1G1dO#F[Q08SO,5?TOOQ07`-EkQWO1G3lO$2dQ^O1G3nO$6hQ^O'#HmOOQU1G3q1G3qO$6uQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6}Q^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;UQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;ZQ(CYO,5:UOOQO,5;[,5;[O$;eQ`O'#I^O$;{QWO,5@WOOQ07b1G/o1G/oO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$PQrO1G4cOOQO1G4i1G4iO%[Q^O,5>wO$>ZQWO1G5qO$>cQWO1G6OO$>kQrO1G6PO9ZQWO,5>}O$>uQ08SO1G5|O%[Q^O1G5|O$?VQ07hO1G5|O$?hQWO1G5{O$?hQWO1G5{O9ZQWO1G5{O$?pQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@UQWO,5?QO$'ZQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7dQWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7iQ`O1G5sO%7}Q(CYO1G0vO%8XQWO1G0vOOQO1G/p1G/pO%8dQ(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=mQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8nQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8yQ07hO7+&TO%9XQ08SO7++hO%[Q^O7++hO%9iQWO7++gO%9iQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9qQWO1G4lOOQO7+%|7+%|O#%sQWO<zQ08SO1G2ZO%A]Q08SO1G2mO%ChQ08SO1G2oO%EsQ7[O,5>yOOQO-E<]-E<]O%E}QrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FXQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5oQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5tQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&sQWO<}AN>}O%[Q^OAN?ZOOQO<qQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@gQrO'#JiO!*fQ^O'#DqO'@nQ^O'#D}O'@uQrO'#ChO'C]QrO'#ChO!*fQ^O'#EPO'CmQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EpQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Br,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Mr],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Hr[O]||-1},{term:334,get:O=>ei[O]||-1},{term:70,get:O=>Oi[O]||-1}],tokenPrec:14638}),FO=[m("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),m("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),m("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),m("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),m("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),m(`try { +import{S as wt,i as yt,s as xt,e as Yt,f as Wt,U as H,g as Tt,x as De,o as jt,J as vt,K as qt,L as _t,I as Rt,C as Vt,M as Gt}from"./index-MkGUixqr.js";import{P as Ct,N as zt,v as Ut,D as Et,w as je,T as Oe,I as ve,x as J,y as o,z as At,L,A as K,B as _,F,G as qe,H as M,u as C,J as YO,K as WO,M as TO,E as q,O as jO,Q as m,R as It,U as Nt,V as vO,W as Dt,X as Bt,a as z,h as Jt,b as Lt,c as Kt,d as Ft,e as Mt,s as Ht,t as ea,f as Oa,g as ta,r as aa,i as ra,k as ia,j as sa,l as na,m as oa,n as la,o as ca,p as Qa,q as Be,C as ee}from"./index-u64XbdBO.js";var Je={};class ie{constructor(e,a,t,r,s,i,n,l,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=n,this.bufferBase=l,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new ie(e,[],a,t,t,0,[],0,r?new Le(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[n-4]==0&&i.buffer[n-1]>-1){if(a==t)return;if(i.buffer[n-2]>=a){i.buffer[n-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new ie(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sl&1&&n==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let n=(i>>19)-s;if(n>1){let l=i&65535,Q=this.stack.length-n*3;if(Q>=0&&e.getGoto(this.stack[Q],l,!1)>=0)return n<<19|65536|l}}else{let n=t(i,s+1);if(n!=null)return n}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Le{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class pa{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class se{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new se(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new se(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let l=i-32;if(l>=46&&(l-=46,n=!0),s+=l,n)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class te{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ke=new te;class da{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ke,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ke,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;qO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class ne{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(qO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}ne.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class k{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function qO(O,e,a,t,r,s){let i=0,n=1<0){let f=O[p];if(l.allows(f)&&(e.token.value==-1||e.token.value==f||ha(f,e.token.value,r,s))){e.acceptToken(f);break}}let d=e.next,c=0,u=O[i+2];if(e.next<0&&u>c&&O[Q+u*3-3]==65535){i=O[Q+u*3-1];continue e}for(;c>1,f=Q+p+(p<<1),P=O[f],S=O[f+1]||65536;if(d=S)c=p+1;else{i=O[f+2],e.advance();continue e}}break}}function Fe(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function ha(O,e,a,t){let r=Fe(a,t,e);return r<0||Fe(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class fa{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Me(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Me(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof Oe){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class ua{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new te)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),n=e.curContext?e.curContext.hash:0,l=0;for(let Q=0;Qc.end+25&&(l=Math.max(c.lookAhead,l)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return l&&e.setLookAhead(l),!t&&e.pos==this.stream.end&&(t=new te,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new te,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(n>>1)){n&1?e.extended=n>>1:e.value=n>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new fa(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(n);else{if(this.advanceStack(n,t,e))continue;{r||(r=[],s=[]),r.push(n);let l=this.tokens.getMainToken(n);s.push(l.value,l.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return g&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw g&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return g&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((n,l)=>l.score-n.score);t.length>i;)t.pop();t.some(n=>n.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((n.score-Q.score||n.buffer.length-Q.buffer.length)>0)t.splice(l--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(je.contextHash)||0)==d))return e.useNode(c,u),g&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof Oe)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof Oe&&c.positions[0]==0)c=p;else break}}let n=s.stateSlot(e.state,4);if(n>0)return e.reduce(n),g&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(n&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let Q=0;Qr?a.push(f):t.push(f)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return He(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(n.deadEnd&&(s||(s=!0,n.restart(),g&&console.log(d+this.stackID(n)+" (restarted)"),this.advanceFully(n,t))))continue;let c=n.split(),u=d;for(let p=0;c.forceReduce()&&p<10&&(g&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)g&&(u=this.stackID(c)+" -> ");for(let p of n.recoverByInsert(l))g&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>n.pos?(Q==n.pos&&(Q++,l=0),n.recoverByDelete(l,Q),g&&console.log(d+this.stackID(n)+` (via recover-delete ${this.parser.getName(l)})`),He(n,t)):(!r||r.scoreO;class _O{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Ct{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let n=0;ne.topRules[n][1]),r=[];for(let n=0;n=0)s(d,l,n[Q++]);else{let c=n[Q+-d];for(let u=-d;u>0;u--)s(n[Q++],l,c);Q++}}}this.nodeSet=new zt(a.map((n,l)=>Ut.define({name:l>=this.minRepeatTerm?void 0:n,id:l,props:r[l],top:t.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Et;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new R(i,n):n),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new $a(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],n=i&1,l=r[s++];if(n&&t)return l;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=x(this.data,s+2);else break;r=a(x(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=x(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(n=>n.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=eO(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const Za=54,ma=1,ga=55,ba=2,ka=56,Xa=3,OO=4,wa=5,oe=6,RO=7,VO=8,GO=9,CO=10,ya=11,xa=12,Ya=13,fe=57,Wa=14,tO=58,zO=20,Ta=22,UO=23,ja=24,Xe=26,EO=27,va=28,qa=31,_a=34,Ra=36,Va=37,Ga=0,Ca=1,za={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ua={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},aO={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ea(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function AO(O){return O==9||O==10||O==13||O==32}let rO=null,iO=null,sO=0;function we(O,e){let a=O.pos+e;if(sO==a&&iO==O)return rO;let t=O.peek(e);for(;AO(t);)t=O.peek(++e);let r="";for(;Ea(t);)r+=String.fromCharCode(t),t=O.peek(++e);return iO=O,sO=a,rO=r?r.toLowerCase():t==Aa||t==Ia?void 0:null}const IO=60,le=62,_e=47,Aa=63,Ia=33,Na=45;function nO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new nO(we(t,1)||"",O):O},reduce(O,e){return e==zO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==oe||r==Ra?new nO(we(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),Ja=new k((O,e)=>{if(O.next!=IO){O.next<0&&e.context&&O.acceptToken(fe);return}O.advance();let a=O.next==_e;a&&O.advance();let t=we(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Wa:oe);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ya);if(r&&Ua[r])return O.acceptToken(fe,-2);if(e.dialectEnabled(Ga))return O.acceptToken(xa);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Ya)}else{if(t=="script")return O.acceptToken(RO);if(t=="style")return O.acceptToken(VO);if(t=="textarea")return O.acceptToken(GO);if(za.hasOwnProperty(t))return O.acceptToken(CO);r&&aO[r]&&aO[r][t]?O.acceptToken(fe,-1):O.acceptToken(oe)}},{contextual:!0}),La=new k(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(tO);break}if(O.next==Na)e++;else if(O.next==le&&e>=2){a>=3&&O.acceptToken(tO,-2);break}else e=0;O.advance()}});function Ka(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Fa=new k((O,e)=>{if(O.next==_e&&O.peek(1)==le){let a=e.dialectEnabled(Ca)||Ka(e.context);O.acceptToken(a?wa:OO,2)}else O.next==le&&O.acceptToken(OO,1)});function Re(O,e,a){let t=2+O.length;return new k(r=>{for(let s=0,i=0,n=0;;n++){if(r.next<0){n&&r.acceptToken(e);break}if(s==0&&r.next==IO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&n){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ma=Re("script",Za,ma),Ha=Re("style",ga,ba),er=Re("textarea",ka,Xa),Or=J({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),tr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[Or],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=n.type.id;if(Q==va)return ue(n,l,a);if(Q==qa)return ue(n,l,t);if(Q==_a)return ue(n,l,r);if(Q==zO&&s.length){let d=n.node,c=d.firstChild,u=c&&oO(c,l),p;if(u){for(let f of s)if(f.tag==u&&(!f.attrs||f.attrs(p||(p=NO(d,l))))){let P=d.lastChild,S=P.type.id==Va?P.from:d.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==UO){let d=n.node,c;if(c=d.firstChild){let u=i[l.read(c.from,c.to)];if(u)for(let p of u){if(p.tagName&&p.tagName!=oO(d.parent,l))continue;let f=d.lastChild;if(f.type.id==Xe){let P=f.from+1,S=f.lastChild,X=f.to-(S&&S.isError?0:1);if(X>P)return{parser:p.parser,overlay:[{from:P,to:X}]}}else if(f.type.id==EO)return{parser:p.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ar=99,lO=1,rr=100,ir=101,cO=2,BO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],sr=58,nr=40,JO=95,or=91,ae=45,lr=46,cr=35,Qr=37,pr=38,dr=92,hr=10;function N(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function fr(O){return O>=48&&O<=57}const ur=new k((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(N(s)||s==ae||s==JO||a&&fr(s))!a&&(s!=ae||r>0)&&(a=!0),t===r&&s==ae&&t++,O.advance();else if(s==dr&&O.peek(1)!=hr)O.advance(),O.next>-1&&O.advance(),a=!0;else{a&&O.acceptToken(s==nr?rr:t==2&&e.canShift(cO)?cO:ir);break}}}),$r=new k(O=>{if(BO.includes(O.peek(-1))){let{next:e}=O;(N(e)||e==JO||e==cr||e==lr||e==or||e==sr&&N(O.peek(1))||e==ae||e==pr)&&O.acceptToken(ar)}}),Pr=new k(O=>{if(!BO.includes(O.peek(-1))){let{next:e}=O;if(e==Qr&&(O.advance(),O.acceptToken(lO)),N(e)){do O.advance();while(N(O.next));O.acceptToken(lO)}}}),Sr=J({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),Zr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},mr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},gr={__proto__:null,not:132,only:132},br=T.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[$r,Pr,ur,1,2,3,4,new ne("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:O=>Zr[O]||-1},{term:58,get:O=>mr[O]||-1},{term:101,get:O=>gr[O]||-1}],tokenPrec:1200});let $e=null;function Pe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const QO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),pO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),W=/^(\w[\w-]*|-\w[\w-]*|)$/,Xr=/^-(-[\w-]*)?$/;function wr(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const dO=new YO,yr=["Declaration"];function xr(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function LO(O,e,a){if(e.to-e.from>4096){let t=dO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let n of LO(O,i.node,a))s.has(n.label)||(s.add(n.label),r.push(n));while(i.nextSibling());return dO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(yr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let n=O.sliceString(s.from,s.to);r.has(n)||(r.add(n),t.push({label:n,type:"variable"}))}}),t}}const Yr=O=>e=>{let{state:a,pos:t}=e,r=C(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:Pe(),validFor:W};if(r.name=="ValueName")return{from:r.from,options:pO,validFor:W};if(r.name=="PseudoClassName")return{from:r.from,options:QO,validFor:W};if(O(r)||(e.explicit||s)&&wr(r,a.doc))return{from:O(r)||s?r.from:t,options:LO(a.doc,xr(r),O),validFor:Xr};if(r.name=="TagName"){for(let{parent:l}=r;l;l=l.parent)if(l.name=="Block")return{from:r.from,options:Pe(),validFor:W};return{from:r.from,options:kr,validFor:W}}if(!e.explicit)return null;let i=r.resolve(t),n=i.childBefore(t);return n&&n.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:QO,validFor:W}:n&&n.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pO,validFor:W}:i.name=="Block"||i.name=="Styles"?{from:t,options:Pe(),validFor:W}:null},Wr=Yr(O=>O.name=="VariableName"),ce=L.define({name:"css",parser:br.configure({props:[K.add({Declaration:_()}),F.add({"Block KeyframeList":qe})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Tr(){return new M(ce,ce.data.of({autocomplete:Wr}))}const jr=309,hO=1,vr=2,qr=3,_r=310,Rr=312,Vr=313,Gr=4,Cr=5,zr=0,ye=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],KO=125,Ur=59,xe=47,Er=42,Ar=43,Ir=45,Nr=60,Dr=44,Br=new _O({start:!1,shift(O,e){return e==Gr||e==Cr||e==Rr?O:e==Vr},strict:!1}),Jr=new k((O,e)=>{let{next:a}=O;(a==KO||a==-1||e.context)&&O.acceptToken(_r)},{contextual:!0,fallback:!0}),Lr=new k((O,e)=>{let{next:a}=O,t;ye.indexOf(a)>-1||a==xe&&((t=O.peek(1))==xe||t==Er)||a!=KO&&a!=Ur&&a!=-1&&!e.context&&O.acceptToken(jr)},{contextual:!0}),Kr=new k((O,e)=>{let{next:a}=O;if((a==Ar||a==Ir)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(hO);O.acceptToken(t?hO:vr)}},{contextual:!0});function Se(O,e){return O>=65&&O<=90||O>=97&&O<=122||O==95||O>=192||!e&&O>=48&&O<=57}const Fr=new k((O,e)=>{if(O.next!=Nr||!e.dialectEnabled(zr)||(O.advance(),O.next==xe))return;let a=0;for(;ye.indexOf(O.next)>-1;)O.advance(),a++;if(Se(O.next,!0)){for(O.advance(),a++;Se(O.next,!1);)O.advance(),a++;for(;ye.indexOf(O.next)>-1;)O.advance(),a++;if(O.next==Dr)return;for(let t=0;;t++){if(t==7){if(!Se(O.next,!0))return;break}if(O.next!="extends".charCodeAt(t))break;O.advance(),a++}}O.acceptToken(qr,-a)}),Mr=J({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),Hr={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},ei={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Oi={__proto__:null,"<":143},ti=T.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EjQ08SO1G0{O#>wQ08SO1G0{O#@uQ08SO1G0{O#CuQ(CYO'#ChO#EsQ(CYO1G1^O#EzQ(CYO'#JjO!,lQWO1G1dO#F[Q08SO,5?TOOQ07`-EkQWO1G3lO$2dQ^O1G3nO$6hQ^O'#HmOOQU1G3q1G3qO$6uQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6}Q^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;UQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;ZQ(CYO,5:UOOQO,5;[,5;[O$;eQ`O'#I^O$;{QWO,5@WOOQ07b1G/o1G/oO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$PQrO1G4cOOQO1G4i1G4iO%[Q^O,5>wO$>ZQWO1G5qO$>cQWO1G6OO$>kQrO1G6PO9ZQWO,5>}O$>uQ08SO1G5|O%[Q^O1G5|O$?VQ07hO1G5|O$?hQWO1G5{O$?hQWO1G5{O9ZQWO1G5{O$?pQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@UQWO,5?QO$'ZQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7dQWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7iQ`O1G5sO%7}Q(CYO1G0vO%8XQWO1G0vOOQO1G/p1G/pO%8dQ(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=mQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8nQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8yQ07hO7+&TO%9XQ08SO7++hO%[Q^O7++hO%9iQWO7++gO%9iQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9qQWO1G4lOOQO7+%|7+%|O#%sQWO<zQ08SO1G2ZO%A]Q08SO1G2mO%ChQ08SO1G2oO%EsQ7[O,5>yOOQO-E<]-E<]O%E}QrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FXQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5oQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5tQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&sQWO<}AN>}O%[Q^OAN?ZOOQO<qQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@gQrO'#JiO!*fQ^O'#DqO'@nQ^O'#D}O'@uQrO'#ChO'C]QrO'#ChO!*fQ^O'#EPO'CmQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EpQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Br,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Mr],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Hr[O]||-1},{term:334,get:O=>ei[O]||-1},{term:70,get:O=>Oi[O]||-1}],tokenPrec:14638}),FO=[m("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),m("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),m("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),m("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),m("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),m(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-Az0ouP1t.js b/ui/dist/assets/ConfirmEmailChangeDocs-4zuP9S10.js similarity index 64% rename from ui/dist/assets/ConfirmEmailChangeDocs-Az0ouP1t.js rename to ui/dist/assets/ConfirmEmailChangeDocs-4zuP9S10.js index 4351c42e..306952b4 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-Az0ouP1t.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-4zuP9S10.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-ohPVsOF0.js";import{S as De}from"./SdkTabs-ZFbexUF1.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` +import{S as Pe,i as Se,s as Oe,O as Y,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as $e,w as j,P as _e,Q as ye,k as Re,R as Te,n as Ae,t as ee,a as te,o as m,d as we,C as Ee,A as qe,q as H,r as Be,N as Ue}from"./index-MkGUixqr.js";import{S as De}from"./SdkTabs-7yshYvVF.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,A,Z,E,x,S,q,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -21,7 +21,7 @@ import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d 'YOUR_PASSWORD', ); `}});let W=Y(o[2]);const de=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',Z=k(),q=r("div"),q.textContent="Responses",x=k(),S=r("div"),A=r("div");for(let e=0;eParam Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',Z=k(),E=r("div"),E.textContent="Responses",x=k(),S=r("div"),q=r("div");for(let e=0;es(1,u=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=qe.getApiExampleUrl(Ae.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),w.$set(c),(!O||t&1)&&M!==(M=e[0].name+"")&&j(J,M),t&6&&(W=Y(e[2]),g=_e(g,t,de,1,e,W,ie,q,ye,ge,null,ke)),t&6&&(U=Y(e[2]),Re(),h=_e(h,t,me,1,e,U,re,B,Te,ve,null,he),Ae())},i(e){if(!O){ee(w.$$.fragment,e);for(let t=0;ts(1,u=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=Ee.getApiExampleUrl(qe.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-TEkFHZVZ.js b/ui/dist/assets/ConfirmPasswordResetDocs-D_DbjoKG.js similarity index 70% rename from ui/dist/assets/ConfirmPasswordResetDocs-TEkFHZVZ.js rename to ui/dist/assets/ConfirmPasswordResetDocs-D_DbjoKG.js index 93a5ae07..9eacd204 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-TEkFHZVZ.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-D_DbjoKG.js @@ -1,4 +1,4 @@ -import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-ohPVsOF0.js";import{S as Ie}from"./SdkTabs-ZFbexUF1.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` +import{S as Ne,i as $e,s as Ce,O as K,e as c,v as w,b as k,c as Ae,f as b,g as r,h as n,m as Re,w as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,A as Be,q as j,r as Me,N as Fe}from"./index-MkGUixqr.js";import{S as Ie}from"./SdkTabs-7yshYvVF.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Ae(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Re(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,A,y,v=[],ie=new Map,de,D,h=[],ce=new Map,R;W=new Ie({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -35,7 +35,7 @@ import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as // (after the above call all previously issued tokens are invalidated) await pb.collection('${(be=o[0])==null?void 0:be.name}').authWithPassword(oldAuth.email, 'NEW_PASSWORD'); `}});let I=K(o[2]);const re=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',Z=k(),E=c("div"),E.textContent="Responses",x=k(),R=c("div"),y=c("div");for(let e=0;eParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',Z=k(),E=c("div"),E.textContent="Responses",x=k(),A=c("div"),y=c("div");for(let e=0;es(1,m=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=qe.getApiExampleUrl(Be.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),W.$set(d),(!R||t&1)&&F!==(F=e[0].name+"")&&U(V,F),t&6&&(I=K(e[2]),v=we(v,t,re,1,e,I,ie,y,Ee,We,null,Pe)),t&6&&(T=K(e[2]),ye(),h=we(h,t,pe,1,e,T,ce,D,De,ge,null,Se),Te())},i(e){if(!R){ee(W.$$.fragment,e);for(let t=0;ts(1,m=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=qe.getApiExampleUrl(Be.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/ConfirmVerificationDocs-jvmhFPKz.js b/ui/dist/assets/ConfirmVerificationDocs-vggZqtpv.js similarity index 62% rename from ui/dist/assets/ConfirmVerificationDocs-jvmhFPKz.js rename to ui/dist/assets/ConfirmVerificationDocs-vggZqtpv.js index 33b73ae3..5535dfdc 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-jvmhFPKz.js +++ b/ui/dist/assets/ConfirmVerificationDocs-vggZqtpv.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-ohPVsOF0.js";import{S as Ae}from"./SdkTabs-ZFbexUF1.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,v as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,w as H,P as ke,Q as qe,k as Re,R as Oe,n as Ae,t as x,a as ee,o as d,d as Pe,C as Ee,A as Ne,q as F,r as Ve,N as Ke}from"./index-MkGUixqr.js";import{S as Me}from"./SdkTabs-7yshYvVF.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ve(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Ke({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,V=o[0].name+"",I,te,L,y,Q,T,z,C,K,le,M,B,se,G,U=o[0].name+"",J,ae,W,q,X,R,Y,O,Z,P,A,v=[],oe=new Map,ne,E,_=[],ie=new Map,S;y=new Me({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -20,7 +20,7 @@ import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f // optionally refresh the previous authStore state with the latest record changes await pb.collection('${(ue=o[0])==null?void 0:ue.name}').authRefresh(); - `}});let j=D(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required token
String The token from the verification request email.',Y=k(),O=r("div"),O.textContent="Responses",Z=k(),P=r("div"),E=r("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required token
String The token from the verification request email.',Y=k(),O=r("div"),O.textContent="Responses",Z=k(),P=r("div"),A=r("div");for(let e=0;es(1,m=u.code);return o.$$set=u=>{"collection"in u&&s(0,b=u.collection)},s(3,a=Ne.getApiExampleUrl(Ve.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),y.$set(c),(!S||t&1)&&U!==(U=e[0].name+"")&&H(J,U),t&6&&(j=D(e[2]),v=ke(v,t,ce,1,e,j,oe,A,qe,we,null,ge)),t&6&&(N=D(e[2]),Re(),_=ke(_,t,re,1,e,N,ie,E,Oe,$e,null,ve),Ae())},i(e){if(!S){x(y.$$.fragment,e);for(let t=0;ts(1,m=u.code);return o.$$set=u=>{"collection"in u&&s(0,b=u.collection)},s(3,a=Ee.getApiExampleUrl(Ne.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/CreateApiDocs-SGziFR1e.js b/ui/dist/assets/CreateApiDocs-SGziFR1e.js new file mode 100644 index 00000000..51d05fd8 --- /dev/null +++ b/ui/dist/assets/CreateApiDocs-SGziFR1e.js @@ -0,0 +1,92 @@ +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as s,v as _,b as f,c as _e,f as v,g as r,h as n,m as he,w as x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as fe,a as ue,o as d,d as ke,A as At,q as ye,r as Ft,x as ae}from"./index-MkGUixqr.js";import{S as Rt}from"./SdkTabs-7yshYvVF.js";import{F as Bt}from"./FieldsQueryParam-N-1EL4Av.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=s("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,u,m,c,p,y,S,T,w,H,D,E,P,I,j,B,C,N,q,g,b;function O(h,$){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),A=z(o);return{c(){e=s("tr"),e.innerHTML='Auth fields',t=f(),a=s("tr"),a.innerHTML=`
Optional username
String The username of the auth record. +
+ If not set, it will be auto generated.`,u=f(),m=s("tr"),c=s("td"),p=s("div"),A.c(),y=f(),S=s("span"),S.textContent="email",T=f(),w=s("td"),w.innerHTML='String',H=f(),D=s("td"),D.textContent="Auth record email address.",E=f(),P=s("tr"),P.innerHTML='
Optional emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.',I=f(),j=s("tr"),j.innerHTML='
Required password
String Auth record password.',B=f(),C=s("tr"),C.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',N=f(),q=s("tr"),q.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not. +
+ This field can be set only by admins or auth records with "Manage" access.`,g=f(),b=s("tr"),b.innerHTML='Schema fields',v(p,"class","inline-flex")},m(h,$){r(h,e,$),r(h,t,$),r(h,a,$),r(h,u,$),r(h,m,$),n(m,c),n(c,p),A.m(p,null),n(p,y),n(p,S),n(m,T),n(m,w),n(m,H),n(m,D),r(h,E,$),r(h,P,$),r(h,I,$),r(h,j,$),r(h,B,$),r(h,C,$),r(h,N,$),r(h,q,$),r(h,g,$),r(h,b,$)},p(h,$){z!==(z=O(h))&&(A.d(1),A=z(h),A&&(A.c(),A.m(p,y)))},d(h){h&&(d(e),d(t),d(a),d(u),d(m),d(E),d(P),d(I),d(j),d(B),d(C),d(N),d(q),d(g),d(b)),A.d()}}}function jt(o){let e;return{c(){e=s("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Dt(o){let e;return{c(){e=s("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Nt(o){let e;return{c(){e=s("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Vt(o){let e;return{c(){e=s("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Jt(o){var m;let e,t=((m=o[13].options)==null?void 0:m.maxSelect)===1?"id":"ids",a,u;return{c(){e=_("Relation record "),a=_(t),u=_(".")},m(c,p){r(c,e,p),r(c,a,p),r(c,u,p)},p(c,p){var y;p&1&&t!==(t=((y=c[13].options)==null?void 0:y.maxSelect)===1?"id":"ids")&&x(a,t)},d(c){c&&(d(e),d(a),d(u))}}}function Et(o){let e,t,a,u,m;return{c(){e=_("File object."),t=s("br"),a=_(` + Set to `),u=s("code"),u.textContent="null",m=_(" to delete already uploaded file(s).")},m(c,p){r(c,e,p),r(c,t,p),r(c,a,p),r(c,u,p),r(c,m,p)},p:ae,d(c){c&&(d(e),d(t),d(a),d(u),d(m))}}}function It(o){let e;return{c(){e=_("URL address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Ut(o){let e;return{c(){e=_("Email address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Qt(o){let e;return{c(){e=_("JSON array or object.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function zt(o){let e;return{c(){e=_("Number value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Kt(o){let e;return{c(){e=_("Plain text value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Ct(o,e){let t,a,u,m,c,p=e[13].name+"",y,S,T,w,H=Q.getFieldValueType(e[13])+"",D,E,P,I;function j(b,O){return b[13].required?Vt:Nt}let B=j(e),C=B(e);function N(b,O){if(b[13].type==="text")return Kt;if(b[13].type==="number")return zt;if(b[13].type==="json")return Qt;if(b[13].type==="email")return Ut;if(b[13].type==="url")return It;if(b[13].type==="file")return Et;if(b[13].type==="relation")return Jt}let q=N(e),g=q&&q(e);return{key:o,first:null,c(){t=s("tr"),a=s("td"),u=s("div"),C.c(),m=f(),c=s("span"),y=_(p),S=f(),T=s("td"),w=s("span"),D=_(H),E=f(),P=s("td"),g&&g.c(),I=f(),v(u,"class","inline-flex"),v(w,"class","label"),this.first=t},m(b,O){r(b,t,O),n(t,a),n(a,u),C.m(u,null),n(u,m),n(u,c),n(c,y),n(t,S),n(t,T),n(T,w),n(w,D),n(t,E),n(t,P),g&&g.m(P,null),n(t,I)},p(b,O){e=b,B!==(B=j(e))&&(C.d(1),C=B(e),C&&(C.c(),C.m(u,m))),O&1&&p!==(p=e[13].name+"")&&x(y,p),O&1&&H!==(H=Q.getFieldValueType(e[13])+"")&&x(D,H),q===(q=N(e))&&g?g.p(e,O):(g&&g.d(1),g=q&&q(e),g&&(g.c(),g.m(P,null)))},d(b){b&&d(t),C.d(),g&&g.d()}}}function $t(o,e){let t,a=e[8].code+"",u,m,c,p;function y(){return e[7](e[8])}return{key:o,first:null,c(){t=s("button"),u=_(a),m=f(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(S,T){r(S,t,T),n(t,u),n(t,m),c||(p=Ft(t,"click",y),c=!0)},p(S,T){e=S,T&8&&a!==(a=e[8].code+"")&&x(u,a),T&12&&ye(t,"active",e[2]===e[8].code)},d(S){S&&d(t),c=!1,p()}}}function St(o,e){let t,a,u,m;return a=new Tt({props:{content:e[8].body}}),{key:o,first:null,c(){t=s("div"),_e(a.$$.fragment),u=f(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(c,p){r(c,t,p),he(a,t,null),n(t,u),m=!0},p(c,p){e=c;const y={};p&8&&(y.content=e[8].body),a.$set(y),(!m||p&12)&&ye(t,"active",e[2]===e[8].code)},i(c){m||(fe(a.$$.fragment,c),m=!0)},o(c){ue(a.$$.fragment,c),m=!1},d(c){c&&d(t),ke(a)}}}function Wt(o){var ot,rt,dt,ct,pt;let e,t,a=o[0].name+"",u,m,c,p,y,S,T,w=o[0].name+"",H,D,E,P,I,j,B,C,N,q,g,b,O,z,A,h,$,ee,K=o[0].name+"",ve,je,De,ge,ie,we,W,Ce,Ne,U,$e,Ve,Se,V=[],Je=new Map,Te,se,qe,Y,Oe,Ee,oe,G,Me,Ie,He,Ue,M,Qe,te,ze,Ke,We,Le,Ye,Pe,Ge,Xe,Ze,Ae,xe,et,le,Fe,re,Re,X,de,J=[],tt=new Map,lt,ce,F=[],nt=new Map,Z;C=new Rt({props:{js:` +import PocketBase from 'pocketbase'; + +const pb = new PocketBase('${o[5]}'); + +... + +// example create data +const data = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,4)}; + +const record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(data); +`+(o[1]?` +// (optional) send an email verification request +await pb.collection('${(rt=o[0])==null?void 0:rt.name}').requestVerification('test@example.com'); +`:""),dart:` +import 'package:pocketbase/pocketbase.dart'; + +final pb = PocketBase('${o[5]}'); + +... + +// example create body +final body = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,2)}; + +final record = await pb.collection('${(dt=o[0])==null?void 0:dt.name}').create(body: body); +`+(o[1]?` +// (optional) send an email verification request +await pb.collection('${(ct=o[0])==null?void 0:ct.name}').requestVerification('test@example.com'); +`:"")}});let R=o[6]&>(),L=o[1]&&wt(o),me=ne((pt=o[0])==null?void 0:pt.schema);const at=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;ll[8].code;for(let l=0;lapplication/json or + multipart/form-data.`,I=f(),j=s("p"),j.innerHTML=`File upload is supported only via multipart/form-data. +
+ For more info and examples you could check the detailed + Files upload and handling docs + .`,B=f(),_e(C.$$.fragment),N=f(),q=s("h6"),q.textContent="API details",g=f(),b=s("div"),O=s("strong"),O.textContent="POST",z=f(),A=s("div"),h=s("p"),$=_("/api/collections/"),ee=s("strong"),ve=_(K),je=_("/records"),De=f(),R&&R.c(),ge=f(),ie=s("div"),ie.textContent="Body Parameters",we=f(),W=s("table"),Ce=s("thead"),Ce.innerHTML='Param Type Description',Ne=f(),U=s("tbody"),$e=s("tr"),$e.innerHTML=`
Optional id
String 15 characters string to store as record ID. +
+ If not set, it will be auto generated.`,Ve=f(),L&&L.c(),Se=f();for(let l=0;lParam Type Description',Ee=f(),oe=s("tbody"),G=s("tr"),Me=s("td"),Me.textContent="expand",Ie=f(),He=s("td"),He.innerHTML='String',Ue=f(),M=s("td"),Qe=_(`Auto expand relations when returning the created record. Ex.: + `),_e(te.$$.fragment),ze=_(` + Supports up to 6-levels depth nested relations expansion. `),Ke=s("br"),We=_(` + The expanded relations will be appended to the record under the + `),Le=s("code"),Le.textContent="expand",Ye=_(" property (eg. "),Pe=s("code"),Pe.textContent='"expand": {"relField1": {...}, ...}',Ge=_(`). + `),Xe=s("br"),Ze=_(` + Only the relations to which the request user has permissions to `),Ae=s("strong"),Ae.textContent="view",xe=_(" will be expanded."),et=f(),_e(le.$$.fragment),Fe=f(),re=s("div"),re.textContent="Responses",Re=f(),X=s("div"),de=s("div");for(let l=0;l${JSON.stringify(Object.assign({},l[4],Q.dummyCollectionSchemaData(l[0])),null,2)}; + +final record = await pb.collection('${(mt=l[0])==null?void 0:mt.name}').create(body: body); +`+(l[1]?` +// (optional) send an email verification request +await pb.collection('${(bt=l[0])==null?void 0:bt.name}').requestVerification('test@example.com'); +`:"")),C.$set(k),(!Z||i&1)&&K!==(K=l[0].name+"")&&x(ve,K),l[6]?R||(R=gt(),R.c(),R.m(b,null)):R&&(R.d(1),R=null),l[1]?L?L.p(l,i):(L=wt(l),L.c(),L.m(U,Se)):L&&(L.d(1),L=null),i&1&&(me=ne((_t=l[0])==null?void 0:_t.schema),V=Be(V,i,at,1,l,me,Je,U,ht,Ct,null,vt)),i&12&&(be=ne(l[3]),J=Be(J,i,it,1,l,be,tt,de,ht,$t,null,yt)),i&12&&(pe=ne(l[3]),Ht(),F=Be(F,i,st,1,l,pe,nt,ce,Lt,St,null,kt),Pt())},i(l){if(!Z){fe(C.$$.fragment,l),fe(te.$$.fragment,l),fe(le.$$.fragment,l);for(let i=0;it(2,p=w.code);return o.$$set=w=>{"collection"in w&&t(0,c=w.collection)},o.$$.update=()=>{var w,H;o.$$.dirty&1&&t(1,a=c.type==="auth"),o.$$.dirty&1&&t(6,u=(c==null?void 0:c.createRule)===null),o.$$.dirty&1&&t(3,y=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(c),null,2)},{code:400,body:` + { + "code": 400, + "message": "Failed to create record.", + "data": { + "${(H=(w=c==null?void 0:c.schema)==null?void 0:w[0])==null?void 0:H.name}": { + "code": "validation_required", + "message": "Missing required value." + } + } + } + `},{code:403,body:` + { + "code": 403, + "message": "You are not allowed to perform this request.", + "data": {} + } + `}]),o.$$.dirty&2&&(a?t(4,S={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):t(4,S={}))},t(5,m=Q.getApiExampleUrl(At.baseUrl)),[c,a,p,y,S,m,u,T]}class xt extends qt{constructor(e){super(),Ot(this,e,Yt,Wt,Mt,{collection:0})}}export{xt as default}; diff --git a/ui/dist/assets/CreateApiDocs-Y1F_-wh9.js b/ui/dist/assets/CreateApiDocs-Y1F_-wh9.js deleted file mode 100644 index c525ac9b..00000000 --- a/ui/dist/assets/CreateApiDocs-Y1F_-wh9.js +++ /dev/null @@ -1,92 +0,0 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-ohPVsOF0.js";import{S as At}from"./SdkTabs-ZFbexUF1.js";import{F as Bt}from"./FieldsQueryParam-pO449pwf.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record. -
- If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
Optional emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
Required password
String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not. -
- This field can be set only by admins or auth records with "Manage" access.`,g=u(),b=i("tr"),b.innerHTML='Schema fields',v(p,"class","inline-flex")},m(h,C){r(h,e,C),r(h,t,C),r(h,a,C),r(h,f,C),r(h,m,C),n(m,c),n(c,p),F.m(p,null),n(p,y),n(p,S),n(m,T),n(m,w),n(m,H),n(m,D),r(h,E,C),r(h,P,C),r(h,I,C),r(h,j,C),r(h,B,C),r(h,$,C),r(h,N,C),r(h,q,C),r(h,g,C),r(h,b,C)},p(h,C){z!==(z=O(h))&&(F.d(1),F=z(h),F&&(F.c(),F.m(p,y)))},d(h){h&&(d(e),d(t),d(a),d(f),d(m),d(E),d(P),d(I),d(j),d(B),d($),d(N),d(q),d(g),d(b)),F.d()}}}function jt(o){let e;return{c(){e=i("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Dt(o){let e;return{c(){e=i("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Nt(o){let e;return{c(){e=i("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Vt(o){let e;return{c(){e=i("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Jt(o){var m;let e,t=((m=o[13].options)==null?void 0:m.maxSelect)===1?"id":"ids",a,f;return{c(){e=_("Relation record "),a=_(t),f=_(".")},m(c,p){r(c,e,p),r(c,a,p),r(c,f,p)},p(c,p){var y;p&1&&t!==(t=((y=c[13].options)==null?void 0:y.maxSelect)===1?"id":"ids")&&x(a,t)},d(c){c&&(d(e),d(a),d(f))}}}function Et(o){let e,t,a,f,m;return{c(){e=_("File object."),t=i("br"),a=_(` - Set to `),f=i("code"),f.textContent="null",m=_(" to delete already uploaded file(s).")},m(c,p){r(c,e,p),r(c,t,p),r(c,a,p),r(c,f,p),r(c,m,p)},p:ae,d(c){c&&(d(e),d(t),d(a),d(f),d(m))}}}function It(o){let e;return{c(){e=_("URL address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Ut(o){let e;return{c(){e=_("Email address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Qt(o){let e;return{c(){e=_("JSON array or object.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function zt(o){let e;return{c(){e=_("Number value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Kt(o){let e;return{c(){e=_("Plain text value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function $t(o,e){let t,a,f,m,c,p=e[13].name+"",y,S,T,w,H=Q.getFieldValueType(e[13])+"",D,E,P,I;function j(b,O){return b[13].required?Vt:Nt}let B=j(e),$=B(e);function N(b,O){if(b[13].type==="text")return Kt;if(b[13].type==="number")return zt;if(b[13].type==="json")return Qt;if(b[13].type==="email")return Ut;if(b[13].type==="url")return It;if(b[13].type==="file")return Et;if(b[13].type==="relation")return Jt}let q=N(e),g=q&&q(e);return{key:o,first:null,c(){t=i("tr"),a=i("td"),f=i("div"),$.c(),m=u(),c=i("span"),y=_(p),S=u(),T=i("td"),w=i("span"),D=_(H),E=u(),P=i("td"),g&&g.c(),I=u(),v(f,"class","inline-flex"),v(w,"class","label"),this.first=t},m(b,O){r(b,t,O),n(t,a),n(a,f),$.m(f,null),n(f,m),n(f,c),n(c,y),n(t,S),n(t,T),n(T,w),n(w,D),n(t,E),n(t,P),g&&g.m(P,null),n(t,I)},p(b,O){e=b,B!==(B=j(e))&&($.d(1),$=B(e),$&&($.c(),$.m(f,m))),O&1&&p!==(p=e[13].name+"")&&x(y,p),O&1&&H!==(H=Q.getFieldValueType(e[13])+"")&&x(D,H),q===(q=N(e))&&g?g.p(e,O):(g&&g.d(1),g=q&&q(e),g&&(g.c(),g.m(P,null)))},d(b){b&&d(t),$.d(),g&&g.d()}}}function Ct(o,e){let t,a=e[8].code+"",f,m,c,p;function y(){return e[7](e[8])}return{key:o,first:null,c(){t=i("button"),f=_(a),m=u(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(S,T){r(S,t,T),n(t,f),n(t,m),c||(p=Rt(t,"click",y),c=!0)},p(S,T){e=S,T&8&&a!==(a=e[8].code+"")&&x(f,a),T&12&&ye(t,"active",e[2]===e[8].code)},d(S){S&&d(t),c=!1,p()}}}function St(o,e){let t,a,f,m;return a=new Tt({props:{content:e[8].body}}),{key:o,first:null,c(){t=i("div"),_e(a.$$.fragment),f=u(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(c,p){r(c,t,p),he(a,t,null),n(t,f),m=!0},p(c,p){e=c;const y={};p&8&&(y.content=e[8].body),a.$set(y),(!m||p&12)&&ye(t,"active",e[2]===e[8].code)},i(c){m||(ue(a.$$.fragment,c),m=!0)},o(c){fe(a.$$.fragment,c),m=!1},d(c){c&&d(t),ke(a)}}}function Wt(o){var ot,rt,dt,ct,pt;let e,t,a=o[0].name+"",f,m,c,p,y,S,T,w=o[0].name+"",H,D,E,P,I,j,B,$,N,q,g,b,O,z,F,h,C,ee,K=o[0].name+"",ve,je,De,ge,se,we,W,$e,Ne,U,Ce,Ve,Se,V=[],Je=new Map,Te,ie,qe,Y,Oe,Ee,oe,G,Me,Ie,He,Ue,M,Qe,te,ze,Ke,We,Le,Ye,Pe,Ge,Xe,Ze,Fe,xe,et,le,Re,re,Ae,X,de,J=[],tt=new Map,lt,ce,R=[],nt=new Map,Z;$=new At({props:{js:` -import PocketBase from 'pocketbase'; - -const pb = new PocketBase('${o[5]}'); - -... - -// example create data -const data = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,4)}; - -const record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(data); -`+(o[1]?` -// (optional) send an email verification request -await pb.collection('${(rt=o[0])==null?void 0:rt.name}').requestVerification('test@example.com'); -`:""),dart:` -import 'package:pocketbase/pocketbase.dart'; - -final pb = PocketBase('${o[5]}'); - -... - -// example create body -final body = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,2)}; - -final record = await pb.collection('${(dt=o[0])==null?void 0:dt.name}').create(body: body); -`+(o[1]?` -// (optional) send an email verification request -await pb.collection('${(ct=o[0])==null?void 0:ct.name}').requestVerification('test@example.com'); -`:"")}});let A=o[6]&>(),L=o[1]&&wt(o),me=ne((pt=o[0])==null?void 0:pt.schema);const at=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;ll[8].code;for(let l=0;lapplication/json or - multipart/form-data.`,I=u(),j=i("p"),j.innerHTML=`File upload is supported only via multipart/form-data. -
- For more info and examples you could check the detailed - Files upload and handling docs - .`,B=u(),_e($.$$.fragment),N=u(),q=i("h6"),q.textContent="API details",g=u(),b=i("div"),O=i("strong"),O.textContent="POST",z=u(),F=i("div"),h=i("p"),C=_("/api/collections/"),ee=i("strong"),ve=_(K),je=_("/records"),De=u(),A&&A.c(),ge=u(),se=i("div"),se.textContent="Body Parameters",we=u(),W=i("table"),$e=i("thead"),$e.innerHTML='Param Type Description',Ne=u(),U=i("tbody"),Ce=i("tr"),Ce.innerHTML=`
Optional id
String 15 characters string to store as record ID. -
- If not set, it will be auto generated.`,Ve=u(),L&&L.c(),Se=u();for(let l=0;lParam Type Description',Ee=u(),oe=i("tbody"),G=i("tr"),Me=i("td"),Me.textContent="expand",Ie=u(),He=i("td"),He.innerHTML='String',Ue=u(),M=i("td"),Qe=_(`Auto expand relations when returning the created record. Ex.: - `),_e(te.$$.fragment),ze=_(` - Supports up to 6-levels depth nested relations expansion. `),Ke=i("br"),We=_(` - The expanded relations will be appended to the record under the - `),Le=i("code"),Le.textContent="expand",Ye=_(" property (eg. "),Pe=i("code"),Pe.textContent='"expand": {"relField1": {...}, ...}',Ge=_(`). - `),Xe=i("br"),Ze=_(` - Only the relations to which the request user has permissions to `),Fe=i("strong"),Fe.textContent="view",xe=_(" will be expanded."),et=u(),_e(le.$$.fragment),Re=u(),re=i("div"),re.textContent="Responses",Ae=u(),X=i("div"),de=i("div");for(let l=0;l${JSON.stringify(Object.assign({},l[4],Q.dummyCollectionSchemaData(l[0])),null,2)}; - -final record = await pb.collection('${(mt=l[0])==null?void 0:mt.name}').create(body: body); -`+(l[1]?` -// (optional) send an email verification request -await pb.collection('${(bt=l[0])==null?void 0:bt.name}').requestVerification('test@example.com'); -`:"")),$.$set(k),(!Z||s&1)&&K!==(K=l[0].name+"")&&x(ve,K),l[6]?A||(A=gt(),A.c(),A.m(b,null)):A&&(A.d(1),A=null),l[1]?L?L.p(l,s):(L=wt(l),L.c(),L.m(U,Se)):L&&(L.d(1),L=null),s&1&&(me=ne((_t=l[0])==null?void 0:_t.schema),V=Be(V,s,at,1,l,me,Je,U,ht,$t,null,vt)),s&12&&(be=ne(l[3]),J=Be(J,s,st,1,l,be,tt,de,ht,Ct,null,yt)),s&12&&(pe=ne(l[3]),Ht(),R=Be(R,s,it,1,l,pe,nt,ce,Lt,St,null,kt),Pt())},i(l){if(!Z){ue($.$$.fragment,l),ue(te.$$.fragment,l),ue(le.$$.fragment,l);for(let s=0;st(2,p=w.code);return o.$$set=w=>{"collection"in w&&t(0,c=w.collection)},o.$$.update=()=>{var w,H;o.$$.dirty&1&&t(1,a=c.type==="auth"),o.$$.dirty&1&&t(6,f=(c==null?void 0:c.createRule)===null),o.$$.dirty&1&&t(3,y=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(c),null,2)},{code:400,body:` - { - "code": 400, - "message": "Failed to create record.", - "data": { - "${(H=(w=c==null?void 0:c.schema)==null?void 0:w[0])==null?void 0:H.name}": { - "code": "validation_required", - "message": "Missing required value." - } - } - } - `},{code:403,body:` - { - "code": 403, - "message": "You are not allowed to perform this request.", - "data": {} - } - `}]),o.$$.dirty&2&&(a?t(4,S={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):t(4,S={}))},t(5,m=Q.getApiExampleUrl(Ft.baseUrl)),[c,a,p,y,S,m,f,T]}class xt extends qt{constructor(e){super(),Ot(this,e,Yt,Wt,Mt,{collection:0})}}export{xt as default}; diff --git a/ui/dist/assets/DeleteApiDocs-UGu6GbCv.js b/ui/dist/assets/DeleteApiDocs-20BG7iGY.js similarity index 60% rename from ui/dist/assets/DeleteApiDocs-UGu6GbCv.js rename to ui/dist/assets/DeleteApiDocs-20BG7iGY.js index d7115a48..0fcf1158 100644 --- a/ui/dist/assets/DeleteApiDocs-UGu6GbCv.js +++ b/ui/dist/assets/DeleteApiDocs-20BG7iGY.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-ohPVsOF0.js";import{S as He}from"./SdkTabs-ZFbexUF1.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,v as y,b as k,c as Ce,f as m,g as p,h as i,m as De,w as ee,P as he,Q as Oe,k as Te,R as Ae,n as Be,t as te,a as le,o as u,d as we,C as Ie,A as qe,q as N,r as Me,N as Se}from"./index-MkGUixqr.js";import{S as He}from"./SdkTabs-7yshYvVF.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Me(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),Ce(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),De(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,C,z,M=a[0].name+"",F,se,K,D,Q,E,G,g,S,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,A,x,w,B,v=[],ce=new Map,de,I,b=[],re=new Map,R;D=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -14,7 +14,7 @@ import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p ... await pb.collection('${(me=a[0])==null?void 0:me.name}').delete('RECORD_ID'); - `}});let _=a[1]&&ve(),U=j(a[4]);const fe=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to delete.',Z=k(),B=c("div"),B.textContent="Responses",x=k(),w=c("div"),I=c("div");for(let e=0;ee[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to delete.',Z=k(),A=c("div"),A.textContent="Responses",x=k(),w=c("div"),B=c("div");for(let e=0;es(2,n=D.code);return a.$$set=D=>{"collection"in D&&s(0,d=D.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,o=(d==null?void 0:d.deleteRule)===null),a.$$.dirty&3&&d!=null&&d.id&&(r.push({code:204,body:` + `),D.$set(f),(!R||t&1)&&L!==(L=e[0].name+"")&&ee(V,L),e[1]?_||(_=ve(),_.c(),_.m(g,null)):_&&(_.d(1),_=null),t&20&&(U=j(e[4]),v=he(v,t,fe,1,e,U,ce,B,Oe,ye,null,ge)),t&20&&(q=j(e[4]),Te(),b=he(b,t,pe,1,e,q,re,I,Ae,$e,null,ke),Be())},i(e){if(!R){te(D.$$.fragment,e);for(let t=0;ts(2,n=C.code);return a.$$set=C=>{"collection"in C&&s(0,d=C.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,o=(d==null?void 0:d.deleteRule)===null),a.$$.dirty&3&&d!=null&&d.id&&(r.push({code:204,body:` null `}),r.push({code:400,body:` { @@ -50,4 +50,4 @@ import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p "message": "The requested resource wasn't found.", "data": {} } - `}))},s(3,h=Ae.getApiExampleUrl(Me.baseUrl)),[d,o,n,h,r,$]}class ze extends Re{constructor(l){super(),Pe(this,l,Ue,Le,Ee,{collection:0})}}export{ze as default}; + `}))},s(3,h=Ie.getApiExampleUrl(qe.baseUrl)),[d,o,n,h,r,$]}class ze extends Re{constructor(l){super(),Pe(this,l,Ue,Le,Ee,{collection:0})}}export{ze as default}; diff --git a/ui/dist/assets/FieldsQueryParam-pO449pwf.js b/ui/dist/assets/FieldsQueryParam-N-1EL4Av.js similarity index 67% rename from ui/dist/assets/FieldsQueryParam-pO449pwf.js rename to ui/dist/assets/FieldsQueryParam-N-1EL4Av.js index 9d1c63c3..8fd9404e 100644 --- a/ui/dist/assets/FieldsQueryParam-pO449pwf.js +++ b/ui/dist/assets/FieldsQueryParam-N-1EL4Av.js @@ -1,7 +1,7 @@ -import{S as J,i as O,s as P,N as Q,e as t,b as c,w as i,c as R,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-ohPVsOF0.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,k,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as O,s as P,N as Q,e as t,b as c,v as i,c as R,f as j,g as z,h as e,m as A,w as D,t as G,a as K,o as U,d as V}from"./index-MkGUixqr.js";function W(f){let n,o,u,d,k,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,v,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',k=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),h=t("em"),h.textContent="(by default returns all fields)",y=i(`. Ex.: `),R(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. `),M=t("br"),N=i(` Ex.: - `),m=t("code"),T=i("?fields=*,"),k=i(f[0]),B=i("description:excerpt(200,true)"),j(o,"id","query-page")},m(l,g){z(l,n,g),e(n,o),e(n,u),e(n,d),e(n,v),e(n,s),e(s,p),e(p,w),e(p,h),e(p,y),A(r,p,null),e(s,F),e(s,_),e(s,S),e(s,b),e(s,E),e(s,C),e(C,a),e(a,$),e(a,L),e(a,q),e(a,H),e(a,M),e(a,N),e(a,m),e(m,T),e(m,k),e(m,B),x=!0},p(l,[g]){const I={};g&1&&(I.content="?fields=*,"+l[0]+"expand.relField.name"),r.$set(I),(!x||g&1)&&D(k,l[0])},i(l){x||(G(r.$$.fragment,l),x=!0)},o(l){K(r.$$.fragment,l),x=!1},d(l){l&&U(n),V(r)}}}function X(f,n,o){let{prefix:u=""}=n;return f.$$set=d=>{"prefix"in d&&o(0,u=d.prefix)},[u]}class Z extends J{constructor(n){super(),O(this,n,X,W,P,{prefix:0})}}export{Z as F}; + `),m=t("code"),T=i("?fields=*,"),v=i(f[0]),B=i("description:excerpt(200,true)"),j(o,"id","query-page")},m(l,g){z(l,n,g),e(n,o),e(n,u),e(n,d),e(n,k),e(n,s),e(s,p),e(p,w),e(p,h),e(p,y),A(r,p,null),e(s,F),e(s,_),e(s,S),e(s,b),e(s,E),e(s,C),e(C,a),e(a,$),e(a,L),e(a,q),e(a,H),e(a,M),e(a,N),e(a,m),e(m,T),e(m,v),e(m,B),x=!0},p(l,[g]){const I={};g&1&&(I.content="?fields=*,"+l[0]+"expand.relField.name"),r.$set(I),(!x||g&1)&&D(v,l[0])},i(l){x||(G(r.$$.fragment,l),x=!0)},o(l){K(r.$$.fragment,l),x=!1},d(l){l&&U(n),V(r)}}}function X(f,n,o){let{prefix:u=""}=n;return f.$$set=d=>{"prefix"in d&&o(0,u=d.prefix)},[u]}class Z extends J{constructor(n){super(),O(this,n,X,W,P,{prefix:0})}}export{Z as F}; diff --git a/ui/dist/assets/FilterAutocompleteInput-OZtUpY4v.js b/ui/dist/assets/FilterAutocompleteInput-YLbqIy3c.js similarity index 98% rename from ui/dist/assets/FilterAutocompleteInput-OZtUpY4v.js rename to ui/dist/assets/FilterAutocompleteInput-YLbqIy3c.js index 03e98a20..cfded22c 100644 --- a/ui/dist/assets/FilterAutocompleteInput-OZtUpY4v.js +++ b/ui/dist/assets/FilterAutocompleteInput-YLbqIy3c.js @@ -1 +1 @@ -import{S as se,i as ae,s as le,e as ue,f as ce,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as h,M as me}from"./index-ohPVsOF0.js";import{E as C,a as q,h as ke,b as xe,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Ie,j as Le,l as ve,m as Ae,n as De,o as Oe,p as _e,q as Y,C as L,S as Be,t as Me,u as He}from"./index-u64XbdBO.js";function Fe(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var g=r[y]=[],s=e[y],o=0;o2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,g=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:g=""}=r,{value:s=""}=r,{disabled:o=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:b=!1}=r,{extraAutocompleteKeys:v=[]}=r,{disableRequestKeys:E=!1}=r,{disableIndirectCollectionsKeys:S=!1}=r,f,w,A=o,H=new L,F=new L,T=new L,U=new L,R=[],W=[],N=[],J=[],I="",D="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{R=$(p),J=ee(),W=E?[]:te(),N=S?[]:ne()},300)}function $(t){let i=t.slice();return a&&h.pushOrReplaceByKey(i,a,"id"),i}function P(){w==null||w.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function V(){if(!g)return;const t=document.querySelectorAll('[for="'+g+'"]');for(let i of t)i.removeEventListener("click",O)}function G(){if(!g)return;V();const t=document.querySelectorAll('[for="'+g+'"]');for(let i of t)i.addEventListener("click",O)}function K(t,i="",u=0){var m,x,Q;let c=R.find(k=>k.name==t||k.id==t);if(!c||u>=4)return[];let d=h.getAllCollectionIdentifiers(c,i);for(const k of(c==null?void 0:c.schema)||[]){const B=i+k.name;if(k.type==="relation"&&((m=k.options)!=null&&m.collectionId)){const X=K(k.options.collectionId,B+".",u+1);X.length&&(d=d.concat(X))}k.type==="select"&&((x=k.options)==null?void 0:x.maxSelect)!=1&&d.push(B+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&d.push(B+":length")}return d}function ee(){return K(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const i=R.filter(c=>c.type==="auth");for(const c of i){const d=K(c.id,"@request.auth.");for(const m of d)h.pushUnique(t,m)}const u=["created","updated"];if(a!=null&&a.id){const c=K(a.name,"@request.data.");for(const d of c){t.push(d);const m=d.split(".");m.length===3&&m[2].indexOf(":")===-1&&!u.includes(m[2])&&t.push(d+":isset")}}return t}function ne(){const t=[];for(const i of R){const u="@collection."+i.name+".",c=K(i.name,u);for(const d of c)t.push(d)}return t}function re(t=!0,i=!0){let u=[].concat(v);return u=u.concat(J||[]),t&&(u=u.concat(W||[])),i&&(u=u.concat(N||[])),u.sort(function(c,d){return d.length-c.length}),u}function ie(t){var m;let i=t.matchBefore(/[\'\"\@\w\.]*/);if(i&&i.from==i.to&&!t.explicit)return null;let u=He(t.state).resolveInner(t.pos,-1);if(((m=u==null?void 0:u.type)==null?void 0:m.name)=="comment")return null;let c=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];S||c.push({label:"@collection.*",apply:"@collection."});const d=re(!E,!E&&i.text.startsWith("@c"));for(const x of d)c.push({label:x.endsWith(".")?x+"*":x,apply:x});return{from:i.from,options:c}}function z(){return Be.define(Fe({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:h.escapeRegExp("@now"),token:"keyword"},{regex:h.escapeRegExp("@second"),token:"keyword"},{regex:h.escapeRegExp("@minute"),token:"keyword"},{regex:h.escapeRegExp("@hour"),token:"keyword"},{regex:h.escapeRegExp("@year"),token:"keyword"},{regex:h.escapeRegExp("@day"),token:"keyword"},{regex:h.escapeRegExp("@month"),token:"keyword"},{regex:h.escapeRegExp("@weekday"),token:"keyword"},{regex:h.escapeRegExp("@todayStart"),token:"keyword"},{regex:h.escapeRegExp("@todayEnd"),token:"keyword"},{regex:h.escapeRegExp("@monthStart"),token:"keyword"},{regex:h.escapeRegExp("@monthEnd"),token:"keyword"},{regex:h.escapeRegExp("@yearStart"),token:"keyword"},{regex:h.escapeRegExp("@yearEnd"),token:"keyword"},{regex:h.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}ye(()=>{const t={key:"Enter",run:i=>{b&&y("submit",s)}};return G(),n(11,f=new C({parent:w,state:q.create({doc:s,extensions:[ke(),xe(),be(),we(),Ee(),q.allowMultipleSelections.of(!0),Se(Me,{fallback:!0}),Ke(),Ce(),qe(),Re(),Ie.of([t,...Le,...ve,Ae.find(i=>i.key==="Mod-d"),...De,...Oe]),C.lineWrapping,_e({override:[ie],icons:!1}),U.of(Y(l)),F.of(C.editable.of(!o)),T.of(q.readOnly.of(o)),H.of(z()),q.transactionFilter.of(i=>{var u,c,d;if(b&&i.newDoc.lines>1){if(!((d=(c=(u=i.changes)==null?void 0:u.inserted)==null?void 0:c.filter(m=>!!m.text.find(x=>x)))!=null&&d.length))return[];i.newDoc.text=[i.newDoc.text.join(" ")]}return i}),C.updateListener.of(i=>{!i.docChanged||o||(n(1,s=i.state.doc.toString()),P())})]})})),()=>{clearTimeout(_),V(),f==null||f.destroy()}});function oe(t){me[t?"unshift":"push"](()=>{w=t,n(0,w)})}return e.$$set=t=>{"id"in t&&n(2,g=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,o=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,b=t.singleLine),"extraAutocompleteKeys"in t&&n(7,v=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,E=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,S=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,I=Ve(a)),e.$$.dirty[0]&25352&&!o&&(D!=I||E!==-1||S!==-1)&&(n(14,D=I),j()),e.$$.dirty[0]&4&&g&&G(),e.$$.dirty[0]&2080&&f&&a!=null&&a.schema&&f.dispatch({effects:[H.reconfigure(z())]}),e.$$.dirty[0]&6152&&f&&A!=o&&(f.dispatch({effects:[F.reconfigure(C.editable.of(!o)),T.reconfigure(q.readOnly.of(o))]}),n(12,A=o),P()),e.$$.dirty[0]&2050&&f&&s!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&f&&typeof l<"u"&&f.dispatch({effects:[U.reconfigure(Y(l))]})},[w,s,g,o,l,a,b,v,E,S,O,f,A,I,D,oe]}class Xe extends se{constructor(r){super(),ae(this,r,Ge,Pe,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Xe as default}; +import{S as se,i as ae,s as le,e as ue,f as ce,g as de,x as M,o as fe,J as he,K as ge,L as pe,I as ye,C as h,M as me}from"./index-MkGUixqr.js";import{E as C,a as q,h as ke,b as xe,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Ie,j as Le,l as ve,m as Ae,n as De,o as Oe,p as _e,q as Y,C as L,S as Be,t as Me,u as He}from"./index-u64XbdBO.js";function Fe(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var g=r[y]=[],s=e[y],o=0;o2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,g=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:g=""}=r,{value:s=""}=r,{disabled:o=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:b=!1}=r,{extraAutocompleteKeys:v=[]}=r,{disableRequestKeys:E=!1}=r,{disableIndirectCollectionsKeys:S=!1}=r,f,w,A=o,H=new L,F=new L,T=new L,U=new L,R=[],W=[],N=[],J=[],I="",D="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{R=$(p),J=ee(),W=E?[]:te(),N=S?[]:ne()},300)}function $(t){let i=t.slice();return a&&h.pushOrReplaceByKey(i,a,"id"),i}function P(){w==null||w.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function V(){if(!g)return;const t=document.querySelectorAll('[for="'+g+'"]');for(let i of t)i.removeEventListener("click",O)}function G(){if(!g)return;V();const t=document.querySelectorAll('[for="'+g+'"]');for(let i of t)i.addEventListener("click",O)}function K(t,i="",u=0){var m,x,Q;let c=R.find(k=>k.name==t||k.id==t);if(!c||u>=4)return[];let d=h.getAllCollectionIdentifiers(c,i);for(const k of(c==null?void 0:c.schema)||[]){const B=i+k.name;if(k.type==="relation"&&((m=k.options)!=null&&m.collectionId)){const X=K(k.options.collectionId,B+".",u+1);X.length&&(d=d.concat(X))}k.type==="select"&&((x=k.options)==null?void 0:x.maxSelect)!=1&&d.push(B+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&d.push(B+":length")}return d}function ee(){return K(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const i=R.filter(c=>c.type==="auth");for(const c of i){const d=K(c.id,"@request.auth.");for(const m of d)h.pushUnique(t,m)}const u=["created","updated"];if(a!=null&&a.id){const c=K(a.name,"@request.data.");for(const d of c){t.push(d);const m=d.split(".");m.length===3&&m[2].indexOf(":")===-1&&!u.includes(m[2])&&t.push(d+":isset")}}return t}function ne(){const t=[];for(const i of R){const u="@collection."+i.name+".",c=K(i.name,u);for(const d of c)t.push(d)}return t}function re(t=!0,i=!0){let u=[].concat(v);return u=u.concat(J||[]),t&&(u=u.concat(W||[])),i&&(u=u.concat(N||[])),u.sort(function(c,d){return d.length-c.length}),u}function ie(t){var m;let i=t.matchBefore(/[\'\"\@\w\.]*/);if(i&&i.from==i.to&&!t.explicit)return null;let u=He(t.state).resolveInner(t.pos,-1);if(((m=u==null?void 0:u.type)==null?void 0:m.name)=="comment")return null;let c=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];S||c.push({label:"@collection.*",apply:"@collection."});const d=re(!E,!E&&i.text.startsWith("@c"));for(const x of d)c.push({label:x.endsWith(".")?x+"*":x,apply:x});return{from:i.from,options:c}}function z(){return Be.define(Fe({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:h.escapeRegExp("@now"),token:"keyword"},{regex:h.escapeRegExp("@second"),token:"keyword"},{regex:h.escapeRegExp("@minute"),token:"keyword"},{regex:h.escapeRegExp("@hour"),token:"keyword"},{regex:h.escapeRegExp("@year"),token:"keyword"},{regex:h.escapeRegExp("@day"),token:"keyword"},{regex:h.escapeRegExp("@month"),token:"keyword"},{regex:h.escapeRegExp("@weekday"),token:"keyword"},{regex:h.escapeRegExp("@todayStart"),token:"keyword"},{regex:h.escapeRegExp("@todayEnd"),token:"keyword"},{regex:h.escapeRegExp("@monthStart"),token:"keyword"},{regex:h.escapeRegExp("@monthEnd"),token:"keyword"},{regex:h.escapeRegExp("@yearStart"),token:"keyword"},{regex:h.escapeRegExp("@yearEnd"),token:"keyword"},{regex:h.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}ye(()=>{const t={key:"Enter",run:i=>{b&&y("submit",s)}};return G(),n(11,f=new C({parent:w,state:q.create({doc:s,extensions:[ke(),xe(),be(),we(),Ee(),q.allowMultipleSelections.of(!0),Se(Me,{fallback:!0}),Ke(),Ce(),qe(),Re(),Ie.of([t,...Le,...ve,Ae.find(i=>i.key==="Mod-d"),...De,...Oe]),C.lineWrapping,_e({override:[ie],icons:!1}),U.of(Y(l)),F.of(C.editable.of(!o)),T.of(q.readOnly.of(o)),H.of(z()),q.transactionFilter.of(i=>{var u,c,d;if(b&&i.newDoc.lines>1){if(!((d=(c=(u=i.changes)==null?void 0:u.inserted)==null?void 0:c.filter(m=>!!m.text.find(x=>x)))!=null&&d.length))return[];i.newDoc.text=[i.newDoc.text.join(" ")]}return i}),C.updateListener.of(i=>{!i.docChanged||o||(n(1,s=i.state.doc.toString()),P())})]})})),()=>{clearTimeout(_),V(),f==null||f.destroy()}});function oe(t){me[t?"unshift":"push"](()=>{w=t,n(0,w)})}return e.$$set=t=>{"id"in t&&n(2,g=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,o=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,b=t.singleLine),"extraAutocompleteKeys"in t&&n(7,v=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,E=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,S=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,I=Ve(a)),e.$$.dirty[0]&25352&&!o&&(D!=I||E!==-1||S!==-1)&&(n(14,D=I),j()),e.$$.dirty[0]&4&&g&&G(),e.$$.dirty[0]&2080&&f&&a!=null&&a.schema&&f.dispatch({effects:[H.reconfigure(z())]}),e.$$.dirty[0]&6152&&f&&A!=o&&(f.dispatch({effects:[F.reconfigure(C.editable.of(!o)),T.reconfigure(q.readOnly.of(o))]}),n(12,A=o),P()),e.$$.dirty[0]&2050&&f&&s!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&f&&typeof l<"u"&&f.dispatch({effects:[U.reconfigure(Y(l))]})},[w,s,g,o,l,a,b,v,E,S,O,f,A,I,D,oe]}class Xe extends se{constructor(r){super(),ae(this,r,Ge,Pe,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Xe as default}; diff --git a/ui/dist/assets/ListApiDocs-o3IOerVB.js b/ui/dist/assets/ListApiDocs-bfTK9tkG.js similarity index 98% rename from ui/dist/assets/ListApiDocs-o3IOerVB.js rename to ui/dist/assets/ListApiDocs-bfTK9tkG.js index 62dcc2b6..b1077acc 100644 --- a/ui/dist/assets/ListApiDocs-o3IOerVB.js +++ b/ui/dist/assets/ListApiDocs-bfTK9tkG.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-ohPVsOF0.js";import{S as dl}from"./SdkTabs-ZFbexUF1.js";import{F as pl}from"./FieldsQueryParam-pO449pwf.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,r as ll,x as Qe,o as m,v as _,h as t,N as Fe,O as se,c as Qt,m as Ut,w as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,A as cl,q as Le}from"./index-MkGUixqr.js";import{S as dl}from"./SdkTabs-7yshYvVF.js";import{F as pl}from"./FieldsQueryParam-N-1EL4Av.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-OczUMJjZ.js b/ui/dist/assets/ListExternalAuthsDocs-X9goxYp8.js similarity index 60% rename from ui/dist/assets/ListExternalAuthsDocs-OczUMJjZ.js rename to ui/dist/assets/ListExternalAuthsDocs-X9goxYp8.js index 212a2f97..8e7219cf 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-OczUMJjZ.js +++ b/ui/dist/assets/ListExternalAuthsDocs-X9goxYp8.js @@ -1,11 +1,11 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-ohPVsOF0.js";import{S as Ye}from"./SdkTabs-ZFbexUF1.js";import{F as Ze}from"./FieldsQueryParam-pO449pwf.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,v,b as m,c as pe,f as b,g as c,h as a,m as ue,w as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,A as Je,q as J,r as Ve,N as Xe}from"./index-MkGUixqr.js";import{S as Ye}from"./SdkTabs-7yshYvVF.js";import{F as Ze}from"./FieldsQueryParam-N-1EL4Av.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Te,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,A,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,q,ae,B,oe,L,ne,C,ie,$e,ce,E,de,M,re,T,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); ... - await pb.collection('${(Ce=o[0])==null?void 0:Ce.name}').authWithPassword('test@example.com', '123456'); + await pb.collection('${(Te=o[0])==null?void 0:Te.name}').authWithPassword('test@example.com', '123456'); const result = await pb.collection('${(Se=o[0])==null?void 0:Se.name}').listExternalAuths( pb.authStore.model.id @@ -22,16 +22,16 @@ import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c final result = await pb.collection('${(Ie=o[0])==null?void 0:Ie.name}').listExternalAuths( pb.authStore.model.id, ); - `}}),E=new Ze({});let j=F(o[2]);const Te=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",se=m(),B=i("div"),B.textContent="Path Parameters",ae=m(),q=i("table"),q.innerHTML='Param Type Description id String ID of the auth record.',oe=m(),L=i("div"),L.textContent="Query parameters",ne=m(),A=i("table"),ie=i("thead"),ie.innerHTML='Param Type Description',$e=m(),ce=i("tbody"),pe(E.$$.fragment),de=m(),M=i("div"),M.textContent="Responses",re=m(),C=i("div"),O=i("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",se=m(),q=i("div"),q.textContent="Path Parameters",ae=m(),B=i("table"),B.innerHTML='Param Type Description id String ID of the auth record.',oe=m(),L=i("div"),L.textContent="Query parameters",ne=m(),C=i("table"),ie=i("thead"),ie.innerHTML='Param Type Description',$e=m(),ce=i("tbody"),pe(E.$$.fragment),de=m(),M=i("div"),M.textContent="Responses",re=m(),T=i("div"),O=i("div");for(let e=0;es(1,_=h.code);return o.$$set=h=>{"collection"in h&&s(0,f=h.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(2,r=[{code:200,body:` + `),P.$set(p),(!S||t&1)&&Q!==(Q=e[0].name+"")&&N(te,Q),t&6&&(j=F(e[2]),g=Oe(g,t,Ae,1,e,j,we,O,je,Re,null,He)),t&6&&(H=F(e[2]),Fe(),k=Oe(k,t,Ce,1,e,H,Pe,D,Ne,We,null,De),Ge())},i(e){if(!S){G(P.$$.fragment,e),G(E.$$.fragment,e);for(let t=0;ts(1,_=h.code);return o.$$set=h=>{"collection"in h&&s(0,f=h.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(2,r=[{code:200,body:` [ { "id": "8171022dc95a4e8", diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-2bhyqO-h.js b/ui/dist/assets/PageAdminConfirmPasswordReset-rlk6ZeZ-.js similarity index 53% rename from ui/dist/assets/PageAdminConfirmPasswordReset-2bhyqO-h.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-rlk6ZeZ-.js index 779e3be5..93d1ced6 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-2bhyqO-h.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-rlk6ZeZ-.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-ohPVsOF0.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password - `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; +import{S as E,i as G,s as I,F as K,c as F,m as R,t as B,a as N,d as T,C as M,p as H,e as _,v as P,b as h,f,q as J,g as b,h as c,r as j,u as O,j as Q,l as U,o as w,z as V,A as L,B as X,D as Y,w as Z,y as q}from"./index-MkGUixqr.js";function W(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,k,v,C,A,y,m=i[3]&&W(i);return u=new H({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new H({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password + `),m&&m.c(),t=h(),F(u.$$.fragment),p=h(),F(d.$$.fragment),r=h(),a=_("button"),g=_("span"),g.textContent="Set new password",S=h(),k=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],J(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(k,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),R(u,e,null),c(e,p),R(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,k,$),c(k,v),C=!0,A||(y=[j(e,"submit",O(i[4])),Q(U.call(null,v))],A=!0)},p(o,$){o[3]?m?m.p(o,$):(m=W(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:o}),u.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:o}),d.$set(D),(!C||$&4)&&(a.disabled=o[2]),(!C||$&4)&&J(a,"btn-loading",o[2])},i(o){C||(B(u.$$.fragment,o),B(d.$$.fragment,o),C=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),C=!1},d(o){o&&(w(e),w(S),w(k)),m&&m.d(),T(u),T(d),A=!1,V(y)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},m(s,l){R(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await L.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){L.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-X0rySEZT.js b/ui/dist/assets/PageAdminRequestPasswordReset-X0rySEZT.js new file mode 100644 index 00000000..a835035c --- /dev/null +++ b/ui/dist/assets/PageAdminRequestPasswordReset-X0rySEZT.js @@ -0,0 +1 @@ +import{S as H,i as M,s as T,F as j,c as L,m as R,t as w,a as y,d as S,b as v,e as _,f as p,g,h as d,j as B,l as N,k as z,n as D,o as k,A as C,p as G,q as F,r as E,u as I,v as h,w as J,x as P,y as A}from"./index-MkGUixqr.js";function K(u){let e,s,n,l,t,i,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),L(l.$$.fragment),t=v(),i=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(i,"type","submit"),p(i,"class","btn btn-lg btn-block"),i.disabled=u[1],F(i,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){g(o,e,$),d(e,s),d(e,n),R(l,e,null),d(e,t),d(e,i),d(i,c),d(i,m),d(i,r),a=!0,b||(f=E(e,"submit",I(u[3])),b=!0)},p(o,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:o}),l.$set(q),(!a||$&2)&&(i.disabled=o[1]),(!a||$&2)&&F(i,"btn-loading",o[1])},i(o){a||(w(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&k(e),S(l),b=!1,f()}}}function O(u){let e,s,n,l,t,i,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),i=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,i),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,i,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",i=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),A(t,u[0]),t.focus(),c||(m=E(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&i!==(i=r[5])&&p(t,"id",i),a&1&&t.value!==r[0]&&A(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,i,c,m;const r=[O,K],a=[];function b(f,o){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,o){a[e].m(f,o),g(f,n,o),g(f,l,o),d(l,t),i=!0,c||(m=B(N.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(z(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,o):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){i||(w(s),i=!0)},o(f){y(s),i=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new j({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){L(e.$$.fragment)},m(n,l){R(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){S(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function i(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,i,c]}class Y extends H{constructor(e){super(),M(this,e,W,V,T,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-u3IJQ56t.js b/ui/dist/assets/PageAdminRequestPasswordReset-u3IJQ56t.js deleted file mode 100644 index 9efeb530..00000000 --- a/ui/dist/assets/PageAdminRequestPasswordReset-u3IJQ56t.js +++ /dev/null @@ -1 +0,0 @@ -import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-ohPVsOF0.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectFailure-r6JT1XbI.js b/ui/dist/assets/PageOAuth2RedirectFailure-QKXWWgns.js similarity index 53% rename from ui/dist/assets/PageOAuth2RedirectFailure-r6JT1XbI.js rename to ui/dist/assets/PageOAuth2RedirectFailure-QKXWWgns.js index 69720d2e..2ab5121e 100644 --- a/ui/dist/assets/PageOAuth2RedirectFailure-r6JT1XbI.js +++ b/ui/dist/assets/PageOAuth2RedirectFailure-QKXWWgns.js @@ -1 +1 @@ -import{S as o,i,s as c,e as r,f as l,g as u,y as a,o as d,I as h}from"./index-ohPVsOF0.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',l(t,"class","content txt-hint txt-center p-base")},m(e,s){u(e,t,s)},p:a,i:a,o:a,d(e){e&&d(t)}}}function p(n){return h(()=>{window.close()}),[]}class g extends o{constructor(t){super(),i(this,t,p,f,c,{})}}export{g as default}; +import{S as o,i,s as c,e as r,f as l,g as u,x as a,o as d,I as h}from"./index-MkGUixqr.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',l(t,"class","content txt-hint txt-center p-base")},m(e,s){u(e,t,s)},p:a,i:a,o:a,d(e){e&&d(t)}}}function p(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,p,f,c,{})}}export{x as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-YNXI3rVf.js b/ui/dist/assets/PageOAuth2RedirectSuccess-TnkusHkS.js similarity index 73% rename from ui/dist/assets/PageOAuth2RedirectSuccess-YNXI3rVf.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-TnkusHkS.js index 07715ebd..c1812447 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-YNXI3rVf.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-TnkusHkS.js @@ -1 +1 @@ -import{S as o,i as c,s as i,e as r,f as u,g as l,y as s,o as d,I as h}from"./index-ohPVsOF0.js";function p(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',u(t,"class","content txt-hint txt-center p-base")},m(e,a){l(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function f(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),c(this,t,f,p,i,{})}}export{x as default}; +import{S as o,i as c,s as i,e as r,f as u,g as l,x as s,o as d,I as h}from"./index-MkGUixqr.js";function p(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',u(t,"class","content txt-hint txt-center p-base")},m(e,a){l(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function f(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),c(this,t,f,p,i,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-4ADie32V.js b/ui/dist/assets/PageRecordConfirmEmailChange-mmZcf5-I.js similarity index 84% rename from ui/dist/assets/PageRecordConfirmEmailChange-4ADie32V.js rename to ui/dist/assets/PageRecordConfirmEmailChange-mmZcf5-I.js index 3bbb6116..c2528f2d 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-4ADie32V.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-mmZcf5-I.js @@ -1,2 +1,2 @@ -import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-ohPVsOF0.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address - `),d&&d.c(),s=C(),S(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),L(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),z(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=R()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(W(),v(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new M({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){S(e.$$.fragment)},m(n,l){L(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new j("../");try{const $=A(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=N.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends G{constructor(e){super(),I(this,e,x,Z,J,{params:5})}}export{te as default}; +import{S as G,i as I,s as J,F as M,c as S,m as A,t as h,a as v,d as L,C as N,E as R,g as _,k as W,n as Y,o as b,G as j,H as z,A as B,p as D,e as m,v as y,b as C,f as p,q as T,h as g,r as P,u as K,x as E,w as O,y as F}from"./index-MkGUixqr.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address + `),d&&d.c(),s=C(),S(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),A(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),L(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=R()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(W(),v(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new M({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){S(e.$$.fragment)},m(n,l){A(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new j("../");try{const $=z(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=N.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends G{constructor(e){super(),I(this,e,x,Z,J,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-CxQguUVC.js b/ui/dist/assets/PageRecordConfirmPasswordReset-Kc5FhBPO.js similarity index 91% rename from ui/dist/assets/PageRecordConfirmPasswordReset-CxQguUVC.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-Kc5FhBPO.js index ff815a0d..cb8d39f6 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-CxQguUVC.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-Kc5FhBPO.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-ohPVsOF0.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password - `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=a[2],G(u,"btn-loading",a[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),N(o,e,null),w(e,c),N(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const L={};$&3073&&(L.$$scope={dirty:$,ctx:f}),o.$set(L);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),r.$set(z),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&G(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){y(o.$$.fragment,f),y(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),T(o),T(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function I(a){let e,l,s;return{c(){e=q("for "),l=b("strong"),s=q(a[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(m(e),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=A()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),y(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){y(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){y(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; +import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,d as T,C as j,E as z,g as _,k as B,n as D,o as m,G as K,H as O,A as Q,p as E,e as b,v as q,b as C,f as p,q as G,h as w,r as S,u as U,x as F,w as V,y as R}from"./index-MkGUixqr.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password + `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=a[2],G(u,"btn-loading",a[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),N(o,e,null),w(e,c),N(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const A={};$&3073&&(A.$$scope={dirty:$,ctx:f}),o.$set(A);const L={};$&3074&&(L.$$scope={dirty:$,ctx:f}),r.$set(L),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&G(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){y(o.$$.fragment,f),y(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),T(o),T(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function I(a){let e,l,s;return{c(){e=q("for "),l=b("strong"),s=q(a[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(m(e),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=z()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),y(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){y(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){y(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-SM6lccm5.js b/ui/dist/assets/PageRecordConfirmVerification-Jpu6HXVR.js similarity index 74% rename from ui/dist/assets/PageRecordConfirmVerification-SM6lccm5.js rename to ui/dist/assets/PageRecordConfirmVerification-Jpu6HXVR.js index 5c78e874..251a3fc0 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-SM6lccm5.js +++ b/ui/dist/assets/PageRecordConfirmVerification-Jpu6HXVR.js @@ -1 +1 @@ -import{S as v,i as y,s as g,F as w,c as x,m as C,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-ohPVsOF0.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; +import{S as v,i as y,s as g,F as w,c as x,m as C,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as f,b as _,f as d,r as b,x as p}from"./index-MkGUixqr.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){r(i,t,o),r(i,s,o),r(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(a(t),a(s),a(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){r(i,t,o),r(i,s,o),r(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(a(t),a(s),a(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&a(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-HwUV4b-E.js b/ui/dist/assets/RealtimeApiDocs-B8Ubzznt.js similarity index 90% rename from ui/dist/assets/RealtimeApiDocs-HwUV4b-E.js rename to ui/dist/assets/RealtimeApiDocs-B8Ubzznt.js index f4959820..d292464d 100644 --- a/ui/dist/assets/RealtimeApiDocs-HwUV4b-E.js +++ b/ui/dist/assets/RealtimeApiDocs-B8Ubzznt.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-ohPVsOF0.js";import{S as de}from"./SdkTabs-ZFbexUF1.js";function he(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,w,v,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as u,g as s,h as I,m as ne,w as ue,t as ie,a as ce,o as n,d as le,A as me}from"./index-MkGUixqr.js";import{S as de}from"./SdkTabs-7yshYvVF.js";function he(t){var B,U,A,W,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,C,$,S,g,w,v,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); @@ -15,13 +15,13 @@ import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as }, { /* other options like expand, custom headers, etc. */ }); // Subscribe to changes only in the specified record - pb.collection('${(W=t[0])==null?void 0:W.name}').subscribe('RECORD_ID', function (e) { + pb.collection('${(A=t[0])==null?void 0:A.name}').subscribe('RECORD_ID', function (e) { console.log(e.action); console.log(e.record); }, { /* other options like expand, custom headers, etc. */ }); // Unsubscribe - pb.collection('${(A=t[0])==null?void 0:A.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions + pb.collection('${(W=t[0])==null?void 0:W.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions pb.collection('${(H=t[0])==null?void 0:H.name}').unsubscribe('*'); // remove all '*' topic subscriptions pb.collection('${(L=t[0])==null?void 0:L.name}').unsubscribe(); // remove all subscriptions in the collection `,dart:` @@ -55,7 +55,7 @@ import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as ViewRule will be used to determine whether the subscriber has access to receive the event message.

When you subscribe to an entire collection, the collection's ListRule will be used to determine whether the subscriber has access to receive the - event message.

`,_=a(),se(l.$$.fragment),S=a(),$=p("h6"),$.textContent="API details",C=a(),g=p("div"),g.innerHTML='SSE

/api/realtime

',w=a(),v=p("div"),v.textContent="Event data format",E=a(),se(r.$$.fragment),u(i,"class","m-b-sm"),u(h,"class","content txt-lg m-b-sm"),u(f,"class","alert alert-info m-t-10 m-b-sm"),u($,"class","m-b-xs"),u(g,"class","alert"),u(v,"class","section-title")},m(e,o){s(e,i,o),I(i,m),I(i,b),I(i,d),s(e,k,o),s(e,h,o),s(e,D,o),s(e,f,o),s(e,_,o),ne(l,e,o),s(e,S,o),s(e,$,o),s(e,C,o),s(e,g,o),s(e,w,o),s(e,v,o),s(e,E,o),ne(r,e,o),R=!0},p(e,[o]){var Y,z,F,G,K,Q,X,Z,x,ee,oe,te;(!R||o&1)&&c!==(c=e[0].name+"")&&ue(b,c);const O={};o&3&&(O.js=` + event message.

`,_=a(),se(l.$$.fragment),C=a(),$=p("h6"),$.textContent="API details",S=a(),g=p("div"),g.innerHTML='SSE

/api/realtime

',w=a(),v=p("div"),v.textContent="Event data format",E=a(),se(r.$$.fragment),u(i,"class","m-b-sm"),u(h,"class","content txt-lg m-b-sm"),u(f,"class","alert alert-info m-t-10 m-b-sm"),u($,"class","m-b-xs"),u(g,"class","alert"),u(v,"class","section-title")},m(e,o){s(e,i,o),I(i,m),I(i,b),I(i,d),s(e,k,o),s(e,h,o),s(e,D,o),s(e,f,o),s(e,_,o),ne(l,e,o),s(e,C,o),s(e,$,o),s(e,S,o),s(e,g,o),s(e,w,o),s(e,v,o),s(e,E,o),ne(r,e,o),R=!0},p(e,[o]){var Y,z,F,G,K,Q,X,Z,x,ee,oe,te;(!R||o&1)&&c!==(c=e[0].name+"")&&ue(b,c);const O={};o&3&&(O.js=` import PocketBase from 'pocketbase'; const pb = new PocketBase('${e[1]}'); @@ -107,4 +107,4 @@ import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as pb.collection('${(ee=e[0])==null?void 0:ee.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions pb.collection('${(oe=e[0])==null?void 0:oe.name}').unsubscribe('*'); // remove all '*' topic subscriptions pb.collection('${(te=e[0])==null?void 0:te.name}').unsubscribe(); // remove all subscriptions in the collection - `),l.$set(O);const V={};o&1&&(V.content=JSON.stringify({action:"create",record:P.dummyCollectionRecord(e[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),r.$set(V)},i(e){R||(ie(l.$$.fragment,e),ie(r.$$.fragment,e),R=!0)},o(e){ce(l.$$.fragment,e),ce(r.$$.fragment,e),R=!1},d(e){e&&(n(i),n(k),n(h),n(D),n(f),n(_),n(S),n($),n(C),n(g),n(w),n(v),n(E)),le(l,e),le(r,e)}}}function fe(t,i,m){let c,{collection:b}=i;return t.$$set=d=>{"collection"in d&&m(0,b=d.collection)},m(1,c=P.getApiExampleUrl(me.baseUrl)),[b,c]}class ve extends re{constructor(i){super(),ae(this,i,fe,he,be,{collection:0})}}export{ve as default}; + `),l.$set(O);const V={};o&1&&(V.content=JSON.stringify({action:"create",record:P.dummyCollectionRecord(e[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),r.$set(V)},i(e){R||(ie(l.$$.fragment,e),ie(r.$$.fragment,e),R=!0)},o(e){ce(l.$$.fragment,e),ce(r.$$.fragment,e),R=!1},d(e){e&&(n(i),n(k),n(h),n(D),n(f),n(_),n(C),n($),n(S),n(g),n(w),n(v),n(E)),le(l,e),le(r,e)}}}function fe(t,i,m){let c,{collection:b}=i;return t.$$set=d=>{"collection"in d&&m(0,b=d.collection)},m(1,c=P.getApiExampleUrl(me.baseUrl)),[b,c]}class ve extends re{constructor(i){super(),ae(this,i,fe,he,be,{collection:0})}}export{ve as default}; diff --git a/ui/dist/assets/RequestEmailChangeDocs-VM_SKuLb.js b/ui/dist/assets/RequestEmailChangeDocs-SM8dNhMn.js similarity index 68% rename from ui/dist/assets/RequestEmailChangeDocs-VM_SKuLb.js rename to ui/dist/assets/RequestEmailChangeDocs-SM8dNhMn.js index 91996736..01626a6a 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-VM_SKuLb.js +++ b/ui/dist/assets/RequestEmailChangeDocs-SM8dNhMn.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-ohPVsOF0.js";import{S as je}from"./SdkTabs-ZFbexUF1.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as ye,w as N,P as ve,Q as Ae,k as Re,R as Me,n as We,t as ee,a as te,o as m,d as Te,C as ze,A as He,q as F,r as Oe,N as Ue}from"./index-MkGUixqr.js";import{S as je}from"./SdkTabs-7yshYvVF.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,A,x,C,R,g=[],ie=new Map,ce,M,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -18,7 +18,7 @@ import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d await pb.collection('${(be=o[0])==null?void 0:be.name}').authWithPassword('test@example.com', '1234567890'); await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestEmailChange('new@example.com'); - `}});let D=L(o[2]);const de=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",X=k(),B=r("div"),B.textContent="Body Parameters",Y=k(),S=r("table"),S.innerHTML='Param Type Description
Required newEmail
String The new email address to send the change email request.',Z=k(),R=r("div"),R.textContent="Responses",x=k(),C=r("div"),M=r("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",X=k(),B=r("div"),B.textContent="Body Parameters",Y=k(),S=r("table"),S.innerHTML='Param Type Description
Required newEmail
String The new email address to send the change email request.',Z=k(),A=r("div"),A.textContent="Responses",x=k(),C=r("div"),R=r("div");for(let e=0;ea(1,f=u.code);return o.$$set=u=>{"collection"in u&&a(0,h=u.collection)},a(3,s=ze.getApiExampleUrl(He.baseUrl)),a(2,i=[{code:204,body:"null"},{code:400,body:` + `),P.$set(c),(!y||t&1)&&U!==(U=e[0].name+"")&&N(V,U),t&6&&(D=L(e[2]),g=ve(g,t,de,1,e,D,ie,R,Ae,qe,null,$e)),t&6&&(W=L(e[2]),Re(),_=ve(_,t,me,1,e,W,re,M,Me,Pe,null,we),We())},i(e){if(!y){ee(P.$$.fragment,e);for(let t=0;ta(1,f=u.code);return o.$$set=u=>{"collection"in u&&a(0,h=u.collection)},a(3,s=ze.getApiExampleUrl(He.baseUrl)),a(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/RequestPasswordResetDocs-5TAO7hUw.js b/ui/dist/assets/RequestPasswordResetDocs-E3P_OK0U.js similarity index 57% rename from ui/dist/assets/RequestPasswordResetDocs-5TAO7hUw.js rename to ui/dist/assets/RequestPasswordResetDocs-E3P_OK0U.js index 2ba53165..6ca5791b 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-5TAO7hUw.js +++ b/ui/dist/assets/RequestPasswordResetDocs-E3P_OK0U.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-ohPVsOF0.js";import{S as Ue}from"./SdkTabs-ZFbexUF1.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as L,P as fe,Q as ye,k as Re,R as Ce,n as Be,t as x,a as ee,o as p,d as we,C as Se,A as Te,q as N,r as Ae,N as Me}from"./index-MkGUixqr.js";import{S as Ue}from"./SdkTabs-7yshYvVF.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,m;function u(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(m=Ae(l,"click",u),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,m()}}}function he(o,s){let l,a,_,f;return a=new Me({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,m){d(i,l,m),ge(a,l,null),n(l,_),f=!0},p(i,m){s=i;const u={};m&4&&(u.content=s[5].body),a.$set(u),(!f||m&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,m,u,w,P,D=o[0].name+"",Q,te,z,$,G,C,J,q,H,se,O,B,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,A,Z,y,M,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -14,14 +14,14 @@ import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d ... await pb.collection('${(pe=o[0])==null?void 0:pe.name}').requestPasswordReset('test@example.com'); - `}});let F=I(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required email
String The auth record email address to send the password reset request (if exists).',Y=h(),M=r("div"),M.textContent="Responses",Z=h(),y=r("div"),A=r("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required email
String The auth record email address to send the password reset request (if exists).',Y=h(),A=r("div"),A.textContent="Responses",Z=h(),y=r("div"),M=r("div");for(let e=0;el(1,f=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` + await pb.collection('${(ue=e[0])==null?void 0:ue.name}').requestPasswordReset('test@example.com'); + `),$.$set(c),(!R||t&1)&&E!==(E=e[0].name+"")&&L(V,E),t&6&&(F=I(e[2]),v=fe(v,t,ce,1,e,F,oe,M,ye,ke,null,_e)),t&6&&(j=I(e[2]),Re(),k=fe(k,t,re,1,e,j,ie,U,Ce,he,null,be),Be())},i(e){if(!R){x($.$$.fragment,e);for(let t=0;tl(1,f=u.code);return o.$$set=u=>{"collection"in u&&l(0,_=u.collection)},l(3,a=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -41,4 +41,4 @@ import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d } } } - `}]),[_,f,i,a,u]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default}; + `}]),[_,f,i,a,m]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default}; diff --git a/ui/dist/assets/RequestVerificationDocs-dmeMkvVt.js b/ui/dist/assets/RequestVerificationDocs-dmeMkvVt.js new file mode 100644 index 00000000..55cf2c85 --- /dev/null +++ b/ui/dist/assets/RequestVerificationDocs-dmeMkvVt.js @@ -0,0 +1,44 @@ +import{S as qe,i as we,s as Pe,O as F,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as I,P as pe,Q as ye,k as Ce,R as Be,n as Se,t as x,a as ee,o as f,d as $e,C as Te,A as Ae,q as L,r as Re,N as Ve}from"./index-MkGUixqr.js";import{S as Me}from"./SdkTabs-7yshYvVF.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,m;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(m=Re(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,m()}}}function he(o,l){let s,a,_,p;return a=new Ve({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,m){d(i,s,m),ge(a,s,null),n(s,_),p=!0},p(i,m){l=i;const u={};m&4&&(u.content=l[5].body),a.$set(u),(!p||m&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,m,u,$,q,j=o[0].name+"",N,te,Q,w,z,B,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,A,Y,R,Z,y,V,v=[],oe=new Map,ne,M,k=[],ie=new Map,C;w=new Me({props:{js:` + import PocketBase from 'pocketbase'; + + const pb = new PocketBase('${o[3]}'); + + ... + + await pb.collection('${(de=o[0])==null?void 0:de.name}').requestVerification('test@example.com'); + `,dart:` + import 'package:pocketbase/pocketbase.dart'; + + final pb = PocketBase('${o[3]}'); + + ... + + await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestVerification('test@example.com'); + `}});let E=F(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required email
String The auth record email address to send the verification request (if exists).',Y=h(),R=r("div"),R.textContent="Responses",Z=h(),y=r("div"),V=r("div");for(let e=0;es(1,p=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=Te.getApiExampleUrl(Ae.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + { + "code": 400, + "message": "Failed to authenticate.", + "data": { + "email": { + "code": "validation_required", + "message": "Missing required value." + } + } + } + `}]),[_,p,i,a,m]}class Oe extends qe{constructor(l){super(),we(this,l,je,Ue,Pe,{collection:0})}}export{Oe as default}; diff --git a/ui/dist/assets/RequestVerificationDocs-yKFp7OPL.js b/ui/dist/assets/RequestVerificationDocs-yKFp7OPL.js deleted file mode 100644 index 1f44985e..00000000 --- a/ui/dist/assets/RequestVerificationDocs-yKFp7OPL.js +++ /dev/null @@ -1,44 +0,0 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-ohPVsOF0.js";import{S as Ae}from"./SdkTabs-ZFbexUF1.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` - import PocketBase from 'pocketbase'; - - const pb = new PocketBase('${o[3]}'); - - ... - - await pb.collection('${(de=o[0])==null?void 0:de.name}').requestVerification('test@example.com'); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final pb = PocketBase('${o[3]}'); - - ... - - await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestVerification('test@example.com'); - `}});let E=F(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required email
String The auth record email address to send the verification request (if exists).',Y=h(),V=r("div"),V.textContent="Responses",Z=h(),y=r("div"),M=r("div");for(let e=0;es(1,p=m.code);return o.$$set=m=>{"collection"in m&&s(0,_=m.collection)},s(3,a=Te.getApiExampleUrl(Re.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` - { - "code": 400, - "message": "Failed to authenticate.", - "data": { - "email": { - "code": "validation_required", - "message": "Missing required value." - } - } - } - `}]),[_,p,i,a,u]}class Oe extends qe{constructor(l){super(),we(this,l,je,Ue,Pe,{collection:0})}}export{Oe as default}; diff --git a/ui/dist/assets/SdkTabs-7yshYvVF.js b/ui/dist/assets/SdkTabs-7yshYvVF.js new file mode 100644 index 00000000..41272449 --- /dev/null +++ b/ui/dist/assets/SdkTabs-7yshYvVF.js @@ -0,0 +1 @@ +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,v as w,q as E,r as A,w as T,N as G,c as H,m as L,d as U}from"./index-MkGUixqr.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function q(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&T(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&T(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/SdkTabs-ZFbexUF1.js b/ui/dist/assets/SdkTabs-ZFbexUF1.js deleted file mode 100644 index 4c7247f9..00000000 --- a/ui/dist/assets/SdkTabs-ZFbexUF1.js +++ /dev/null @@ -1 +0,0 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as P,a as T,o as C,w,r as E,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-ohPVsOF0.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function I(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function M(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(P(s.$$.fragment,b),d=!0)},o(b){T(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(N,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs--pYR2xlr.js b/ui/dist/assets/UnlinkExternalAuthDocs-pKf1Zp4R.js similarity index 56% rename from ui/dist/assets/UnlinkExternalAuthDocs--pYR2xlr.js rename to ui/dist/assets/UnlinkExternalAuthDocs-pKf1Zp4R.js index cce2af55..09ea02cf 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs--pYR2xlr.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-pKf1Zp4R.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-ohPVsOF0.js";import{S as Ke}from"./SdkTabs-ZFbexUF1.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,v as g,b as f,c as Be,f as h,g as d,h as a,m as qe,w as I,P as ye,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as Ue,C as Re,A as je,q as N,r as Ie,N as Ne}from"./index-MkGUixqr.js";import{S as Ke}from"./SdkTabs-7yshYvVF.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,b,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),b=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,b),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,b;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),qe(s,o,null),a(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(oe(s.$$.fragment,c),b=!0)},o(c){ae(s.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,b,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,y,G,E,J,w,W,ie,z,A,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,q,le,C,U,v=[],pe=new Map,me,O,k=[],he=new Map,T;y=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); @@ -24,8 +24,8 @@ import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d pb.authStore.model.id, 'google', ); - `}});let R=j(n[2]);const he=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",x=f(),S=i("div"),S.textContent="Path Parameters",ee=f(),B=i("table"),B.innerHTML=`Param Type Description id String ID of the auth record. provider String The name of the auth provider to unlink, eg. google, twitter, - github, etc.`,te=f(),U=i("div"),U.textContent="Responses",le=f(),C=i("div"),q=i("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",x=f(),S=i("div"),S.textContent="Path Parameters",ee=f(),B=i("table"),B.innerHTML=`Param Type Description id String ID of the auth record. provider String The name of the auth provider to unlink, eg. google, twitter, + github, etc.`,te=f(),q=i("div"),q.textContent="Responses",le=f(),C=i("div"),U=i("div");for(let e=0;eo(1,h=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:` + `),y.$set(r),(!T||t&1)&&H!==(H=e[0].name+"")&&I(X,H),t&6&&(R=j(e[2]),v=ye(v,t,be,1,e,R,pe,U,We,Ee,null,Te)),t&6&&(D=j(e[2]),ze(),k=ye(k,t,fe,1,e,D,he,O,He,Se,null,Ce),Le())},i(e){if(!T){oe(y.$$.fragment,e);for(let t=0;to(1,b=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:` { "code": 401, "message": "The request requires valid record authorization token to be set.", @@ -69,4 +69,4 @@ import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d "message": "The requested resource wasn't found.", "data": {} } - `}]),[_,h,c,s,p]}class Ve extends Oe{constructor(l){super(),De(this,l,Fe,Qe,Me,{collection:0})}}export{Ve as default}; + `}]),[_,b,c,s,p]}class Ve extends Oe{constructor(l){super(),De(this,l,Fe,Qe,Me,{collection:0})}}export{Ve as default}; diff --git a/ui/dist/assets/UpdateApiDocs-pnf_K2jX.js b/ui/dist/assets/UpdateApiDocs-XdZRybfj.js similarity index 83% rename from ui/dist/assets/UpdateApiDocs-pnf_K2jX.js rename to ui/dist/assets/UpdateApiDocs-XdZRybfj.js index 514f3d67..3f0753ad 100644 --- a/ui/dist/assets/UpdateApiDocs-pnf_K2jX.js +++ b/ui/dist/assets/UpdateApiDocs-XdZRybfj.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-ohPVsOF0.js";import{S as Ft}from"./SdkTabs-ZFbexUF1.js";import{F as Nt}from"./FieldsQueryParam-pO449pwf.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,v as b,b as f,c as he,f as v,g as i,h as s,m as ye,w as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,A as Lt,q as ve,r as Pt,x as ee}from"./index-MkGUixqr.js";import{S as Ft}from"./SdkTabs-7yshYvVF.js";import{F as At}from"./FieldsQueryParam-N-1EL4Av.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
Optional username
String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
Optional email
String The auth record email address.
@@ -9,8 +9,8 @@ import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as h This field is required only when changing the record password. Admins and auth records with "Manage" access can skip this field.`,S=f(),g=r("tr"),g.innerHTML='
Optional password
String New auth record password.',$=f(),P=r("tr"),P.innerHTML='
Optional passwordConfirm
String New auth record password confirmation.',E=f(),M=r("tr"),M.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
- This field can be set only by admins or auth records with "Manage" access.`,U=f(),F=r("tr"),F.innerHTML='Schema fields'},m(y,_){i(y,e,_),i(y,t,_),i(y,n,_),i(y,u,_),i(y,m,_),i(y,o,_),i(y,p,_),i(y,h,_),i(y,w,_),i(y,S,_),i(y,g,_),i(y,$,_),i(y,P,_),i(y,E,_),i(y,M,_),i(y,U,_),i(y,F,_)},d(y){y&&(d(e),d(t),d(n),d(u),d(m),d(o),d(p),d(h),d(w),d(S),d(g),d($),d(P),d(E),d(M),d(U),d(F))}}}function Bt(c){let e;return{c(){e=r("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function jt(c){let e;return{c(){e=r("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function At(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("User "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Et(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("Relation record "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Ut(c){let e,t,n,u,m;return{c(){e=b("File object."),t=r("br"),n=b(` - Set to `),u=r("code"),u.textContent="null",m=b(" to delete already uploaded file(s).")},m(o,p){i(o,e,p),i(o,t,p),i(o,n,p),i(o,u,p),i(o,m,p)},p:ee,d(o){o&&(d(e),d(t),d(n),d(u),d(m))}}}function It(c){let e;return{c(){e=b("URL address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Jt(c){let e;return{c(){e=b("Email address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Vt(c){let e;return{c(){e=b("JSON array or object.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Qt(c){let e;return{c(){e=b("Number value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function xt(c){let e;return{c(){e=b("Plain text value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Tt(c,e){let t,n,u,m,o,p=e[13].name+"",h,w,S,g,$=I.getFieldValueType(e[13])+"",P,E,M,U;function F(C,O){return C[13].required?jt:Bt}let y=F(e),_=y(e);function N(C,O){if(C[13].type==="text")return xt;if(C[13].type==="number")return Qt;if(C[13].type==="json")return Vt;if(C[13].type==="email")return Jt;if(C[13].type==="url")return It;if(C[13].type==="file")return Ut;if(C[13].type==="relation")return Et;if(C[13].type==="user")return At}let B=N(e),T=B&&B(e);return{key:c,first:null,c(){t=r("tr"),n=r("td"),u=r("div"),_.c(),m=f(),o=r("span"),h=b(p),w=f(),S=r("td"),g=r("span"),P=b($),E=f(),M=r("td"),T&&T.c(),U=f(),v(u,"class","inline-flex"),v(g,"class","label"),this.first=t},m(C,O){i(C,t,O),s(t,n),s(n,u),_.m(u,null),s(u,m),s(u,o),s(o,h),s(t,w),s(t,S),s(S,g),s(g,P),s(t,E),s(t,M),T&&T.m(M,null),s(t,U)},p(C,O){e=C,y!==(y=F(e))&&(_.d(1),_=y(e),_&&(_.c(),_.m(u,m))),O&1&&p!==(p=e[13].name+"")&&J(h,p),O&1&&$!==($=I.getFieldValueType(e[13])+"")&&J(P,$),B===(B=N(e))&&T?T.p(e,O):(T&&T.d(1),T=B&&B(e),T&&(T.c(),T.m(M,null)))},d(C){C&&d(t),_.d(),T&&T.d()}}}function Ct(c,e){let t,n=e[8].code+"",u,m,o,p;function h(){return e[7](e[8])}return{key:c,first:null,c(){t=r("button"),u=b(n),m=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(w,S){i(w,t,S),s(t,u),s(t,m),o||(p=Pt(t,"click",h),o=!0)},p(w,S){e=w,S&4&&n!==(n=e[8].code+"")&&J(u,n),S&6&&ve(t,"active",e[1]===e[8].code)},d(w){w&&d(t),o=!1,p()}}}function St(c,e){let t,n,u,m;return n=new Ot({props:{content:e[8].body}}),{key:c,first:null,c(){t=r("div"),he(n.$$.fragment),u=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(o,p){i(o,t,p),ye(n,t,null),s(t,u),m=!0},p(o,p){e=o;const h={};p&4&&(h.content=e[8].body),n.$set(h),(!m||p&6)&&ve(t,"active",e[1]===e[8].code)},i(o){m||(ce(n.$$.fragment,o),m=!0)},o(o){pe(n.$$.fragment,o),m=!1},d(o){o&&d(t),ke(n)}}}function zt(c){var ct,pt,ut;let e,t,n=c[0].name+"",u,m,o,p,h,w,S,g=c[0].name+"",$,P,E,M,U,F,y,_,N,B,T,C,O,ue,Ue,fe,Y,Ie,ge,me=c[0].name+"",we,Je,Te,Ve,Ce,te,Se,le,Oe,ne,$e,V,Me,Qe,Q,qe,j=[],xe=new Map,He,ae,Re,x,De,ze,se,z,Le,Ke,Pe,We,q,Ye,G,Ge,Xe,Ze,Fe,et,Ne,tt,Be,lt,nt,X,je,ie,Ae,K,de,A=[],at=new Map,st,oe,H=[],it=new Map,W,R=c[6]&&vt();N=new Ft({props:{js:` + This field can be set only by admins or auth records with "Manage" access.`,U=f(),F=r("tr"),F.innerHTML='Schema fields'},m(y,_){i(y,e,_),i(y,t,_),i(y,n,_),i(y,u,_),i(y,m,_),i(y,o,_),i(y,p,_),i(y,h,_),i(y,w,_),i(y,S,_),i(y,g,_),i(y,$,_),i(y,P,_),i(y,E,_),i(y,M,_),i(y,U,_),i(y,F,_)},d(y){y&&(d(e),d(t),d(n),d(u),d(m),d(o),d(p),d(h),d(w),d(S),d(g),d($),d(P),d(E),d(M),d(U),d(F))}}}function Nt(c){let e;return{c(){e=r("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function Bt(c){let e;return{c(){e=r("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function jt(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("User "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Et(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("Relation record "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Ut(c){let e,t,n,u,m;return{c(){e=b("File object."),t=r("br"),n=b(` + Set to `),u=r("code"),u.textContent="null",m=b(" to delete already uploaded file(s).")},m(o,p){i(o,e,p),i(o,t,p),i(o,n,p),i(o,u,p),i(o,m,p)},p:ee,d(o){o&&(d(e),d(t),d(n),d(u),d(m))}}}function It(c){let e;return{c(){e=b("URL address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Jt(c){let e;return{c(){e=b("Email address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Vt(c){let e;return{c(){e=b("JSON array or object.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Qt(c){let e;return{c(){e=b("Number value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function xt(c){let e;return{c(){e=b("Plain text value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Tt(c,e){let t,n,u,m,o,p=e[13].name+"",h,w,S,g,$=I.getFieldValueType(e[13])+"",P,E,M,U;function F(C,O){return C[13].required?Bt:Nt}let y=F(e),_=y(e);function A(C,O){if(C[13].type==="text")return xt;if(C[13].type==="number")return Qt;if(C[13].type==="json")return Vt;if(C[13].type==="email")return Jt;if(C[13].type==="url")return It;if(C[13].type==="file")return Ut;if(C[13].type==="relation")return Et;if(C[13].type==="user")return jt}let N=A(e),T=N&&N(e);return{key:c,first:null,c(){t=r("tr"),n=r("td"),u=r("div"),_.c(),m=f(),o=r("span"),h=b(p),w=f(),S=r("td"),g=r("span"),P=b($),E=f(),M=r("td"),T&&T.c(),U=f(),v(u,"class","inline-flex"),v(g,"class","label"),this.first=t},m(C,O){i(C,t,O),s(t,n),s(n,u),_.m(u,null),s(u,m),s(u,o),s(o,h),s(t,w),s(t,S),s(S,g),s(g,P),s(t,E),s(t,M),T&&T.m(M,null),s(t,U)},p(C,O){e=C,y!==(y=F(e))&&(_.d(1),_=y(e),_&&(_.c(),_.m(u,m))),O&1&&p!==(p=e[13].name+"")&&J(h,p),O&1&&$!==($=I.getFieldValueType(e[13])+"")&&J(P,$),N===(N=A(e))&&T?T.p(e,O):(T&&T.d(1),T=N&&N(e),T&&(T.c(),T.m(M,null)))},d(C){C&&d(t),_.d(),T&&T.d()}}}function Ct(c,e){let t,n=e[8].code+"",u,m,o,p;function h(){return e[7](e[8])}return{key:c,first:null,c(){t=r("button"),u=b(n),m=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(w,S){i(w,t,S),s(t,u),s(t,m),o||(p=Pt(t,"click",h),o=!0)},p(w,S){e=w,S&4&&n!==(n=e[8].code+"")&&J(u,n),S&6&&ve(t,"active",e[1]===e[8].code)},d(w){w&&d(t),o=!1,p()}}}function St(c,e){let t,n,u,m;return n=new Ot({props:{content:e[8].body}}),{key:c,first:null,c(){t=r("div"),he(n.$$.fragment),u=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(o,p){i(o,t,p),ye(n,t,null),s(t,u),m=!0},p(o,p){e=o;const h={};p&4&&(h.content=e[8].body),n.$set(h),(!m||p&6)&&ve(t,"active",e[1]===e[8].code)},i(o){m||(ce(n.$$.fragment,o),m=!0)},o(o){pe(n.$$.fragment,o),m=!1},d(o){o&&d(t),ke(n)}}}function zt(c){var ct,pt,ut;let e,t,n=c[0].name+"",u,m,o,p,h,w,S,g=c[0].name+"",$,P,E,M,U,F,y,_,A,N,T,C,O,ue,Ue,fe,Y,Ie,ge,me=c[0].name+"",we,Je,Te,Ve,Ce,te,Se,le,Oe,ne,$e,V,Me,Qe,Q,qe,B=[],xe=new Map,He,ae,Re,x,De,ze,se,z,Le,Ke,Pe,We,q,Ye,G,Ge,Xe,Ze,Fe,et,Ae,tt,Ne,lt,nt,X,Be,ie,je,K,de,j=[],at=new Map,st,oe,H=[],it=new Map,W,R=c[6]&&vt();A=new Ft({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${c[4]}'); @@ -32,17 +32,17 @@ final pb = PocketBase('${c[4]}'); final body = ${JSON.stringify(Object.assign({},c[3],I.dummyCollectionSchemaData(c[0])),null,2)}; final record = await pb.collection('${(pt=c[0])==null?void 0:pt.name}').update('RECORD_ID', body: body); - `}});let D=c[5]&>(),L=c[6]&&wt(),be=Z((ut=c[0])==null?void 0:ut.schema);const dt=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;l<_e.length;l+=1){let a=yt(c,_e,l),k=ot(a);at.set(k,A[l]=Ct(k,a))}let re=Z(c[2]);const rt=l=>l[8].code;for(let l=0;lapplication/json or + `}});let D=c[5]&>(),L=c[6]&&wt(),be=Z((ut=c[0])==null?void 0:ut.schema);const dt=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;l<_e.length;l+=1){let a=yt(c,_e,l),k=ot(a);at.set(k,j[l]=Ct(k,a))}let re=Z(c[2]);const rt=l=>l[8].code;for(let l=0;lapplication/json or multipart/form-data.`,U=f(),F=r("p"),F.innerHTML=`File upload is supported only via multipart/form-data.
For more info and examples you could check the detailed Files upload and handling docs - .`,y=f(),R&&R.c(),_=f(),he(N.$$.fragment),B=f(),T=r("h6"),T.textContent="API details",C=f(),O=r("div"),ue=r("strong"),ue.textContent="PATCH",Ue=f(),fe=r("div"),Y=r("p"),Ie=b("/api/collections/"),ge=r("strong"),we=b(me),Je=b("/records/"),Te=r("strong"),Te.textContent=":id",Ve=f(),D&&D.c(),Ce=f(),te=r("div"),te.textContent="Path parameters",Se=f(),le=r("table"),le.innerHTML='Param Type Description id String ID of the record to update.',Oe=f(),ne=r("div"),ne.textContent="Body Parameters",$e=f(),V=r("table"),Me=r("thead"),Me.innerHTML='Param Type Description',Qe=f(),Q=r("tbody"),L&&L.c(),qe=f();for(let l=0;lParam Type Description',ze=f(),se=r("tbody"),z=r("tr"),Le=r("td"),Le.textContent="expand",Ke=f(),Pe=r("td"),Pe.innerHTML='String',We=f(),q=r("td"),Ye=b(`Auto expand relations when returning the updated record. Ex.: + .`,y=f(),R&&R.c(),_=f(),he(A.$$.fragment),N=f(),T=r("h6"),T.textContent="API details",C=f(),O=r("div"),ue=r("strong"),ue.textContent="PATCH",Ue=f(),fe=r("div"),Y=r("p"),Ie=b("/api/collections/"),ge=r("strong"),we=b(me),Je=b("/records/"),Te=r("strong"),Te.textContent=":id",Ve=f(),D&&D.c(),Ce=f(),te=r("div"),te.textContent="Path parameters",Se=f(),le=r("table"),le.innerHTML='Param Type Description id String ID of the record to update.',Oe=f(),ne=r("div"),ne.textContent="Body Parameters",$e=f(),V=r("table"),Me=r("thead"),Me.innerHTML='Param Type Description',Qe=f(),Q=r("tbody"),L&&L.c(),qe=f();for(let l=0;lParam Type Description',ze=f(),se=r("tbody"),z=r("tr"),Le=r("td"),Le.textContent="expand",Ke=f(),Pe=r("td"),Pe.innerHTML='String',We=f(),q=r("td"),Ye=b(`Auto expand relations when returning the updated record. Ex.: `),he(G.$$.fragment),Ge=b(` Supports up to 6-levels depth nested relations expansion. `),Xe=r("br"),Ze=b(` The expanded relations will be appended to the record under the - `),Fe=r("code"),Fe.textContent="expand",et=b(" property (eg. "),Ne=r("code"),Ne.textContent='"expand": {"relField1": {...}, ...}',tt=b(`). Only - the relations that the user has permissions to `),Be=r("strong"),Be.textContent="view",lt=b(" will be expanded."),nt=f(),he(X.$$.fragment),je=f(),ie=r("div"),ie.textContent="Responses",Ae=f(),K=r("div"),de=r("div");for(let l=0;l${JSON.stringify(Object.assign({},l[3],I.dummyCollectionSchemaData(l[0])),null,2)}; final record = await pb.collection('${(mt=l[0])==null?void 0:mt.name}').update('RECORD_ID', body: body); - `),N.$set(k),(!W||a&1)&&me!==(me=l[0].name+"")&&J(we,me),l[5]?D||(D=gt(),D.c(),D.m(O,null)):D&&(D.d(1),D=null),l[6]?L||(L=wt(),L.c(),L.m(Q,qe)):L&&(L.d(1),L=null),a&1&&(be=Z((bt=l[0])==null?void 0:bt.schema),j=Ee(j,a,dt,1,l,be,xe,Q,_t,Tt,null,kt)),a&6&&(_e=Z(l[2]),A=Ee(A,a,ot,1,l,_e,at,de,_t,Ct,null,yt)),a&6&&(re=Z(l[2]),Ht(),H=Ee(H,a,rt,1,l,re,it,oe,Rt,St,null,ht),Dt())},i(l){if(!W){ce(N.$$.fragment,l),ce(G.$$.fragment,l),ce(X.$$.fragment,l);for(let a=0;at(1,p=g.code);return c.$$set=g=>{"collection"in g&&t(0,o=g.collection)},c.$$.update=()=>{var g,$;c.$$.dirty&1&&t(6,n=(o==null?void 0:o.type)==="auth"),c.$$.dirty&1&&t(5,u=(o==null?void 0:o.updateRule)===null),c.$$.dirty&1&&t(2,h=[{code:200,body:JSON.stringify(I.dummyCollectionRecord(o),null,2)},{code:400,body:` + `),A.$set(k),(!W||a&1)&&me!==(me=l[0].name+"")&&J(we,me),l[5]?D||(D=gt(),D.c(),D.m(O,null)):D&&(D.d(1),D=null),l[6]?L||(L=wt(),L.c(),L.m(Q,qe)):L&&(L.d(1),L=null),a&1&&(be=Z((bt=l[0])==null?void 0:bt.schema),B=Ee(B,a,dt,1,l,be,xe,Q,_t,Tt,null,kt)),a&6&&(_e=Z(l[2]),j=Ee(j,a,ot,1,l,_e,at,de,_t,Ct,null,yt)),a&6&&(re=Z(l[2]),Ht(),H=Ee(H,a,rt,1,l,re,it,oe,Rt,St,null,ht),Dt())},i(l){if(!W){ce(A.$$.fragment,l),ce(G.$$.fragment,l),ce(X.$$.fragment,l);for(let a=0;at(1,p=g.code);return c.$$set=g=>{"collection"in g&&t(0,o=g.collection)},c.$$.update=()=>{var g,$;c.$$.dirty&1&&t(6,n=(o==null?void 0:o.type)==="auth"),c.$$.dirty&1&&t(5,u=(o==null?void 0:o.updateRule)===null),c.$$.dirty&1&&t(2,h=[{code:200,body:JSON.stringify(I.dummyCollectionRecord(o),null,2)},{code:400,body:` { "code": 400, "message": "Failed to update record.", diff --git a/ui/dist/assets/ViewApiDocs-dkYTmtVs.js b/ui/dist/assets/ViewApiDocs-fZDF7bi9.js similarity index 69% rename from ui/dist/assets/ViewApiDocs-dkYTmtVs.js rename to ui/dist/assets/ViewApiDocs-fZDF7bi9.js index 1e8fa3d6..14d1985a 100644 --- a/ui/dist/assets/ViewApiDocs-dkYTmtVs.js +++ b/ui/dist/assets/ViewApiDocs-fZDF7bi9.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-ohPVsOF0.js";import{S as pt}from"./SdkTabs-ZFbexUF1.js";import{F as ut}from"./FieldsQueryParam-pO449pwf.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,v as _,b as m,c as W,f as b,g as r,h as l,m as X,w as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,A as dt,q as Z,r as ct}from"./index-MkGUixqr.js";import{S as pt}from"./SdkTabs-7yshYvVF.js";import{F as ut}from"./FieldsQueryParam-N-1EL4Av.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,S,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,q,ce,x,pe,R,ue,Re,I,O,fe,Oe,me,Pe,h,De,A,Te,Ae,Ee,be,Se,_e,Be,qe,xe,he,Ie,Me,E,ke,M,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -18,13 +18,13 @@ import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b final record = await pb.collection('${(Ve=a[0])==null?void 0:Ve.name}').getOne('RECORD_ID', expand: 'relField1,relField2.subRelField', ); - `}});let g=a[1]&&Ye();E=new tt({props:{content:"?expand=relField1,relField2.subRelField"}}),S=new ut({});let J=K(a[4]);const Qe=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to view.',ce=m(),I=o("div"),I.textContent="Query parameters",pe=m(),R=o("table"),ue=o("thead"),ue.innerHTML='Param Type Description',Re=m(),M=o("tbody"),O=o("tr"),fe=o("td"),fe.textContent="expand",Oe=m(),me=o("td"),me.innerHTML='String',Pe=m(),h=o("td"),De=_(`Auto expand record relations. Ex.: - `),W(E.$$.fragment),Te=_(` - Supports up to 6-levels depth nested relations expansion. `),Ee=o("br"),Se=_(` + `}});let g=a[1]&&Ye();A=new tt({props:{content:"?expand=relField1,relField2.subRelField"}}),E=new ut({});let J=K(a[4]);const Qe=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to view.',ce=m(),x=o("div"),x.textContent="Query parameters",pe=m(),R=o("table"),ue=o("thead"),ue.innerHTML='Param Type Description',Re=m(),I=o("tbody"),O=o("tr"),fe=o("td"),fe.textContent="expand",Oe=m(),me=o("td"),me.innerHTML='String',Pe=m(),h=o("td"),De=_(`Auto expand record relations. Ex.: + `),W(A.$$.fragment),Te=_(` + Supports up to 6-levels depth nested relations expansion. `),Ae=o("br"),Ee=_(` The expanded relations will be appended to the record under the - `),be=o("code"),be.textContent="expand",xe=_(" property (eg. "),_e=o("code"),_e.textContent='"expand": {"relField1": {...}, ...}',Be=_(`). - `),Ae=o("br"),Ie=_(` - Only the relations to which the request user has permissions to `),he=o("strong"),he.textContent="view",Me=_(" will be expanded."),qe=m(),W(S.$$.fragment),ke=m(),q=o("div"),q.textContent="Responses",ge=m(),P=o("div"),H=o("div");for(let e=0;es(2,c=C.code);return a.$$set=C=>{"collection"in C&&s(0,p=C.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,i=(p==null?void 0:p.viewRule)===null),a.$$.dirty&3&&p!=null&&p.id&&(f.push({code:200,body:JSON.stringify(Ke.dummyCollectionRecord(p),null,2)}),i&&f.push({code:403,body:` + `),F.$set(u),(!D||t&1)&&G!==(G=e[0].name+"")&&ve(ae,G),e[1]?g||(g=Ye(),g.c(),g.m($,null)):g&&(g.d(1),g=null),t&20&&(J=K(e[4]),y=Je(y,t,Qe,1,e,J,He,H,ot,Ze,null,Xe)),t&20&&(N=K(e[4]),at(),k=Je(k,t,Ue,1,e,N,Ne,L,it,et,null,We),rt())},i(e){if(!D){Q(F.$$.fragment,e),Q(A.$$.fragment,e),Q(E.$$.fragment,e);for(let t=0;ts(2,c=C.code);return a.$$set=C=>{"collection"in C&&s(0,p=C.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,i=(p==null?void 0:p.viewRule)===null),a.$$.dirty&3&&p!=null&&p.id&&(f.push({code:200,body:JSON.stringify(Ke.dummyCollectionRecord(p),null,2)}),i&&f.push({code:403,body:` { "code": 403, "message": "Only admins can access this action.", diff --git a/ui/dist/assets/index-ohPVsOF0.js b/ui/dist/assets/index-MkGUixqr.js similarity index 75% rename from ui/dist/assets/index-ohPVsOF0.js rename to ui/dist/assets/index-MkGUixqr.js index fa06a417..e4b53789 100644 --- a/ui/dist/assets/index-ohPVsOF0.js +++ b/ui/dist/assets/index-MkGUixqr.js @@ -1,122 +1,122 @@ -var e0=Object.defineProperty;var t0=(n,e,t)=>e in n?e0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>(t0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const _s=n=>n;function Pe(n,e){for(const t in e)n[t]=e[t];return n}function n0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function vg(n){return n()}function Ja(){return Object.create(null)}function ve(n){n.forEach(vg)}function Tt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ms;function en(n,e){return n===e?!0:(Ms||(Ms=document.createElement("a")),Ms.href=e,n===Ms.href)}function i0(n){return Object.keys(n).length===0}function la(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function l0(n){let e;return la(n,t=>e=t)(),e}function Ue(n,e,t){n.$$.on_destroy.push(la(e,t))}function vt(n,e,t,i){if(n){const l=wg(n,e,t,i);return n[0](l)}}function wg(n,e,t,i){return n[1]&&i?Pe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),sa=Sg?n=>requestAnimationFrame(n):Q;const bl=new Set;function $g(n){bl.forEach(e=>{e.c(n)||(bl.delete(e),e.f())}),bl.size!==0&&sa($g)}function Po(n){let e;return bl.size===0&&sa($g),{promise:new Promise(t=>{bl.add(e={c:n,f:t})}),abort(){bl.delete(e)}}}function k(n,e){n.appendChild(e)}function Tg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function s0(n){const e=b("style");return e.textContent="/* empty */",o0(Tg(n),e),e.sheet}function o0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function rt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function cn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const r0=["width","height"];function ti(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&r0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function a0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function lt(n){return n===""?null:+n}function f0(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function u0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Cg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Ot(n,e){return new n(e)}const _o=new Map;let go=0;function c0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function d0(n,e){const t={stylesheet:s0(e),rules:{}};return _o.set(n,t),t}function ns(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ +var s0=Object.defineProperty;var o0=(n,e,t)=>e in n?s0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>(o0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const gs=n=>n;function Pe(n,e){for(const t in e)n[t]=e[t];return n}function r0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Sg(n){return n()}function Ga(){return Object.create(null)}function ve(n){n.forEach(Sg)}function Tt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ds;function en(n,e){return n===e?!0:(Ds||(Ds=document.createElement("a")),Ds.href=e,n===Ds.href)}function a0(n){return Object.keys(n).length===0}function oa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function $g(n){let e;return oa(n,t=>e=t)(),e}function Ue(n,e,t){n.$$.on_destroy.push(oa(e,t))}function vt(n,e,t,i){if(n){const l=Tg(n,e,t,i);return n[0](l)}}function Tg(n,e,t,i){return n[1]&&i?Pe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ra=Cg?n=>requestAnimationFrame(n):Q;const bl=new Set;function Og(n){bl.forEach(e=>{e.c(n)||(bl.delete(e),e.f())}),bl.size!==0&&ra(Og)}function Ro(n){let e;return bl.size===0&&ra(Og),{promise:new Promise(t=>{bl.add(e={c:n,f:t})}),abort(){bl.delete(e)}}}function k(n,e){n.appendChild(e)}function Mg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function f0(n){const e=b("style");return e.textContent="/* empty */",u0(Mg(n),e),e.sheet}function u0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function rt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function cn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const c0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&c0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function d0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function lt(n){return n===""?null:+n}function p0(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function m0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Dg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Ot(n,e){return new n(e)}const bo=new Map;let ko=0;function h0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function _0(n,e){const t={stylesheet:f0(e),rules:{}};return bo.set(n,t),t}function is(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ `;for(let g=0;g<=1;g+=a){const y=e+(t-e)*s(g);f+=g*100+`%{${o(y,1-y)}} `}const u=f+`100% {${o(t,1-t)}} -}`,c=`__svelte_${c0(u)}_${r}`,d=Tg(n),{stylesheet:m,rules:h}=_o.get(d)||d0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,go+=1,c}function is(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),go-=l,go||p0())}function p0(){sa(()=>{go||(_o.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),_o.clear())})}function m0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=_s,start:a=No()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=ns(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&is(n,h),d=!1}return Po(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function h0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Og(n,l)}}function Og(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ls;function di(n){ls=n}function gs(){if(!ls)throw new Error("Function called outside component initialization");return ls}function jt(n){gs().$$.on_mount.push(n)}function _0(n){gs().$$.after_update.push(n)}function bs(n){gs().$$.on_destroy.push(n)}function st(){const n=gs();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Cg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Te(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _l=[],ee=[];let kl=[];const Nr=[],Mg=Promise.resolve();let Pr=!1;function Dg(){Pr||(Pr=!0,Mg.then(oa))}function Xt(){return Dg(),Mg}function Ye(n){kl.push(n)}function ke(n){Nr.push(n)}const xo=new Set;let cl=0;function oa(){if(cl!==0)return;const n=ls;do{try{for(;cl<_l.length;){const e=_l[cl];cl++,di(e),g0(e.$$)}}catch(e){throw _l.length=0,cl=0,e}for(di(null),_l.length=0,cl=0;ee.length;)ee.pop()();for(let e=0;en.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),kl=e}let Rl;function ra(){return Rl||(Rl=Promise.resolve(),Rl.then(()=>{Rl=null})),Rl}function Ki(n,e,t){n.dispatchEvent(Cg(`${e?"intro":"outro"}${t}`))}const no=new Set;let xn;function se(){xn={r:0,c:[],p:xn}}function oe(){xn.r||ve(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(no.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(no.has(n))return;no.add(n),xn.c.push(()=>{no.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const aa={duration:0};function Eg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&is(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=_s,tick:_=Q,css:g}=l||aa;g&&(o=ns(n,0,1,m,d,h,g,a++)),_(0,1);const y=No()+d,S=y+m;r&&r.abort(),s=!0,Ye(()=>Ki(n,!0,"start")),r=Po(T=>{if(s){if(T>=S)return _(1,0),Ki(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,is(n),Tt(l)?(l=l(i),ra().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function fa(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=_s,tick:m=Q,css:h}=l||aa;h&&(o=ns(n,1,0,c,u,d,h));const _=No()+u,g=_+c;Ye(()=>Ki(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Po(y=>{if(s){if(y>=g)return m(0,1),Ki(n,!1,"end"),--r.r||ve(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Tt(l)?ra().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&is(n,o),s=!1)}}}function Ne(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&is(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=_s,tick:S=Q,css:T}=s||aa,$={start:No()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=ns(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ye(()=>Ki(n,h,"start")),Po(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ki(n,r.b,"start"),T&&(c(),f=ns(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?c():--r.group.r||ve(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*y(M/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Tt(s)?ra().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function Ga(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(se(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),oe())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&oa()}if(n0(n)){const l=gs();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function k0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function de(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ii(n,e){n.d(1),e.delete(n.key)}function It(n,e){A(n,1,1,()=>{e.delete(n.key)})}function y0(n,e){n.f(),It(n,e)}function ct(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?i&&T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function M(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?M(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),M(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)M(g[m-1]);return ve(T),g}function dt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ct(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function H(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ye(()=>{const s=n.$$.on_mount.map(vg).filter(Tt);n.$$.on_destroy?n.$$.on_destroy.push(...s):ve(s),n.$$.on_mount=[]}),l.forEach(Ye)}function z(n,e){const t=n.$$;t.fragment!==null&&(b0(t.after_update),ve(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function v0(n,e){n.$$.dirty[0]===-1&&(_l.push(n),Dg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&v0(n,c)),d}):[],f.update(),u=!0,ve(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=f0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),H(n,e.target,e.anchor),oa()}di(a)}class _e{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){z(this,1),this.$destroy=Q}$on(e,t){if(!Tt(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!i0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const w0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(w0);const dl=[];function Ig(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function Ag(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Ig(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Tt(h)?h:Q},m=l.map((h,_)=>la(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){ve(m),c(),a=!1}})}function Lg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function S0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};if(a!==void 0&&a&4)f=dt(l,[Ct(r[2])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),e.$on("routeEvent",r[7]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a&4?dt(l,[Ct(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function $0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};if(a!==void 0&&a&6)f=dt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),e.$on("routeEvent",r[6]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a&6?dt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function T0(n){let e,t,i,l;const s=[$0,S0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Xa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Fo=Ig(null,function(e){e(Xa());const t=()=>{e(Xa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Ag(Fo,n=>n.location);const Ro=Ag(Fo,n=>n.querystring),Qa=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Xt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function nn(n,e){if(e=ef(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return xa(n,e),{update(t){t=ef(t),xa(n,t)}}}function C0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function xa(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||O0(i.currentTarget.getAttribute("href"))})}function ef(n){return n&&typeof n=="string"?{href:n}:n||{}}function O0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function M0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Lg(C);this.path=C,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const M=this._pattern.exec(C);if(M===null)return null;if(this._keys===!1)return M;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=st();async function d($,C){await Xt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),_0(()=>{C0(m)}));let _=null,g=null;const y=Fo.subscribe(async $=>{_=$;let C=0;for(;C{Qa.set(f)});return}t(0,a=null),g=null,Qa.set(void 0)});bs(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Te.call(this,n,$)}function T($){Te.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class D0 extends _e{constructor(e){super(),he(this,e,M0,T0,me,{routes:3,prefix:4,restoreScrollState:5})}}const io=[];let Ng;function Pg(n){const e=n.pattern.test(Ng);tf(n,n.className,e),tf(n,n.inactiveClassName,!e)}function tf(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Fo.subscribe(n=>{Ng=n.location+(n.querystring?"?"+n.querystring:""),io.map(Pg)});function An(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Lg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return io.push(i),Pg(i),{destroy(){io.splice(io.indexOf(i),1)}}}const E0="modulepreload",I0=function(n,e){return new URL(n,e).href},nf={},nt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const s=document.getElementsByTagName("link");l=Promise.all(t.map(o=>{if(o=I0(o,i),o in nf)return;nf[o]=!0;const r=o.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(!!i)for(let c=s.length-1;c>=0;c--){const d=s[c];if(d.href===o&&(!r||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":E0,r||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),r)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})}))}return l.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function Dt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}Fg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const sf="pb_auth";class P0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ua(this.token)}get isAdmin(){return lo(this.token).type==="admin"}get isAuthRecord(){return lo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=sf){const i=A0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=sf){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=lo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=lf(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=lf(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Rg extends P0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class F0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class ca extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new bn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new bn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Sn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function er(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class R0 extends ca{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=Sn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||er(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){er(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&er(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&ua(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let M in $)if(M.toLowerCase()=="authorization"&&S==$[M]&&f.authStore.token){$[M]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=Sn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Sn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Sn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const q0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function qg(n){if(n){n.query=n.query||{};for(let e in n)q0.includes(e)||(n.query[e]=n[e],delete n[e])}}class jg extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){qg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new bn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class j0 extends ca{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=Sn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=Sn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new bn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new jg(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=of(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new bn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=of(h)})(d)}catch(c){r(),f(new bn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=Sn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Sn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Sn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Sn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Sn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Sn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Sn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function of(n){if(typeof window>"u"||!(window!=null&&window.open))throw new bn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class H0 extends ca{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class z0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new bn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class V0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class B0 extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class U0 extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class qo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Rg,this.admins=new R0(this),this.collections=new H0(this),this.files=new B0(this),this.logs=new z0(this),this.settings=new F0(this),this.realtime=new jg(this),this.health=new V0(this),this.backups=new U0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new j0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new bn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new bn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),qg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class W0 extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Y0 extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class K0 extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class gl extends il{}class Hg extends il{constructor(e){super(`Invalid unit ${e}`)}}class hn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Yn="short",Tn="long",bo={year:Oe,month:Oe,day:Oe},zg={year:Oe,month:Yn,day:Oe},J0={year:Oe,month:Yn,day:Oe,weekday:Yn},Vg={year:Oe,month:Tn,day:Oe},Bg={year:Oe,month:Tn,day:Oe,weekday:Tn},Ug={hour:Oe,minute:Oe},Wg={hour:Oe,minute:Oe,second:Oe},Yg={hour:Oe,minute:Oe,second:Oe,timeZoneName:Yn},Kg={hour:Oe,minute:Oe,second:Oe,timeZoneName:Tn},Jg={hour:Oe,minute:Oe,hourCycle:"h23"},Zg={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},Gg={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Yn},Xg={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Tn},Qg={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},xg={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},e1={year:Oe,month:Yn,day:Oe,hour:Oe,minute:Oe},t1={year:Oe,month:Yn,day:Oe,hour:Oe,minute:Oe,second:Oe},Z0={year:Oe,month:Yn,day:Oe,weekday:Yn,hour:Oe,minute:Oe},n1={year:Oe,month:Tn,day:Oe,hour:Oe,minute:Oe,timeZoneName:Yn},i1={year:Oe,month:Tn,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Yn},l1={year:Oe,month:Tn,day:Oe,weekday:Tn,hour:Oe,minute:Oe,timeZoneName:Tn},s1={year:Oe,month:Tn,day:Oe,weekday:Tn,hour:Oe,minute:Oe,second:Oe,timeZoneName:Tn};class ks{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let tr=null;class jo extends ks{static get instance(){return tr===null&&(tr=new jo),tr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return m1(e,t,i)}formatOffset(e,t){return Zl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let so={};function G0(n){return so[n]||(so[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),so[n]}const X0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Q0(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function x0(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let rf={};function ek(n,e={}){const t=JSON.stringify([n,e]);let i=rf[t];return i||(i=new Intl.ListFormat(n,e),rf[t]=i),i}let Fr={};function Rr(n,e={}){const t=JSON.stringify([n,e]);let i=Fr[t];return i||(i=new Intl.DateTimeFormat(n,e),Fr[t]=i),i}let qr={};function tk(n,e={}){const t=JSON.stringify([n,e]);let i=qr[t];return i||(i=new Intl.NumberFormat(n,e),qr[t]=i),i}let jr={};function nk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=jr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),jr[l]=s),s}let Wl=null;function ik(){return Wl||(Wl=new Intl.DateTimeFormat().resolvedOptions().locale,Wl)}let af={};function lk(n){let e=af[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,af[n]=e}return e}function sk(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Rr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Rr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function ok(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function rk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function ak(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function Is(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function fk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class uk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=tk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ha(e,3);return zt(t,this.padTo)}}}class ck{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Rr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class dk{constructor(e,t,i){this.opts={style:"long",...i},!t&&d1()&&(this.rtf=nk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Ak(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const pk={firstDay:1,minimalDays:4,weekend:[6,7]};class gt{static fromOpts(e){return gt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Rt.defaultLocale,r=o||(s?"en-US":ik()),a=t||Rt.defaultNumberingSystem,f=i||Rt.defaultOutputCalendar,u=Hr(l)||Rt.defaultWeekSettings;return new gt(r,a,f,u,o)}static resetCache(){Wl=null,Fr={},qr={},jr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return gt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=sk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=ok(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=fk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:gt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Hr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Is(this,e,g1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=rk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Is(this,e,y1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=ak(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Is(this,void 0,()=>v1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Is(this,e,w1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new uk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new ck(e,this.intl,t)}relFormatter(e={}){return new dk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ek(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:p1()?lk(this.locale):pk}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let nr=null;class un extends ks{static get utcInstance(){return nr===null&&(nr=new un(0)),nr}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Vo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Zl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Zl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Zl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class mk extends ks{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(We(n)||n===null)return e;if(n instanceof ks)return n;if(gk(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?jo.instance:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||pi.create(n)}else return Ji(n)?un.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new mk(n)}let ff=()=>Date.now(),uf="system",cf=null,df=null,pf=null,mf=60,hf,_f=null;class Rt{static get now(){return ff}static set now(e){ff=e}static set defaultZone(e){uf=e}static get defaultZone(){return Si(uf,jo.instance)}static get defaultLocale(){return cf}static set defaultLocale(e){cf=e}static get defaultNumberingSystem(){return df}static set defaultNumberingSystem(e){df=e}static get defaultOutputCalendar(){return pf}static set defaultOutputCalendar(e){pf=e}static get defaultWeekSettings(){return _f}static set defaultWeekSettings(e){_f=Hr(e)}static get twoDigitCutoffYear(){return mf}static set twoDigitCutoffYear(e){mf=e%100}static get throwOnInvalid(){return hf}static set throwOnInvalid(e){hf=e}static resetCaches(){gt.resetCache(),pi.resetCache()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const o1=[0,31,59,90,120,151,181,212,243,273,304,334],r1=[0,31,60,91,121,152,182,213,244,274,305,335];function Ln(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function da(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function a1(n,e,t){return t+(ys(n)?r1:o1)[e-1]}function f1(n,e){const t=ys(n)?r1:o1,i=t.findIndex(s=>sss(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Bo(n)}}function gf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=pa(da(i,1,e),t),r=yl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=yl(f)):a>r?(f=i+1,a-=yl(i)):f=i;const{month:u,day:c}=f1(f,a);return{year:f,month:u,day:c,...Bo(n)}}function ir(n){const{year:e,month:t,day:i}=n,l=a1(e,t,i);return{year:e,ordinal:l,...Bo(n)}}function bf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=f1(e,t);return{year:e,month:i,day:l,...Bo(n)}}function kf(n,e){if(!We(n.localWeekday)||!We(n.localWeekNumber)||!We(n.localWeekYear)){if(!We(n.weekday)||!We(n.weekNumber)||!We(n.weekYear))throw new gl("Cannot mix locale-based week fields with ISO-based week fields");return We(n.localWeekday)||(n.weekday=n.localWeekday),We(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),We(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function hk(n,e=4,t=1){const i=Ho(n.weekYear),l=Nn(n.weekNumber,1,ss(n.weekYear,e,t)),s=Nn(n.weekday,1,7);return i?l?s?!1:Ln("weekday",n.weekday):Ln("week",n.weekNumber):Ln("weekYear",n.weekYear)}function _k(n){const e=Ho(n.year),t=Nn(n.ordinal,1,yl(n.year));return e?t?!1:Ln("ordinal",n.ordinal):Ln("year",n.year)}function u1(n){const e=Ho(n.year),t=Nn(n.month,1,12),i=Nn(n.day,1,yo(n.year,n.month));return e?t?i?!1:Ln("day",n.day):Ln("month",n.month):Ln("year",n.year)}function c1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Nn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Nn(t,0,59),r=Nn(i,0,59),a=Nn(l,0,999);return s?o?r?a?!1:Ln("millisecond",l):Ln("second",i):Ln("minute",t):Ln("hour",e)}function We(n){return typeof n>"u"}function Ji(n){return typeof n=="number"}function Ho(n){return typeof n=="number"&&n%1===0}function gk(n){return typeof n=="string"}function bk(n){return Object.prototype.toString.call(n)==="[object Date]"}function d1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function p1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function kk(n){return Array.isArray(n)?n:[n]}function yf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function yk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Tl(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Hr(n){if(n==null)return null;if(typeof n!="object")throw new hn("Week settings must be an object");if(!Nn(n.firstDay,1,7)||!Nn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Nn(e,1,7)))throw new hn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Nn(n,e,t){return Ho(n)&&n>=e&&n<=t}function vk(n,e){return n-e*Math.floor(n/e)}function zt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(We(n)||n===null||n===""))return parseInt(n,10)}function Ni(n){if(!(We(n)||n===null||n===""))return parseFloat(n)}function ma(n){if(!(We(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ha(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ys(n){return n%4===0&&(n%100!==0||n%400===0)}function yl(n){return ys(n)?366:365}function yo(n,e){const t=vk(e-1,12)+1,i=n+(e-t)/12;return t===2?ys(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function zo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function vf(n,e,t){return-pa(da(n,1,e),t)+e-1}function ss(n,e=4,t=1){const i=vf(n,e,t),l=vf(n+1,e,t);return(yl(n)-i+l)/7}function zr(n){return n>99?n:n>Rt.twoDigitCutoffYear?1900+n:2e3+n}function m1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Vo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function h1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new hn(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Tl(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=h1(l)}return t}function Zl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${zt(t,2)}:${zt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${zt(t,2)}${zt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Bo(n){return yk(n,["hour","minute","second","millisecond"])}const wk=["January","February","March","April","May","June","July","August","September","October","November","December"],_1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sk=["J","F","M","A","M","J","J","A","S","O","N","D"];function g1(n){switch(n){case"narrow":return[...Sk];case"short":return[..._1];case"long":return[...wk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const b1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],k1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$k=["M","T","W","T","F","S","S"];function y1(n){switch(n){case"narrow":return[...$k];case"short":return[...k1];case"long":return[...b1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const v1=["AM","PM"],Tk=["Before Christ","Anno Domini"],Ck=["BC","AD"],Ok=["B","A"];function w1(n){switch(n){case"narrow":return[...Ok];case"short":return[...Ck];case"long":return[...Tk];default:return null}}function Mk(n){return v1[n.hour<12?0:1]}function Dk(n,e){return y1(e)[n.weekday-1]}function Ek(n,e){return g1(e)[n.month-1]}function Ik(n,e){return w1(e)[n.year<0?0:1]}function Ak(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function wf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Lk={D:bo,DD:zg,DDD:Vg,DDDD:Bg,t:Ug,tt:Wg,ttt:Yg,tttt:Kg,T:Jg,TT:Zg,TTT:Gg,TTTT:Xg,f:Qg,ff:e1,fff:n1,ffff:l1,F:xg,FF:t1,FFF:i1,FFFF:s1};class ln{static create(e,t={}){return new ln(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Lk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return zt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Mk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Ek(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Dk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=ln.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Ik(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return wf(ln.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=ln.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return wf(s,l(r))}}const S1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function El(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Il(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Al(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function $1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Ni(t)),months:d(Ni(i)),weeks:d(Ni(l)),days:d(Ni(s)),hours:d(Ni(o)),minutes:d(Ni(r)),seconds:d(Ni(a),a==="-0"),milliseconds:d(ma(f),c)}]}const Yk={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ba(n,e,t,i,l,s,o){const r={year:e.length===2?zr(vi(e)):vi(e),month:_1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?b1.indexOf(n)+1:k1.indexOf(n)+1),r}const Kk=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Jk(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=ba(e,l,i,t,s,o,r);let m;return a?m=Yk[a]:f?m=0:m=Vo(u,c),[d,new un(m)]}function Zk(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Gk=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Xk=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Qk=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Sf(n){const[,e,t,i,l,s,o,r]=n;return[ba(e,l,i,t,s,o,r),un.utcInstance]}function xk(n){const[,e,t,i,l,s,o,r]=n;return[ba(e,r,t,i,l,s,o),un.utcInstance]}const ey=El(Pk,ga),ty=El(Fk,ga),ny=El(Rk,ga),iy=El(C1),M1=Il(Vk,Ll,vs,ws),ly=Il(qk,Ll,vs,ws),sy=Il(jk,Ll,vs,ws),oy=Il(Ll,vs,ws);function ry(n){return Al(n,[ey,M1],[ty,ly],[ny,sy],[iy,oy])}function ay(n){return Al(Zk(n),[Kk,Jk])}function fy(n){return Al(n,[Gk,Sf],[Xk,Sf],[Qk,xk])}function uy(n){return Al(n,[Uk,Wk])}const cy=Il(Ll);function dy(n){return Al(n,[Bk,cy])}const py=El(Hk,zk),my=El(O1),hy=Il(Ll,vs,ws);function _y(n){return Al(n,[py,M1],[my,hy])}const $f="Invalid Duration",D1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},gy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...D1},Mn=146097/400,pl=146097/4800,by={years:{quarters:4,months:12,weeks:Mn/7,days:Mn,hours:Mn*24,minutes:Mn*24*60,seconds:Mn*24*60*60,milliseconds:Mn*24*60*60*1e3},quarters:{months:3,weeks:Mn/28,days:Mn/4,hours:Mn*24/4,minutes:Mn*24*60/4,seconds:Mn*24*60*60/4,milliseconds:Mn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...D1},Ui=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ky=Ui.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new ot(i)}function E1(n,e){let t=e.milliseconds??0;for(const i of ky.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Tf(n,e){const t=E1(n,e)<0?-1:1;Ui.reduceRight((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Ui.reduce((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function yy(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?by:gy;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||gt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new hn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:vo(e,ot.normalizeUnit),loc:gt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ji(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new hn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=uy(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=dy(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new K0(i);return new ot({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Hg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?ln.create(this.loc,i).formatDurationFromString(this,e):$f}toHuman(e={}){if(!this.isValid)return $f;const t=Ui.map(i=>{const l=this.values[i];return We(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ha(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?E1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e),i={};for(const l of Ui)(Tl(t.values,l)||Tl(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=h1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vo(e,ot.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Tf(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=yy(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ot.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Ui)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Ji(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Ji(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Tf(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Ui)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function vy(n,e){return!n||!n.isValid?Nt.invalid("missing or invalid start"):!e||!e.isValid?Nt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Nt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(jl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Nt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Nt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Nt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Nt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Nt.fromDateTimes(t,a.time)),t=null);return Nt.merge(l)}difference(...e){return Nt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=bo,t={}){return this.isValid?ln.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Nt.fromDateTimes(e(this.s),e(this.e))}}class As{static hasDST(e=Rt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,Rt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||gt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||gt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||gt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||gt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||gt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||gt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||gt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return gt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return gt.create(t,null,"gregory").eras(e)}static features(){return{relative:d1(),localeWeek:p1()}}}function Cf(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function wy(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=Cf(a,f);return(u-u%7)/7}],["days",Cf]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Sy(n,e,t,i){let[l,s,o,r]=wy(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...f).plus(u):u}const ka={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Of={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},$y=ka.hanidec.replace(/[\[|\]]/g,"").split("");function Ty(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function jn({numberingSystem:n},e=""){return new RegExp(`${ka[n||"latn"]}${e}`)}const Cy="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Ty(t))}}const Oy=" ",I1=`[ ${Oy}]`,A1=new RegExp(I1,"g");function My(n){return n.replace(/\./g,"\\.?").replace(A1,I1)}function Mf(n){return n.replace(/\./g,"").replace(A1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(My).join("|")),deser:([t])=>n.findIndex(i=>Mf(t)===Mf(i))+e}}function Df(n,e){return{regex:n,deser:([,t,i])=>Vo(t,i),groups:e}}function Ls(n){return{regex:n,deser:([e])=>e}}function Dy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ey(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(Dy(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ft(f);case"yy":return ft(c,zr);case"yyyy":return ft(s);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(l);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(l);case"u":return Ls(u);case"uu":return Ls(r);case"uuu":return ft(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ft(s);case"kk":return ft(c,zr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Df(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Df(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Ls(/[a-z_+-/]{1,256}?/i);case" ":return Ls(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:Cy};return _.token=n,_}const Iy={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Ay(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=Iy[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Ly(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Ny(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Tl(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Py(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return We(n.z)||(t=pi.create(n.z)),We(n.Z)||(t||(t=new un(n.Z)),i=n.Z),We(n.q)||(n.M=(n.q-1)*3+1),We(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),We(n.u)||(n.S=ma(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let lr=null;function Fy(){return lr||(lr=je.fromMillis(1555555555555)),lr}function Ry(n,e){if(n.literal)return n;const t=ln.macroTokenToFormatOpts(n.val),i=P1(t,e);return i==null||i.includes(void 0)?n:i}function L1(n,e){return Array.prototype.concat(...n.map(t=>Ry(t,e)))}function N1(n,e,t){const i=L1(ln.parseFormat(t),n),l=i.map(o=>Ey(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=Ly(l),a=RegExp(o,"i"),[f,u]=Ny(e,a,r),[c,d,m]=u?Py(u):[null,null,void 0];if(Tl(u,"a")&&Tl(u,"H"))throw new gl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:f,matches:u,result:c,zone:d,specificOffset:m}}}function qy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=N1(n,e,t);return[i,l,s,o]}function P1(n,e){if(!n)return null;const i=ln.create(e,n).dtFormatter(Fy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Ay(o,n,s))}const sr="Invalid DateTime",Ef=864e13;function Ns(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=ko(n.c)),n.weekData}function rr(n){return n.localWeekData===null&&(n.localWeekData=ko(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Pi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function F1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Ps(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function oo(n,e,t){return F1(zo(n),e,t)}function If(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,yo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=zo(s);let[a,f]=F1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function ql(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Fs(n,e,t=!0){return n.isValid?ln.create(gt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ar(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=zt(n.c.year,t?6:4),e?(i+="-",i+=zt(n.c.month),i+="-",i+=zt(n.c.day)):(i+=zt(n.c.month),i+=zt(n.c.day)),i}function Af(n,e,t,i,l,s){let o=zt(n.c.hour);return e?(o+=":",o+=zt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=zt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=zt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=zt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=zt(Math.trunc(-n.o/60)),o+=":",o+=zt(Math.trunc(-n.o%60))):(o+="+",o+=zt(Math.trunc(n.o/60)),o+=":",o+=zt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const R1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},jy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Hy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},q1=["year","month","day","hour","minute","second","millisecond"],zy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Vy=["year","ordinal","hour","minute","second","millisecond"];function By(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Hg(n);return e}function Lf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return By(n)}}function Nf(n,e){const t=Si(e.zone,Rt.defaultZone),i=gt.fromObject(e),l=Rt.now();let s,o;if(We(n.year))s=l;else{for(const f of q1)We(n[f])&&(n[f]=R1[f]);const r=u1(n)||c1(n);if(r)return je.invalid(r);const a=t.offset(l);[s,o]=oo(n,a,t)}return new je({ts:s,zone:t,loc:i,o})}function Pf(n,e,t){const i=We(t.round)?!0:t.round,l=(o,r)=>(o=ha(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Ff(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class je{constructor(e){const t=e.zone||Rt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Ns(t));this.ts=We(e.ts)?Rt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Ps(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||gt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Ff(arguments),[i,l,s,o,r,a,f]=t;return Nf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Ff(arguments),[i,l,s,o,r,a,f]=t;return e.zone=un.utcInstance,Nf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=bk(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,Rt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:gt.fromObject(t)}):je.invalid(Ns(l))}static fromMillis(e,t={}){if(Ji(e))return e<-Ef||e>Ef?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,Rt.defaultZone),loc:gt.fromObject(t)});throw new hn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new je({ts:e*1e3,zone:Si(t.zone,Rt.defaultZone),loc:gt.fromObject(t)});throw new hn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,Rt.defaultZone);if(!i.isValid)return je.invalid(Ns(i));const l=gt.fromObject(t),s=vo(e,Lf),{minDaysInFirstWeek:o,startOfWeek:r}=kf(s,l),a=Rt.now(),f=We(t.specificOffset)?i.offset(a):t.specificOffset,u=!We(s.ordinal),c=!We(s.year),d=!We(s.month)||!We(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new gl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Ps(a,f);_?(g=zy,y=jy,S=ko(S,o,r)):u?(g=Vy,y=Hy,S=ir(S)):(g=q1,y=R1);let T=!1;for(const R of g){const F=s[R];We(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?hk(s,o,r):u?_k(s):u1(s),C=$||c1(s);if(C)return je.invalid(C);const M=_?gf(s,o,r):u?bf(s):s,[D,I]=oo(M,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L}static fromISO(e,t={}){const[i,l]=ry(e);return ql(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=ay(e);return ql(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=fy(e);return ql(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(We(e)||We(t))throw new hn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=gt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=qy(o,e,t);return u?je.invalid(u):ql(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=_y(e);return ql(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new W0(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=P1(e,gt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return L1(ln.parseFormat(e),gt.fromObject(t)).map(l=>l.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?rr(this).weekday:NaN}get localWeekNumber(){return this.isValid?rr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?rr(this).weekYear:NaN}get ordinal(){return this.isValid?ir(this.c).ordinal:NaN}get monthShort(){return this.isValid?As.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?As.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?As.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?As.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=zo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Ps(a,o),c=Ps(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Pi(this,{ts:a}),Pi(this,{ts:f})]:[this]}get isInLeapYear(){return ys(this.year)}get daysInMonth(){return yo(this.year,this.month)}get daysInYear(){return this.isValid?yl(this.year):NaN}get weeksInWeekYear(){return this.isValid?ss(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ss(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=ln.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(Rt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,Rt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=oo(o,s,e)}return Pi(this,{ts:l,zone:e})}else return je.invalid(Ns(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Pi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vo(e,Lf),{minDaysInFirstWeek:i,startOfWeek:l}=kf(t,this.loc),s=!We(t.weekYear)||!We(t.weekNumber)||!We(t.weekday),o=!We(t.ordinal),r=!We(t.year),a=!We(t.month)||!We(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new gl("Can't mix ordinal dates with month/day");let c;s?c=gf({...ko(this.c,i,l),...t},i,l):We(t.ordinal)?(c={...this.toObject(),...t},We(t.day)&&(c.day=Math.min(yo(c.year,c.month),c.day))):c=bf({...ir(this.c),...t});const[d,m]=oo(c,this.o,this.zone);return Pi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return Pi(this,If(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return Pi(this,If(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=ot.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Sy(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Nt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new hn("max requires all arguments be DateTimes");return yf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=gt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return N1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return bo}static get DATE_MED(){return zg}static get DATE_MED_WITH_WEEKDAY(){return J0}static get DATE_FULL(){return Vg}static get DATE_HUGE(){return Bg}static get TIME_SIMPLE(){return Ug}static get TIME_WITH_SECONDS(){return Wg}static get TIME_WITH_SHORT_OFFSET(){return Yg}static get TIME_WITH_LONG_OFFSET(){return Kg}static get TIME_24_SIMPLE(){return Jg}static get TIME_24_WITH_SECONDS(){return Zg}static get TIME_24_WITH_SHORT_OFFSET(){return Gg}static get TIME_24_WITH_LONG_OFFSET(){return Xg}static get DATETIME_SHORT(){return Qg}static get DATETIME_SHORT_WITH_SECONDS(){return xg}static get DATETIME_MED(){return e1}static get DATETIME_MED_WITH_SECONDS(){return t1}static get DATETIME_MED_WITH_WEEKDAY(){return Z0}static get DATETIME_FULL(){return n1}static get DATETIME_FULL_WITH_SECONDS(){return i1}static get DATETIME_HUGE(){return l1}static get DATETIME_HUGE_WITH_SECONDS(){return s1}}function jl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new hn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Uy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Wy=[".mp4",".avi",".mov",".3gp",".wmv"],Yy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Ky=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],j1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Uy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Wy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Yy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Ky.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` +}`,c=`__svelte_${h0(u)}_${r}`,d=Mg(n),{stylesheet:m,rules:h}=bo.get(d)||_0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,ko+=1,c}function ls(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),ko-=l,ko||g0())}function g0(){ra(()=>{ko||(bo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),bo.clear())})}function b0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=gs,start:a=Fo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=is(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&ls(n,h),d=!1}return Ro(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function k0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Eg(n,l)}}function Eg(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ss;function di(n){ss=n}function bs(){if(!ss)throw new Error("Function called outside component initialization");return ss}function jt(n){bs().$$.on_mount.push(n)}function y0(n){bs().$$.after_update.push(n)}function ks(n){bs().$$.on_destroy.push(n)}function st(){const n=bs();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Dg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Te(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _l=[],ee=[];let kl=[];const Fr=[],Ig=Promise.resolve();let Rr=!1;function Ag(){Rr||(Rr=!0,Ig.then(aa))}function Xt(){return Ag(),Ig}function Ye(n){kl.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let cl=0;function aa(){if(cl!==0)return;const n=ss;do{try{for(;cl<_l.length;){const e=_l[cl];cl++,di(e),v0(e.$$)}}catch(e){throw _l.length=0,cl=0,e}for(di(null),_l.length=0,cl=0;ee.length;)ee.pop()();for(let e=0;en.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),kl=e}let Rl;function fa(){return Rl||(Rl=Promise.resolve(),Rl.then(()=>{Rl=null})),Rl}function Ki(n,e,t){n.dispatchEvent(Dg(`${e?"intro":"outro"}${t}`))}const io=new Set;let ei;function se(){ei={r:0,c:[],p:ei}}function oe(){ei.r||ve(ei.c),ei=ei.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ei.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Lg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&ls(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=gs,tick:_=Q,css:g}=l||ua;g&&(o=is(n,0,1,m,d,h,g,a++)),_(0,1);const y=Fo()+d,S=y+m;r&&r.abort(),s=!0,Ye(()=>Ki(n,!0,"start")),r=Ro(T=>{if(s){if(T>=S)return _(1,0),Ki(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,ls(n),Tt(l)?(l=l(i),fa().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ca(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=ei;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=gs,tick:m=Q,css:h}=l||ua;h&&(o=is(n,1,0,c,u,d,h));const _=Fo()+u,g=_+c;Ye(()=>Ki(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Ro(y=>{if(s){if(y>=g)return m(0,1),Ki(n,!1,"end"),--r.r||ve(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Tt(l)?fa().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&ls(n,o),s=!1)}}}function Ne(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&ls(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=gs,tick:S=Q,css:T}=s||ua,$={start:Fo()+_,b:h};h||($.group=ei,ei.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=is(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ye(()=>Ki(n,h,"start")),Ro(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ki(n,r.b,"start"),T&&(c(),f=is(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?c():--r.group.r||ve(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*y(M/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Tt(s)?fa().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function Qa(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(se(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),oe())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&aa()}if(r0(n)){const l=bs();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function S0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function de(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ii(n,e){n.d(1),e.delete(n.key)}function It(n,e){A(n,1,1,()=>{e.delete(n.key)})}function $0(n,e){n.f(),It(n,e)}function ct(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?i&&T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function M(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?M(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),M(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)M(g[m-1]);return ve(T),g}function dt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ct(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function H(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ye(()=>{const s=n.$$.on_mount.map(Sg).filter(Tt);n.$$.on_destroy?n.$$.on_destroy.push(...s):ve(s),n.$$.on_mount=[]}),l.forEach(Ye)}function z(n,e){const t=n.$$;t.fragment!==null&&(w0(t.after_update),ve(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function T0(n,e){n.$$.dirty[0]===-1&&(_l.push(n),Ag(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&T0(n,c)),d}):[],f.update(),u=!0,ve(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=p0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),H(n,e.target,e.anchor),aa()}di(a)}class _e{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){z(this,1),this.$destroy=Q}$on(e,t){if(!Tt(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!a0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const C0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(C0);const dl=[];function Ng(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function Pg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Ng(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Tt(h)?h:Q},m=l.map((h,_)=>oa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){ve(m),c(),a=!1}})}function Fg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function O0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};if(a!==void 0&&a&4)f=dt(l,[Ct(r[2])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),e.$on("routeEvent",r[7]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a&4?dt(l,[Ct(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function M0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};if(a!==void 0&&a&6)f=dt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),e.$on("routeEvent",r[6]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a&6?dt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function D0(n){let e,t,i,l;const s=[M0,O0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function xa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qo=Ng(null,function(e){e(xa());const t=()=>{e(xa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Pg(qo,n=>n.location);const jo=Pg(qo,n=>n.querystring),ef=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Xt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function nn(n,e){if(e=nf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return tf(n,e),{update(t){t=nf(t),tf(n,t)}}}function E0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function tf(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||I0(i.currentTarget.getAttribute("href"))})}function nf(n){return n&&typeof n=="string"?{href:n}:n||{}}function I0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function A0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Fg(C);this.path=C,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const M=this._pattern.exec(C);if(M===null)return null;if(this._keys===!1)return M;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=st();async function d($,C){await Xt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),y0(()=>{E0(m)}));let _=null,g=null;const y=qo.subscribe(async $=>{_=$;let C=0;for(;C{ef.set(f)});return}t(0,a=null),g=null,ef.set(void 0)});ks(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Te.call(this,n,$)}function T($){Te.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class L0 extends _e{constructor(e){super(),he(this,e,A0,D0,me,{routes:3,prefix:4,restoreScrollState:5})}}const lo=[];let Rg;function qg(n){const e=n.pattern.test(Rg);lf(n,n.className,e),lf(n,n.inactiveClassName,!e)}function lf(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{Rg=n.location+(n.querystring?"?"+n.querystring:""),lo.map(qg)});function An(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Fg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return lo.push(i),qg(i),{destroy(){lo.splice(lo.indexOf(i),1)}}}const N0="modulepreload",P0=function(n,e){return new URL(n,e).href},sf={},nt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const s=document.getElementsByTagName("link");l=Promise.all(t.map(o=>{if(o=P0(o,i),o in sf)return;sf[o]=!0;const r=o.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(!!i)for(let c=s.length-1;c>=0;c--){const d=s[c];if(d.href===o&&(!r||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":N0,r||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),r)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})}))}return l.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function Dt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}jg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const rf="pb_auth";class j0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!da(this.token)}get isAdmin(){return so(this.token).type==="admin"}get isAuthRecord(){return so(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=rf){const i=F0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=rf){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=so(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=of(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=of(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Hg extends j0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class H0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class pa extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new bn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new bn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Sn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function nr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class z0 extends pa{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=Sn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||nr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){nr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&nr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&da(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let M in $)if(M.toLowerCase()=="authorization"&&S==$[M]&&f.authStore.token){$[M]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=Sn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Sn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Sn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const V0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function zg(n){if(n){n.query=n.query||{};for(let e in n)V0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Vg extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){zg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new bn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class B0 extends pa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=Sn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=Sn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new bn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Vg(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=af(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new bn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=af(h)})(d)}catch(c){r(),f(new bn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=Sn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Sn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Sn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Sn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Sn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Sn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Sn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function af(n){if(typeof window>"u"||!(window!=null&&window.open))throw new bn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class U0 extends pa{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class W0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new bn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Y0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class K0 extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class J0 extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Ho{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Hg,this.admins=new z0(this),this.collections=new U0(this),this.files=new K0(this),this.logs=new W0(this),this.settings=new H0(this),this.realtime=new Vg(this),this.health=new Y0(this),this.backups=new J0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new B0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new bn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new bn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),zg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class Z0 extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class G0 extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class X0 extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class gl extends il{}class Bg extends il{constructor(e){super(`Invalid unit ${e}`)}}class hn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Yn="short",Tn="long",yo={year:Oe,month:Oe,day:Oe},Ug={year:Oe,month:Yn,day:Oe},Q0={year:Oe,month:Yn,day:Oe,weekday:Yn},Wg={year:Oe,month:Tn,day:Oe},Yg={year:Oe,month:Tn,day:Oe,weekday:Tn},Kg={hour:Oe,minute:Oe},Jg={hour:Oe,minute:Oe,second:Oe},Zg={hour:Oe,minute:Oe,second:Oe,timeZoneName:Yn},Gg={hour:Oe,minute:Oe,second:Oe,timeZoneName:Tn},Xg={hour:Oe,minute:Oe,hourCycle:"h23"},Qg={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},xg={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Yn},e1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Tn},t1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},n1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},i1={year:Oe,month:Yn,day:Oe,hour:Oe,minute:Oe},l1={year:Oe,month:Yn,day:Oe,hour:Oe,minute:Oe,second:Oe},x0={year:Oe,month:Yn,day:Oe,weekday:Yn,hour:Oe,minute:Oe},s1={year:Oe,month:Tn,day:Oe,hour:Oe,minute:Oe,timeZoneName:Yn},o1={year:Oe,month:Tn,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Yn},r1={year:Oe,month:Tn,day:Oe,weekday:Tn,hour:Oe,minute:Oe,timeZoneName:Tn},a1={year:Oe,month:Tn,day:Oe,weekday:Tn,hour:Oe,minute:Oe,second:Oe,timeZoneName:Tn};class ys{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let ir=null;class zo extends ys{static get instance(){return ir===null&&(ir=new zo),ir}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return g1(e,t,i)}formatOffset(e,t){return Zl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let oo={};function ek(n){return oo[n]||(oo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oo[n]}const tk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function nk(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function ik(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ff={};function lk(n,e={}){const t=JSON.stringify([n,e]);let i=ff[t];return i||(i=new Intl.ListFormat(n,e),ff[t]=i),i}let qr={};function jr(n,e={}){const t=JSON.stringify([n,e]);let i=qr[t];return i||(i=new Intl.DateTimeFormat(n,e),qr[t]=i),i}let Hr={};function sk(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.NumberFormat(n,e),Hr[t]=i),i}let zr={};function ok(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=zr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),zr[l]=s),s}let Wl=null;function rk(){return Wl||(Wl=new Intl.DateTimeFormat().resolvedOptions().locale,Wl)}let uf={};function ak(n){let e=uf[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,uf[n]=e}return e}function fk(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=jr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=jr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function uk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function ck(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function dk(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function As(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function pk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class mk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=sk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ga(e,3);return zt(t,this.padTo)}}}class hk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=jr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class _k{constructor(e,t,i){this.opts={style:"long",...i},!t&&h1()&&(this.rtf=ok(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Fk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const gk={firstDay:1,minimalDays:4,weekend:[6,7]};class gt{static fromOpts(e){return gt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Rt.defaultLocale,r=o||(s?"en-US":rk()),a=t||Rt.defaultNumberingSystem,f=i||Rt.defaultOutputCalendar,u=Vr(l)||Rt.defaultWeekSettings;return new gt(r,a,f,u,o)}static resetCache(){Wl=null,qr={},Hr={},zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return gt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=fk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=uk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=pk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:gt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Vr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return As(this,e,y1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=ck(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return As(this,e,S1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=dk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return As(this,void 0,()=>$1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return As(this,e,T1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new mk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new hk(e,this.intl,t)}relFormatter(e={}){return new _k(this.intl,this.isEnglish(),e)}listFormatter(e={}){return lk(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:_1()?ak(this.locale):gk}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let lr=null;class un extends ys{static get utcInstance(){return lr===null&&(lr=new un(0)),lr}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Uo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Zl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Zl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Zl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class bk extends ys{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(We(n)||n===null)return e;if(n instanceof ys)return n;if(vk(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?zo.instance:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||pi.create(n)}else return Ji(n)?un.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new bk(n)}let cf=()=>Date.now(),df="system",pf=null,mf=null,hf=null,_f=60,gf,bf=null;class Rt{static get now(){return cf}static set now(e){cf=e}static set defaultZone(e){df=e}static get defaultZone(){return Si(df,zo.instance)}static get defaultLocale(){return pf}static set defaultLocale(e){pf=e}static get defaultNumberingSystem(){return mf}static set defaultNumberingSystem(e){mf=e}static get defaultOutputCalendar(){return hf}static set defaultOutputCalendar(e){hf=e}static get defaultWeekSettings(){return bf}static set defaultWeekSettings(e){bf=Vr(e)}static get twoDigitCutoffYear(){return _f}static set twoDigitCutoffYear(e){_f=e%100}static get throwOnInvalid(){return gf}static set throwOnInvalid(e){gf=e}static resetCaches(){gt.resetCache(),pi.resetCache()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const f1=[0,31,59,90,120,151,181,212,243,273,304,334],u1=[0,31,60,91,121,152,182,213,244,274,305,335];function Ln(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ma(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function c1(n,e,t){return t+(vs(n)?u1:f1)[e-1]}function d1(n,e){const t=vs(n)?u1:f1,i=t.findIndex(s=>sos(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Wo(n)}}function kf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ha(ma(i,1,e),t),r=yl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=yl(f)):a>r?(f=i+1,a-=yl(i)):f=i;const{month:u,day:c}=d1(f,a);return{year:f,month:u,day:c,...Wo(n)}}function sr(n){const{year:e,month:t,day:i}=n,l=c1(e,t,i);return{year:e,ordinal:l,...Wo(n)}}function yf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=d1(e,t);return{year:e,month:i,day:l,...Wo(n)}}function vf(n,e){if(!We(n.localWeekday)||!We(n.localWeekNumber)||!We(n.localWeekYear)){if(!We(n.weekday)||!We(n.weekNumber)||!We(n.weekYear))throw new gl("Cannot mix locale-based week fields with ISO-based week fields");return We(n.localWeekday)||(n.weekday=n.localWeekday),We(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),We(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function kk(n,e=4,t=1){const i=Vo(n.weekYear),l=Nn(n.weekNumber,1,os(n.weekYear,e,t)),s=Nn(n.weekday,1,7);return i?l?s?!1:Ln("weekday",n.weekday):Ln("week",n.weekNumber):Ln("weekYear",n.weekYear)}function yk(n){const e=Vo(n.year),t=Nn(n.ordinal,1,yl(n.year));return e?t?!1:Ln("ordinal",n.ordinal):Ln("year",n.year)}function p1(n){const e=Vo(n.year),t=Nn(n.month,1,12),i=Nn(n.day,1,wo(n.year,n.month));return e?t?i?!1:Ln("day",n.day):Ln("month",n.month):Ln("year",n.year)}function m1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Nn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Nn(t,0,59),r=Nn(i,0,59),a=Nn(l,0,999);return s?o?r?a?!1:Ln("millisecond",l):Ln("second",i):Ln("minute",t):Ln("hour",e)}function We(n){return typeof n>"u"}function Ji(n){return typeof n=="number"}function Vo(n){return typeof n=="number"&&n%1===0}function vk(n){return typeof n=="string"}function wk(n){return Object.prototype.toString.call(n)==="[object Date]"}function h1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function _1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Sk(n){return Array.isArray(n)?n:[n]}function wf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function $k(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Tl(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Vr(n){if(n==null)return null;if(typeof n!="object")throw new hn("Week settings must be an object");if(!Nn(n.firstDay,1,7)||!Nn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Nn(e,1,7)))throw new hn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Nn(n,e,t){return Vo(n)&&n>=e&&n<=t}function Tk(n,e){return n-e*Math.floor(n/e)}function zt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(We(n)||n===null||n===""))return parseInt(n,10)}function Ni(n){if(!(We(n)||n===null||n===""))return parseFloat(n)}function _a(n){if(!(We(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ga(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function vs(n){return n%4===0&&(n%100!==0||n%400===0)}function yl(n){return vs(n)?366:365}function wo(n,e){const t=Tk(e-1,12)+1,i=n+(e-t)/12;return t===2?vs(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Bo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Sf(n,e,t){return-ha(ma(n,1,e),t)+e-1}function os(n,e=4,t=1){const i=Sf(n,e,t),l=Sf(n+1,e,t);return(yl(n)-i+l)/7}function Br(n){return n>99?n:n>Rt.twoDigitCutoffYear?1900+n:2e3+n}function g1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Uo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function b1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new hn(`Invalid unit value ${n}`);return e}function So(n,e){const t={};for(const i in n)if(Tl(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=b1(l)}return t}function Zl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${zt(t,2)}:${zt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${zt(t,2)}${zt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Wo(n){return $k(n,["hour","minute","second","millisecond"])}const Ck=["January","February","March","April","May","June","July","August","September","October","November","December"],k1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ok=["J","F","M","A","M","J","J","A","S","O","N","D"];function y1(n){switch(n){case"narrow":return[...Ok];case"short":return[...k1];case"long":return[...Ck];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const v1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],w1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Mk=["M","T","W","T","F","S","S"];function S1(n){switch(n){case"narrow":return[...Mk];case"short":return[...w1];case"long":return[...v1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $1=["AM","PM"],Dk=["Before Christ","Anno Domini"],Ek=["BC","AD"],Ik=["B","A"];function T1(n){switch(n){case"narrow":return[...Ik];case"short":return[...Ek];case"long":return[...Dk];default:return null}}function Ak(n){return $1[n.hour<12?0:1]}function Lk(n,e){return S1(e)[n.weekday-1]}function Nk(n,e){return y1(e)[n.month-1]}function Pk(n,e){return T1(e)[n.year<0?0:1]}function Fk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function $f(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Rk={D:yo,DD:Ug,DDD:Wg,DDDD:Yg,t:Kg,tt:Jg,ttt:Zg,tttt:Gg,T:Xg,TT:Qg,TTT:xg,TTTT:e1,f:t1,ff:i1,fff:s1,ffff:r1,F:n1,FF:l1,FFF:o1,FFFF:a1};class ln{static create(e,t={}){return new ln(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Rk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return zt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Ak(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Nk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Lk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=ln.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Pk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return $f(ln.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=ln.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return $f(s,l(r))}}const C1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function El(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Il(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Al(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function O1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Ni(t)),months:d(Ni(i)),weeks:d(Ni(l)),days:d(Ni(s)),hours:d(Ni(o)),minutes:d(Ni(r)),seconds:d(Ni(a),a==="-0"),milliseconds:d(_a(f),c)}]}const Gk={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ya(n,e,t,i,l,s,o){const r={year:e.length===2?Br(vi(e)):vi(e),month:k1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?v1.indexOf(n)+1:w1.indexOf(n)+1),r}const Xk=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Qk(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=ya(e,l,i,t,s,o,r);let m;return a?m=Gk[a]:f?m=0:m=Uo(u,c),[d,new un(m)]}function xk(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ey=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ty=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ny=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Tf(n){const[,e,t,i,l,s,o,r]=n;return[ya(e,l,i,t,s,o,r),un.utcInstance]}function iy(n){const[,e,t,i,l,s,o,r]=n;return[ya(e,r,t,i,l,s,o),un.utcInstance]}const ly=El(jk,ka),sy=El(Hk,ka),oy=El(zk,ka),ry=El(D1),I1=Il(Yk,Ll,ws,Ss),ay=Il(Vk,Ll,ws,Ss),fy=Il(Bk,Ll,ws,Ss),uy=Il(Ll,ws,Ss);function cy(n){return Al(n,[ly,I1],[sy,ay],[oy,fy],[ry,uy])}function dy(n){return Al(xk(n),[Xk,Qk])}function py(n){return Al(n,[ey,Tf],[ty,Tf],[ny,iy])}function my(n){return Al(n,[Jk,Zk])}const hy=Il(Ll);function _y(n){return Al(n,[Kk,hy])}const gy=El(Uk,Wk),by=El(E1),ky=Il(Ll,ws,Ss);function yy(n){return Al(n,[gy,I1],[by,ky])}const Cf="Invalid Duration",A1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},vy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...A1},Mn=146097/400,pl=146097/4800,wy={years:{quarters:4,months:12,weeks:Mn/7,days:Mn,hours:Mn*24,minutes:Mn*24*60,seconds:Mn*24*60*60,milliseconds:Mn*24*60*60*1e3},quarters:{months:3,weeks:Mn/28,days:Mn/4,hours:Mn*24/4,minutes:Mn*24*60/4,seconds:Mn*24*60*60/4,milliseconds:Mn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...A1},Ui=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Sy=Ui.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new ot(i)}function L1(n,e){let t=e.milliseconds??0;for(const i of Sy.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Of(n,e){const t=L1(n,e)<0?-1:1;Ui.reduceRight((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Ui.reduce((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function $y(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?wy:vy;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||gt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new hn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:So(e,ot.normalizeUnit),loc:gt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ji(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new hn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=my(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=_y(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new X0(i);return new ot({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Bg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?ln.create(this.loc,i).formatDurationFromString(this,e):Cf}toHuman(e={}){if(!this.isValid)return Cf;const t=Ui.map(i=>{const l=this.values[i];return We(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ga(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?L1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e),i={};for(const l of Ui)(Tl(t.values,l)||Tl(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=b1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...So(e,ot.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Of(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=$y(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ot.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Ui)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Ji(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Ji(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Of(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Ui)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Ty(n,e){return!n||!n.isValid?Nt.invalid("missing or invalid start"):!e||!e.isValid?Nt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Nt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(jl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Nt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Nt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Nt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Nt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Nt.fromDateTimes(t,a.time)),t=null);return Nt.merge(l)}difference(...e){return Nt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=yo,t={}){return this.isValid?ln.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Nt.fromDateTimes(e(this.s),e(this.e))}}class Ls{static hasDST(e=Rt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,Rt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||gt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||gt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||gt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||gt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||gt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||gt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||gt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return gt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return gt.create(t,null,"gregory").eras(e)}static features(){return{relative:h1(),localeWeek:_1()}}}function Mf(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Cy(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=Mf(a,f);return(u-u%7)/7}],["days",Mf]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Oy(n,e,t,i){let[l,s,o,r]=Cy(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...f).plus(u):u}const va={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Df={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},My=va.hanidec.replace(/[\[|\]]/g,"").split("");function Dy(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function jn({numberingSystem:n},e=""){return new RegExp(`${va[n||"latn"]}${e}`)}const Ey="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Dy(t))}}const Iy=" ",N1=`[ ${Iy}]`,P1=new RegExp(N1,"g");function Ay(n){return n.replace(/\./g,"\\.?").replace(P1,N1)}function Ef(n){return n.replace(/\./g,"").replace(P1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Ay).join("|")),deser:([t])=>n.findIndex(i=>Ef(t)===Ef(i))+e}}function If(n,e){return{regex:n,deser:([,t,i])=>Uo(t,i),groups:e}}function Ns(n){return{regex:n,deser:([e])=>e}}function Ly(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ny(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(Ly(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ft(f);case"yy":return ft(c,Br);case"yyyy":return ft(s);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(l);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(l);case"u":return Ns(u);case"uu":return Ns(r);case"uuu":return ft(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ft(s);case"kk":return ft(c,Br);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return If(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return If(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Ns(/[a-z_+-/]{1,256}?/i);case" ":return Ns(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:Ey};return _.token=n,_}const Py={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Fy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=Py[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Ry(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function qy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Tl(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function jy(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return We(n.z)||(t=pi.create(n.z)),We(n.Z)||(t||(t=new un(n.Z)),i=n.Z),We(n.q)||(n.M=(n.q-1)*3+1),We(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),We(n.u)||(n.S=_a(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let or=null;function Hy(){return or||(or=je.fromMillis(1555555555555)),or}function zy(n,e){if(n.literal)return n;const t=ln.macroTokenToFormatOpts(n.val),i=q1(t,e);return i==null||i.includes(void 0)?n:i}function F1(n,e){return Array.prototype.concat(...n.map(t=>zy(t,e)))}function R1(n,e,t){const i=F1(ln.parseFormat(t),n),l=i.map(o=>Ny(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=Ry(l),a=RegExp(o,"i"),[f,u]=qy(e,a,r),[c,d,m]=u?jy(u):[null,null,void 0];if(Tl(u,"a")&&Tl(u,"H"))throw new gl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:f,matches:u,result:c,zone:d,specificOffset:m}}}function Vy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=R1(n,e,t);return[i,l,s,o]}function q1(n,e){if(!n)return null;const i=ln.create(e,n).dtFormatter(Hy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Fy(o,n,s))}const rr="Invalid DateTime",Af=864e13;function Ps(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ar(n){return n.weekData===null&&(n.weekData=vo(n.c)),n.weekData}function fr(n){return n.localWeekData===null&&(n.localWeekData=vo(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Pi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function j1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Fs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ro(n,e,t){return j1(Bo(n),e,t)}function Lf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,wo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Bo(s);let[a,f]=j1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function ql(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Rs(n,e,t=!0){return n.isValid?ln.create(gt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ur(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=zt(n.c.year,t?6:4),e?(i+="-",i+=zt(n.c.month),i+="-",i+=zt(n.c.day)):(i+=zt(n.c.month),i+=zt(n.c.day)),i}function Nf(n,e,t,i,l,s){let o=zt(n.c.hour);return e?(o+=":",o+=zt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=zt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=zt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=zt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=zt(Math.trunc(-n.o/60)),o+=":",o+=zt(Math.trunc(-n.o%60))):(o+="+",o+=zt(Math.trunc(n.o/60)),o+=":",o+=zt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const H1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},By={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Uy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},z1=["year","month","day","hour","minute","second","millisecond"],Wy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Yy=["year","ordinal","hour","minute","second","millisecond"];function Ky(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Bg(n);return e}function Pf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ky(n)}}function Ff(n,e){const t=Si(e.zone,Rt.defaultZone),i=gt.fromObject(e),l=Rt.now();let s,o;if(We(n.year))s=l;else{for(const f of z1)We(n[f])&&(n[f]=H1[f]);const r=p1(n)||m1(n);if(r)return je.invalid(r);const a=t.offset(l);[s,o]=ro(n,a,t)}return new je({ts:s,zone:t,loc:i,o})}function Rf(n,e,t){const i=We(t.round)?!0:t.round,l=(o,r)=>(o=ga(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function qf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class je{constructor(e){const t=e.zone||Rt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Ps(t));this.ts=We(e.ts)?Rt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Fs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||gt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=qf(arguments),[i,l,s,o,r,a,f]=t;return Ff({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=qf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=un.utcInstance,Ff({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=wk(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,Rt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:gt.fromObject(t)}):je.invalid(Ps(l))}static fromMillis(e,t={}){if(Ji(e))return e<-Af||e>Af?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,Rt.defaultZone),loc:gt.fromObject(t)});throw new hn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new je({ts:e*1e3,zone:Si(t.zone,Rt.defaultZone),loc:gt.fromObject(t)});throw new hn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,Rt.defaultZone);if(!i.isValid)return je.invalid(Ps(i));const l=gt.fromObject(t),s=So(e,Pf),{minDaysInFirstWeek:o,startOfWeek:r}=vf(s,l),a=Rt.now(),f=We(t.specificOffset)?i.offset(a):t.specificOffset,u=!We(s.ordinal),c=!We(s.year),d=!We(s.month)||!We(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new gl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Fs(a,f);_?(g=Wy,y=By,S=vo(S,o,r)):u?(g=Yy,y=Uy,S=sr(S)):(g=z1,y=H1);let T=!1;for(const R of g){const F=s[R];We(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?kk(s,o,r):u?yk(s):p1(s),C=$||m1(s);if(C)return je.invalid(C);const M=_?kf(s,o,r):u?yf(s):s,[D,I]=ro(M,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L}static fromISO(e,t={}){const[i,l]=cy(e);return ql(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=dy(e);return ql(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=py(e);return ql(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(We(e)||We(t))throw new hn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=gt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Vy(o,e,t);return u?je.invalid(u):ql(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=yy(e);return ql(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new Z0(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=q1(e,gt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return F1(ln.parseFormat(e),gt.fromObject(t)).map(l=>l.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ar(this).weekYear:NaN}get weekNumber(){return this.isValid?ar(this).weekNumber:NaN}get weekday(){return this.isValid?ar(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fr(this).weekday:NaN}get localWeekNumber(){return this.isValid?fr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fr(this).weekYear:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ls.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ls.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ls.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ls.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Bo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Fs(a,o),c=Fs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Pi(this,{ts:a}),Pi(this,{ts:f})]:[this]}get isInLeapYear(){return vs(this.year)}get daysInMonth(){return wo(this.year,this.month)}get daysInYear(){return this.isValid?yl(this.year):NaN}get weeksInWeekYear(){return this.isValid?os(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?os(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=ln.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(Rt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,Rt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ro(o,s,e)}return Pi(this,{ts:l,zone:e})}else return je.invalid(Ps(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Pi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=So(e,Pf),{minDaysInFirstWeek:i,startOfWeek:l}=vf(t,this.loc),s=!We(t.weekYear)||!We(t.weekNumber)||!We(t.weekday),o=!We(t.ordinal),r=!We(t.year),a=!We(t.month)||!We(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new gl("Can't mix ordinal dates with month/day");let c;s?c=kf({...vo(this.c,i,l),...t},i,l):We(t.ordinal)?(c={...this.toObject(),...t},We(t.day)&&(c.day=Math.min(wo(c.year,c.month),c.day))):c=yf({...sr(this.c),...t});const[d,m]=ro(c,this.o,this.zone);return Pi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return Pi(this,Lf(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return Pi(this,Lf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=ot.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Oy(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Nt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new hn("max requires all arguments be DateTimes");return wf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=gt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return R1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return yo}static get DATE_MED(){return Ug}static get DATE_MED_WITH_WEEKDAY(){return Q0}static get DATE_FULL(){return Wg}static get DATE_HUGE(){return Yg}static get TIME_SIMPLE(){return Kg}static get TIME_WITH_SECONDS(){return Jg}static get TIME_WITH_SHORT_OFFSET(){return Zg}static get TIME_WITH_LONG_OFFSET(){return Gg}static get TIME_24_SIMPLE(){return Xg}static get TIME_24_WITH_SECONDS(){return Qg}static get TIME_24_WITH_SHORT_OFFSET(){return xg}static get TIME_24_WITH_LONG_OFFSET(){return e1}static get DATETIME_SHORT(){return t1}static get DATETIME_SHORT_WITH_SECONDS(){return n1}static get DATETIME_MED(){return i1}static get DATETIME_MED_WITH_SECONDS(){return l1}static get DATETIME_MED_WITH_WEEKDAY(){return x0}static get DATETIME_FULL(){return s1}static get DATETIME_FULL_WITH_SECONDS(){return o1}static get DATETIME_HUGE(){return r1}static get DATETIME_HUGE_WITH_SECONDS(){return a1}}function jl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new hn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Jy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Zy=[".mp4",".avi",".mov",".3gp",".wmv"],Gy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Xy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],V1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Jy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Zy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Gy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Xy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Uo=Cn([]);function wo(n,e=4e3){return Wo(n,"info",e)}function Et(n,e=3e3){return Wo(n,"success",e)}function ni(n,e=4500){return Wo(n,"error",e)}function Jy(n,e=4500){return Wo(n,"warning",e)}function Wo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{H1(i)},t)};Uo.update(l=>(va(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function H1(n){Uo.update(e=>(va(e,n),e))}function ya(){Uo.update(n=>{for(let e of n)va(n,e);return[]})}function va(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function ii(n){mi.update(e=>(j.deleteByPath(e,n),e))}const wa=Cn({});function Vr(n){wa.set(n||{})}const Fn=Cn([]),li=Cn({}),So=Cn(!1),z1=Cn({});function Zy(n){Fn.update(e=>{const t=j.findByKey(e,"id",n);return t?li.set(t):e.length&&li.set(e[0]),e})}function Gy(n){li.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Fn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Sa(),j.sortCollections(e)))}function Xy(n){Fn.update(e=>(j.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e[0]:t),Sa(),e))}async function Qy(n=null){So.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Fn.set(e);const t=n&&j.findByKey(e,"id",n);t?li.set(t):e.length&&li.set(e[0]),Sa()}catch(e){ae.error(e)}So.set(!1)}function Sa(){z1.update(n=>(Fn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const fr="pb_admin_file_token";qo.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};qo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ni(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};qo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=l0(z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(fr)||"";return(!t||ua(t,10))&&(t&&localStorage.removeItem(fr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(fr,t),this._adminFileTokenRequest=null),t};class xy extends Rg{save(e,t){super.save(e,t),t&&!t.collectionId&&Vr(t)}clear(){super.clear(),Vr(null)}}const ae=new qo("../",new xy("pb_admin_auth"));ae.authStore.model&&!ae.authStore.model.collectionId&&Vr(ae.authStore.model);const ev=n=>({}),Rf=n=>({});function tv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=vt(h,n,n[2],null),g=n[3].footer,y=vt(g,n,n[2],Rf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=O(),l=b("footer"),y&&y.c(),s=O(),o=b("a"),o.innerHTML=' Docs',r=O(),a=b("span"),a.textContent="|",f=O(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.21.1",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&St(_,h,S,S[2],m?wt(h,S[2],T,null):$t(S[2]),null),y&&y.p&&(!m||T&4)&&St(y,g,S,S[2],m?wt(g,S[2],T,ev):$t(S[2]),Rf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function nv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class kn extends _e{constructor(e){super(),he(this,e,nv,tv,me,{center:0,class:1})}}function qf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function iv(n){let e,t,i,l=!n[0]&&qf();const s=n[1].default,o=vt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=qf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,s,r,r[2],i?wt(s,r[2],a,null):$t(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function lv(n){let e,t;return e=new kn({props:{class:"full-page",center:!0,$$slots:{default:[iv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function sv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class V1 extends _e{constructor(e){super(),he(this,e,sv,lv,me,{nobranding:0})}}function Yo(n){const e=n-1;return e*e*e+1}function os(n,{delay:e=0,duration:t=400,easing:i=_s}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Pn(n,{delay:e=0,duration:t=400,easing:i=Yo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=Za(l),[m,h]=Za(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Yo=Cn([]);function $o(n,e=4e3){return Ko(n,"info",e)}function Et(n,e=3e3){return Ko(n,"success",e)}function ii(n,e=4500){return Ko(n,"error",e)}function Qy(n,e=4500){return Ko(n,"warning",e)}function Ko(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{B1(i)},t)};Yo.update(l=>(Sa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function B1(n){Yo.update(e=>(Sa(e,n),e))}function wa(){Yo.update(n=>{for(let e of n)Sa(n,e);return[]})}function Sa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const $a=Cn({});function Ur(n){$a.set(n||{})}const Fn=Cn([]),Kn=Cn({}),To=Cn(!1),U1=Cn({});let Gl;typeof BroadcastChannel<"u"&&(Gl=new BroadcastChannel("collections"),Gl.onmessage=()=>{var n;Y1((n=$g(Kn))==null?void 0:n.id)});function W1(){Gl==null||Gl.postMessage("reload")}function xy(n){Fn.update(e=>{const t=j.findByKey(e,"id",n);return t?Kn.set(t):e.length&&Kn.set(e[0]),e})}function ev(n){Kn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Fn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ta(),W1(),j.sortCollections(e)))}function tv(n){Fn.update(e=>(j.removeByKey(e,"id",n.id),Kn.update(t=>t.id===n.id?e[0]:t),Ta(),W1(),e))}async function Y1(n=null){To.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Fn.set(e);const t=n&&j.findByKey(e,"id",n);t?Kn.set(t):e.length&&Kn.set(e[0]),Ta()}catch(e){ae.error(e)}To.set(!1)}function Ta(){U1.update(n=>(Fn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const cr="pb_admin_file_token";Ho.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Ho.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Ho.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=$g(U1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||da(t,10))&&(t&&localStorage.removeItem(cr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(cr,t),this._adminFileTokenRequest=null),t};class nv extends Hg{save(e,t){super.save(e,t),t&&!t.collectionId&&Ur(t)}clear(){super.clear(),Ur(null)}}const ao=new Ho("../",new nv("pb_admin_auth"));ao.authStore.model&&!ao.authStore.model.collectionId&&Ur(ao.authStore.model);const ae=ao,iv=n=>({}),jf=n=>({});function lv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=vt(h,n,n[2],null),g=n[3].footer,y=vt(g,n,n[2],jf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=O(),l=b("footer"),y&&y.c(),s=O(),o=b("a"),o.innerHTML=' Docs',r=O(),a=b("span"),a.textContent="|",f=O(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.21.1",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&St(_,h,S,S[2],m?wt(h,S[2],T,null):$t(S[2]),null),y&&y.p&&(!m||T&4)&&St(y,g,S,S[2],m?wt(g,S[2],T,iv):$t(S[2]),jf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function sv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class kn extends _e{constructor(e){super(),he(this,e,sv,lv,me,{center:0,class:1})}}function Hf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function ov(n){let e,t,i,l=!n[0]&&Hf();const s=n[1].default,o=vt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Hf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,s,r,r[2],i?wt(s,r[2],a,null):$t(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function rv(n){let e,t;return e=new kn({props:{class:"full-page",center:!0,$$slots:{default:[ov]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function av(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class K1 extends _e{constructor(e){super(),he(this,e,av,rv,me,{nobranding:0})}}function Jo(n){const e=n-1;return e*e*e+1}function rs(n,{delay:e=0,duration:t=400,easing:i=gs}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Pn(n,{delay:e=0,duration:t=400,easing:i=Jo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=Xa(l),[m,h]=Xa(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` transform: ${f} translate(${(1-_)*c}${d}, ${(1-_)*m}${h}); - opacity: ${a-u*g}`}}function xe(n,{delay:e=0,duration:t=400,easing:i=Yo,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Ut(n,{delay:e=0,duration:t=400,easing:i=Yo,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` + opacity: ${a-u*g}`}}function xe(n,{delay:e=0,duration:t=400,easing:i=Jo,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Ut(n,{delay:e=0,duration:t=400,easing:i=Jo,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-f*d}); opacity: ${r-u*d} - `}}let Br,Fi;const Ur="app-tooltip";function jf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return Fi=Fi||document.querySelector("."+Ur),Fi||(Fi=document.createElement("div"),Fi.classList.add(Ur),document.body.appendChild(Fi)),Fi}function B1(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Wr();return}t.textContent=e.text,t.className=Ur+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Wr(){clearTimeout(Br),Oi().classList.remove("active"),Oi().activeNode=void 0}function ov(n,e){Oi().activeNode=n,clearTimeout(Br),Br=setTimeout(()=>{Oi().classList.add("active"),B1(n,e)},isNaN(e.delay)?0:e.delay)}function Le(n,e){let t=jf(e);function i(){ov(n,t)}function l(){Wr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Oi(),{update(s){var o,r;t=jf(s),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&B1(n,t)},destroy(){var s,o;(o=(s=Oi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Wr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Hf(n,e,t){const i=n.slice();return i[12]=e[t],i}const rv=n=>({}),zf=n=>({uniqueId:n[4]});function av(n){let e,t,i=de(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Ne(t,Ut,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Ne(t,Ut,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Vf(n){let e,t,i=$o(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=O(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=$o(a[12])+"")&&le(l,i)},i(a){r||(a&&Ye(()=>{r&&(o||(o=Ne(e,xe,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ne(e,xe,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function uv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=vt(a,n,n[8],zf),u=[fv,av],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=O(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&St(f,a,m,m[8],s?wt(a,m[8],h,rv):$t(m[8]),zf);let _=i;i=d(m),i===_?c[i].p(m,h):(se(),A(c[_],1,1,()=>{c[_]=null}),oe(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Bf="Invalid value";function $o(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Bf:n||Bf}function cv(n,e,t){let i;Ue(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){ii(r)}jt(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Te.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class pe extends _e{constructor(e){super(),he(this,e,cv,uv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function dv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=O(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function pv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Password"),l=O(),s=b("input"),r=O(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function mv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Password confirm"),l=O(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=K(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function hv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[dv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[pv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[mv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),H(l,e,null),k(e,s),H(o,e,null),k(e,r),H(a,e,null),k(e,f),k(e,u),c=!0,d||(m=K(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),z(l),z(o),z(a),d=!1,m()}}}function _v(n,e,t){const i=st();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class gv extends _e{constructor(e){super(),he(this,e,_v,hv,me,{})}}function Uf(n){let e,t;return e=new V1({props:{$$slots:{default:[bv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function bv(n){let e,t;return e=new gv({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function kv(n){let e,t,i=n[0]&&Uf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Uf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(se(),A(i,1,1,()=>{i=null}),oe())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function yv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Xt(),window.location.search=""}]}class vv extends _e{constructor(e){super(),he(this,e,yv,kv,me,{})}}const Mt=Cn(""),To=Cn(""),Xi=Cn(!1);function wv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Sv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function Wf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Yf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function $v(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Sv,wv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Wf(),g=(n[0].length||n[7].length)&&Yf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=O(),o.c(),r=O(),_&&_.c(),a=O(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[K(e,"click",cn(n[11])),K(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(se(),A(m[T],1,1,()=>{m[T]=null}),oe(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Wf(),_.c(),E(_,1),_.m(e,a)):_&&(se(),A(_,1,1,()=>{_=null}),oe()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Yf(y),g.c(),E(g,1),g.m(e,null)):g&&(se(),A(g,1,1,()=>{g=null}),oe())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,ve(c)}}}function Tv(n,e,t){const i=st(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await nt(()=>import("./FilterAutocompleteInput-OZtUpY4v.js"),__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}jt(()=>{_()});function g(C){Te.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class Ss extends _e{constructor(e){super(),he(this,e,Tv,$v,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Cv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[we(l=Le.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Tt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,ve(o)}}}function Ov(n,e,t){const i=st();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return jt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Ko extends _e{constructor(e){super(),he(this,e,Ov,Cv,me,{tooltip:0,class:1})}}function Mv(n){let e,t,i,l,s;const o=n[6].default,r=vt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&St(r,o,a,a[5],i?wt(o,a[5],f,null):$t(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,ve(s)}}}function Dv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class $n extends _e{constructor(e){super(),he(this,e,Dv,Mv,me,{class:1,name:2,sort:0,disable:3})}}const Ev=n=>({}),Kf=n=>({}),Iv=n=>({}),Jf=n=>({});function Av(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=vt(f,n,n[10],Jf),c=n[11].default,d=vt(c,n,n[10],null),m=n[11].after,h=vt(m,n,n[10],Kf);return{c(){e=b("div"),u&&u.c(),t=O(),i=b("div"),d&&d.c(),s=O(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&St(u,f,_,_[10],o?wt(f,_[10],g,Iv):$t(_[10]),Jf),d&&d.p&&(!o||g&1024)&&St(d,c,_,_[10],o?wt(c,_[10],g,null):$t(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&St(h,m,_,_[10],o?wt(m,_[10],g,Ev):$t(_[10]),Kf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,ve(a)}}}function Lv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}jt(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function M(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,M]}class Jo extends _e{constructor(e){super(),he(this,e,Lv,Av,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Nv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=W(i),s=W(" ("),o=W(n[0]),r=W(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&le(l,i),u&1&&le(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Pv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=j1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class U1 extends _e{constructor(e){super(),he(this,e,Pv,Nv,me,{level:0})}}function Fv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=we(Le.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&le(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Rv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class W1 extends _e{constructor(e){super(),he(this,e,Rv,Fv,me,{date:0})}}function Zf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=Zv(i[31]);return i[33]=s,i}function Gf(n,e,t){const i=n.slice();return i[36]=e[t],i}function qv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=O(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function jv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Hv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function zv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Vv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Xf(n){let e;function t(s,o){return s[7]?Uv:Bv}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Bv(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Qf(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=O(),o&&o.c(),s=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=Qf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Uv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function xf(n){let e,t=de(n[33]),i=[];for(let l=0;l',R=O(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(M,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(B,Y){w(B,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),H(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),U&&U.m(_,null),k(t,C),k(t,M),H(D,M,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[K(s,"change",q),K(l,"click",cn(e[17])),K(t,"click",Z),K(t,"keydown",G)],N=!0)},p(B,Y){e=B,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ue={};Y[0]&8&&(ue.level=e[31].level),m.$set(ue),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&le(T,S),e[33].length?U?U.p(e,Y):(U=xf(e),U.c(),U.m(_,null)):U&&(U.d(1),U=null);const ie={};Y[0]&8&&(ie.date=e[31].created),D.$set(ie)},i(B){F||(E(m.$$.fragment,B),E(D.$$.fragment,B),F=!0)},o(B){A(m.$$.fragment,B),A(D.$$.fragment,B),F=!1},d(B){B&&v(t),z(m),U&&U.d(),z(D),N=!1,ve(P)}}}function Kv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,B){return G[7]?jv:qv}let M=C(n),D=M(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Hv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new $n({props:L}),ee.push(()=>ge(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[zv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new $n({props:F}),ee.push(()=>ge(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Vv]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new $n({props:P}),ee.push(()=>ge(d,"sort",N));let q=de(n[3]);const U=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ue={};B[1]&256&&(ue.$$scope={dirty:B,ctx:G}),!u&&B[0]&2&&(u=!0,ue.sort=G[1],ke(()=>u=!1)),f.$set(ue);const ie={};B[1]&256&&(ie.$$scope={dirty:B,ctx:G}),!m&&B[0]&2&&(m=!0,ie.sort=G[1],ke(()=>m=!1)),d.$set(ie),B[0]&9369&&(q=de(G[3]),se(),S=ct(S,B,U,1,G,q,T,y,It,tu,null,Zf),oe(),!q.length&&Z?Z.p(G,B):q.length?Z&&(Z.d(1),Z=null):(Z=Xf(G),Z.c(),Z.m(y,null))),(!$||B[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let B=0;BLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function iu(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),l=b("strong"),s=W(n[5]),o=O(),a=W(r),f=O(),u=b("button"),u.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[K(u,"click",n[27]),K(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&le(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&le(a,r)},i(T){g||(T&&Ye(()=>{g&&(_||(_=Ne(e,Pn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Ne(e,Pn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,ve(S)}}}function Jv(n){let e,t,i,l,s;e=new Jo({props:{class:"table-wrapper",$$slots:{default:[Kv]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&nu(n),r=n[5]&&iu(n);return{c(){V(e.$$.fragment),t=O(),o&&o.c(),i=O(),r&&r.c(),l=ye()},m(a,f){H(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=nu(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=iu(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),z(e,a),o&&o.d(a),r&&r.d(a)}}}const lu=50,ur=/[-:\. ]/gi;function Zv(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function Gv(n,e,t){let i,l,s;const o=st();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(B=1,Y=!0){t(7,m=!0);const ue=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(B,lu,{sort:f,skipTotal:1,filter:ue}).then(async ie=>{var Ae;B<=1&&y();const be=j.toArray(ie.items);if(t(7,m=!1),t(6,c=ie.page),t(16,d=((Ae=ie.items)==null?void 0:Ae.length)||0),o("load",u.concat(be)),Y){const He=++h;for(;be.length&&h==He;){const Je=be.splice(0,10);for(let tt of Je)j.pushOrReplaceByKey(u,tt);t(3,u),await j.yieldToMain()}}else{for(let He of be)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(ie=>{ie!=null&&ie.isAbort||(t(7,m=!1),console.warn(ie),y(),ae.error(ie,!ue||(ie==null?void 0:ie.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const B of u)t(4,_[B.id]=B,_);t(4,_)}function C(B){_[B.id]?delete _[B.id]:t(4,_[B.id]=B,_),t(4,_)}function M(){const B=Object.values(_).sort((ie,be)=>ie.createdbe.created?-1:0);if(!B.length)return;if(B.length==1)return j.downloadJson(B[0],"log_"+B[0].created.replaceAll(ur,"")+".json");const Y=B[0].created.replaceAll(ur,""),ue=B[B.length-1].created.replaceAll(ur,"");return j.downloadJson(B,`${B.length}_logs_${ue}_to_${Y}.json`)}function D(B){Te.call(this,n,B)}const I=()=>S();function L(B){f=B,t(1,f)}function R(B){f=B,t(1,f)}function F(B){f=B,t(1,f)}const N=B=>C(B),P=B=>o("select",B),q=(B,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",B))},U=()=>t(0,r=""),Z=()=>g(c+1),G=()=>T();return n.$$set=B=>{"filter"in B&&t(0,r=B.filter),"presets"in B&&t(15,a=B.presets),"sort"in B&&t(1,f=B.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=lu),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,M,a,d,D,I,L,R,F,N,P,q,U,Z,G]}class Xv extends _e{constructor(e){super(),he(this,e,Gv,Jv,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! + `}}let Wr,Fi;const Yr="app-tooltip";function zf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return Fi=Fi||document.querySelector("."+Yr),Fi||(Fi=document.createElement("div"),Fi.classList.add(Yr),document.body.appendChild(Fi)),Fi}function J1(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Kr();return}t.textContent=e.text,t.className=Yr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Kr(){clearTimeout(Wr),Oi().classList.remove("active"),Oi().activeNode=void 0}function fv(n,e){Oi().activeNode=n,clearTimeout(Wr),Wr=setTimeout(()=>{Oi().classList.add("active"),J1(n,e)},isNaN(e.delay)?0:e.delay)}function Le(n,e){let t=zf(e);function i(){fv(n,t)}function l(){Kr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Oi(),{update(s){var o,r;t=zf(s),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&J1(n,t)},destroy(){var s,o;(o=(s=Oi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Kr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Vf(n,e,t){const i=n.slice();return i[12]=e[t],i}const uv=n=>({}),Bf=n=>({uniqueId:n[4]});function cv(n){let e,t,i=de(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Ne(t,Ut,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Ne(t,Ut,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Uf(n){let e,t,i=Co(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=O(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Co(a[12])+"")&&le(l,i)},i(a){r||(a&&Ye(()=>{r&&(o||(o=Ne(e,xe,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ne(e,xe,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function pv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=vt(a,n,n[8],Bf),u=[dv,cv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=O(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&St(f,a,m,m[8],s?wt(a,m[8],h,uv):$t(m[8]),Bf);let _=i;i=d(m),i===_?c[i].p(m,h):(se(),A(c[_],1,1,()=>{c[_]=null}),oe(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Wf="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Wf:n||Wf}function mv(n,e,t){let i;Ue(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}jt(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Te.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class pe extends _e{constructor(e){super(),he(this,e,mv,pv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function hv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=O(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function _v(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Password"),l=O(),s=b("input"),r=O(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function gv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Password confirm"),l=O(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=K(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function bv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[hv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[_v,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),H(l,e,null),k(e,s),H(o,e,null),k(e,r),H(a,e,null),k(e,f),k(e,u),c=!0,d||(m=K(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),z(l),z(o),z(a),d=!1,m()}}}function kv(n,e,t){const i=st();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class yv extends _e{constructor(e){super(),he(this,e,kv,bv,me,{})}}function Yf(n){let e,t;return e=new K1({props:{$$slots:{default:[vv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function vv(n){let e,t;return e=new yv({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function wv(n){let e,t,i=n[0]&&Yf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Yf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(se(),A(i,1,1,()=>{i=null}),oe())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Sv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Xt(),window.location.search=""}]}class $v extends _e{constructor(e){super(),he(this,e,Sv,wv,me,{})}}const Mt=Cn(""),Oo=Cn(""),Xi=Cn(!1);function Tv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Cv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function Kf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Jf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Ov(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Cv,Tv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Kf(),g=(n[0].length||n[7].length)&&Jf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=O(),o.c(),r=O(),_&&_.c(),a=O(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[K(e,"click",cn(n[11])),K(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(se(),A(m[T],1,1,()=>{m[T]=null}),oe(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Kf(),_.c(),E(_,1),_.m(e,a)):_&&(se(),A(_,1,1,()=>{_=null}),oe()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Jf(y),g.c(),E(g,1),g.m(e,null)):g&&(se(),A(g,1,1,()=>{g=null}),oe())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,ve(c)}}}function Mv(n,e,t){const i=st(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await nt(()=>import("./FilterAutocompleteInput-YLbqIy3c.js"),__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}jt(()=>{_()});function g(C){Te.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class $s extends _e{constructor(e){super(),he(this,e,Mv,Ov,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Dv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[we(l=Le.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Tt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,ve(o)}}}function Ev(n,e,t){const i=st();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return jt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Zo extends _e{constructor(e){super(),he(this,e,Ev,Dv,me,{tooltip:0,class:1})}}function Iv(n){let e,t,i,l,s;const o=n[6].default,r=vt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&St(r,o,a,a[5],i?wt(o,a[5],f,null):$t(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,ve(s)}}}function Av(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class $n extends _e{constructor(e){super(),he(this,e,Av,Iv,me,{class:1,name:2,sort:0,disable:3})}}const Lv=n=>({}),Zf=n=>({}),Nv=n=>({}),Gf=n=>({});function Pv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=vt(f,n,n[10],Gf),c=n[11].default,d=vt(c,n,n[10],null),m=n[11].after,h=vt(m,n,n[10],Zf);return{c(){e=b("div"),u&&u.c(),t=O(),i=b("div"),d&&d.c(),s=O(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&St(u,f,_,_[10],o?wt(f,_[10],g,Nv):$t(_[10]),Gf),d&&d.p&&(!o||g&1024)&&St(d,c,_,_[10],o?wt(c,_[10],g,null):$t(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&St(h,m,_,_[10],o?wt(m,_[10],g,Lv):$t(_[10]),Zf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,ve(a)}}}function Fv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}jt(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function M(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,M]}class Go extends _e{constructor(e){super(),he(this,e,Fv,Pv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Rv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=W(i),s=W(" ("),o=W(n[0]),r=W(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&le(l,i),u&1&&le(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function qv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=V1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class Z1 extends _e{constructor(e){super(),he(this,e,qv,Rv,me,{level:0})}}function jv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=we(Le.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&le(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Hv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class G1 extends _e{constructor(e){super(),he(this,e,Hv,jv,me,{date:0})}}function Xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=Qv(i[31]);return i[33]=s,i}function Qf(n,e,t){const i=n.slice();return i[36]=e[t],i}function zv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=O(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Vv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Bv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Uv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Wv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xf(n){let e;function t(s,o){return s[7]?Kv:Yv}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Yv(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&eu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=O(),o&&o.c(),s=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=eu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Kv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function eu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function tu(n){let e,t=de(n[33]),i=[];for(let l=0;l',R=O(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(M,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(B,Y){w(B,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),H(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),U&&U.m(_,null),k(t,C),k(t,M),H(D,M,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[K(s,"change",q),K(l,"click",cn(e[17])),K(t,"click",Z),K(t,"keydown",G)],N=!0)},p(B,Y){e=B,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ue={};Y[0]&8&&(ue.level=e[31].level),m.$set(ue),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&le(T,S),e[33].length?U?U.p(e,Y):(U=tu(e),U.c(),U.m(_,null)):U&&(U.d(1),U=null);const ie={};Y[0]&8&&(ie.date=e[31].created),D.$set(ie)},i(B){F||(E(m.$$.fragment,B),E(D.$$.fragment,B),F=!0)},o(B){A(m.$$.fragment,B),A(D.$$.fragment,B),F=!1},d(B){B&&v(t),z(m),U&&U.d(),z(D),N=!1,ve(P)}}}function Gv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,B){return G[7]?Vv:zv}let M=C(n),D=M(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Bv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new $n({props:L}),ee.push(()=>ge(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[Uv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new $n({props:F}),ee.push(()=>ge(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Wv]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new $n({props:P}),ee.push(()=>ge(d,"sort",N));let q=de(n[3]);const U=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ue={};B[1]&256&&(ue.$$scope={dirty:B,ctx:G}),!u&&B[0]&2&&(u=!0,ue.sort=G[1],ke(()=>u=!1)),f.$set(ue);const ie={};B[1]&256&&(ie.$$scope={dirty:B,ctx:G}),!m&&B[0]&2&&(m=!0,ie.sort=G[1],ke(()=>m=!1)),d.$set(ie),B[0]&9369&&(q=de(G[3]),se(),S=ct(S,B,U,1,G,q,T,y,It,iu,null,Xf),oe(),!q.length&&Z?Z.p(G,B):q.length?Z&&(Z.d(1),Z=null):(Z=xf(G),Z.c(),Z.m(y,null))),(!$||B[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let B=0;BLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function su(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),l=b("strong"),s=W(n[5]),o=O(),a=W(r),f=O(),u=b("button"),u.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[K(u,"click",n[27]),K(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&le(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&le(a,r)},i(T){g||(T&&Ye(()=>{g&&(_||(_=Ne(e,Pn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Ne(e,Pn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,ve(S)}}}function Xv(n){let e,t,i,l,s;e=new Go({props:{class:"table-wrapper",$$slots:{default:[Gv]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&lu(n),r=n[5]&&su(n);return{c(){V(e.$$.fragment),t=O(),o&&o.c(),i=O(),r&&r.c(),l=ye()},m(a,f){H(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=lu(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=su(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),z(e,a),o&&o.d(a),r&&r.d(a)}}}const ou=50,dr=/[-:\. ]/gi;function Qv(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function xv(n,e,t){let i,l,s;const o=st();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(B=1,Y=!0){t(7,m=!0);const ue=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(B,ou,{sort:f,skipTotal:1,filter:ue}).then(async ie=>{var Ae;B<=1&&y();const be=j.toArray(ie.items);if(t(7,m=!1),t(6,c=ie.page),t(16,d=((Ae=ie.items)==null?void 0:Ae.length)||0),o("load",u.concat(be)),Y){const He=++h;for(;be.length&&h==He;){const Je=be.splice(0,10);for(let tt of Je)j.pushOrReplaceByKey(u,tt);t(3,u),await j.yieldToMain()}}else{for(let He of be)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(ie=>{ie!=null&&ie.isAbort||(t(7,m=!1),console.warn(ie),y(),ae.error(ie,!ue||(ie==null?void 0:ie.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const B of u)t(4,_[B.id]=B,_);t(4,_)}function C(B){_[B.id]?delete _[B.id]:t(4,_[B.id]=B,_),t(4,_)}function M(){const B=Object.values(_).sort((ie,be)=>ie.createdbe.created?-1:0);if(!B.length)return;if(B.length==1)return j.downloadJson(B[0],"log_"+B[0].created.replaceAll(dr,"")+".json");const Y=B[0].created.replaceAll(dr,""),ue=B[B.length-1].created.replaceAll(dr,"");return j.downloadJson(B,`${B.length}_logs_${ue}_to_${Y}.json`)}function D(B){Te.call(this,n,B)}const I=()=>S();function L(B){f=B,t(1,f)}function R(B){f=B,t(1,f)}function F(B){f=B,t(1,f)}const N=B=>C(B),P=B=>o("select",B),q=(B,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",B))},U=()=>t(0,r=""),Z=()=>g(c+1),G=()=>T();return n.$$set=B=>{"filter"in B&&t(0,r=B.filter),"presets"in B&&t(15,a=B.presets),"sort"in B&&t(1,f=B.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=ou),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,M,a,d,D,I,L,R,F,N,P,q,U,Z,G]}class e2 extends _e{constructor(e){super(),he(this,e,xv,Xv,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function $s(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Yl(n){return $i($s(n*2.55),0,255)}function Mi(n){return $i($s(n*255),0,255)}function ui(n){return $i($s(n/2.55)/100,0,1)}function su(n){return $i($s(n*100),0,100)}const Dn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Yr=[..."0123456789ABCDEF"],Qv=n=>Yr[n&15],xv=n=>Yr[(n&240)>>4]+Yr[n&15],Rs=n=>(n&240)>>4===(n&15),e2=n=>Rs(n.r)&&Rs(n.g)&&Rs(n.b)&&Rs(n.a);function t2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Dn[n[1]]*17,g:255&Dn[n[2]]*17,b:255&Dn[n[3]]*17,a:e===5?Dn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Dn[n[1]]<<4|Dn[n[2]],g:Dn[n[3]]<<4|Dn[n[4]],b:Dn[n[5]]<<4|Dn[n[6]],a:e===9?Dn[n[7]]<<4|Dn[n[8]]:255})),t}const n2=(n,e)=>n<255?e(n):"";function i2(n){var e=e2(n)?Qv:xv;return n?"#"+e(n.r)+e(n.g)+e(n.b)+n2(n.a,e):void 0}const l2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Y1(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function s2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function o2(n,e,t){const i=Y1(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function r2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?u/(2-s-o):u/(s+o),a=r2(t,i,l,u,s),a=a*60+.5),[a|0,f||0,r]}function Ta(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Mi)}function Ca(n,e,t){return Ta(Y1,n,e,t)}function a2(n,e,t){return Ta(o2,n,e,t)}function f2(n,e,t){return Ta(s2,n,e,t)}function K1(n){return(n%360+360)%360}function u2(n){const e=l2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Yl(+e[5]):Mi(+e[5]));const l=K1(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=a2(l,s,o):e[1]==="hsv"?i=f2(l,s,o):i=Ca(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function c2(n,e){var t=$a(n);t[0]=K1(t[0]+e),t=Ca(t),n.r=t[0],n.g=t[1],n.b=t[2]}function d2(n){if(!n)return;const e=$a(n),t=e[0],i=su(e[1]),l=su(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const ou={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ru={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function p2(){const n={},e=Object.keys(ru),t=Object.keys(ou);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let qs;function m2(n){qs||(qs=p2(),qs.transparent=[0,0,0,0]);const e=qs[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const h2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _2(n){const e=h2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Yl(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Yl(i):$i(i,0,255)),l=255&(e[4]?Yl(l):$i(l,0,255)),s=255&(e[6]?Yl(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function g2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ui(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const cr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function b2(n,e,t){const i=hl(ui(n.r)),l=hl(ui(n.g)),s=hl(ui(n.b));return{r:Mi(cr(i+t*(hl(ui(e.r))-i))),g:Mi(cr(l+t*(hl(ui(e.g))-l))),b:Mi(cr(s+t*(hl(ui(e.b))-s))),a:n.a+t*(e.a-n.a)}}function js(n,e,t){if(n){let i=$a(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ca(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function J1(n,e){return n&&Object.assign(e||{},n)}function au(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Mi(n[3]))):(e=J1(n,{r:0,g:0,b:0,a:1}),e.a=Mi(e.a)),e}function k2(n){return n.charAt(0)==="r"?_2(n):u2(n)}class rs{constructor(e){if(e instanceof rs)return e;const t=typeof e;let i;t==="object"?i=au(e):t==="string"&&(i=t2(e)||m2(e)||k2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=J1(this._rgb);return e&&(e.a=ui(e.a)),e}set rgb(e){this._rgb=au(e)}rgbString(){return this._valid?g2(this._rgb):void 0}hexString(){return this._valid?i2(this._rgb):void 0}hslString(){return this._valid?d2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,f=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-f,i.r=255&f*i.r+s*l.r+.5,i.g=255&f*i.g+s*l.g+.5,i.b=255&f*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=b2(this._rgb,e._rgb,t)),this}clone(){return new rs(this.rgb)}alpha(e){return this._rgb.a=Mi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=$s(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return js(this._rgb,2,e),this}darken(e){return js(this._rgb,2,-e),this}saturate(e){return js(this._rgb,1,e),this}desaturate(e){return js(this._rgb,1,-e),this}rotate(e){return c2(this._rgb,e),this}}/*! + */function Ts(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Yl(n){return $i(Ts(n*2.55),0,255)}function Mi(n){return $i(Ts(n*255),0,255)}function ui(n){return $i(Ts(n/2.55)/100,0,1)}function ru(n){return $i(Ts(n*100),0,100)}const Dn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Jr=[..."0123456789ABCDEF"],t2=n=>Jr[n&15],n2=n=>Jr[(n&240)>>4]+Jr[n&15],qs=n=>(n&240)>>4===(n&15),i2=n=>qs(n.r)&&qs(n.g)&&qs(n.b)&&qs(n.a);function l2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Dn[n[1]]*17,g:255&Dn[n[2]]*17,b:255&Dn[n[3]]*17,a:e===5?Dn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Dn[n[1]]<<4|Dn[n[2]],g:Dn[n[3]]<<4|Dn[n[4]],b:Dn[n[5]]<<4|Dn[n[6]],a:e===9?Dn[n[7]]<<4|Dn[n[8]]:255})),t}const s2=(n,e)=>n<255?e(n):"";function o2(n){var e=i2(n)?t2:n2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+s2(n.a,e):void 0}const r2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function X1(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function a2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function f2(n,e,t){const i=X1(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function u2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?u/(2-s-o):u/(s+o),a=u2(t,i,l,u,s),a=a*60+.5),[a|0,f||0,r]}function Oa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Mi)}function Ma(n,e,t){return Oa(X1,n,e,t)}function c2(n,e,t){return Oa(f2,n,e,t)}function d2(n,e,t){return Oa(a2,n,e,t)}function Q1(n){return(n%360+360)%360}function p2(n){const e=r2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Yl(+e[5]):Mi(+e[5]));const l=Q1(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=c2(l,s,o):e[1]==="hsv"?i=d2(l,s,o):i=Ma(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function m2(n,e){var t=Ca(n);t[0]=Q1(t[0]+e),t=Ma(t),n.r=t[0],n.g=t[1],n.b=t[2]}function h2(n){if(!n)return;const e=Ca(n),t=e[0],i=ru(e[1]),l=ru(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const au={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},fu={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function _2(){const n={},e=Object.keys(fu),t=Object.keys(au);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let js;function g2(n){js||(js=_2(),js.transparent=[0,0,0,0]);const e=js[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const b2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function k2(n){const e=b2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Yl(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Yl(i):$i(i,0,255)),l=255&(e[4]?Yl(l):$i(l,0,255)),s=255&(e[6]?Yl(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function y2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ui(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function v2(n,e,t){const i=hl(ui(n.r)),l=hl(ui(n.g)),s=hl(ui(n.b));return{r:Mi(pr(i+t*(hl(ui(e.r))-i))),g:Mi(pr(l+t*(hl(ui(e.g))-l))),b:Mi(pr(s+t*(hl(ui(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Hs(n,e,t){if(n){let i=Ca(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ma(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function x1(n,e){return n&&Object.assign(e||{},n)}function uu(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Mi(n[3]))):(e=x1(n,{r:0,g:0,b:0,a:1}),e.a=Mi(e.a)),e}function w2(n){return n.charAt(0)==="r"?k2(n):p2(n)}class as{constructor(e){if(e instanceof as)return e;const t=typeof e;let i;t==="object"?i=uu(e):t==="string"&&(i=l2(e)||g2(e)||w2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=x1(this._rgb);return e&&(e.a=ui(e.a)),e}set rgb(e){this._rgb=uu(e)}rgbString(){return this._valid?y2(this._rgb):void 0}hexString(){return this._valid?o2(this._rgb):void 0}hslString(){return this._valid?h2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,f=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-f,i.r=255&f*i.r+s*l.r+.5,i.g=255&f*i.g+s*l.g+.5,i.b=255&f*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=v2(this._rgb,e._rgb,t)),this}clone(){return new as(this.rgb)}alpha(e){return this._rgb.a=Mi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Ts(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Hs(this._rgb,2,e),this}darken(e){return Hs(this._rgb,2,-e),this}saturate(e){return Hs(this._rgb,1,e),this}desaturate(e){return Hs(this._rgb,1,-e),this}rotate(e){return m2(this._rgb,e),this}}/*! * Chart.js v4.4.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License - */function ri(){}const y2=(()=>{let n=0;return()=>n++})();function qt(n){return n===null||typeof n>"u"}function Kt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function on(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Zn(n,e){return on(n)?n:e}function yt(n,e){return typeof n>"u"?e:n}const v2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Ft(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let l,s,o;if(Kt(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;ln,x:n=>n.x,y:n=>n.y};function $2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function T2(n){const e=$2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Mo(n,e){return(fu[e]||(fu[e]=T2(e)))(n)}function Oa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Do=n=>typeof n<"u",Di=n=>typeof n=="function",uu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function C2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const sn=Math.PI,Un=2*sn,O2=Un+sn,Eo=Number.POSITIVE_INFINITY,M2=sn/180,Vn=sn/2,Ri=sn/4,cu=sn*2/3,Kr=Math.log10,Cl=Math.sign;function Xl(n,e,t){return Math.abs(n-e)l-s).pop(),e}function fs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function E2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function I2(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ma(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Yi=(n,e,t,i)=>Ma(n,t,i?l=>{const s=n[l][e];return sn[l][e]Ma(n,t,i=>n[i][e]>=t);function R2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Oa(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function mu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(Q1.forEach(s=>{delete n[s]}),delete n._chartjs)}function j2(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const x1=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function eb(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,x1.call(window,()=>{i=!1,n.apply(e,t)}))}}function H2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const z2=n=>n==="start"?"left":n==="end"?"right":"center",hu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function V2(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=Bn(Math.min(Yi(r,a,f).lo,t?i:Yi(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?s=Bn(Math.max(Yi(r,o.axis,u,!0).hi+1,t?0:Yi(e,a,o.getPixelForValue(u),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function B2(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Hs=n=>n===0||n===1,_u=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Un/t)),gu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Un/t)+1,Ql={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(sn*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Hs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Hs(n)?n:_u(n,.075,.3),easeOutElastic:n=>Hs(n)?n:gu(n,.075,.3),easeInOutElastic(n){return Hs(n)?n:n<.5?.5*_u(n*2,.1125,.45):.5+.5*gu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Ql.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ql.easeInBounce(n*2)*.5:Ql.easeOutBounce(n*2-1)*.5+.5};function Da(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function bu(n){return Da(n)?n:new rs(n)}function dr(n){return Da(n)?n:new rs(n).saturate(.5).darken(.1).hexString()}const U2=["x","y","borderWidth","radius","tension"],W2=["color","borderColor","backgroundColor"];function Y2(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:W2},numbers:{type:"number",properties:U2}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function K2(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ku=new Map;function J2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=ku.get(t);return i||(i=new Intl.NumberFormat(n,e),ku.set(t,i)),i}function tb(n,e,t){return J2(e,t).format(n)}const nb={values(n){return Kt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(l="scientific"),s=Z2(n,t)}const o=Kr(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),tb(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Kr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?nb.numeric.call(this,n,e,t):""}};function Z2(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var ib={formatters:nb};function G2(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ib.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Qi=Object.create(null),Zr=Object.create(null);function xl(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>dr(l.backgroundColor),this.hoverBorderColor=(i,l)=>dr(l.borderColor),this.hoverColor=(i,l)=>dr(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return pr(this,e,t)}get(e){return xl(this,e)}describe(e,t){return pr(Zr,e,t)}override(e,t){return pr(Qi,e,t)}route(e,t,i,l){const s=xl(this,e),o=xl(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[l];return it(a)?Object.assign({},f,a):yt(a,f)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Bt=new X2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Y2,K2,G2]);function Q2(n){return!n||qt(n.size)||qt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function yu(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function qi(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function vu(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Gr(n,e,t,i){x2(n,e,t,i,null)}function x2(n,e,t,i,l){let s,o,r,a,f,u,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*M2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:l?n.ellipse(t,i,l/2,_,0,0,Un):n.arc(t,i,_,0,Un),n.closePath();break;case"triangle":u=l?l/2:_,n.moveTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=cu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=cu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":f=_*.516,a=_-f,o=Math.cos(g+Ri)*a,c=Math.cos(g+Ri)*(l?l/2-f:a),r=Math.sin(g+Ri)*a,d=Math.sin(g+Ri)*(l?l/2-f:a),n.arc(t-c,i-r,f,g-sn,g-Vn),n.arc(t+d,i-o,f,g-Vn,g),n.arc(t+c,i+r,f,g,g+Vn),n.arc(t-d,i+o,f,g+Vn,g+sn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,u=l?l/2:a,n.rect(t-u,i-a,2*u,2*a);break}g+=Ri;case"rectRot":c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=Ri;case"cross":c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=Ri,c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=l?l/2:Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*(l?l/2:_),i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function us(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,f;for(n.save(),n.font=l.string,nw(n,s),a=0;a+n||0;function lb(n,e){const t={},i=it(e),l=i?Object.keys(e):e,s=it(n)?i?o=>yt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=aw(s(o));return t}function fw(n){return lb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ro(n){return lb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ei(n){const e=fw(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ei(n,e){n=n||{},e=e||Bt.font;let t=yt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=yt(n.style,e.style);i&&!(""+i).match(ow)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:yt(n.family,e.family),lineHeight:rw(yt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:yt(n.weight,e.weight),string:""};return l.string=Q2(l),l}function zs(n,e,t,i){let l=!0,s,o,r;for(s=0,o=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function ll(n,e){return Object.assign(Object.create(n),e)}function Aa(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=ab("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Aa([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return ob(r,a,()=>bw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Tu(r).includes(a)},ownKeys(r){return Tu(r)},set(r,a,f){const u=r._storage||(r._storage=l());return r[a]=u[a]=f,delete r._keys,!0}})}function Ol(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:sb(n,i),setContext:s=>Ol(n,s,t,i),override:s=>Ol(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return ob(s,o,()=>dw(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function sb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Di(t)?t:()=>t,isIndexable:Di(i)?i:()=>i}}const cw=(n,e)=>n?n+Oa(e):e,La=(n,e)=>it(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function ob(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function dw(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Di(r)&&o.isScriptable(e)&&(r=pw(e,r,n,t)),Kt(r)&&r.length&&(r=mw(e,r,n,o.isIndexable)),La(e,r)&&(r=Ol(r,l,s&&s[e],o)),r}function pw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),La(n,a)&&(a=Na(l._scopes,l,n,a)),a}function mw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(it(e[0])){const a=e,f=l._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=Na(f,l,n,u);e.push(Ol(c,s,o&&o[n],r))}}return e}function rb(n,e,t){return Di(n)?n(e,t):n}const hw=(n,e)=>n===!0?e:typeof n=="string"?Mo(e,n):void 0;function _w(n,e,t,i,l){for(const s of e){const o=hw(t,s);if(o){n.add(o);const r=rb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Na(n,e,t,i){const l=e._rootScopes,s=rb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=$u(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=$u(r,o,s,a,i),a===null)?!1:Aa(Array.from(r),[""],l,s,()=>gw(e,t,i))}function $u(n,e,t,i,l){for(;t;)t=_w(n,e,t,i,l);return t}function gw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Kt(l)&&it(t)?t:l||{}}function bw(n,e,t,i){let l;for(const s of e)if(l=ab(cw(s,n),t),typeof l<"u")return La(n,l)?Na(t,i,n,l):l}function ab(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Tu(n){let e=n._keys;return e||(e=n._keys=kw(n._scopes)),e}function kw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const yw=Number.EPSILON||1e-14,Ml=(n,e)=>en==="x"?"y":"x";function vw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Jr(s,l),a=Jr(o,s);let f=r/(r+a),u=a/(r+a);f=isNaN(f)?0:f,u=isNaN(u)?0:u;const c=i*f,d=i*u;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function ww(n,e,t){const i=n.length;let l,s,o,r,a,f=Ml(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")$w(n,l);else{let f=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function Ow(n,e){return Zo(n).getPropertyValue(e)}const Mw=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Mw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Dw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Ew(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Dw(l,s,n.target))r=l,a=s;else{const f=e.getBoundingClientRect();r=i.clientX-f.left,a=i.clientY-f.top,o=!0}return{x:r,y:a,box:o}}function zi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=Zo(t),s=l.boxSizing==="border-box",o=Zi(l,"padding"),r=Zi(l,"border","width"),{x:a,y:f,box:u}=Ew(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/h*t.height/i)}}function Iw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=Fa(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=Zo(s),a=Zi(r,"border","width"),f=Zi(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Io(r.maxWidth,s,"clientWidth"),l=Io(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Eo,maxHeight:l||Eo}}const Bs=n=>Math.round(n*10)/10;function Aw(n,e,t,i){const l=Zo(n),s=Zi(l,"margin"),o=Io(l.maxWidth,n,"clientWidth")||Eo,r=Io(l.maxHeight,n,"clientHeight")||Eo,a=Iw(n,e,t);let{width:f,height:u}=a;if(l.boxSizing==="content-box"){const d=Zi(l,"border","width"),m=Zi(l,"padding");f-=m.width+d.width,u-=m.height+d.height}return f=Math.max(0,f-s.width),u=Math.max(0,i?f/i:u-s.height),f=Bs(Math.min(f,o,a.maxWidth)),u=Bs(Math.min(u,r,a.maxHeight)),f&&!u&&(u=Bs(f/2)),(e!==void 0||t!==void 0)&&i&&a.height&&u>a.height&&(u=a.height,f=Bs(Math.floor(u*i))),{width:f,height:u}}function Cu(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Lw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Pa()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Ou(n,e){const t=Ow(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Nw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Pw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Vi(n,l,t),r=Vi(l,s,t),a=Vi(s,e,t),f=Vi(o,r,t),u=Vi(r,a,t);return Vi(f,u,t)}const Fw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Rw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function mr(n,e,t){return n?Fw(e,t):Rw()}function qw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function jw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function ub(n){return n==="angle"?{between:G1,compare:N2,normalize:Qn}:{between:X1,compare:(e,t)=>e-t,normalize:e=>e}}function Mu({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Hw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=ub(i),a=e.length;let{start:f,end:u,loop:c}=n,d,m;if(c){for(f+=a,u+=a,d=0,m=a;da(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),M=()=>_||$(),D=()=>!_||C();for(let I=u,L=u;I<=c;++I)S=e[I%o],!S.skip&&(y=f(S[i]),y!==T&&(_=a(y,l,s),g===null&&M()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Mu({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Mu({start:g,end:c,loop:d,count:o,style:m})),h}function db(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function Vw(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%l];f.skip||f.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function Bw(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=zw(t,l,s,i);if(i===!0)return Du(n,[{start:o,end:r,loop:s}],t,e);const a=r{let n=0;return()=>n++})();function qt(n){return n===null||typeof n>"u"}function Kt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function on(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Gn(n,e){return on(n)?n:e}function yt(n,e){return typeof n>"u"?e:n}const $2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Ft(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let l,s,o;if(Kt(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;ln,x:n=>n.x,y:n=>n.y};function O2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function M2(n){const e=O2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Eo(n,e){return(cu[e]||(cu[e]=M2(e)))(n)}function Da(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Io=n=>typeof n<"u",Di=n=>typeof n=="function",du=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function D2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const sn=Math.PI,Un=2*sn,E2=Un+sn,Ao=Number.POSITIVE_INFINITY,I2=sn/180,Vn=sn/2,Ri=sn/4,pu=sn*2/3,Zr=Math.log10,Cl=Math.sign;function Ql(n,e,t){return Math.abs(n-e)l-s).pop(),e}function us(n){return!isNaN(parseFloat(n))&&isFinite(n)}function L2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function N2(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ea(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Yi=(n,e,t,i)=>Ea(n,t,i?l=>{const s=n[l][e];return sn[l][e]Ea(n,t,i=>n[i][e]>=t);function H2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Da(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function _u(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(ib.forEach(s=>{delete n[s]}),delete n._chartjs)}function V2(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const lb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function sb(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,lb.call(window,()=>{i=!1,n.apply(e,t)}))}}function B2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const U2=n=>n==="start"?"left":n==="end"?"right":"center",gu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function W2(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=Bn(Math.min(Yi(r,a,f).lo,t?i:Yi(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?s=Bn(Math.max(Yi(r,o.axis,u,!0).hi+1,t?0:Yi(e,a,o.getPixelForValue(u),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function Y2(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const zs=n=>n===0||n===1,bu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Un/t)),ku=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Un/t)+1,xl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(sn*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>zs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>zs(n)?n:bu(n,.075,.3),easeOutElastic:n=>zs(n)?n:ku(n,.075,.3),easeInOutElastic(n){return zs(n)?n:n<.5?.5*bu(n*2,.1125,.45):.5+.5*ku(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-xl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?xl.easeInBounce(n*2)*.5:xl.easeOutBounce(n*2-1)*.5+.5};function Ia(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function yu(n){return Ia(n)?n:new as(n)}function mr(n){return Ia(n)?n:new as(n).saturate(.5).darken(.1).hexString()}const K2=["x","y","borderWidth","radius","tension"],J2=["color","borderColor","backgroundColor"];function Z2(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:J2},numbers:{type:"number",properties:K2}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function G2(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const vu=new Map;function X2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=vu.get(t);return i||(i=new Intl.NumberFormat(n,e),vu.set(t,i)),i}function ob(n,e,t){return X2(e,t).format(n)}const rb={values(n){return Kt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(l="scientific"),s=Q2(n,t)}const o=Zr(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),ob(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Zr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?rb.numeric.call(this,n,e,t):""}};function Q2(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var ab={formatters:rb};function x2(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ab.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Qi=Object.create(null),Xr=Object.create(null);function es(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>mr(l.backgroundColor),this.hoverBorderColor=(i,l)=>mr(l.borderColor),this.hoverColor=(i,l)=>mr(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return hr(this,e,t)}get(e){return es(this,e)}describe(e,t){return hr(Xr,e,t)}override(e,t){return hr(Qi,e,t)}route(e,t,i,l){const s=es(this,e),o=es(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[l];return it(a)?Object.assign({},f,a):yt(a,f)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Bt=new ew({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Z2,G2,x2]);function tw(n){return!n||qt(n.size)||qt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function wu(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function qi(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Su(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Qr(n,e,t,i){nw(n,e,t,i,null)}function nw(n,e,t,i,l){let s,o,r,a,f,u,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*I2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:l?n.ellipse(t,i,l/2,_,0,0,Un):n.arc(t,i,_,0,Un),n.closePath();break;case"triangle":u=l?l/2:_,n.moveTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=pu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=pu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":f=_*.516,a=_-f,o=Math.cos(g+Ri)*a,c=Math.cos(g+Ri)*(l?l/2-f:a),r=Math.sin(g+Ri)*a,d=Math.sin(g+Ri)*(l?l/2-f:a),n.arc(t-c,i-r,f,g-sn,g-Vn),n.arc(t+d,i-o,f,g-Vn,g),n.arc(t+c,i+r,f,g,g+Vn),n.arc(t-d,i+o,f,g+Vn,g+sn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,u=l?l/2:a,n.rect(t-u,i-a,2*u,2*a);break}g+=Ri;case"rectRot":c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=Ri;case"cross":c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=Ri,c=Math.cos(g)*(l?l/2:_),o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*(l?l/2:_),n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=l?l/2:Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*(l?l/2:_),i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function cs(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,f;for(n.save(),n.font=l.string,sw(n,s),a=0;a+n||0;function fb(n,e){const t={},i=it(e),l=i?Object.keys(e):e,s=it(n)?i?o=>yt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=cw(s(o));return t}function dw(n){return fb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function fo(n){return fb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ei(n){const e=dw(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ti(n,e){n=n||{},e=e||Bt.font;let t=yt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=yt(n.style,e.style);i&&!(""+i).match(fw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:yt(n.family,e.family),lineHeight:uw(yt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:yt(n.weight,e.weight),string:""};return l.string=tw(l),l}function Vs(n,e,t,i){let l=!0,s,o,r;for(s=0,o=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function ll(n,e){return Object.assign(Object.create(n),e)}function Na(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=pb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Na([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return cb(r,a,()=>vw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Ou(r).includes(a)},ownKeys(r){return Ou(r)},set(r,a,f){const u=r._storage||(r._storage=l());return r[a]=u[a]=f,delete r._keys,!0}})}function Ol(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:ub(n,i),setContext:s=>Ol(n,s,t,i),override:s=>Ol(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return cb(s,o,()=>hw(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function ub(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Di(t)?t:()=>t,isIndexable:Di(i)?i:()=>i}}const mw=(n,e)=>n?n+Da(e):e,Pa=(n,e)=>it(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function cb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function hw(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Di(r)&&o.isScriptable(e)&&(r=_w(e,r,n,t)),Kt(r)&&r.length&&(r=gw(e,r,n,o.isIndexable)),Pa(e,r)&&(r=Ol(r,l,s&&s[e],o)),r}function _w(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Pa(n,a)&&(a=Fa(l._scopes,l,n,a)),a}function gw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(it(e[0])){const a=e,f=l._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=Fa(f,l,n,u);e.push(Ol(c,s,o&&o[n],r))}}return e}function db(n,e,t){return Di(n)?n(e,t):n}const bw=(n,e)=>n===!0?e:typeof n=="string"?Eo(e,n):void 0;function kw(n,e,t,i,l){for(const s of e){const o=bw(t,s);if(o){n.add(o);const r=db(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Fa(n,e,t,i){const l=e._rootScopes,s=db(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Cu(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Cu(r,o,s,a,i),a===null)?!1:Na(Array.from(r),[""],l,s,()=>yw(e,t,i))}function Cu(n,e,t,i,l){for(;t;)t=kw(n,e,t,i,l);return t}function yw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Kt(l)&&it(t)?t:l||{}}function vw(n,e,t,i){let l;for(const s of e)if(l=pb(mw(s,n),t),typeof l<"u")return Pa(n,l)?Fa(t,i,n,l):l}function pb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Ou(n){let e=n._keys;return e||(e=n._keys=ww(n._scopes)),e}function ww(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const Sw=Number.EPSILON||1e-14,Ml=(n,e)=>en==="x"?"y":"x";function $w(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Gr(s,l),a=Gr(o,s);let f=r/(r+a),u=a/(r+a);f=isNaN(f)?0:f,u=isNaN(u)?0:u;const c=i*f,d=i*u;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Tw(n,e,t){const i=n.length;let l,s,o,r,a,f=Ml(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")Ow(n,l);else{let f=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function Ew(n,e){return Xo(n).getPropertyValue(e)}const Iw=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Iw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Aw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Lw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Aw(l,s,n.target))r=l,a=s;else{const f=e.getBoundingClientRect();r=i.clientX-f.left,a=i.clientY-f.top,o=!0}return{x:r,y:a,box:o}}function zi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=Xo(t),s=l.boxSizing==="border-box",o=Zi(l,"padding"),r=Zi(l,"border","width"),{x:a,y:f,box:u}=Lw(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/h*t.height/i)}}function Nw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=qa(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=Xo(s),a=Zi(r,"border","width"),f=Zi(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Lo(r.maxWidth,s,"clientWidth"),l=Lo(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Ao,maxHeight:l||Ao}}const Us=n=>Math.round(n*10)/10;function Pw(n,e,t,i){const l=Xo(n),s=Zi(l,"margin"),o=Lo(l.maxWidth,n,"clientWidth")||Ao,r=Lo(l.maxHeight,n,"clientHeight")||Ao,a=Nw(n,e,t);let{width:f,height:u}=a;if(l.boxSizing==="content-box"){const d=Zi(l,"border","width"),m=Zi(l,"padding");f-=m.width+d.width,u-=m.height+d.height}return f=Math.max(0,f-s.width),u=Math.max(0,i?f/i:u-s.height),f=Us(Math.min(f,o,a.maxWidth)),u=Us(Math.min(u,r,a.maxHeight)),f&&!u&&(u=Us(f/2)),(e!==void 0||t!==void 0)&&i&&a.height&&u>a.height&&(u=a.height,f=Us(Math.floor(u*i))),{width:f,height:u}}function Mu(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Fw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ra()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Du(n,e){const t=Ew(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Rw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function qw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Vi(n,l,t),r=Vi(l,s,t),a=Vi(s,e,t),f=Vi(o,r,t),u=Vi(r,a,t);return Vi(f,u,t)}const jw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Hw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function _r(n,e,t){return n?jw(e,t):Hw()}function zw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Vw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function hb(n){return n==="angle"?{between:tb,compare:R2,normalize:xn}:{between:nb,compare:(e,t)=>e-t,normalize:e=>e}}function Eu({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Bw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=hb(i),a=e.length;let{start:f,end:u,loop:c}=n,d,m;if(c){for(f+=a,u+=a,d=0,m=a;da(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),M=()=>_||$(),D=()=>!_||C();for(let I=u,L=u;I<=c;++I)S=e[I%o],!S.skip&&(y=f(S[i]),y!==T&&(_=a(y,l,s),g===null&&M()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Eu({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Eu({start:g,end:c,loop:d,count:o,style:m})),h}function gb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function Ww(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%l];f.skip||f.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function Yw(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=Uw(t,l,s,i);if(i===!0)return Iu(n,[{start:o,end:r,loop:s}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=x1.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Yw;const Iu="transparent",Kw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=bu(n||Iu),l=i.valid&&bu(e||Iu);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Jw{constructor(e,t,i,l){const s=t[i];l=zs([e.to,l,s,e.from]);const o=zs([e.from,s,l]);this._active=!0,this._fn=e.fn||Kw[e.type||typeof o],this._easing=Ql[e.easing]||Ql.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=zs([e.to,t,l,e.from]),this._from=zs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Kt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=Gw(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&Zw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new Jw(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function Zw(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function Fu(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,f=o.axis,u=e3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function i3(n,e){return ll(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function l3(n,e,t){return ll(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Hl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const _r=n=>n==="reset"||n==="none",Ru=(n,e)=>e?n:Object.assign({},n),s3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:mb(t,!0),values:null};class es{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Nu(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Hl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=yt(i.xAxisID,hr(e,"x")),o=t.yAxisID=yt(i.yAxisID,hr(e,"y")),r=t.rAxisID=yt(i.rAxisID,hr(e,"r")),a=t.indexAxis,f=t.iAxisID=l(a,s,o,r),u=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&mu(this._data,this),e._stacked&&Hl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(it(t))this._data=xw(t);else if(i!==t){if(i){mu(i,this);const l=this._cachedMeta;Hl(l),l._parsed=[]}t&&Object.isExtensible(t)&&q2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=Nu(t.vScale,t),t.stack!==i.stack&&(l=!0,Hl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&Fu(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Kt(l[e])?d=this.parseArrayData(i,l,e,t):it(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||f&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=f.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(Ru(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const u=this.chart.config,c=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),c);a=u.createResolver(d,this.getContext(e,i,t))}const f=new pb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||_r(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){_r(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!_r(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,f]of this._syncList)this[r](a,f);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let C=0;C=S){D.skip=!0;continue}const I=this.getParsed(C),L=qt(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=f.data[C]),c&&(D.options=u||this.resolveDataElementOptions(C,M.active?"active":l)),y||this.updateElement(M,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ze(ao,"id","line"),Ze(ao,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ze(ao,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ra{constructor(e){Ze(this,"options");this.options=e||{}}static override(e){Object.assign(Ra.prototype,e)}init(){}formats(){return ji()}parse(){return ji()}format(){return ji()}add(){return ji()}diff(){return ji()}startOf(){return ji()}endOf(){return ji()}}var hb={_date:Ra};function o3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?F2:Yi;if(i){if(l._sharedOptions){const f=s[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(s,e,t-u),d=a(s,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function Ts(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o](e[t],l)&&(s.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var u3={evaluateInteractionItems:Ts,modes:{index(n,e,t,i){const l=zi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?gr(n,l,s,i,o):br(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const u=r[0].index,c=f.data[u];c&&!c.skip&&a.push({element:c,datasetIndex:f.index,index:u})}),a):[]},dataset(n,e,t,i){const l=zi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?gr(n,l,s,i,o):br(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,f=n.getDatasetMeta(a).data;r=[];for(let u=0;ut.pos===e)}function ju(n,e){return n.filter(t=>_b.indexOf(t.pos)===-1&&t.box.axis===e)}function Vl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function c3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Vl(zl(e,"left"),!0),l=Vl(zl(e,"right")),s=Vl(zl(e,"top"),!0),o=Vl(zl(e,"bottom")),r=ju(e,"x"),a=ju(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:zl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Hu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function gb(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function h3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!it(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&gb(o,s.getPadding());const r=Math.max(0,e.outerWidth-Hu(o,n,"left","right")),a=Math.max(0,e.outerHeight-Hu(o,n,"top","bottom")),f=r!==n.w,u=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:f,other:u}:{same:u,other:f}}function _3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function g3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Kl(n,e,t,i){const l=[];let s,o,r,a,f,u;for(s=0,o=n.length,f=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},l);gb(d,Ei(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=p3(a.concat(f),c);Kl(r.fullSize,m,c,h),Kl(a,m,c,h),Kl(f,m,c,h)&&Kl(a,m,c,h),_3(m),zu(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,zu(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},mt(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class bb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class b3 extends bb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const fo="$chartjs",k3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vu=n=>n===null||n==="";function y3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[fo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Vu(l)){const s=Ou(n,"width");s!==void 0&&(n.width=s)}if(Vu(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Ou(n,"height");s!==void 0&&(n.height=s)}return n}const kb=Lw?{passive:!0}:!1;function v3(n,e,t){n.addEventListener(e,t,kb)}function w3(n,e,t){n.canvas.removeEventListener(e,t,kb)}function S3(n,e){const t=k3[n.type]||n.type,{x:i,y:l}=zi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Ao(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function $3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Ao(r.addedNodes,i),o=o&&!Ao(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function T3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Ao(r.removedNodes,i),o=o&&!Ao(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const cs=new Map;let Bu=0;function yb(){const n=window.devicePixelRatio;n!==Bu&&(Bu=n,cs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function C3(n,e){cs.size||window.addEventListener("resize",yb),cs.set(n,e)}function O3(n){cs.delete(n),cs.size||window.removeEventListener("resize",yb)}function M3(n,e,t){const i=n.canvas,l=i&&Fa(i);if(!l)return;const s=eb((r,a)=>{const f=l.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||s(f,u)});return o.observe(l),C3(n,s),o}function kr(n,e,t){t&&t.disconnect(),e==="resize"&&O3(n)}function D3(n,e,t){const i=n.canvas,l=eb(s=>{n.ctx!==null&&t(S3(s,n))},n);return v3(i,e,l),l}class E3 extends bb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(y3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[fo])return!1;const i=t[fo].initial;["height","width"].forEach(s=>{const o=i[s];qt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[fo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:$3,detach:T3,resize:M3}[t]||D3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:kr,detach:kr,resize:kr}[t]||w3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Aw(e,t,i,l)}isAttached(e){const t=Fa(e);return!!(t&&t.isConnected)}}function I3(n){return!Pa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?b3:E3}class xi{constructor(){Ze(this,"x");Ze(this,"y");Ze(this,"active",!1);Ze(this,"options");Ze(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return fs(this.x)&&fs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ze(xi,"defaults",{}),Ze(xi,"defaultRoutes");function A3(n,e){const t=n.options.ticks,i=L3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?P3(e):[],o=s.length,r=s[0],a=s[o-1],f=[];if(o>l)return F3(e,f,s,o/l),f;const u=N3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Ys(e,f,u,qt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function P3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Uu=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Wu=(n,e)=>Math.min(e||n,n);function Yu(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function H3(n,e){mt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:Zn(t,Zn(i,t)),max:Zn(i,Zn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=uw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Bl(e.grid)-t.padding-Ku(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=A2(Math.min(Math.asin(Bn((u.highest.height+6)/r,-1,1)),Math.asin(Bn(a/f,-1,1))-Math.asin(Bn(d/f,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Ku(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Bl(s)+a):(e.height=this.maxHeight,e.width=Bl(s)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Wi(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,f=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?f?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let u=t.height/2,c=e.height/2;s==="start"?(u=0,c=e.height):s==="end"&&(u=t.height,c=0),this.paddingTop=u+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(M),highest:I(D),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return P2(this._alignToPixels?qi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,f=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Bl(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(Z){return qi(i,Z,_)};let S,T,$,C,M,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),M=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,M=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(it(o)){const Z=Object.keys(o)[0],G=o[Z];S=y(this.chart.scales[Z].getPixelForValue(G))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(it(o)){const Z=Object.keys(o)[0],G=o[Z];S=y(this.chart.scales[Z].getPixelForValue(G))}M=S-g,I=M-d,R=e.left,N=e.right}const q=yt(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/q));for(T=0;T0&&(tt-=He/2);break}ie={left:tt,top:Je,width:He+be.width,height:Ae+be.height,color:U.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:G,strokeColor:B,strokeWidth:Y,textAlign:ue,textBaseline:P,translation:[C,M],backdrop:ie}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Wi(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let f,u;return t==="left"?l?(u=this.right+s,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u+=a)):(u=this.right-r,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u=this.left)):t==="right"?l?(u=this.left+s,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u-=a)):(u=this.left+r,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u=this.right)):f="right",{textAlign:f,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,f,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Bt.route(s,l,a,r)})}function K3(n){return"id"in n&&"defaults"in n}class J3{constructor(){this.controllers=new Ks(es,"datasets",!0),this.elements=new Ks(xi,"elements"),this.plugins=new Ks(Object,"plugins"),this.scales=new Ks(Cs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):mt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Oa(e);Ft(i["before"+l],[],i),t[e](i),Ft(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function G3(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let s=0;s1&&Ju(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Zu(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function i4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Zu(n,"x",t[0])||Zu(n,"y",t[0])}return{}}function l4(n,e){const t=Qi[n.type]||{scales:{}},i=e.scales||{},l=Xr(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!it(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=Qr(o,r,i4(o,n),Bt.scales[r.type]),f=t4(a,l),u=t.scales||{};s[o]=Gl(Object.create(null),[{axis:a},r,u[a],u[f]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||Xr(r,e),u=(Qi[r]||{}).scales||{};Object.keys(u).forEach(c=>{const d=e4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Gl(s[m],[{axis:d},i[m],u[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Gl(r,[Bt.scales[r.type],Bt.scale])}),s}function vb(n){const e=n.options||(n.options={});e.plugins=yt(e.plugins,{}),e.scales=l4(n,e)}function wb(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function s4(n){return n=n||{},n.data=wb(n.data),vb(n),n}const Gu=new Map,Sb=new Set;function Js(n,e){let t=Gu.get(n);return t||(t=e(),Gu.set(n,t),Sb.add(t)),t}const Ul=(n,e,t)=>{const i=Mo(e,t);i!==void 0&&n.add(i)};class o4{constructor(e){this._config=s4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=wb(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),vb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Js(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Js(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Js(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Js(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(u=>{e&&(a.add(e),u.forEach(c=>Ul(a,e,c))),u.forEach(c=>Ul(a,l,c)),u.forEach(c=>Ul(a,Qi[s]||{},c)),u.forEach(c=>Ul(a,Bt,c)),u.forEach(c=>Ul(a,Zr,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Sb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,Qi[t]||{},Bt.datasets[t]||{},{type:t},Bt,Zr]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Xu(this._resolverCache,e,l);let a=o;if(a4(o,t)){s.$shared=!1,i=Di(i)?i():i;const f=this.createResolver(e,i,r);a=Ol(o,i,f)}for(const f of t)s[f]=a[f];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Xu(this._resolverCache,e,i);return it(t)?Ol(s,t,void 0,l):s}}function Xu(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Aa(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const r4=n=>it(n)&&Object.getOwnPropertyNames(n).some(e=>Di(n[e]));function a4(n,e){const{isScriptable:t,isIndexable:i}=sb(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Di(r)||r4(r))||o&&Kt(r))return!0}return!1}var f4="4.4.1";const u4=["top","bottom","left","right","chartArea"];function Qu(n,e){return n==="top"||n==="bottom"||u4.indexOf(n)===-1&&e==="x"}function xu(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function ec(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ft(t&&t.onComplete,[n],e)}function c4(n){const e=n.chart,t=e.options.animation;Ft(t&&t.onProgress,[n],e)}function $b(n){return Pa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const uo={},tc=n=>{const e=$b(n);return Object.values(uo).filter(t=>t.canvas===e).pop()};function d4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function p4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Zs(n,e,t){return n.options.clip?n[t]:e[t]}function m4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Zs(t,e,"left"),right:Zs(t,e,"right"),top:Zs(i,e,"top"),bottom:Zs(i,e,"bottom")}:e}class ci{static register(...e){Xn.add(...e),nc()}static unregister(...e){Xn.remove(...e),nc()}constructor(e,t){const i=this.config=new o4(t),l=$b(e),s=tc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||I3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=y2(),this.ctx=r,this.canvas=a,this.width=u,this.height=f,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Z3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=H2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],uo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",ec),ai.listen(this,"progress",c4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return qt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vu(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Cu(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Ft(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};mt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=Qr(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),mt(s,o=>{const r=o.options,a=r.id,f=Qr(a,r),u=yt(r.type,o.dtype);(r.position===void 0||Qu(r.position,f)!==Qu(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=Xn.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),mt(l,(o,r)=>{o||delete i[r]}),mt(i,o=>{Ws.configure(this,o,o.options),Ws.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let f=0,u=this.data.datasets.length;f{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(xu("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){mt(this.scales,e=>{Ws.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!uu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;d4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ws.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],mt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=m4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Ea(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Ia(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return us(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=u3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=ll(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Do(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};mt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},l=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},s=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){mt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},mt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Co(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=C2(e),f=p4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Ft(s.onHover,[e,r,this],this),a&&Ft(s.onClick,[e,r,this],this));const u=!Co(r,l);return(u||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ze(ci,"defaults",Bt),Ze(ci,"instances",uo),Ze(ci,"overrides",Qi),Ze(ci,"registry",Xn),Ze(ci,"version",f4),Ze(ci,"getChart",tc);function nc(){return mt(ci.instances,n=>n._plugins.invalidate())}function Tb(n,e,t=e){n.lineCap=yt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(yt(t.borderDash,e.borderDash)),n.lineDashOffset=yt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=yt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=yt(t.borderWidth,e.borderWidth),n.strokeStyle=yt(t.borderColor,e.borderColor)}function h4(n,e,t){n.lineTo(t.x,t.y)}function _4(n){return n.stepped?ew:n.tension||n.cubicInterpolationMode==="monotone"?tw:h4}function Cb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),f=Math.min(s,r),u=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(u,g),n.lineTo(u,_),n.lineTo(u,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,M=$|0;M===h?(C<_?_=C:C>g&&(g=C),u=(c*u+$)/++c):(T(),n.lineTo($,C),h=M,c=0,_=g=C),y=C}T()}function xr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?b4:g4}function k4(n){return n.stepped?Nw:n.tension||n.cubicInterpolationMode==="monotone"?Pw:Vi}function y4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Tb(n,e.options),n.stroke(l)}function v4(n,e,t,i){const{segments:l,options:s}=e,o=xr(e);for(const r of l)Tb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const w4=typeof Path2D=="function";function S4(n,e,t,i){w4&&!e.options.segment?y4(n,e,t,i):v4(n,e,t,i)}class Ti extends xi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;Cw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Bw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=db(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=k4(i);let f,u;for(f=0,u=o.length;fe!=="borderDash"&&e!=="fill"});function ic(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=qa(o,r,l);const a=l[o],f=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:f.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:f.y}))}),s}function qa(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function lc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Ob(n,e){let t=[],i=!1;return Kt(n)?(i=!0,t=n):t=T4(n,e),t.length?new Ti({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function sc(n){return n&&n.fill!==!1}function C4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!on(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function O4(n,e,t){const i=I4(n);if(it(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return on(l)&&Math.floor(l)===l?M4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function M4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function D4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:it(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function E4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:it(n)?i=n.value:i=e.getBaseValue(),i}function I4(n){const e=n.options,t=e.fill;let i=yt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function A4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=L4(e,t);r.push(Ob({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&yr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;sc(s)&&yr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!sc(i)||t.drawTime!=="beforeDatasetDraw"||yr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jl={average(n){if(!n.length)return!1;let e,t,i=0,l=0,s=0;for(e=0,t=n.length;er({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=lb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Zw;const Lu="transparent",Gw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=yu(n||Lu),l=i.valid&&yu(e||Lu);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Xw{constructor(e,t,i,l){const s=t[i];l=Vs([e.to,l,s,e.from]);const o=Vs([e.from,s,l]);this._active=!0,this._fn=e.fn||Gw[e.type||typeof o],this._easing=xl[e.easing]||xl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Vs([e.to,t,l,e.from]),this._from=Vs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Kt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=xw(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&Qw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new Xw(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function Qw(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function qu(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,f=o.axis,u=i3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function o3(n,e){return ll(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function r3(n,e,t){return ll(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Hl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const br=n=>n==="reset"||n==="none",ju=(n,e)=>e?n:Object.assign({},n),a3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:kb(t,!0),values:null};class ts{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Fu(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Hl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=yt(i.xAxisID,gr(e,"x")),o=t.yAxisID=yt(i.yAxisID,gr(e,"y")),r=t.rAxisID=yt(i.rAxisID,gr(e,"r")),a=t.indexAxis,f=t.iAxisID=l(a,s,o,r),u=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&_u(this._data,this),e._stacked&&Hl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(it(t))this._data=n3(t);else if(i!==t){if(i){_u(i,this);const l=this._cachedMeta;Hl(l),l._parsed=[]}t&&Object.isExtensible(t)&&z2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=Fu(t.vScale,t),t.stack!==i.stack&&(l=!0,Hl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&qu(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Kt(l[e])?d=this.parseArrayData(i,l,e,t):it(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||f&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=f.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(ju(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const u=this.chart.config,c=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),c);a=u.createResolver(d,this.getContext(e,i,t))}const f=new bb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||br(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){br(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!br(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,f]of this._syncList)this[r](a,f);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let C=0;C=S){D.skip=!0;continue}const I=this.getParsed(C),L=qt(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=f.data[C]),c&&(D.options=u||this.resolveDataElementOptions(C,M.active?"active":l)),y||this.updateElement(M,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ze(uo,"id","line"),Ze(uo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ze(uo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ja{constructor(e){Ze(this,"options");this.options=e||{}}static override(e){Object.assign(ja.prototype,e)}init(){}formats(){return ji()}parse(){return ji()}format(){return ji()}add(){return ji()}diff(){return ji()}startOf(){return ji()}endOf(){return ji()}}var yb={_date:ja};function f3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?j2:Yi;if(i){if(l._sharedOptions){const f=s[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(s,e,t-u),d=a(s,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function Cs(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o](e[t],l)&&(s.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var p3={evaluateInteractionItems:Cs,modes:{index(n,e,t,i){const l=zi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?kr(n,l,s,i,o):yr(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const u=r[0].index,c=f.data[u];c&&!c.skip&&a.push({element:c,datasetIndex:f.index,index:u})}),a):[]},dataset(n,e,t,i){const l=zi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?kr(n,l,s,i,o):yr(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,f=n.getDatasetMeta(a).data;r=[];for(let u=0;ut.pos===e)}function zu(n,e){return n.filter(t=>vb.indexOf(t.pos)===-1&&t.box.axis===e)}function Vl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function m3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Vl(zl(e,"left"),!0),l=Vl(zl(e,"right")),s=Vl(zl(e,"top"),!0),o=Vl(zl(e,"bottom")),r=zu(e,"x"),a=zu(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:zl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Vu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function wb(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function b3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!it(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&wb(o,s.getPadding());const r=Math.max(0,e.outerWidth-Vu(o,n,"left","right")),a=Math.max(0,e.outerHeight-Vu(o,n,"top","bottom")),f=r!==n.w,u=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:f,other:u}:{same:u,other:f}}function k3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function y3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Kl(n,e,t,i){const l=[];let s,o,r,a,f,u;for(s=0,o=n.length,f=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},l);wb(d,Ei(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=_3(a.concat(f),c);Kl(r.fullSize,m,c,h),Kl(a,m,c,h),Kl(f,m,c,h)&&Kl(a,m,c,h),k3(m),Bu(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Bu(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},mt(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Sb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class v3 extends Sb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",w3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Uu=n=>n===null||n==="";function S3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[co]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Uu(l)){const s=Du(n,"width");s!==void 0&&(n.width=s)}if(Uu(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Du(n,"height");s!==void 0&&(n.height=s)}return n}const $b=Fw?{passive:!0}:!1;function $3(n,e,t){n.addEventListener(e,t,$b)}function T3(n,e,t){n.canvas.removeEventListener(e,t,$b)}function C3(n,e){const t=w3[n.type]||n.type,{x:i,y:l}=zi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function No(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function O3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||No(r.addedNodes,i),o=o&&!No(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function M3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||No(r.removedNodes,i),o=o&&!No(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const ds=new Map;let Wu=0;function Tb(){const n=window.devicePixelRatio;n!==Wu&&(Wu=n,ds.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function D3(n,e){ds.size||window.addEventListener("resize",Tb),ds.set(n,e)}function E3(n){ds.delete(n),ds.size||window.removeEventListener("resize",Tb)}function I3(n,e,t){const i=n.canvas,l=i&&qa(i);if(!l)return;const s=sb((r,a)=>{const f=l.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||s(f,u)});return o.observe(l),D3(n,s),o}function vr(n,e,t){t&&t.disconnect(),e==="resize"&&E3(n)}function A3(n,e,t){const i=n.canvas,l=sb(s=>{n.ctx!==null&&t(C3(s,n))},n);return $3(i,e,l),l}class L3 extends Sb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(S3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(s=>{const o=i[s];qt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:O3,detach:M3,resize:I3}[t]||A3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:vr,detach:vr,resize:vr}[t]||T3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Pw(e,t,i,l)}isAttached(e){const t=qa(e);return!!(t&&t.isConnected)}}function N3(n){return!Ra()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?v3:L3}class xi{constructor(){Ze(this,"x");Ze(this,"y");Ze(this,"active",!1);Ze(this,"options");Ze(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return us(this.x)&&us(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ze(xi,"defaults",{}),Ze(xi,"defaultRoutes");function P3(n,e){const t=n.options.ticks,i=F3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?q3(e):[],o=s.length,r=s[0],a=s[o-1],f=[];if(o>l)return j3(e,f,s,o/l),f;const u=R3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Ks(e,f,u,qt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function q3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Yu=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Ku=(n,e)=>Math.min(e||n,n);function Ju(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function B3(n,e){mt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:Gn(t,Gn(i,t)),max:Gn(i,Gn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=pw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Bl(e.grid)-t.padding-Zu(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=P2(Math.min(Math.asin(Bn((u.highest.height+6)/r,-1,1)),Math.asin(Bn(a/f,-1,1))-Math.asin(Bn(d/f,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Zu(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Bl(s)+a):(e.height=this.maxHeight,e.width=Bl(s)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Wi(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,f=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?f?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let u=t.height/2,c=e.height/2;s==="start"?(u=0,c=e.height):s==="end"&&(u=t.height,c=0),this.paddingTop=u+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(M),highest:I(D),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return q2(this._alignToPixels?qi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,f=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Bl(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(Z){return qi(i,Z,_)};let S,T,$,C,M,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),M=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,M=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(it(o)){const Z=Object.keys(o)[0],G=o[Z];S=y(this.chart.scales[Z].getPixelForValue(G))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(it(o)){const Z=Object.keys(o)[0],G=o[Z];S=y(this.chart.scales[Z].getPixelForValue(G))}M=S-g,I=M-d,R=e.left,N=e.right}const q=yt(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/q));for(T=0;T0&&(tt-=He/2);break}ie={left:tt,top:Je,width:He+be.width,height:Ae+be.height,color:U.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:G,strokeColor:B,strokeWidth:Y,textAlign:ue,textBaseline:P,translation:[C,M],backdrop:ie}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Wi(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let f,u;return t==="left"?l?(u=this.right+s,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u+=a)):(u=this.right-r,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u=this.left)):t==="right"?l?(u=this.left+s,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u-=a)):(u=this.left+r,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u=this.right)):f="right",{textAlign:f,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,f,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Bt.route(s,l,a,r)})}function G3(n){return"id"in n&&"defaults"in n}class X3{constructor(){this.controllers=new Js(ts,"datasets",!0),this.elements=new Js(xi,"elements"),this.plugins=new Js(Object,"plugins"),this.scales=new Js(Os,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):mt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Da(e);Ft(i["before"+l],[],i),t[e](i),Ft(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function x3(n){const e={},t=[],i=Object.keys(Qn.plugins.items);for(let s=0;s1&&Gu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Xu(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function o4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Xu(n,"x",t[0])||Xu(n,"y",t[0])}return{}}function r4(n,e){const t=Qi[n.type]||{scales:{}},i=e.scales||{},l=xr(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!it(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ea(o,r,o4(o,n),Bt.scales[r.type]),f=l4(a,l),u=t.scales||{};s[o]=Xl(Object.create(null),[{axis:a},r,u[a],u[f]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||xr(r,e),u=(Qi[r]||{}).scales||{};Object.keys(u).forEach(c=>{const d=i4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Xl(s[m],[{axis:d},i[m],u[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Xl(r,[Bt.scales[r.type],Bt.scale])}),s}function Cb(n){const e=n.options||(n.options={});e.plugins=yt(e.plugins,{}),e.scales=r4(n,e)}function Ob(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function a4(n){return n=n||{},n.data=Ob(n.data),Cb(n),n}const Qu=new Map,Mb=new Set;function Zs(n,e){let t=Qu.get(n);return t||(t=e(),Qu.set(n,t),Mb.add(t)),t}const Ul=(n,e,t)=>{const i=Eo(e,t);i!==void 0&&n.add(i)};class f4{constructor(e){this._config=a4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ob(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Cb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Zs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Zs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Zs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Zs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(u=>{e&&(a.add(e),u.forEach(c=>Ul(a,e,c))),u.forEach(c=>Ul(a,l,c)),u.forEach(c=>Ul(a,Qi[s]||{},c)),u.forEach(c=>Ul(a,Bt,c)),u.forEach(c=>Ul(a,Xr,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Mb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,Qi[t]||{},Bt.datasets[t]||{},{type:t},Bt,Xr]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=xu(this._resolverCache,e,l);let a=o;if(c4(o,t)){s.$shared=!1,i=Di(i)?i():i;const f=this.createResolver(e,i,r);a=Ol(o,i,f)}for(const f of t)s[f]=a[f];return s}createResolver(e,t,i=[""],l){const{resolver:s}=xu(this._resolverCache,e,i);return it(t)?Ol(s,t,void 0,l):s}}function xu(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Na(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const u4=n=>it(n)&&Object.getOwnPropertyNames(n).some(e=>Di(n[e]));function c4(n,e){const{isScriptable:t,isIndexable:i}=ub(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Di(r)||u4(r))||o&&Kt(r))return!0}return!1}var d4="4.4.1";const p4=["top","bottom","left","right","chartArea"];function ec(n,e){return n==="top"||n==="bottom"||p4.indexOf(n)===-1&&e==="x"}function tc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function nc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ft(t&&t.onComplete,[n],e)}function m4(n){const e=n.chart,t=e.options.animation;Ft(t&&t.onProgress,[n],e)}function Db(n){return Ra()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const po={},ic=n=>{const e=Db(n);return Object.values(po).filter(t=>t.canvas===e).pop()};function h4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function _4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Gs(n,e,t){return n.options.clip?n[t]:e[t]}function g4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Gs(t,e,"left"),right:Gs(t,e,"right"),top:Gs(i,e,"top"),bottom:Gs(i,e,"bottom")}:e}class ci{static register(...e){Qn.add(...e),lc()}static unregister(...e){Qn.remove(...e),lc()}constructor(e,t){const i=this.config=new f4(t),l=Db(e),s=ic(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||N3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=S2(),this.ctx=r,this.canvas=a,this.width=u,this.height=f,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Q3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=B2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],po[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",nc),ai.listen(this,"progress",m4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return qt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Su(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Mu(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Ft(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};mt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=ea(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),mt(s,o=>{const r=o.options,a=r.id,f=ea(a,r),u=yt(r.type,o.dtype);(r.position===void 0||ec(r.position,f)!==ec(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=Qn.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),mt(l,(o,r)=>{o||delete i[r]}),mt(i,o=>{Ys.configure(this,o,o.options),Ys.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let f=0,u=this.data.datasets.length;f{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(tc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){mt(this.scales,e=>{Ys.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!du(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;h4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ys.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],mt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=g4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Aa(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&La(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return cs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=p3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=ll(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Io(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};mt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},l=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},s=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){mt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},mt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Mo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=D2(e),f=_4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Ft(s.onHover,[e,r,this],this),a&&Ft(s.onClick,[e,r,this],this));const u=!Mo(r,l);return(u||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ze(ci,"defaults",Bt),Ze(ci,"instances",po),Ze(ci,"overrides",Qi),Ze(ci,"registry",Qn),Ze(ci,"version",d4),Ze(ci,"getChart",ic);function lc(){return mt(ci.instances,n=>n._plugins.invalidate())}function Eb(n,e,t=e){n.lineCap=yt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(yt(t.borderDash,e.borderDash)),n.lineDashOffset=yt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=yt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=yt(t.borderWidth,e.borderWidth),n.strokeStyle=yt(t.borderColor,e.borderColor)}function b4(n,e,t){n.lineTo(t.x,t.y)}function k4(n){return n.stepped?iw:n.tension||n.cubicInterpolationMode==="monotone"?lw:b4}function Ib(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),f=Math.min(s,r),u=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(u,g),n.lineTo(u,_),n.lineTo(u,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,M=$|0;M===h?(C<_?_=C:C>g&&(g=C),u=(c*u+$)/++c):(T(),n.lineTo($,C),h=M,c=0,_=g=C),y=C}T()}function ta(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?v4:y4}function w4(n){return n.stepped?Rw:n.tension||n.cubicInterpolationMode==="monotone"?qw:Vi}function S4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Eb(n,e.options),n.stroke(l)}function $4(n,e,t,i){const{segments:l,options:s}=e,o=ta(e);for(const r of l)Eb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const T4=typeof Path2D=="function";function C4(n,e,t,i){T4&&!e.options.segment?S4(n,e,t,i):$4(n,e,t,i)}class Ti extends xi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;Dw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Yw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=gb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=w4(i);let f,u;for(f=0,u=o.length;fe!=="borderDash"&&e!=="fill"});function sc(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Ha(o,r,l);const a=l[o],f=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:f.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:f.y}))}),s}function Ha(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function oc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Ab(n,e){let t=[],i=!1;return Kt(n)?(i=!0,t=n):t=M4(n,e),t.length?new Ti({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function rc(n){return n&&n.fill!==!1}function D4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!on(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function E4(n,e,t){const i=N4(n);if(it(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return on(l)&&Math.floor(l)===l?I4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function I4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function A4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:it(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function L4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:it(n)?i=n.value:i=e.getBaseValue(),i}function N4(n){const e=n.options,t=e.fill;let i=yt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function P4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=F4(e,t);r.push(Ab({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&wr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;rc(s)&&wr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!rc(i)||t.drawTime!=="beforeDatasetDraw"||wr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jl={average(n){if(!n.length)return!1;let e,t,i=0,l=0,s=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function U4(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function fc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ei(e.bodyFont),f=ei(e.titleFont),u=ei(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ei(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=f.string,mt(n.title,T),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,mt(i,$=>{mt($.before,T),mt($.lines,T),mt($.after,T)}),S=0,t.font=u.string,mt(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function W4(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function Y4(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function K4(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),Y4(f,n,e,t)&&(f="center"),f}function uc(n,e,t){const i=t.yAlign||e.yAlign||W4(n,t);return{xAlign:t.xAlign||e.xAlign||K4(n,e,t,i),yAlign:i}}function J4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Z4(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function cc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=ro(o);let h=J4(e,r);const _=Z4(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Gs(n,e,t){const i=Ei(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function dc(n){return Gn([],fi(n))}function G4(n,e,t){return ll(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function pc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Db={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?Db[e].call(t,i):l}class ta extends xi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new pb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=G4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),o=pn(i,"afterTitle",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}getBeforeBody(e,t){return dc(pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return mt(e,s=>{const o={before:[],lines:[],after:[]},r=pc(i,s);Gn(o.before,fi(pn(r,"beforeLabel",this,s))),Gn(o.lines,pn(r,"label",this,s)),Gn(o.after,fi(pn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return dc(pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),o=pn(i,"afterFooter",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,f;for(a=0,f=t.length;ae.filter(u,c,d,i))),e.itemSort&&(r=r.sort((u,c)=>e.itemSort(u,c,i))),mt(r,u=>{const c=pc(e.callbacks,u);l.push(pn(c,"labelColor",this,u)),s.push(pn(c,"labelPointStyle",this,u)),o.push(pn(c,"labelTextColor",this,u))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Jl[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=fc(this,i),f=Object.assign({},r,a),u=uc(this.chart,i,f),c=cc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=ro(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,u)+o:l==="right"?y=d+h-Math.max(f,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const f=mr(i.rtl,this.x,this.width);for(e.x=Gs(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=ei(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Su(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Su(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ei(i.bodyFont);let d=c.lineHeight,m=0;const h=mr(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,M,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Gs(this,g,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,M=l.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Jl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=fc(this,e),a=Object.assign({},o,this._size),f=uc(t,e,a),u=cc(e,a,f,t);(l._to!==u.x||s._to!==u.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ei(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),qw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),jw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const f=this.chart.getDatasetMeta(r);if(!f)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:f.data[a],index:a}}),s=!Co(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Co(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Jl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ze(ta,"positioners",Jl);var X4={id:"tooltip",_element:ta,positioners:Jl,afterInit(n,e,t){t&&(n.tooltip=new ta({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Db},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Q4(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=s||1,h=u-1,{min:_,max:g}=e,y=!qt(o),S=!qt(r),T=!qt(f),$=(g-_)/(c+1);let C=du((g-_)/h/m)*m,M,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=du(L*C/h/m)*m),qt(a)||(M=Math.pow(10,a),C=Math.ceil(C*M)/M),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&E2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,u)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=f-1,C=(I-D)/L):(L=(I-D)/C,Xl(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(pu(C),pu(D));M=Math.pow(10,qt(a)?R:a),D=Math.round(D*M)/M,I=Math.round(I*M)/M;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),Dr)break;t.push({value:N})}return S&&d&&I!==r?t.length&&Xl(t[t.length-1].value,r,mc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function mc(n,e,{horizontal:t,minRotation:i}){const l=Wi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class x4 extends Cs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return qt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Cl(l),f=Cl(s);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=Q4(l,s);return e.bounds==="ticks"&&I2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return tb(e,this.chart.options.locale,this.options.ticks.format)}}class na extends x4{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=on(e)?e:0,this.max=on(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Wi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ze(na,"id","linear"),Ze(na,"defaults",{ticks:{callback:ib.formatters.numeric}});const Go={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},gn=Object.keys(Go);function hc(n,e){return n-e}function _c(n,e){if(qt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),on(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(fs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function gc(n,e,t,i){const l=gn.length;for(let s=gn.indexOf(n);s=gn.indexOf(t);s--){const o=gn[s];if(Go[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return gn[t?gn.indexOf(t):0]}function tS(n){for(let e=gn.indexOf(n)+1,t=gn.length;e=e?t[i]:t[l];n[s]=!0}}function nS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function kc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||gc(s.minUnit,t,i,this._getLabelCapacity(t)),r=yt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=fs(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return Ft(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Yi(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Yi(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class yc extends ds{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Xs(t,this.min),this._tableRange=Xs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&l.push(f);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Xs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Xs(this._table,i*this._tableRange+this._minPos,!0)}}Ze(yc,"id","timeseries"),Ze(yc,"defaults",ds.defaults);/*! +`):n}function K4(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function cc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ti(e.bodyFont),f=ti(e.titleFont),u=ti(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ei(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=f.string,mt(n.title,T),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,mt(i,$=>{mt($.before,T),mt($.lines,T),mt($.after,T)}),S=0,t.font=u.string,mt(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function J4(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function Z4(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function G4(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),Z4(f,n,e,t)&&(f="center"),f}function dc(n,e,t){const i=t.yAlign||e.yAlign||J4(n,t);return{xAlign:t.xAlign||e.xAlign||G4(n,e,t,i),yAlign:i}}function X4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Q4(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function pc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=fo(o);let h=X4(e,r);const _=Q4(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Xs(n,e,t){const i=Ei(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function mc(n){return Xn([],fi(n))}function x4(n,e,t){return ll(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function hc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Nb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?Nb[e].call(t,i):l}class ia extends xi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new bb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=x4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),o=pn(i,"afterTitle",this,e);let r=[];return r=Xn(r,fi(l)),r=Xn(r,fi(s)),r=Xn(r,fi(o)),r}getBeforeBody(e,t){return mc(pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return mt(e,s=>{const o={before:[],lines:[],after:[]},r=hc(i,s);Xn(o.before,fi(pn(r,"beforeLabel",this,s))),Xn(o.lines,pn(r,"label",this,s)),Xn(o.after,fi(pn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return mc(pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),o=pn(i,"afterFooter",this,e);let r=[];return r=Xn(r,fi(l)),r=Xn(r,fi(s)),r=Xn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,f;for(a=0,f=t.length;ae.filter(u,c,d,i))),e.itemSort&&(r=r.sort((u,c)=>e.itemSort(u,c,i))),mt(r,u=>{const c=hc(e.callbacks,u);l.push(pn(c,"labelColor",this,u)),s.push(pn(c,"labelPointStyle",this,u)),o.push(pn(c,"labelTextColor",this,u))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Jl[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=cc(this,i),f=Object.assign({},r,a),u=dc(this.chart,i,f),c=pc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=fo(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,u)+o:l==="right"?y=d+h-Math.max(f,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const f=_r(i.rtl,this.x,this.width);for(e.x=Xs(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=ti(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Tu(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Tu(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ti(i.bodyFont);let d=c.lineHeight,m=0;const h=_r(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,M,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xs(this,g,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,M=l.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Jl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=cc(this,e),a=Object.assign({},o,this._size),f=dc(t,e,a),u=pc(e,a,f,t);(l._to!==u.x||s._to!==u.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ei(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),zw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Vw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const f=this.chart.getDatasetMeta(r);if(!f)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:f.data[a],index:a}}),s=!Mo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Mo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Jl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ze(ia,"positioners",Jl);var eS={id:"tooltip",_element:ia,positioners:Jl,afterInit(n,e,t){t&&(n.tooltip=new ia({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Nb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function tS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=s||1,h=u-1,{min:_,max:g}=e,y=!qt(o),S=!qt(r),T=!qt(f),$=(g-_)/(c+1);let C=mu((g-_)/h/m)*m,M,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=mu(L*C/h/m)*m),qt(a)||(M=Math.pow(10,a),C=Math.ceil(C*M)/M),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&L2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,u)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=f-1,C=(I-D)/L):(L=(I-D)/C,Ql(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(hu(C),hu(D));M=Math.pow(10,qt(a)?R:a),D=Math.round(D*M)/M,I=Math.round(I*M)/M;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),Dr)break;t.push({value:N})}return S&&d&&I!==r?t.length&&Ql(t[t.length-1].value,r,_c(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function _c(n,e,{horizontal:t,minRotation:i}){const l=Wi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class nS extends Os{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return qt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Cl(l),f=Cl(s);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=tS(l,s);return e.bounds==="ticks"&&N2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return ob(e,this.chart.options.locale,this.options.ticks.format)}}class la extends nS{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=on(e)?e:0,this.max=on(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Wi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ze(la,"id","linear"),Ze(la,"defaults",{ticks:{callback:ab.formatters.numeric}});const Qo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},gn=Object.keys(Qo);function gc(n,e){return n-e}function bc(n,e){if(qt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),on(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(us(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function kc(n,e,t,i){const l=gn.length;for(let s=gn.indexOf(n);s=gn.indexOf(t);s--){const o=gn[s];if(Qo[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return gn[t?gn.indexOf(t):0]}function lS(n){for(let e=gn.indexOf(n)+1,t=gn.length;e=e?t[i]:t[l];n[s]=!0}}function sS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function vc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||kc(s.minUnit,t,i,this._getLabelCapacity(t)),r=yt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=us(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return Ft(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Yi(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Yi(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class wc extends ps{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Qs(t,this.min),this._tableRange=Qs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&l.push(f);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Qs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Qs(this._table,i*this._tableRange+this._minPos,!0)}}Ze(wc,"id","timeseries"),Ze(wc,"defaults",ps.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license - */const iS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};hb._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return iS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function vc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,Ut,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function lS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&vc();return{c(){e=b("div"),t=b("div"),i=W("Found "),l=W(n[1]),s=O(),r=W(o),a=O(),c&&c.c(),f=O(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&le(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&le(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=vc(),c.c(),E(c,1),c.m(e,f)):c&&(se(),A(c,1,1,()=>{c=null}),oe()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function sS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}jt(()=>(ci.register(Ti,co,ao,na,ds,B4,X4),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class oS extends _e{constructor(e){super(),he(this,e,sS,lS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function rS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function aS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class ja extends _e{constructor(e){super(),he(this,e,aS,rS,me,{content:2,language:3,class:0})}}const fS=n=>({}),wc=n=>({}),uS=n=>({}),Sc=n=>({});function $c(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Tc(n);const $=n[19].header,C=vt($,n,n[18],Sc);let M=n[4]&&n[2]&&Cc(n);const D=n[19].default,I=vt(D,n,n[18],null),L=n[19].footer,R=vt(L,n,n[18],wc);return{c(){e=b("div"),t=b("div"),l=O(),s=b("div"),o=b("div"),T&&T.c(),r=O(),C&&C.c(),a=O(),M&&M.c(),f=O(),u=b("div"),I&&I.c(),c=O(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),M&&M.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[K(t,"click",Be(n[20])),K(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Tc(n),T.c(),E(T,1),T.m(o,r)):T&&(se(),A(T,1,1,()=>{T=null}),oe()),C&&C.p&&(!g||N[0]&262144)&&St(C,$,n,n[18],g?wt($,n[18],N,uS):$t(n[18]),Sc),n[4]&&n[2]?M?M.p(n,N):(M=Cc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!g||N[0]&262144)&&St(I,D,n,n[18],g?wt(D,n[18],N,null):$t(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&St(R,L,n,n[18],g?wt(L,n[18],N,fS):$t(n[18]),wc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ye(()=>{g&&(i||(i=Ne(t,os,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ye(()=>{g&&(_&&_.end(1),h=Eg(s,Pn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Ne(t,os,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=fa(s,Pn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),M&&M.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,ve(S)}}}function Tc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,os,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,os,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Cc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=K(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function cS(n){let e,t,i,l,s=n[0]&&$c(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=$c(o),s.c(),E(s,1),s.m(e,null)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,ve(l)}}}let Hi,vr=[];function Eb(){return Hi=Hi||document.querySelector(".overlays"),Hi||(Hi=document.createElement("div"),Hi.classList.add("overlays"),document.body.appendChild(Hi)),Hi}let wi=150;function Oc(){return 1e3+Eb().querySelectorAll(".overlay-panel-container.active").length}function dS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=st(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Xt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Oc(),_):t(6,_.style="",_))}function R(){j.pushUnique(vr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(vr,h),vr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Oc()&&(Y.preventDefault(),M())}function P(Y){o&&q(g)}function q(Y,ue){ue&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}jt(()=>(Eb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const U=()=>a?M():!0;function Z(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function B(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,M,_,g,T,N,P,q,u,c,d,C,D,$,l,i,U,Z,G,B]}class Zt extends _e{constructor(e){super(),he(this,e,dS,cS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function pS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),l||(s=[we(i=Le.call(null,e,n[2]?"":"Copy")),K(e,"click",cn(n[3]))],l=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Tt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&v(e),l=!1,ve(s)}}}function mS(n,e,t){let{value:i=""}=e,{idleClasses:l="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:s="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return jt(()=>()=>{r&&clearTimeout(r)}),n.$$set=f=>{"value"in f&&t(4,i=f.value),"idleClasses"in f&&t(0,l=f.idleClasses),"successClasses"in f&&t(1,s=f.successClasses),"successDuration"in f&&t(5,o=f.successDuration)},[l,s,r,a,i,o]}class sl extends _e{constructor(e){super(),he(this,e,mS,pS,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Mc(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function hS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,M,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new U1({props:{level:n[1].level}}),I=new W1({props:{date:n[1].created}});let N=!n[4]&&Dc(n),P=de(n[5](n[1].data)),q=[];for(let Z=0;ZA(q[Z],1,1,()=>{q[Z]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=O(),o=b("td"),r=b("div"),V(a.$$.fragment),f=O(),u=b("div"),d=W(c),m=O(),h=b("tr"),_=b("td"),_.textContent="level",g=O(),y=b("td"),V(S.$$.fragment),T=O(),$=b("tr"),C=b("td"),C.textContent="created",M=O(),D=b("td"),V(I.$$.fragment),L=O(),N&&N.c(),R=O();for(let Z=0;Z',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Dc(n){let e,t,i,l;function s(a,f){return a[1].message?bS:gS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=O(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function gS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bS(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&le(i,t)},d(l){l&&v(e)}}}function kS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=W(t),s=W(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&le(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&le(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function yS(n){let e,t;return e=new ja({props:{content:n[17],language:"html"}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function vS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function wS(n){let e,t;return e=new ja({props:{content:JSON.stringify(n[17],null,2)}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function SS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ec(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[SS,wS,vS,yS,kS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=W("data."),s=W(l),o=O(),r=b("td"),u.c(),c=O(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&le(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(se(),A(h[S],1,1,()=>{h[S]=null}),oe(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function $S(n){let e,t,i,l;const s=[_S,hS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(se(),A(o[u],1,1,()=>{o[u]=null}),oe()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function TS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=O(),i=b("button"),l=b("i"),s=O(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[K(e,"click",n[9]),K(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,ve(a)}}}function OS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[CS],header:[TS],default:[$S]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}const Ic="log_view";function MS(n,e,t){let i;const l=st();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Ic),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Ic})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ni(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let M of c)typeof T[M]<"u"&&$.push(M);const C=Object.keys(T);for(let M of C)$.includes(M)||$.push(M);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class DS extends _e{constructor(e){super(),he(this,e,MS,OS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function ES(n,e,t){const i=n.slice();return i[1]=e[t],i}function IS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AS(n){let e,t,i,l=de(j1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Ib extends _e{constructor(e){super(),he(this,e,LS,AS,me,{class:0})}}function NS(n){let e,t,i,l,s,o,r,a,f;return t=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[FS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[RS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[qS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),H(t,e,null),k(e,i),H(l,e,null),k(e,s),H(o,e,null),r=!0,a||(f=K(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),z(t),z(l),z(o),a=!1,f()}}}function PS(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function FS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Max days retention"),l=O(),s=b("input"),r=O(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&<(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function RS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Ib({}),{c(){e=b("label"),t=W("Min log level"),l=O(),s=b("input"),o=O(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=O(),V(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),H(u,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&<(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),z(u),d=!1,m()}}}function qS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function jS(n){let e,t,i,l;const s=[PS,NS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function HS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function zS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function VS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[zS],header:[HS],default:[jS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),z(e,l)}}}function BS(n,e,t){let i,l;const s=st(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Et("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=lt(this.value),t(1,c)}function T(){c.logs.minLevel=lt(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function M(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Te.call(this,n,L)}function I(L){Te.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,M,D,I]}class US extends _e{constructor(e){super(),he(this,e,BS,VS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function WS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Ac(n){let e,t;return e=new oS({props:{filter:n[1],presets:n[5]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Lc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new Xv({props:s}),ee.push(()=>ge(e,"filter",l)),e.$on("select",n[14]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function YS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,M=n[4],D,I,L,R;f=new Ko({}),f.$on("refresh",n[10]),h=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[WS,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Ss({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Ib({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Ac(n),N=Lc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=W(n[6]),o=O(),r=b("button"),r.innerHTML='',a=O(),V(f.$$.fragment),u=O(),c=b("div"),d=O(),m=b("div"),V(h.$$.fragment),_=O(),V(g.$$.fragment),y=O(),V(S.$$.fragment),T=O(),F.c(),C=O(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),H(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),H(h,m,null),k(e,_),H(g,e,null),k(e,y),H(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[we(Le.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&le(s,P[6]);const U={};q&12582916&&(U.$$scope={dirty:q,ctx:P}),h.$set(U);const Z={};q&2&&(Z.value=P[1]),g.$set(Z),q&16&&me($,$=P[4])?(se(),A(F,1,1,Q),oe(),F=Ac(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(M,M=P[4])?(se(),A(N,1,1,Q),oe(),N=Lc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),z(f),z(h),z(g),z(S),F.d(P),N.d(P),L=!1,ve(R)}}}function KS(n){let e,t,i,l,s,o;e=new kn({props:{$$slots:{default:[YS]},$$scope:{ctx:n}}});let r={};i=new DS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new US({props:a}),n[18](s),s.$on("save",n[7]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(f,u){H(e,f,u),w(f,t,u),H(i,f,u),w(f,l,u),H(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),z(e,f),n[15](null),z(i,f),n[18](null),z(s,f)}}}const Qs="logId",Nc="adminRequests",Pc="adminLogRequests";function JS(n,e,t){var L;let i,l,s;Ue(n,Ro,R=>t(19,l=R)),Ue(n,Mt,R=>t(6,s=R)),xt(Mt,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Nc)||((L=window.localStorage)==null?void 0:L.getItem(Pc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Nc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const M=R=>{var N;let F={};F[Qs]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[Qs]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(Qs)&&r&&r.show(o.get(Qs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Pc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,M,D,I]}class ZS extends _e{constructor(e){super(),he(this,e,JS,KS,me,{})}}function GS(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,ve(i)}}}function XS(n,e,t){const i=st();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class QS extends _e{constructor(e){super(),he(this,e,XS,GS,me,{tolerance:3})}}function xS(n){let e,t,i,l,s;const o=n[5].default,r=vt(o,n,n[4],null);return l=new QS({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=O(),V(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),H(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&St(r,o,a,a[4],s?wt(o,a[4],f,null):$t(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),z(l,a)}}}const Fc="@adminSidebarWidth";function e$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Fc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Fc,a))},[s,o,a,r,l,i,f,u,c,d]}class Ab extends _e{constructor(e){super(),he(this,e,e$,xS,me,{class:0})}}const Ha=Cn({});function fn(n,e,t){Ha.set({text:n,yesCallback:e,noCallback:t})}function Lb(){Ha.set({})}function Rc(n){let e,t,i;const l=n[17].default,s=vt(l,n,n[16],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[18](e),i=!0},p(o,r){s&&s.p&&(!i||r&65536)&&St(s,l,o,o[16],i?wt(l,o[16],r,null):$t(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Ne(e,Pn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[18](null),o&&t&&t.end()}}}function t$(n){let e,t,i,l,s=n[0]&&Rc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),t=!0,i||(l=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?s?(s.p(o,r),r&1&&E(s,1)):(s=Rc(o),s.c(),E(s,1),s.m(e,null)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[19](null),i=!1,ve(l)}}}function n$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_=!1;const g=st();function y(){t(0,o=!1),_=!1,clearTimeout(h)}function S(){t(0,o=!0),clearTimeout(h),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function T(){o?y():S()}function $(U){return!c||U.classList.contains(f)||(m==null?void 0:m.contains(U))&&!c.contains(U)||c.contains(U)&&U.closest&&U.closest("."+f)}function C(U){(!o||$(U.target))&&(U.preventDefault(),U.stopPropagation(),T())}function M(U){(U.code==="Enter"||U.code==="Space")&&(!o||$(U.target))&&(U.preventDefault(),U.stopPropagation(),T())}function D(U){o&&r&&U.code==="Escape"&&(U.preventDefault(),y())}function I(U){o&&!(c!=null&&c.contains(U.target))?_=!0:_&&(_=!1)}function L(U){var Z;o&&_&&!(c!=null&&c.contains(U.target))&&!(m!=null&&m.contains(U.target))&&!((Z=U.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function R(U){I(U),L(U)}function F(U){N(),c==null||c.addEventListener("click",C),t(15,m=U||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",C),m==null||m.addEventListener("keydown",M)}function N(){clearTimeout(h),c==null||c.removeEventListener("click",C),m==null||m.removeEventListener("click",C),m==null||m.removeEventListener("keydown",M)}jt(()=>(F(),()=>N()));function P(U){ee[U?"unshift":"push"](()=>{d=U,t(3,d)})}function q(U){ee[U?"unshift":"push"](()=>{c=U,t(2,c)})}return n.$$set=U=>{"trigger"in U&&t(8,s=U.trigger),"active"in U&&t(0,o=U.active),"escClose"in U&&t(9,r=U.escClose),"autoScroll"in U&&t(10,a=U.autoScroll),"closableClass"in U&&t(11,f=U.closableClass),"class"in U&&t(1,u=U.class),"$$scope"in U&&t(16,l=U.$$scope)},n.$$.update=()=>{var U,Z;n.$$.dirty&260&&c&&F(s),n.$$.dirty&32769&&(o?((U=m==null?void 0:m.classList)==null||U.add("active"),g("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),g("hide")))},[o,u,c,d,D,I,L,R,s,r,a,f,y,S,T,m,l,i,P,q]}class On extends _e{constructor(e){super(),he(this,e,n$,t$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function qc(n,e,t){const i=n.slice();return i[27]=e[t],i}function i$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=O(),s=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=K(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function l$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){se();const c=e;A(c.$$.fragment,1,0,()=>{z(c,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function s$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function o$(n){let e,t,i,l;const s=[s$,l$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function jc(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[o$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&jc(n);return{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),r&&r.c(),s=ye()},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=jc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),z(e,a),z(i,a),r&&r.d(a)}}}function a$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=W(t),l=W(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&le(i,t)},d(s){s&&v(e)}}}function zc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[we(Le.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,ve(i)}}}function f$(n){let e,t,i,l,s,o,r=n[5]!=""&&zc(n);return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='Cancel',i=O(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[K(t,"click",n[17]),K(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=zc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,ve(o)}}}function u$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[f$],header:[a$],default:[r$]},$$scope:{ctx:n}};for(let s=0;sB.name==U);G?j.removeByValue(Z.columns,G):j.pushUnique(Z.columns,{name:U}),t(2,d=j.buildIndex(Z))}jt(async()=>{t(8,_=!0);try{t(7,h=(await nt(()=>import("./CodeEditor-AgADv186.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,_=!1)});const M=()=>T(),D=()=>y(),I=()=>$(),L=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(U){d=U,t(2,d)}const F=U=>C(U);function N(U){ee[U?"unshift":"push"](()=>{u=U,t(4,u)})}function P(U){Te.call(this,n,U)}function q(U){Te.call(this,n,U)}return n.$$set=U=>{e=Pe(Pe({},e),Wt(U)),t(14,r=Ge(e,o)),"collection"in U&&t(0,f=U.collection)},n.$$.update=()=>{var U,Z,G;n.$$.dirty[0]&1&&t(10,i=(((Z=(U=f==null?void 0:f.schema)==null?void 0:U.filter(B=>!B.toDelete))==null?void 0:Z.map(B=>B.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(B=>B.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,M,D,I,L,R,F,N,P,q]}class d$ extends _e{constructor(e){super(),he(this,e,c$,u$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Vc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Bc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Uc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Wc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Bc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=O(),i=b("span"),s=W(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[we(r=Le.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),K(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Bc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Wc).join(", "))+"")&&le(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Tt(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,ve(f)}}}function p$(n){var $,C,M;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=de(((M=n[0])==null?void 0:M.indexes)||[]),y=[];for(let D=0;Dge(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),l=W(i),s=W(")"),o=O(),r=b("div");for(let D=0;D+ New index',u=O(),V(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),rt(y,D),n[6](null),z(c,D),h=!1,_()}}}const Wc=n=>n.name;function m$(n,e,t){let i;Ue(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class h$ extends _e{constructor(e){super(),he(this,e,m$,p$,me,{collection:0})}}function Yc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Kc(n){let e,t,i,l,s,o,r;function a(){return n[4](n[6])}function f(...u){return n[5](n[6],...u)}return{c(){e=b("div"),t=b("i"),i=O(),l=b("span"),l.textContent=`${n[6].label}`,s=O(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=[K(e,"click",cn(a)),K(e,"keydown",cn(f))],o=!0)},p(u,c){n=u},d(u){u&&v(e),o=!1,ve(r)}}}function _$(n){let e,t=de(n[2]),i=[];for(let l=0;l{o(f.value)},a=(f,u)=>{(u.code==="Enter"||u.code==="Space")&&o(f.value)};return n.$$set=f=>{"class"in f&&t(0,i=f.class)},[i,l,s,o,r,a]}class k$ extends _e{constructor(e){super(),he(this,e,b$,g$,me,{class:0})}}const y$=n=>({interactive:n&64,hasErrors:n&32}),Jc=n=>({interactive:n[6],hasErrors:n[5]}),v$=n=>({interactive:n&64,hasErrors:n&32}),Zc=n=>({interactive:n[6],hasErrors:n[5]}),w$=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]});function Xc(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qc(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=W(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&le(i,l[4])},d(l){l&&v(e)}}}function S$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&Qc(n);return{c(){m&&m.c(),e=O(),t=b("div"),i=b("i"),s=O(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=K(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=Qc(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function $$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function T$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=K(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function C$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[we(Le.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,ve(i)}}}function xc(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=vt(d,n,n[19],Zc);s=new pe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[O$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[M$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=vt(h,n,n[19],Jc);let g=!n[0].toDelete&&ed(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=O(),l=b("div"),V(s.$$.fragment),o=O(),V(r.$$.fragment),a=O(),_&&_.c(),f=O(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),H(s,l,null),k(l,o),H(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&St(m,d,y,y[19],c?wt(d,y[19],S,v$):$t(y[19]),Zc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&St(_,h,y,y[19],c?wt(h,y[19],S,y$):$t(y[19]),Jc),y[0].toDelete?g&&(se(),A(g,1,1,()=>{g=null}),oe()):g?(g.p(y,S),S&1&&E(g,1)):(g=ed(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ye(()=>{c&&(u||(u=Ne(e,xe,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Ne(e,xe,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),z(s),z(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function O$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),o=W(n[4]),r=O(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[K(e,"change",n[17]),we(f=Le.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&le(o,m[4]),f&&Tt(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,ve(d)}}}function M$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Presentable",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[18]),we(Le.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function ed(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[D$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=O(),V(o.$$.fragment),p(l,"class","ri-more-line"),p(i,"tabindex","0"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(o)}}}function D$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=O(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right"),p(i,"type","button"),p(i,"class","dropdown-item txt-right")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",Be(n[10])),K(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function E$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Xc();l=new pe({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[S$]},$$scope:{ctx:n}}});const c=n[14].default,d=vt(c,n,n[19],Gc),m=d||$$();function h(S,T){if(S[0].toDelete)return C$;if(S[6])return T$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&xc(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=O(),V(l.$$.fragment),s=O(),m&&m.c(),o=O(),g&&g.c(),r=O(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),H(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=Xc(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&St(d,c,S,S[19],f?wt(c,S[19],T,w$):$t(S[19]),Gc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=xc(S),y.c(),E(y,1),y.m(e,null)):y&&(se(),A(y,1,1,()=>{y=null}),oe()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ye(()=>{f&&(a||(a=Ne(e,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Ne(e,xe,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),z(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let wr=[];function I$(n,e,t){let i,l,s,o;Ue(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=st(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function M(){_?C():$()}function D(){for(let N of wr)N.id!=f&&N.collapse()}jt(()=>(wr.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(wr,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,M,o,r,I,L,R,F,a]}class si extends _e{constructor(e){super(),he(this,e,I$,E$,me,{key:1,field:0})}}function A$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min length"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=K(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function L$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max length"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=K(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&<(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function N$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Regex pattern"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function P$(n){let e,t,i,l,s,o,r,a,f,u;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[A$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[L$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[N$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),z(i),z(o),z(f)}}}function F$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[P$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function R$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=lt(this.value),t(0,s)}function a(){s.options.max=lt(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Te.call(this,n,h)}function d(h){Te.call(this,n,h)}function m(h){Te.call(this,n,h)}return n.$$set=h=>{e=Pe(Pe({},e),Wt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class q$ extends _e{constructor(e){super(),he(this,e,R$,F$,me,{field:0,key:1})}}function j$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=K(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function H$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=K(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&<(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function z$(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[j$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[H$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function V$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="No decimals",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[3]),we(Le.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function B$(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[V$,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function U$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[B$],options:[z$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function W$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=lt(this.value),t(0,s)}function f(){s.options.max=lt(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Te.call(this,n,h)}function d(h){Te.call(this,n,h)}function m(h){Te.call(this,n,h)}return n.$$set=h=>{e=Pe(Pe({},e),Wt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class Y$ extends _e{constructor(e){super(),he(this,e,W$,U$,me,{field:0,key:1})}}function K$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function J$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Te.call(this,n,c)}function f(c){Te.call(this,n,c)}function u(c){Te.call(this,n,c)}return n.$$set=c=>{e=Pe(Pe({},e),Wt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class Z$ extends _e{constructor(e){super(),he(this,e,J$,K$,me,{field:0,key:1})}}function G$(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Pe(Pe({},e),Wt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Nl extends _e{constructor(e){super(),he(this,e,X$,G$,me,{value:0,separator:1,readonly:2,disabled:3})}}function Q$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function x$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function eT(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[Q$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[x$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function tT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[eT]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function nT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Te.call(this,n,m)}function c(m){Te.call(this,n,m)}function d(m){Te.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Nb extends _e{constructor(e){super(),he(this,e,nT,tT,me,{field:0,key:1})}}function iT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function lT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Te.call(this,n,c)}function f(c){Te.call(this,n,c)}function u(c){Te.call(this,n,c)}return n.$$set=c=>{e=Pe(Pe({},e),Wt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class sT extends _e{constructor(e){super(),he(this,e,lT,iT,me,{field:0,key:1})}}function oT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[3]),we(Le.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function rT(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[oT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function aT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[rT]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function fT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Te.call(this,n,m)}function c(m){Te.call(this,n,m)}function d(m){Te.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class uT extends _e{constructor(e){super(),he(this,e,fT,aT,me,{field:0,key:1})}}var Sr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],wl={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ps={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},En=function(n){return n===!0?1:0};function td(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var $r=function(n){return n instanceof Array?n:[n]};function an(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ut(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function xs(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Pb(n,e){if(e(n))return n;if(n.parentNode)return Pb(n.parentNode,e)}function eo(n,e){var t=ut("div","numInputWrapper"),i=ut("input","numInput "+n),l=ut("span","arrowUp"),s=ut("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function vn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Tr=function(){},Lo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},cT={D:Tr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*En(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Tr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Tr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Bi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ts={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ts.w(n,e,t)]},F:function(n,e,t){return Lo(ts.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ts.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[En(n.getHours()>11)]},M:function(n,e){return Lo(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Fb=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ps:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ts[c]&&m[d-1]!=="\\"?ts[c](r,u,t):c!=="\\"?c:""}).join("")}},ia=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ps:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||wl).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Or(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}J!==void 0&&J.type!=="blur"&&oi(J);var ce=t._input.value;c(),Qt(),t._input.value!==ce&&t._debouncedChange()}function f(J,X){return J%12+12*En(X===t.l10n.amPM[1])}function u(J){switch(J%24){case 0:case 12:return 12;default:return J%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var J=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(J=f(J,t.amPM.textContent));var ce=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.minDate,!0)===0,$e=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ie=Cr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ke=Cr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Cr(J,X,ne);if(qe>Ke&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(J){var X=vn(J),ne=parseInt(X.value)+(J.delta||0);(ne/1e3>1||J.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&bt(ne)}function _(J,X,ne,ce){if(X instanceof Array)return X.forEach(function($e){return _(J,$e,ne,ce)});if(J instanceof Array)return J.forEach(function($e){return _($e,X,ne,ce)});J.addEventListener(X,ne,ce),t._handlers.push({remove:function(){return J.removeEventListener(X,ne,ce)}})}function g(){_t("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(ce){return _(ce,"click",t[ne])})}),t.isMobile){al();return}var J=td(ze,50);if(t._debouncedChange=td(g,hT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ee(vn(ne))}),_(t._input,"keydown",Me),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Me),!t.config.inline&&!t.config.static&&_(window,"resize",J),window.ontouchstart!==void 0?_(window.document,"touchstart",tt):_(window.document,"mousedown",tt),_(window.document,"focus",tt,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",qn),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return vn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(J,X){var ne=J!==void 0?t.parseDate(J):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(J);var $e=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!$e&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ie=ut("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function M(J,X,ne,ce){var $e=at(X,!0),Ie=ut("span",J,X.getDate().toString());return Ie.dateObj=X,Ie.$i=ce,Ie.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),J.indexOf("hidden")===-1&&wn(X,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),$e?(Ie.tabIndex=-1,Ce(X)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(an(Ie,"startRange",t.selectedDates[0]&&wn(X,t.selectedDates[0],!0)===0),an(Ie,"endRange",t.selectedDates[1]&&wn(X,t.selectedDates[1],!0)===0),J==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(X)&&!Ce(X)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&J!=="prevMonthDay"&&ce%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),_t("onDayCreate",Ie),Ie}function D(J){J.focus(),t.config.mode==="range"&&Ee(J)}function I(J){for(var X=J>0?0:t.config.showMonths-1,ne=J>0?t.config.showMonths:-1,ce=X;ce!=ne;ce+=J)for(var $e=t.daysContainer.children[ce],Ie=J>0?0:$e.children.length-1,Ke=J>0?$e.children.length:-1,qe=Ie;qe!=Ke;qe+=J){var Qe=$e.children[qe];if(Qe.className.indexOf("hidden")===-1&&at(Qe.dateObj))return Qe}}function L(J,X){for(var ne=J.className.indexOf("Month")===-1?J.dateObj.getMonth():t.currentMonth,ce=X>0?t.config.showMonths:-1,$e=X>0?1:-1,Ie=ne-t.currentMonth;Ie!=ce;Ie+=$e)for(var Ke=t.daysContainer.children[Ie],qe=ne-t.currentMonth===Ie?J.$i+X:X<0?Ke.children.length-1:0,Qe=Ke.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=$e){var Ve=Ke.children[Re];if(Ve.className.indexOf("hidden")===-1&&at(Ve.dateObj)&&Math.abs(J.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth($e),R(I($e),0)}function R(J,X){var ne=s(),ce=Pt(ne||document.body),$e=J!==void 0?J:ce?ne:t.selectedDateElem!==void 0&&Pt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Pt(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);$e===void 0?t._input.focus():ce?L($e,X):D($e)}function F(J,X){for(var ne=(new Date(J,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ce=t.utils.getDaysInMonth((X-1+12)%12,J),$e=t.utils.getDaysInMonth(X,J),Ie=window.document.createDocumentFragment(),Ke=t.config.showMonths>1,qe=Ke?"prevMonthDay hidden":"prevMonthDay",Qe=Ke?"nextMonthDay hidden":"nextMonthDay",Re=ce+1-ne,Ve=0;Re<=ce;Re++,Ve++)Ie.appendChild(M("flatpickr-day "+qe,new Date(J,X-1,Re),Re,Ve));for(Re=1;Re<=$e;Re++,Ve++)Ie.appendChild(M("flatpickr-day",new Date(J,X,Re),Re,Ve));for(var kt=$e+1;kt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);kt++,Ve++)Ie.appendChild(M("flatpickr-day "+Qe,new Date(J,X+1,kt%$e),kt,Ve));var Jn=ut("div","dayContainer");return Jn.appendChild(Ie),Jn}function N(){if(t.daysContainer!==void 0){xs(t.daysContainer),t.weekNumbers&&xs(t.weekNumbers);for(var J=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var J=function(ce){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&cet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(J(X)){var ne=ut("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Lo(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var J=ut("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ut("span","cur-month"):(t.monthsDropdownContainer=ut("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Ke){var qe=vn(Ke),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),_t("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var ce=eo("cur-year",{tabindex:"-1"}),$e=ce.getElementsByTagName("input")[0];$e.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&$e.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&($e.setAttribute("max",t.config.maxDate.getFullYear().toString()),$e.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ut("div","flatpickr-current-month");return Ie.appendChild(ne),Ie.appendChild(ce),X.appendChild(Ie),J.appendChild(X),{container:J,yearElement:$e,monthElement:ne}}function U(){xs(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var J=t.config.showMonths;J--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ut("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ut("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ut("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(J){t.__hidePrevMonthArrow!==J&&(an(t.prevMonthNav,"flatpickr-disabled",J),t.__hidePrevMonthArrow=J)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(J){t.__hideNextMonthArrow!==J&&(an(t.nextMonthNav,"flatpickr-disabled",J),t.__hideNextMonthArrow=J)}}),t.currentYearElement=t.yearElements[0],Yt(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var J=Or(t.config);t.timeContainer=ut("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ut("span","flatpickr-time-separator",":"),ne=eo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var ce=eo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ce.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?J.hours:u(J.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():J.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(ce),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var $e=eo("flatpickr-second");t.secondElement=$e.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():J.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ut("span","flatpickr-time-separator",":")),t.timeContainer.appendChild($e)}return t.config.time_24hr||(t.amPM=ut("span","flatpickr-am-pm",t.l10n.amPM[En((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function B(){t.weekdayContainer?xs(t.weekdayContainer):t.weekdayContainer=ut("div","flatpickr-weekdays");for(var J=t.config.showMonths;J--;){var X=ut("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var J=t.l10n.firstDayOfWeek,X=nd(t.l10n.weekdays.shorthand);J>0&&J{i&&(t||(t=Ne(e,Ut,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,Ut,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function rS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&Sc();return{c(){e=b("div"),t=b("div"),i=W("Found "),l=W(n[1]),s=O(),r=W(o),a=O(),c&&c.c(),f=O(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&le(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&le(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=Sc(),c.c(),E(c,1),c.m(e,f)):c&&(se(),A(c,1,1,()=>{c=null}),oe()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function aS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}jt(()=>(ci.register(Ti,mo,uo,la,ps,Y4,eS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class fS extends _e{constructor(e){super(),he(this,e,aS,rS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function uS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function cS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class za extends _e{constructor(e){super(),he(this,e,cS,uS,me,{content:2,language:3,class:0})}}const dS=n=>({}),$c=n=>({}),pS=n=>({}),Tc=n=>({});function Cc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Oc(n);const $=n[19].header,C=vt($,n,n[18],Tc);let M=n[4]&&n[2]&&Mc(n);const D=n[19].default,I=vt(D,n,n[18],null),L=n[19].footer,R=vt(L,n,n[18],$c);return{c(){e=b("div"),t=b("div"),l=O(),s=b("div"),o=b("div"),T&&T.c(),r=O(),C&&C.c(),a=O(),M&&M.c(),f=O(),u=b("div"),I&&I.c(),c=O(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),M&&M.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[K(t,"click",Be(n[20])),K(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Oc(n),T.c(),E(T,1),T.m(o,r)):T&&(se(),A(T,1,1,()=>{T=null}),oe()),C&&C.p&&(!g||N[0]&262144)&&St(C,$,n,n[18],g?wt($,n[18],N,pS):$t(n[18]),Tc),n[4]&&n[2]?M?M.p(n,N):(M=Mc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!g||N[0]&262144)&&St(I,D,n,n[18],g?wt(D,n[18],N,null):$t(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&St(R,L,n,n[18],g?wt(L,n[18],N,dS):$t(n[18]),$c),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ye(()=>{g&&(i||(i=Ne(t,rs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ye(()=>{g&&(_&&_.end(1),h=Lg(s,Pn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Ne(t,rs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ca(s,Pn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),M&&M.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,ve(S)}}}function Oc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,rs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,rs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Mc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=K(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function mS(n){let e,t,i,l,s=n[0]&&Cc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Cc(o),s.c(),E(s,1),s.m(e,null)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,ve(l)}}}let Hi,Sr=[];function Pb(){return Hi=Hi||document.querySelector(".overlays"),Hi||(Hi=document.createElement("div"),Hi.classList.add("overlays"),document.body.appendChild(Hi)),Hi}let wi=150;function Dc(){return 1e3+Pb().querySelectorAll(".overlay-panel-container.active").length}function hS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=st(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Xt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Dc(),_):t(6,_.style="",_))}function R(){j.pushUnique(Sr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Sr,h),Sr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Dc()&&(Y.preventDefault(),M())}function P(Y){o&&q(g)}function q(Y,ue){ue&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}jt(()=>(Pb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const U=()=>a?M():!0;function Z(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function B(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,M,_,g,T,N,P,q,u,c,d,C,D,$,l,i,U,Z,G,B]}class Zt extends _e{constructor(e){super(),he(this,e,hS,mS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function _S(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),l||(s=[we(i=Le.call(null,e,n[2]?"":"Copy")),K(e,"click",cn(n[3]))],l=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Tt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&v(e),l=!1,ve(s)}}}function gS(n,e,t){let{value:i=""}=e,{idleClasses:l="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:s="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return jt(()=>()=>{r&&clearTimeout(r)}),n.$$set=f=>{"value"in f&&t(4,i=f.value),"idleClasses"in f&&t(0,l=f.idleClasses),"successClasses"in f&&t(1,s=f.successClasses),"successDuration"in f&&t(5,o=f.successDuration)},[l,s,r,a,i,o]}class sl extends _e{constructor(e){super(),he(this,e,gS,_S,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Ec(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function bS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,M,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new Z1({props:{level:n[1].level}}),I=new G1({props:{date:n[1].created}});let N=!n[4]&&Ic(n),P=de(n[5](n[1].data)),q=[];for(let Z=0;ZA(q[Z],1,1,()=>{q[Z]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=O(),o=b("td"),r=b("div"),V(a.$$.fragment),f=O(),u=b("div"),d=W(c),m=O(),h=b("tr"),_=b("td"),_.textContent="level",g=O(),y=b("td"),V(S.$$.fragment),T=O(),$=b("tr"),C=b("td"),C.textContent="created",M=O(),D=b("td"),V(I.$$.fragment),L=O(),N&&N.c(),R=O();for(let Z=0;Z',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ic(n){let e,t,i,l;function s(a,f){return a[1].message?vS:yS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=O(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function yS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function vS(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&le(i,t)},d(l){l&&v(e)}}}function wS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=W(t),s=W(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&le(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&le(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function SS(n){let e,t;return e=new za({props:{content:n[17],language:"html"}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function $S(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function TS(n){let e,t;return e=new za({props:{content:JSON.stringify(n[17],null,2)}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function CS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ac(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[CS,TS,$S,SS,wS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=W("data."),s=W(l),o=O(),r=b("td"),u.c(),c=O(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&le(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(se(),A(h[S],1,1,()=>{h[S]=null}),oe(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function OS(n){let e,t,i,l;const s=[kS,bS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(se(),A(o[u],1,1,()=>{o[u]=null}),oe()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function MS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function DS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=O(),i=b("button"),l=b("i"),s=O(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[K(e,"click",n[9]),K(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,ve(a)}}}function ES(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[DS],header:[MS],default:[OS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}const Lc="log_view";function IS(n,e,t){let i;const l=st();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Lc),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Lc})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let M of c)typeof T[M]<"u"&&$.push(M);const C=Object.keys(T);for(let M of C)$.includes(M)||$.push(M);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class AS extends _e{constructor(e){super(),he(this,e,IS,ES,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function LS(n,e,t){const i=n.slice();return i[1]=e[t],i}function NS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function PS(n){let e,t,i,l=de(V1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Fb extends _e{constructor(e){super(),he(this,e,FS,PS,me,{class:0})}}function RS(n){let e,t,i,l,s,o,r,a,f;return t=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[jS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[HS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[zS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),H(t,e,null),k(e,i),H(l,e,null),k(e,s),H(o,e,null),r=!0,a||(f=K(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),z(t),z(l),z(o),a=!1,f()}}}function qS(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function jS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Max days retention"),l=O(),s=b("input"),r=O(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&<(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function HS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Fb({}),{c(){e=b("label"),t=W("Min log level"),l=O(),s=b("input"),o=O(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=O(),V(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),H(u,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&<(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),z(u),d=!1,m()}}}function zS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function VS(n){let e,t,i,l;const s=[qS,RS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function BS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function US(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function WS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[US],header:[BS],default:[VS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),z(e,l)}}}function YS(n,e,t){let i,l;const s=st(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Et("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=lt(this.value),t(1,c)}function T(){c.logs.minLevel=lt(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function M(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Te.call(this,n,L)}function I(L){Te.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,M,D,I]}class KS extends _e{constructor(e){super(),he(this,e,YS,WS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function JS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Nc(n){let e,t;return e=new fS({props:{filter:n[1],presets:n[5]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Pc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new e2({props:s}),ee.push(()=>ge(e,"filter",l)),e.$on("select",n[14]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function ZS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,M=n[4],D,I,L,R;f=new Zo({}),f.$on("refresh",n[10]),h=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[JS,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new $s({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Fb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Nc(n),N=Pc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=W(n[6]),o=O(),r=b("button"),r.innerHTML='',a=O(),V(f.$$.fragment),u=O(),c=b("div"),d=O(),m=b("div"),V(h.$$.fragment),_=O(),V(g.$$.fragment),y=O(),V(S.$$.fragment),T=O(),F.c(),C=O(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),H(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),H(h,m,null),k(e,_),H(g,e,null),k(e,y),H(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[we(Le.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&le(s,P[6]);const U={};q&12582916&&(U.$$scope={dirty:q,ctx:P}),h.$set(U);const Z={};q&2&&(Z.value=P[1]),g.$set(Z),q&16&&me($,$=P[4])?(se(),A(F,1,1,Q),oe(),F=Nc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(M,M=P[4])?(se(),A(N,1,1,Q),oe(),N=Pc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),z(f),z(h),z(g),z(S),F.d(P),N.d(P),L=!1,ve(R)}}}function GS(n){let e,t,i,l,s,o;e=new kn({props:{$$slots:{default:[ZS]},$$scope:{ctx:n}}});let r={};i=new AS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new KS({props:a}),n[18](s),s.$on("save",n[7]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(f,u){H(e,f,u),w(f,t,u),H(i,f,u),w(f,l,u),H(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),z(e,f),n[15](null),z(i,f),n[18](null),z(s,f)}}}const xs="logId",Fc="adminRequests",Rc="adminLogRequests";function XS(n,e,t){var L;let i,l,s;Ue(n,jo,R=>t(19,l=R)),Ue(n,Mt,R=>t(6,s=R)),xt(Mt,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Fc)||((L=window.localStorage)==null?void 0:L.getItem(Rc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Fc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const M=R=>{var N;let F={};F[xs]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[xs]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(xs)&&r&&r.show(o.get(xs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Rc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,M,D,I]}class QS extends _e{constructor(e){super(),he(this,e,XS,GS,me,{})}}function xS(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,ve(i)}}}function e$(n,e,t){const i=st();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class t$ extends _e{constructor(e){super(),he(this,e,e$,xS,me,{tolerance:3})}}function n$(n){let e,t,i,l,s;const o=n[5].default,r=vt(o,n,n[4],null);return l=new t$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=O(),V(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),H(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&St(r,o,a,a[4],s?wt(o,a[4],f,null):$t(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),z(l,a)}}}const qc="@adminSidebarWidth";function i$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(qc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(qc,a))},[s,o,a,r,l,i,f,u,c,d]}class Rb extends _e{constructor(e){super(),he(this,e,i$,n$,me,{class:0})}}const Va=Cn({});function fn(n,e,t){Va.set({text:n,yesCallback:e,noCallback:t})}function qb(){Va.set({})}function jc(n){let e,t,i;const l=n[17].default,s=vt(l,n,n[16],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[18](e),i=!0},p(o,r){s&&s.p&&(!i||r&65536)&&St(s,l,o,o[16],i?wt(l,o[16],r,null):$t(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Ne(e,Pn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[18](null),o&&t&&t.end()}}}function l$(n){let e,t,i,l,s=n[0]&&jc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),t=!0,i||(l=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?s?(s.p(o,r),r&1&&E(s,1)):(s=jc(o),s.c(),E(s,1),s.m(e,null)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[19](null),i=!1,ve(l)}}}function s$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_=!1;const g=st();function y(){t(0,o=!1),_=!1,clearTimeout(h)}function S(){t(0,o=!0),clearTimeout(h),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function T(){o?y():S()}function $(U){return!c||U.classList.contains(f)||(m==null?void 0:m.contains(U))&&!c.contains(U)||c.contains(U)&&U.closest&&U.closest("."+f)}function C(U){(!o||$(U.target))&&(U.preventDefault(),U.stopPropagation(),T())}function M(U){(U.code==="Enter"||U.code==="Space")&&(!o||$(U.target))&&(U.preventDefault(),U.stopPropagation(),T())}function D(U){o&&r&&U.code==="Escape"&&(U.preventDefault(),y())}function I(U){o&&!(c!=null&&c.contains(U.target))?_=!0:_&&(_=!1)}function L(U){var Z;o&&_&&!(c!=null&&c.contains(U.target))&&!(m!=null&&m.contains(U.target))&&!((Z=U.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function R(U){I(U),L(U)}function F(U){N(),c==null||c.addEventListener("click",C),t(15,m=U||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",C),m==null||m.addEventListener("keydown",M)}function N(){clearTimeout(h),c==null||c.removeEventListener("click",C),m==null||m.removeEventListener("click",C),m==null||m.removeEventListener("keydown",M)}jt(()=>(F(),()=>N()));function P(U){ee[U?"unshift":"push"](()=>{d=U,t(3,d)})}function q(U){ee[U?"unshift":"push"](()=>{c=U,t(2,c)})}return n.$$set=U=>{"trigger"in U&&t(8,s=U.trigger),"active"in U&&t(0,o=U.active),"escClose"in U&&t(9,r=U.escClose),"autoScroll"in U&&t(10,a=U.autoScroll),"closableClass"in U&&t(11,f=U.closableClass),"class"in U&&t(1,u=U.class),"$$scope"in U&&t(16,l=U.$$scope)},n.$$.update=()=>{var U,Z;n.$$.dirty&260&&c&&F(s),n.$$.dirty&32769&&(o?((U=m==null?void 0:m.classList)==null||U.add("active"),g("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),g("hide")))},[o,u,c,d,D,I,L,R,s,r,a,f,y,S,T,m,l,i,P,q]}class On extends _e{constructor(e){super(),he(this,e,s$,l$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Hc(n,e,t){const i=n.slice();return i[27]=e[t],i}function o$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=O(),s=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=K(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function r$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){se();const c=e;A(c.$$.fragment,1,0,()=>{z(c,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function a$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function f$(n){let e,t,i,l;const s=[a$,r$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function zc(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[f$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&zc(n);return{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),r&&r.c(),s=ye()},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=zc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),z(e,a),z(i,a),r&&r.d(a)}}}function c$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=W(t),l=W(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&le(i,t)},d(s){s&&v(e)}}}function Bc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[we(Le.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,ve(i)}}}function d$(n){let e,t,i,l,s,o,r=n[5]!=""&&Bc(n);return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='Cancel',i=O(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[K(t,"click",n[17]),K(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Bc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,ve(o)}}}function p$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[d$],header:[c$],default:[u$]},$$scope:{ctx:n}};for(let s=0;sB.name==U);G?j.removeByValue(Z.columns,G):j.pushUnique(Z.columns,{name:U}),t(2,d=j.buildIndex(Z))}jt(async()=>{t(8,_=!0);try{t(7,h=(await nt(()=>import("./CodeEditor-rWx4HUVf.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,_=!1)});const M=()=>T(),D=()=>y(),I=()=>$(),L=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(U){d=U,t(2,d)}const F=U=>C(U);function N(U){ee[U?"unshift":"push"](()=>{u=U,t(4,u)})}function P(U){Te.call(this,n,U)}function q(U){Te.call(this,n,U)}return n.$$set=U=>{e=Pe(Pe({},e),Wt(U)),t(14,r=Ge(e,o)),"collection"in U&&t(0,f=U.collection)},n.$$.update=()=>{var U,Z,G;n.$$.dirty[0]&1&&t(10,i=(((Z=(U=f==null?void 0:f.schema)==null?void 0:U.filter(B=>!B.toDelete))==null?void 0:Z.map(B=>B.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(B=>B.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,M,D,I,L,R,F,N,P,q]}class h$ extends _e{constructor(e){super(),he(this,e,m$,p$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Uc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Wc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Yc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Kc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Wc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=O(),i=b("span"),s=W(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[we(r=Le.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),K(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Wc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Kc).join(", "))+"")&&le(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Tt(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,ve(f)}}}function _$(n){var $,C,M;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=de(((M=n[0])==null?void 0:M.indexes)||[]),y=[];for(let D=0;Dge(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),l=W(i),s=W(")"),o=O(),r=b("div");for(let D=0;D+ New index',u=O(),V(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),rt(y,D),n[6](null),z(c,D),h=!1,_()}}}const Kc=n=>n.name;function g$(n,e,t){let i;Ue(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class b$ extends _e{constructor(e){super(),he(this,e,g$,_$,me,{collection:0})}}function Jc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zc(n){let e,t,i,l,s,o,r;function a(){return n[4](n[6])}function f(...u){return n[5](n[6],...u)}return{c(){e=b("div"),t=b("i"),i=O(),l=b("span"),l.textContent=`${n[6].label}`,s=O(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=[K(e,"click",cn(a)),K(e,"keydown",cn(f))],o=!0)},p(u,c){n=u},d(u){u&&v(e),o=!1,ve(r)}}}function k$(n){let e,t=de(n[2]),i=[];for(let l=0;l{o(f.value)},a=(f,u)=>{(u.code==="Enter"||u.code==="Space")&&o(f.value)};return n.$$set=f=>{"class"in f&&t(0,i=f.class)},[i,l,s,o,r,a]}class w$ extends _e{constructor(e){super(),he(this,e,v$,y$,me,{class:0})}}const S$=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]}),$$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]}),T$=n=>({interactive:n&64,hasErrors:n&32}),Qc=n=>({interactive:n[6],hasErrors:n[5]});function xc(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ed(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=W(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&le(i,l[4])},d(l){l&&v(e)}}}function C$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&ed(n);return{c(){m&&m.c(),e=O(),t=b("div"),i=b("i"),s=O(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=K(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=ed(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function O$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function M$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=K(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function D$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[we(Le.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,ve(i)}}}function td(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=vt(d,n,n[19],Xc);s=new pe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[E$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[I$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=vt(h,n,n[19],Gc);let g=!n[0].toDelete&&nd(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=O(),l=b("div"),V(s.$$.fragment),o=O(),V(r.$$.fragment),a=O(),_&&_.c(),f=O(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),H(s,l,null),k(l,o),H(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&St(m,d,y,y[19],c?wt(d,y[19],S,$$):$t(y[19]),Xc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&St(_,h,y,y[19],c?wt(h,y[19],S,S$):$t(y[19]),Gc),y[0].toDelete?g&&(se(),A(g,1,1,()=>{g=null}),oe()):g?(g.p(y,S),S&1&&E(g,1)):(g=nd(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ye(()=>{c&&(u||(u=Ne(e,xe,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Ne(e,xe,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),z(s),z(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function E$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),o=W(n[4]),r=O(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[K(e,"change",n[17]),we(f=Le.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&le(o,m[4]),f&&Tt(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,ve(d)}}}function I$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Presentable",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[18]),we(Le.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function nd(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[A$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=O(),V(o.$$.fragment),p(l,"class","ri-more-line"),p(i,"tabindex","0"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(o)}}}function A$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=O(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right"),p(i,"type","button"),p(i,"class","dropdown-item txt-right")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",Be(n[10])),K(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function L$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&xc();l=new pe({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[C$]},$$scope:{ctx:n}}});const c=n[14].default,d=vt(c,n,n[19],Qc),m=d||O$();function h(S,T){if(S[0].toDelete)return D$;if(S[6])return M$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&td(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=O(),V(l.$$.fragment),s=O(),m&&m.c(),o=O(),g&&g.c(),r=O(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),H(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=xc(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&St(d,c,S,S[19],f?wt(c,S[19],T,T$):$t(S[19]),Qc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=td(S),y.c(),E(y,1),y.m(e,null)):y&&(se(),A(y,1,1,()=>{y=null}),oe()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ye(()=>{f&&(a||(a=Ne(e,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Ne(e,xe,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),z(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let $r=[];function N$(n,e,t){let i,l,s,o;Ue(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=st(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function M(){_?C():$()}function D(){for(let N of $r)N.id!=f&&N.collapse()}jt(()=>($r.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey($r,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,M,o,r,I,L,R,F,a]}class si extends _e{constructor(e){super(),he(this,e,N$,L$,me,{key:1,field:0})}}function P$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min length"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=K(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function F$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max length"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=K(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&<(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function R$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Regex pattern"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function q$(n){let e,t,i,l,s,o,r,a,f,u;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[P$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[F$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[R$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),z(i),z(o),z(f)}}}function j$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[q$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function H$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=lt(this.value),t(0,s)}function a(){s.options.max=lt(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Te.call(this,n,h)}function d(h){Te.call(this,n,h)}function m(h){Te.call(this,n,h)}return n.$$set=h=>{e=Pe(Pe({},e),Wt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class z$ extends _e{constructor(e){super(),he(this,e,H$,j$,me,{field:0,key:1})}}function V$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=K(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function B$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max"),l=O(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=K(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&<(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function U$(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[V$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[B$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function W$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="No decimals",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[3]),we(Le.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function Y$(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[W$,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function K$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[Y$],options:[U$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function J$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=lt(this.value),t(0,s)}function f(){s.options.max=lt(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Te.call(this,n,h)}function d(h){Te.call(this,n,h)}function m(h){Te.call(this,n,h)}return n.$$set=h=>{e=Pe(Pe({},e),Wt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class Z$ extends _e{constructor(e){super(),he(this,e,J$,K$,me,{field:0,key:1})}}function G$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function X$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Te.call(this,n,c)}function f(c){Te.call(this,n,c)}function u(c){Te.call(this,n,c)}return n.$$set=c=>{e=Pe(Pe({},e),Wt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class Q$ extends _e{constructor(e){super(),he(this,e,X$,G$,me,{field:0,key:1})}}function x$(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Pe(Pe({},e),Wt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Nl extends _e{constructor(e){super(),he(this,e,eT,x$,me,{value:0,separator:1,readonly:2,disabled:3})}}function tT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function nT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function iT(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[tT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[nT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function lT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[iT]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function sT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Te.call(this,n,m)}function c(m){Te.call(this,n,m)}function d(m){Te.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class jb extends _e{constructor(e){super(),he(this,e,sT,lT,me,{field:0,key:1})}}function oT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function rT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Te.call(this,n,c)}function f(c){Te.call(this,n,c)}function u(c){Te.call(this,n,c)}return n.$$set=c=>{e=Pe(Pe({},e),Wt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class aT extends _e{constructor(e){super(),he(this,e,rT,oT,me,{field:0,key:1})}}function fT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[3]),we(Le.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function uT(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[fT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function cT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[uT]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function dT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Te.call(this,n,m)}function c(m){Te.call(this,n,m)}function d(m){Te.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class pT extends _e{constructor(e){super(),he(this,e,dT,cT,me,{field:0,key:1})}}var Tr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],wl={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ms={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},En=function(n){return n===!0?1:0};function id(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Cr=function(n){return n instanceof Array?n:[n]};function an(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ut(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Hb(n,e){if(e(n))return n;if(n.parentNode)return Hb(n.parentNode,e)}function to(n,e){var t=ut("div","numInputWrapper"),i=ut("input","numInput "+n),l=ut("span","arrowUp"),s=ut("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function vn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Or=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},mT={D:Or,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*En(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Or,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Or,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Bi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ns={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ns.w(n,e,t)]},F:function(n,e,t){return Po(ns.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ns.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[En(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},zb=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ms:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ns[c]&&m[d-1]!=="\\"?ns[c](r,u,t):c!=="\\"?c:""}).join("")}},sa=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ms:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||wl).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Dr(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}J!==void 0&&J.type!=="blur"&&oi(J);var ce=t._input.value;c(),Qt(),t._input.value!==ce&&t._debouncedChange()}function f(J,X){return J%12+12*En(X===t.l10n.amPM[1])}function u(J){switch(J%24){case 0:case 12:return 12;default:return J%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var J=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(J=f(J,t.amPM.textContent));var ce=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.minDate,!0)===0,$e=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ie=Mr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ke=Mr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Mr(J,X,ne);if(qe>Ke&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(J){var X=vn(J),ne=parseInt(X.value)+(J.delta||0);(ne/1e3>1||J.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&bt(ne)}function _(J,X,ne,ce){if(X instanceof Array)return X.forEach(function($e){return _(J,$e,ne,ce)});if(J instanceof Array)return J.forEach(function($e){return _($e,X,ne,ce)});J.addEventListener(X,ne,ce),t._handlers.push({remove:function(){return J.removeEventListener(X,ne,ce)}})}function g(){_t("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(ce){return _(ce,"click",t[ne])})}),t.isMobile){al();return}var J=id(ze,50);if(t._debouncedChange=id(g,bT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ee(vn(ne))}),_(t._input,"keydown",Me),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Me),!t.config.inline&&!t.config.static&&_(window,"resize",J),window.ontouchstart!==void 0?_(window.document,"touchstart",tt):_(window.document,"mousedown",tt),_(window.document,"focus",tt,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",qn),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return vn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(J,X){var ne=J!==void 0?t.parseDate(J):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(J);var $e=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!$e&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ie=ut("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function M(J,X,ne,ce){var $e=at(X,!0),Ie=ut("span",J,X.getDate().toString());return Ie.dateObj=X,Ie.$i=ce,Ie.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),J.indexOf("hidden")===-1&&wn(X,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),$e?(Ie.tabIndex=-1,Ce(X)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(an(Ie,"startRange",t.selectedDates[0]&&wn(X,t.selectedDates[0],!0)===0),an(Ie,"endRange",t.selectedDates[1]&&wn(X,t.selectedDates[1],!0)===0),J==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(X)&&!Ce(X)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&J!=="prevMonthDay"&&ce%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),_t("onDayCreate",Ie),Ie}function D(J){J.focus(),t.config.mode==="range"&&Ee(J)}function I(J){for(var X=J>0?0:t.config.showMonths-1,ne=J>0?t.config.showMonths:-1,ce=X;ce!=ne;ce+=J)for(var $e=t.daysContainer.children[ce],Ie=J>0?0:$e.children.length-1,Ke=J>0?$e.children.length:-1,qe=Ie;qe!=Ke;qe+=J){var Qe=$e.children[qe];if(Qe.className.indexOf("hidden")===-1&&at(Qe.dateObj))return Qe}}function L(J,X){for(var ne=J.className.indexOf("Month")===-1?J.dateObj.getMonth():t.currentMonth,ce=X>0?t.config.showMonths:-1,$e=X>0?1:-1,Ie=ne-t.currentMonth;Ie!=ce;Ie+=$e)for(var Ke=t.daysContainer.children[Ie],qe=ne-t.currentMonth===Ie?J.$i+X:X<0?Ke.children.length-1:0,Qe=Ke.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=$e){var Ve=Ke.children[Re];if(Ve.className.indexOf("hidden")===-1&&at(Ve.dateObj)&&Math.abs(J.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth($e),R(I($e),0)}function R(J,X){var ne=s(),ce=Pt(ne||document.body),$e=J!==void 0?J:ce?ne:t.selectedDateElem!==void 0&&Pt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Pt(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);$e===void 0?t._input.focus():ce?L($e,X):D($e)}function F(J,X){for(var ne=(new Date(J,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ce=t.utils.getDaysInMonth((X-1+12)%12,J),$e=t.utils.getDaysInMonth(X,J),Ie=window.document.createDocumentFragment(),Ke=t.config.showMonths>1,qe=Ke?"prevMonthDay hidden":"prevMonthDay",Qe=Ke?"nextMonthDay hidden":"nextMonthDay",Re=ce+1-ne,Ve=0;Re<=ce;Re++,Ve++)Ie.appendChild(M("flatpickr-day "+qe,new Date(J,X-1,Re),Re,Ve));for(Re=1;Re<=$e;Re++,Ve++)Ie.appendChild(M("flatpickr-day",new Date(J,X,Re),Re,Ve));for(var kt=$e+1;kt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);kt++,Ve++)Ie.appendChild(M("flatpickr-day "+Qe,new Date(J,X+1,kt%$e),kt,Ve));var Zn=ut("div","dayContainer");return Zn.appendChild(Ie),Zn}function N(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var J=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var J=function(ce){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&cet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(J(X)){var ne=ut("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Po(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var J=ut("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ut("span","cur-month"):(t.monthsDropdownContainer=ut("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Ke){var qe=vn(Ke),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),_t("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var ce=to("cur-year",{tabindex:"-1"}),$e=ce.getElementsByTagName("input")[0];$e.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&$e.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&($e.setAttribute("max",t.config.maxDate.getFullYear().toString()),$e.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ut("div","flatpickr-current-month");return Ie.appendChild(ne),Ie.appendChild(ce),X.appendChild(Ie),J.appendChild(X),{container:J,yearElement:$e,monthElement:ne}}function U(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var J=t.config.showMonths;J--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ut("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ut("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ut("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(J){t.__hidePrevMonthArrow!==J&&(an(t.prevMonthNav,"flatpickr-disabled",J),t.__hidePrevMonthArrow=J)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(J){t.__hideNextMonthArrow!==J&&(an(t.nextMonthNav,"flatpickr-disabled",J),t.__hideNextMonthArrow=J)}}),t.currentYearElement=t.yearElements[0],Yt(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var J=Dr(t.config);t.timeContainer=ut("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ut("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var ce=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ce.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?J.hours:u(J.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():J.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(ce),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var $e=to("flatpickr-second");t.secondElement=$e.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():J.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ut("span","flatpickr-time-separator",":")),t.timeContainer.appendChild($e)}return t.config.time_24hr||(t.amPM=ut("span","flatpickr-am-pm",t.l10n.amPM[En((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function B(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=ut("div","flatpickr-weekdays");for(var J=t.config.showMonths;J--;){var X=ut("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var J=t.l10n.firstDayOfWeek,X=ld(t.l10n.weekdays.shorthand);J>0&&J `+X.join("")+` - `}}function ue(){t.calendarContainer.classList.add("hasWeeks");var J=ut("div","flatpickr-weekwrapper");J.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ut("div","flatpickr-weeks");return J.appendChild(X),{weekWrapper:J,weekNumbers:X}}function ie(J,X){X===void 0&&(X=!0);var ne=X?J:J-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,_t("onYearChange"),P()),N(),_t("onMonthChange"),Yt())}function be(J,X){if(J===void 0&&(J=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Or(t.config),ce=ne.hours,$e=ne.minutes,Ie=ne.seconds;m(ce,$e,Ie)}t.redraw(),J&&_t("onChange")}function Ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),_t("onClose")}function He(){t.config!==void 0&&_t("onDestroy");for(var J=t._handlers.length;J--;)t._handlers[J].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Je(J){return t.calendarContainer.contains(J)}function tt(J){if(t.isOpen&&!t.config.inline){var X=vn(J),ne=Je(X),ce=X===t.input||X===t.altInput||t.element.contains(X)||J.path&&J.path.indexOf&&(~J.path.indexOf(t.input)||~J.path.indexOf(t.altInput)),$e=!ce&&!ne&&!Je(J.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Ke){return Ke.contains(X)});$e&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function bt(J){if(!(!J||t.config.minDate&&Jt.config.maxDate.getFullYear())){var X=J,ne=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),_t("onYearChange"),P())}}function at(J,X){var ne;X===void 0&&(X=!0);var ce=t.parseDate(J,void 0,X);if(t.config.minDate&&ce&&wn(ce,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&ce&&wn(ce,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ce===void 0)return!1;for(var $e=!!t.config.enable,Ie=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Ke=0,qe=void 0;Ke=qe.from.getTime()&&ce.getTime()<=qe.to.getTime())return $e}return!$e}function Pt(J){return t.daysContainer!==void 0?J.className.indexOf("hidden")===-1&&J.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(J):!1}function Gt(J){var X=J.target===t._input,ne=t._input.value.trimEnd()!==et();X&&ne&&!(J.relatedTarget&&Je(J.relatedTarget))&&t.setDate(t._input.value,!0,J.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Me(J){var X=vn(J),ne=t.config.wrap?n.contains(X):X===t._input,ce=t.config.allowInput,$e=t.isOpen&&(!ce||!ne),Ie=t.config.inline&&ne&&!ce;if(J.keyCode===13&&ne){if(ce)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Je(X)||$e||Ie){var Ke=!!t.timeContainer&&t.timeContainer.contains(X);switch(J.keyCode){case 13:Ke?(J.preventDefault(),a(),Ai()):ol(J);break;case 27:J.preventDefault(),Ai();break;case 8:case 46:ne&&!t.config.allowInput&&(J.preventDefault(),t.clear());break;case 37:case 39:if(!Ke&&!ne){J.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(ce===!1||qe&&Pt(qe))){var Qe=J.keyCode===39?1:-1;J.ctrlKey?(J.stopPropagation(),ie(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:J.preventDefault();var Re=J.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?J.ctrlKey?(J.stopPropagation(),bt(t.currentYear-Re),R(I(1),0)):Ke||R(void 0,Re*7):X===t.currentYearElement?bt(t.currentYear-Re):t.config.enableTime&&(!Ke&&t.hourElement&&t.hourElement.focus(),a(J),t._debouncedChange());break;case 9:if(Ke){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(yn){return yn}),kt=Ve.indexOf(X);if(kt!==-1){var Jn=Ve[kt+(J.shiftKey?-1:1)];J.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&J.shiftKey&&(J.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(J.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Qt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Qt();break}(ne||Je(X))&&_t("onKeyDown",J)}function Ee(J,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||J&&(!J.classList.contains(X)||J.classList.contains("flatpickr-disabled")))){for(var ne=J?J.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ce=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),$e=Math.min(ne,t.selectedDates[0].getTime()),Ie=Math.max(ne,t.selectedDates[0].getTime()),Ke=!1,qe=0,Qe=0,Re=$e;Re$e&&Reqe)?qe=Re:Re>ce&&(!Qe||Re ."+X));Ve.forEach(function(kt){var Jn=kt.dateObj,yn=Jn.getTime(),Fl=qe>0&&yn0&&yn>Qe;if(Fl){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ul){kt.classList.remove(ul)});return}else if(Ke&&!Fl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ul){kt.classList.remove(ul)}),J!==void 0&&(J.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),cene&&yn===ce&&kt.classList.add("endRange"),yn>=qe&&(Qe===0||yn<=Qe)&&dT(yn,ce,ne)&&kt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&Ht()}function ht(J,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(J){J.preventDefault();var ne=vn(J);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),_t("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ce=t.isOpen;t.isOpen=!0,ce||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),_t("onOpen"),Ht(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(J===void 0||!t.timeContainer.contains(J.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function te(J){return function(X){var ne=t.config["_"+J+"Date"]=t.parseDate(X,t.config.dateFormat),ce=t.config["_"+(J==="min"?"max":"min")+"Date"];ne!==void 0&&(t[J==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function($e){return at($e)}),!t.selectedDates.length&&J==="min"&&d(ne),Qt()),t.daysContainer&&(Rn(),ne!==void 0?t.currentYearElement[J]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(J),t.currentYearElement.disabled=!!ce&&ne!==void 0&&ce.getFullYear()===ne.getFullYear())}}function Fe(){var J=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=tn(tn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Kn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Kn(Ve)}});var ce=X.mode==="time";if(!X.dateFormat&&(X.enableTime||ce)){var $e=Vt.defaultConfig.dateFormat||wl.dateFormat;ne.dateFormat=X.noCalendar||ce?"H:i"+(X.enableSeconds?":S":""):$e+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||ce)&&!X.altFormat){var Ie=Vt.defaultConfig.altFormat||wl.altFormat;ne.altFormat=X.noCalendar||ce?"h:i"+(X.enableSeconds?":S K":" K"):Ie+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:te("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:te("max")});var Ke=function(Ve){return function(kt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ke("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ke("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe-1?t.config[Re]=$r(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=Se().className+" "+t.config.altInputClass),_t("onParseConfig")}function Se(){return t.config.wrap?n.querySelector("[data-input]"):n}function pt(){typeof t.config.locale!="object"&&typeof Vt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=tn(tn({},Vt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Vt.l10ns[t.config.locale]:void 0),Bi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Bi.l="("+t.l10n.weekdays.longhand.join("|")+")",Bi.M="("+t.l10n.months.shorthand.join("|")+")",Bi.F="("+t.l10n.months.longhand.join("|")+")",Bi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var J=tn(tn({},e),JSON.parse(JSON.stringify(n.dataset||{})));J.time_24hr===void 0&&Vt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Fb(t),t.parseDate=ia({config:t.config,l10n:t.l10n})}function Ht(J){if(typeof t.config.position=="function")return void t.config.position(t,J);if(t.calendarContainer!==void 0){_t("onPreCalendarPosition");var X=J||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(Qb,xb){return Qb+xb.offsetHeight},0),ce=t.calendarContainer.offsetWidth,$e=t.config.position.split(" "),Ie=$e[0],Ke=$e.length>1?$e[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Ie==="above"||Ie!=="below"&&Qene,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(an(t.calendarContainer,"arrowTop",!Re),an(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+qe.left,Jn=!1,yn=!1;Ke==="center"?(kt-=(ce-qe.width)/2,Jn=!0):Ke==="right"&&(kt-=ce-qe.width,yn=!0),an(t.calendarContainer,"arrowLeft",!Jn&&!yn),an(t.calendarContainer,"arrowCenter",Jn),an(t.calendarContainer,"arrowRight",yn);var Fl=window.document.body.offsetWidth-(window.pageXOffset+qe.right),ul=kt+ce>window.document.body.offsetWidth,Wb=Fl+ce>window.document.body.offsetWidth;if(an(t.calendarContainer,"rightMost",ul),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!ul)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!Wb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fl+"px";else{var Qo=dn();if(Qo===void 0)return;var Yb=window.document.body.offsetWidth,Kb=Math.max(0,Yb/2-ce/2),Jb=".flatpickr-calendar.centerMost:before",Zb=".flatpickr-calendar.centerMost:after",Gb=Qo.cssRules.length,Xb="{left:"+qe.left+"px;right:auto;}";an(t.calendarContainer,"rightMost",!1),an(t.calendarContainer,"centerMost",!0),Qo.insertRule(Jb+","+Zb+Xb,Gb),t.calendarContainer.style.left=Kb+"px",t.calendarContainer.style.right="auto"}}}}function dn(){for(var J=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ce,t.config.mode==="single")t.selectedDates=[$e];else if(t.config.mode==="multiple"){var Ke=Ce($e);Ke?t.selectedDates.splice(parseInt(Ke),1):t.selectedDates.push($e)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=$e,t.selectedDates.push($e),wn($e,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,kt){return Ve.getTime()-kt.getTime()}));if(c(),Ie){var qe=t.currentYear!==$e.getFullYear();t.currentYear=$e.getFullYear(),t.currentMonth=$e.getMonth(),qe&&(_t("onYearChange"),P()),_t("onMonthChange")}if(Yt(),N(),Qt(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?D(ce):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Ai()}g()}}var gi={locale:[pt,Y],showMonths:[U,r,B],minDate:[S],maxDate:[S],positionElement:[bi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function De(J,X){if(J!==null&&typeof J=="object"){Object.assign(t.config,J);for(var ne in J)gi[ne]!==void 0&&gi[ne].forEach(function(ce){return ce()})}else t.config[J]=X,gi[J]!==void 0?gi[J].forEach(function(ce){return ce()}):Sr.indexOf(J)>-1&&(t.config[J]=$r(X));t.redraw(),Qt(!0)}function At(J,X){var ne=[];if(J instanceof Array)ne=J.map(function(ce){return t.parseDate(ce,X)});else if(J instanceof Date||typeof J=="number")ne=[t.parseDate(J,X)];else if(typeof J=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(J,X)];break;case"multiple":ne=J.split(t.config.conjunction).map(function(ce){return t.parseDate(ce,X)});break;case"range":ne=J.split(t.l10n.rangeSeparator).map(function(ce){return t.parseDate(ce,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(J)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(ce){return ce instanceof Date&&at(ce,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ce,$e){return ce.getTime()-$e.getTime()})}function Li(J,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),J!==0&&!J||J instanceof Array&&J.length===0)return t.clear(X);At(J,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Qt(X),X&&_t("onChange")}function Kn(J){return J.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function rl(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var J=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);J&&At(J,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Pl(){if(t.input=Se(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ut(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bi()}function bi(){t._positionElement=t.config.positionElement||t._input}function al(){var J=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ut("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=J,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=J==="datetime-local"?"Y-m-d\\TH:i:S":J==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(vn(X).value,!1,t.mobileFormatStr),_t("onChange"),_t("onClose")})}function fl(J){if(t.isOpen===!0)return t.close();t.open(J)}function _t(J,X){if(t.config!==void 0){var ne=t.config[J];if(ne!==void 0&&ne.length>0)for(var ce=0;ne[ce]&&ce=0&&wn(J,t.selectedDates[1])<=0}function Yt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(J,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Lo(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),J.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function et(J){var X=J||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,ce,$e){return t.config.mode!=="range"||t.config.enableTime||$e.indexOf(ne)===ce}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Qt(J){J===void 0&&(J=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=et(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=et(t.config.altFormat)),J!==!1&&_t("onValueUpdate")}function qn(J){var X=vn(J),ne=t.prevMonthNav.contains(X),ce=t.nextMonthNav.contains(X);ne||ce?ie(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(J){J.preventDefault();var X=J.type==="keydown",ne=vn(J),ce=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[En(t.amPM.textContent===t.l10n.amPM[0])]);var $e=parseFloat(ce.getAttribute("min")),Ie=parseFloat(ce.getAttribute("max")),Ke=parseFloat(ce.getAttribute("step")),qe=parseInt(ce.value,10),Qe=J.delta||(X?J.which===38?1:-1:0),Re=qe+Ke*Qe;if(typeof ce.value<"u"&&ce.value.length===2){var Ve=ce===t.hourElement,kt=ce===t.minuteElement;Re<$e?(Re=Ie+Re+En(!Ve)+(En(Ve)&&En(!t.amPM)),kt&&$(void 0,-1,t.hourElement)):Re>Ie&&(Re=ce===t.hourElement?Re-Ie-En(!t.amPM):$e,kt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Ke===1?Re+qe===23:Math.abs(Re-qe)>Ke)&&(t.amPM.textContent=t.l10n.amPM[En(t.amPM.textContent===t.l10n.amPM[0])]),ce.value=mn(Re)}}return l(),t}function Sl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function yT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:f="",element:u=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;jt(()=>{const $=u??h,C=y(d);return C.onReady.push((M,D,I)=>{a===void 0&&S(M,D,I),Xt().then(()=>{t(8,m=!0)})}),t(3,_=Vt($,Object.assign(C,u?{wrap:!0}:{}))),()=>{_.destroy()}});const g=st();function y($={}){$=Object.assign({},$);for(const C of r){const M=(D,I,L)=>{g(kT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(M)):$[C]=[M]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,M){const D=id(M,$);!ld(a,D)&&(a||D)&&t(2,a=D),t(4,f=C)}function T($){ee[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Pe(Pe({},e),Wt($)),t(1,l=Ge(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,f=$.formattedValue),"element"in $&&t(5,u=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(ld(a,id(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,f,u,c,d,m,o,s,T]}class za extends _e{constructor(e){super(),he(this,e,yT,bT,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function vT(n){let e,t,i,l,s,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new za({props:c}),ee.push(()=>ge(s,"value",f)),ee.push(()=>ge(s,"formattedValue",u)),s.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),l=O(),V(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),H(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),z(s,d)}}}function wT(n){let e,t,i,l,s,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new za({props:c}),ee.push(()=>ge(s,"value",f)),ee.push(()=>ge(s,"formattedValue",u)),s.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),l=O(),V(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),H(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),z(s,d)}}}function ST(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[vT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[wT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&196613&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&196617&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function $T(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[ST]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&131087&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function TT(n,e,t){var $,C;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function f(M,D){M.detail&&M.detail.length==3&&t(0,s.options[D]=M.detail[1],s)}function u(M){r=M,t(2,r),t(0,s)}function c(M){n.$$.not_equal(s.options.min,M)&&(s.options.min=M,t(0,s))}const d=M=>f(M,"min");function m(M){a=M,t(3,a),t(0,s)}function h(M){n.$$.not_equal(s.options.max,M)&&(s.options.max=M,t(0,s))}const _=M=>f(M,"max");function g(M){s=M,t(0,s)}function y(M){Te.call(this,n,M)}function S(M){Te.call(this,n,M)}function T(M){Te.call(this,n,M)}return n.$$set=M=>{e=Pe(Pe({},e),Wt(M)),t(5,l=Ge(e,i)),"field"in M&&t(0,s=M.field),"key"in M&&t(1,o=M.key)},n.$$.update=()=>{var M,D,I,L;n.$$.dirty&5&&r!=((M=s==null?void 0:s.options)==null?void 0:M.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,f,l,u,c,d,m,h,_,g,y,S,T]}class CT extends _e{constructor(e){super(),he(this,e,TT,$T,me,{field:0,key:1})}}const OT=n=>({}),sd=n=>({});function od(n,e,t){const i=n.slice();return i[48]=e[t],i}const MT=n=>({}),rd=n=>({});function ad(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function fd(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=O(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&le(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function DT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ET(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let f={};if(a!==void 0&&a[0]&2049)f=dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&2049?dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function ud(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[we(Le.call(null,e,"Clear")),K(e,"click",cn(Be(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,ve(i)}}}function cd(n){let e,t,i,l,s,o;const r=[ET,DT],a=[];function f(c,d){return c[10]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[8])&&ud(n);return{c(){e=b("div"),i.c(),l=O(),u&&u.c(),s=O(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),u&&u.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(se(),A(a[m],1,1,()=>{a[m]=null}),oe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?u?u.p(c,d):(u=ud(c),u.c(),u.m(e,s)):u&&(u.d(1),u=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),u&&u.d()}}}function dd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[LT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),z(e,l)}}}function pd(n){let e,t,i,l,s,o,r,a,f=n[17].length&&md(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=O(),s=b("input"),o=O(),f&&f.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(t,l),k(t,s),re(s,n[17]),k(t,o),f&&f.m(t,null),s.focus(),r||(a=K(s,"input",n[38]),r=!0)},p(u,c){c[0]&8&&p(s,"placeholder",u[3]),c[0]&131072&&s.value!==u[17]&&re(s,u[17]),u[17].length?f?f.p(u,c):(f=md(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&v(e),f&&f.d(),r=!1,a()}}}function md(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",cn(Be(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function hd(n){let e,t=n[1]&&_d(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=_d(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function _d(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&le(t,i[1])},d(i){i&&v(e)}}}function IT(n){let e=n[48]+"",t;return{c(){t=W(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&le(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function AT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let f={};if(a!==void 0&&a[0]&4202496)f=dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&4202496?dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function gd(n){let e,t,i,l,s,o,r;const a=[AT,IT],f=[];function u(m,h){return m[12]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=O(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),f[t].m(e,null),k(e,l),s=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=u(n),t===_?f[t].p(n,h):(se(),A(f[_],1,1,()=>{f[_]=null}),oe(),i=f[t],i?i.p(n,h):(i=f[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),f[t].d(),o=!1,ve(r)}}}function LT(n){let e,t,i,l,s,o=n[14]&&pd(n);const r=n[35].beforeOptions,a=vt(r,n,n[44],rd);let f=de(n[22]),u=[];for(let _=0;_A(u[_],1,1,()=>{u[_]=null});let d=null;f.length||(d=hd(n));const m=n[35].afterOptions,h=vt(m,n,n[44],sd);return{c(){o&&o.c(),e=O(),a&&a.c(),t=O(),i=b("div");for(let _=0;_A(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=fd(n));let c=!n[5]&&!n[6]&&dd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),oe()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mSe(pt,Fe))||[]}function Ae(te,Fe){te.preventDefault(),y&&d?Z(Fe):U(Fe)}function He(te,Fe){(te.code==="Enter"||te.code==="Space")&&(Ae(te,Fe),S&&Y())}function Je(){ie(),setTimeout(()=>{const te=N==null?void 0:N.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function tt(te){te.stopPropagation(),!h&&!m&&(R==null||R.toggle())}jt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of te)Fe.addEventListener("click",tt);return()=>{for(const Fe of te)Fe.removeEventListener("click",tt)}});const bt=te=>q(te);function at(te){ee[te?"unshift":"push"](()=>{P=te,t(20,P)})}function Pt(){F=this.value,t(17,F)}const Gt=(te,Fe)=>Ae(Fe,te),Me=(te,Fe)=>He(Fe,te);function Ee(te){ee[te?"unshift":"push"](()=>{R=te,t(18,R)})}function ze(te){Te.call(this,n,te)}function ht(te){ee[te?"unshift":"push"](()=>{N=te,t(19,N)})}return n.$$set=te=>{"id"in te&&t(27,r=te.id),"noOptionsText"in te&&t(1,a=te.noOptionsText),"selectPlaceholder"in te&&t(2,f=te.selectPlaceholder),"searchPlaceholder"in te&&t(3,u=te.searchPlaceholder),"items"in te&&t(28,c=te.items),"multiple"in te&&t(4,d=te.multiple),"disabled"in te&&t(5,m=te.disabled),"readonly"in te&&t(6,h=te.readonly),"upside"in te&&t(7,_=te.upside),"selected"in te&&t(0,g=te.selected),"toggle"in te&&t(8,y=te.toggle),"closable"in te&&t(9,S=te.closable),"labelComponent"in te&&t(10,T=te.labelComponent),"labelComponentProps"in te&&t(11,$=te.labelComponentProps),"optionComponent"in te&&t(12,C=te.optionComponent),"optionComponentProps"in te&&t(13,M=te.optionComponentProps),"searchable"in te&&t(14,D=te.searchable),"searchFunc"in te&&t(29,I=te.searchFunc),"class"in te&&t(15,L=te.class),"$$scope"in te&&t(44,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),ie()),n.$$.dirty[0]&268566528&&t(22,i=be(c,F)),n.$$.dirty[0]&1&&t(21,l=function(te){const Fe=j.toArray(g);return j.inArray(Fe,te)})},[g,a,f,u,d,m,h,_,y,S,T,$,C,M,D,L,q,F,R,N,P,l,i,ie,Ae,He,Je,r,c,I,U,Z,G,B,Y,s,bt,at,Pt,Gt,Me,Ee,ze,ht,o]}class Rb extends _e{constructor(e){super(),he(this,e,FT,NT,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function bd(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function RT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&bd(n);return{c(){s&&s.c(),e=O(),t=b("span"),l=W(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=bd(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function qT(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class kd extends _e{constructor(e){super(),he(this,e,qT,RT,me,{item:0})}}const jT=n=>({}),yd=n=>({});function HT(n){let e;const t=n[8].afterOptions,i=vt(t,n,n[12],yd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&St(i,t,l,l[12],e?wt(t,l[12],s,jT):$t(l[12]),yd)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function zT(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[HT]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&62?dt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ct(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function VT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=kd}=e,{optionComponent:c=kd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const M=j.findByKey(r,d,C);M&&$.push(M)}T.length&&!$.length||t(0,f=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){f=T,t(0,f)}function y(T){Te.call(this,n,T)}function S(T){Te.call(this,n,T)}return n.$$set=T=>{e=Pe(Pe({},e),Wt(T)),t(5,l=Ge(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,f=T.selected),"labelComponent"in T&&t(3,u=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(f)},[f,r,a,u,c,l,m,d,s,g,y,S,o]}class hi extends _e{constructor(e){super(),he(this,e,VT,zT,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function BT(n){let e,t,i,l,s,o;function r(f){n[7](f)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Nl({props:a}),ee.push(()=>ge(t,"value",r)),{c(){e=b("div"),V(t.$$.fragment)},m(f,u){w(f,e,u),H(t,e,null),l=!0,s||(o=we(Le.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(f,u){const c={};u&16384&&(c.id=f[14]),u&32768&&(c.readonly=!f[15]),!i&&u&1&&(i=!0,c.value=f[0].options.values,ke(()=>i=!1)),t.$set(c)},i(f){l||(E(t.$$.fragment,f),l=!0)},o(f){A(t.$$.fragment,f),l=!1},d(f){f&&v(e),z(t),s=!1,o()}}}function UT(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function WT(n){let e,t,i,l,s,o,r,a,f,u;return i=new pe({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[BT,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[UT,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),V(i.$$.fragment),l=O(),s=b("div"),o=O(),V(r.$$.fragment),a=O(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),z(i,c),z(r,c)}}}function vd(n){let e,t;return e=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[YT,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function YT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=O(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=K(s,"input",n[6]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function KT(n){let e,t,i=!n[2]&&vd(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(se(),A(i,1,1,()=>{i=null}),oe()):i?(i.p(l,s),s&4&&E(i,1)):(i=vd(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function JT(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[KT],default:[WT,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&18?dt(l,[a&2&&{key:r[1]},a&16&&Ct(r[4])]):{};a&98311&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ZT(n,e,t){var S;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,f=a;function u(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,f=a)}function c(){s.options.maxSelect=lt(this.value),t(0,s),t(5,f),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,f),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,f),t(2,a)}function _(T){Te.call(this,n,T)}function g(T){Te.call(this,n,T)}function y(T){Te.call(this,n,T)}return n.$$set=T=>{e=Pe(Pe({},e),Wt(T)),t(4,l=Ge(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&u()},[s,o,a,r,l,f,c,d,m,h,_,g,y]}class GT extends _e{constructor(e){super(),he(this,e,ZT,JT,me,{field:0,key:1})}}function XT(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=O(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(u,c){w(u,e,c),k(e,t),k(e,i),w(u,s,c),w(u,o,c),re(o,n[0].options.maxSize),a||(f=K(o,"input",n[4]),a=!0)},p(u,c){c&2048&&l!==(l=u[11])&&p(e,"for",l),c&2048&&r!==(r=u[11])&&p(o,"id",r),c&1&<(o.value)!==u[0].options.maxSize&&re(o,u[0].options.maxSize)},d(u){u&&(v(e),v(s),v(o)),a=!1,f()}}}function QT(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xT(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,U,Z,G,B,Y,ue;return{c(){e=b("div"),t=b("div"),i=b("div"),l=W("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=W(` and + `}}function ue(){t.calendarContainer.classList.add("hasWeeks");var J=ut("div","flatpickr-weekwrapper");J.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ut("div","flatpickr-weeks");return J.appendChild(X),{weekWrapper:J,weekNumbers:X}}function ie(J,X){X===void 0&&(X=!0);var ne=X?J:J-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,_t("onYearChange"),P()),N(),_t("onMonthChange"),Yt())}function be(J,X){if(J===void 0&&(J=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Dr(t.config),ce=ne.hours,$e=ne.minutes,Ie=ne.seconds;m(ce,$e,Ie)}t.redraw(),J&&_t("onChange")}function Ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),_t("onClose")}function He(){t.config!==void 0&&_t("onDestroy");for(var J=t._handlers.length;J--;)t._handlers[J].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Je(J){return t.calendarContainer.contains(J)}function tt(J){if(t.isOpen&&!t.config.inline){var X=vn(J),ne=Je(X),ce=X===t.input||X===t.altInput||t.element.contains(X)||J.path&&J.path.indexOf&&(~J.path.indexOf(t.input)||~J.path.indexOf(t.altInput)),$e=!ce&&!ne&&!Je(J.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Ke){return Ke.contains(X)});$e&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function bt(J){if(!(!J||t.config.minDate&&Jt.config.maxDate.getFullYear())){var X=J,ne=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),_t("onYearChange"),P())}}function at(J,X){var ne;X===void 0&&(X=!0);var ce=t.parseDate(J,void 0,X);if(t.config.minDate&&ce&&wn(ce,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&ce&&wn(ce,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ce===void 0)return!1;for(var $e=!!t.config.enable,Ie=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Ke=0,qe=void 0;Ke=qe.from.getTime()&&ce.getTime()<=qe.to.getTime())return $e}return!$e}function Pt(J){return t.daysContainer!==void 0?J.className.indexOf("hidden")===-1&&J.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(J):!1}function Gt(J){var X=J.target===t._input,ne=t._input.value.trimEnd()!==et();X&&ne&&!(J.relatedTarget&&Je(J.relatedTarget))&&t.setDate(t._input.value,!0,J.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Me(J){var X=vn(J),ne=t.config.wrap?n.contains(X):X===t._input,ce=t.config.allowInput,$e=t.isOpen&&(!ce||!ne),Ie=t.config.inline&&ne&&!ce;if(J.keyCode===13&&ne){if(ce)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Je(X)||$e||Ie){var Ke=!!t.timeContainer&&t.timeContainer.contains(X);switch(J.keyCode){case 13:Ke?(J.preventDefault(),a(),Ai()):ol(J);break;case 27:J.preventDefault(),Ai();break;case 8:case 46:ne&&!t.config.allowInput&&(J.preventDefault(),t.clear());break;case 37:case 39:if(!Ke&&!ne){J.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(ce===!1||qe&&Pt(qe))){var Qe=J.keyCode===39?1:-1;J.ctrlKey?(J.stopPropagation(),ie(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:J.preventDefault();var Re=J.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?J.ctrlKey?(J.stopPropagation(),bt(t.currentYear-Re),R(I(1),0)):Ke||R(void 0,Re*7):X===t.currentYearElement?bt(t.currentYear-Re):t.config.enableTime&&(!Ke&&t.hourElement&&t.hourElement.focus(),a(J),t._debouncedChange());break;case 9:if(Ke){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(yn){return yn}),kt=Ve.indexOf(X);if(kt!==-1){var Zn=Ve[kt+(J.shiftKey?-1:1)];J.preventDefault(),(Zn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&J.shiftKey&&(J.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(J.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Qt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Qt();break}(ne||Je(X))&&_t("onKeyDown",J)}function Ee(J,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||J&&(!J.classList.contains(X)||J.classList.contains("flatpickr-disabled")))){for(var ne=J?J.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ce=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),$e=Math.min(ne,t.selectedDates[0].getTime()),Ie=Math.max(ne,t.selectedDates[0].getTime()),Ke=!1,qe=0,Qe=0,Re=$e;Re$e&&Reqe)?qe=Re:Re>ce&&(!Qe||Re ."+X));Ve.forEach(function(kt){var Zn=kt.dateObj,yn=Zn.getTime(),Fl=qe>0&&yn0&&yn>Qe;if(Fl){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ul){kt.classList.remove(ul)});return}else if(Ke&&!Fl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ul){kt.classList.remove(ul)}),J!==void 0&&(J.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),cene&&yn===ce&&kt.classList.add("endRange"),yn>=qe&&(Qe===0||yn<=Qe)&&hT(yn,ce,ne)&&kt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&Ht()}function ht(J,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(J){J.preventDefault();var ne=vn(J);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),_t("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ce=t.isOpen;t.isOpen=!0,ce||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),_t("onOpen"),Ht(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(J===void 0||!t.timeContainer.contains(J.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function te(J){return function(X){var ne=t.config["_"+J+"Date"]=t.parseDate(X,t.config.dateFormat),ce=t.config["_"+(J==="min"?"max":"min")+"Date"];ne!==void 0&&(t[J==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function($e){return at($e)}),!t.selectedDates.length&&J==="min"&&d(ne),Qt()),t.daysContainer&&(Rn(),ne!==void 0?t.currentYearElement[J]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(J),t.currentYearElement.disabled=!!ce&&ne!==void 0&&ce.getFullYear()===ne.getFullYear())}}function Fe(){var J=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=tn(tn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Jn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Jn(Ve)}});var ce=X.mode==="time";if(!X.dateFormat&&(X.enableTime||ce)){var $e=Vt.defaultConfig.dateFormat||wl.dateFormat;ne.dateFormat=X.noCalendar||ce?"H:i"+(X.enableSeconds?":S":""):$e+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||ce)&&!X.altFormat){var Ie=Vt.defaultConfig.altFormat||wl.altFormat;ne.altFormat=X.noCalendar||ce?"h:i"+(X.enableSeconds?":S K":" K"):Ie+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:te("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:te("max")});var Ke=function(Ve){return function(kt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ke("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ke("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe-1?t.config[Re]=Cr(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=Se().className+" "+t.config.altInputClass),_t("onParseConfig")}function Se(){return t.config.wrap?n.querySelector("[data-input]"):n}function pt(){typeof t.config.locale!="object"&&typeof Vt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=tn(tn({},Vt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Vt.l10ns[t.config.locale]:void 0),Bi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Bi.l="("+t.l10n.weekdays.longhand.join("|")+")",Bi.M="("+t.l10n.months.shorthand.join("|")+")",Bi.F="("+t.l10n.months.longhand.join("|")+")",Bi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var J=tn(tn({},e),JSON.parse(JSON.stringify(n.dataset||{})));J.time_24hr===void 0&&Vt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=zb(t),t.parseDate=sa({config:t.config,l10n:t.l10n})}function Ht(J){if(typeof t.config.position=="function")return void t.config.position(t,J);if(t.calendarContainer!==void 0){_t("onPreCalendarPosition");var X=J||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(i0,l0){return i0+l0.offsetHeight},0),ce=t.calendarContainer.offsetWidth,$e=t.config.position.split(" "),Ie=$e[0],Ke=$e.length>1?$e[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Ie==="above"||Ie!=="below"&&Qene,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(an(t.calendarContainer,"arrowTop",!Re),an(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+qe.left,Zn=!1,yn=!1;Ke==="center"?(kt-=(ce-qe.width)/2,Zn=!0):Ke==="right"&&(kt-=ce-qe.width,yn=!0),an(t.calendarContainer,"arrowLeft",!Zn&&!yn),an(t.calendarContainer,"arrowCenter",Zn),an(t.calendarContainer,"arrowRight",yn);var Fl=window.document.body.offsetWidth-(window.pageXOffset+qe.right),ul=kt+ce>window.document.body.offsetWidth,Gb=Fl+ce>window.document.body.offsetWidth;if(an(t.calendarContainer,"rightMost",ul),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!ul)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!Gb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fl+"px";else{var er=dn();if(er===void 0)return;var Xb=window.document.body.offsetWidth,Qb=Math.max(0,Xb/2-ce/2),xb=".flatpickr-calendar.centerMost:before",e0=".flatpickr-calendar.centerMost:after",t0=er.cssRules.length,n0="{left:"+qe.left+"px;right:auto;}";an(t.calendarContainer,"rightMost",!1),an(t.calendarContainer,"centerMost",!0),er.insertRule(xb+","+e0+n0,t0),t.calendarContainer.style.left=Qb+"px",t.calendarContainer.style.right="auto"}}}}function dn(){for(var J=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ce,t.config.mode==="single")t.selectedDates=[$e];else if(t.config.mode==="multiple"){var Ke=Ce($e);Ke?t.selectedDates.splice(parseInt(Ke),1):t.selectedDates.push($e)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=$e,t.selectedDates.push($e),wn($e,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,kt){return Ve.getTime()-kt.getTime()}));if(c(),Ie){var qe=t.currentYear!==$e.getFullYear();t.currentYear=$e.getFullYear(),t.currentMonth=$e.getMonth(),qe&&(_t("onYearChange"),P()),_t("onMonthChange")}if(Yt(),N(),Qt(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?D(ce):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Ai()}g()}}var gi={locale:[pt,Y],showMonths:[U,r,B],minDate:[S],maxDate:[S],positionElement:[bi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function De(J,X){if(J!==null&&typeof J=="object"){Object.assign(t.config,J);for(var ne in J)gi[ne]!==void 0&&gi[ne].forEach(function(ce){return ce()})}else t.config[J]=X,gi[J]!==void 0?gi[J].forEach(function(ce){return ce()}):Tr.indexOf(J)>-1&&(t.config[J]=Cr(X));t.redraw(),Qt(!0)}function At(J,X){var ne=[];if(J instanceof Array)ne=J.map(function(ce){return t.parseDate(ce,X)});else if(J instanceof Date||typeof J=="number")ne=[t.parseDate(J,X)];else if(typeof J=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(J,X)];break;case"multiple":ne=J.split(t.config.conjunction).map(function(ce){return t.parseDate(ce,X)});break;case"range":ne=J.split(t.l10n.rangeSeparator).map(function(ce){return t.parseDate(ce,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(J)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(ce){return ce instanceof Date&&at(ce,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ce,$e){return ce.getTime()-$e.getTime()})}function Li(J,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),J!==0&&!J||J instanceof Array&&J.length===0)return t.clear(X);At(J,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Qt(X),X&&_t("onChange")}function Jn(J){return J.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function rl(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var J=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);J&&At(J,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Pl(){if(t.input=Se(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ut(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bi()}function bi(){t._positionElement=t.config.positionElement||t._input}function al(){var J=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ut("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=J,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=J==="datetime-local"?"Y-m-d\\TH:i:S":J==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(vn(X).value,!1,t.mobileFormatStr),_t("onChange"),_t("onClose")})}function fl(J){if(t.isOpen===!0)return t.close();t.open(J)}function _t(J,X){if(t.config!==void 0){var ne=t.config[J];if(ne!==void 0&&ne.length>0)for(var ce=0;ne[ce]&&ce=0&&wn(J,t.selectedDates[1])<=0}function Yt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(J,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),J.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function et(J){var X=J||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,ce,$e){return t.config.mode!=="range"||t.config.enableTime||$e.indexOf(ne)===ce}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Qt(J){J===void 0&&(J=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=et(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=et(t.config.altFormat)),J!==!1&&_t("onValueUpdate")}function qn(J){var X=vn(J),ne=t.prevMonthNav.contains(X),ce=t.nextMonthNav.contains(X);ne||ce?ie(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(J){J.preventDefault();var X=J.type==="keydown",ne=vn(J),ce=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[En(t.amPM.textContent===t.l10n.amPM[0])]);var $e=parseFloat(ce.getAttribute("min")),Ie=parseFloat(ce.getAttribute("max")),Ke=parseFloat(ce.getAttribute("step")),qe=parseInt(ce.value,10),Qe=J.delta||(X?J.which===38?1:-1:0),Re=qe+Ke*Qe;if(typeof ce.value<"u"&&ce.value.length===2){var Ve=ce===t.hourElement,kt=ce===t.minuteElement;Re<$e?(Re=Ie+Re+En(!Ve)+(En(Ve)&&En(!t.amPM)),kt&&$(void 0,-1,t.hourElement)):Re>Ie&&(Re=ce===t.hourElement?Re-Ie-En(!t.amPM):$e,kt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Ke===1?Re+qe===23:Math.abs(Re-qe)>Ke)&&(t.amPM.textContent=t.l10n.amPM[En(t.amPM.textContent===t.l10n.amPM[0])]),ce.value=mn(Re)}}return l(),t}function Sl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function ST(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:f="",element:u=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;jt(()=>{const $=u??h,C=y(d);return C.onReady.push((M,D,I)=>{a===void 0&&S(M,D,I),Xt().then(()=>{t(8,m=!0)})}),t(3,_=Vt($,Object.assign(C,u?{wrap:!0}:{}))),()=>{_.destroy()}});const g=st();function y($={}){$=Object.assign({},$);for(const C of r){const M=(D,I,L)=>{g(wT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(M)):$[C]=[M]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,M){const D=sd(M,$);!od(a,D)&&(a||D)&&t(2,a=D),t(4,f=C)}function T($){ee[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Pe(Pe({},e),Wt($)),t(1,l=Ge(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,f=$.formattedValue),"element"in $&&t(5,u=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(od(a,sd(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,f,u,c,d,m,o,s,T]}class Ba extends _e{constructor(e){super(),he(this,e,ST,vT,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function $T(n){let e,t,i,l,s,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Ba({props:c}),ee.push(()=>ge(s,"value",f)),ee.push(()=>ge(s,"formattedValue",u)),s.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),l=O(),V(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),H(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),z(s,d)}}}function TT(n){let e,t,i,l,s,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Ba({props:c}),ee.push(()=>ge(s,"value",f)),ee.push(()=>ge(s,"formattedValue",u)),s.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),l=O(),V(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),H(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),z(s,d)}}}function CT(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[$T,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[TT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&196613&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&196617&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function OT(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[CT]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&131087&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function MT(n,e,t){var $,C;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function f(M,D){M.detail&&M.detail.length==3&&t(0,s.options[D]=M.detail[1],s)}function u(M){r=M,t(2,r),t(0,s)}function c(M){n.$$.not_equal(s.options.min,M)&&(s.options.min=M,t(0,s))}const d=M=>f(M,"min");function m(M){a=M,t(3,a),t(0,s)}function h(M){n.$$.not_equal(s.options.max,M)&&(s.options.max=M,t(0,s))}const _=M=>f(M,"max");function g(M){s=M,t(0,s)}function y(M){Te.call(this,n,M)}function S(M){Te.call(this,n,M)}function T(M){Te.call(this,n,M)}return n.$$set=M=>{e=Pe(Pe({},e),Wt(M)),t(5,l=Ge(e,i)),"field"in M&&t(0,s=M.field),"key"in M&&t(1,o=M.key)},n.$$.update=()=>{var M,D,I,L;n.$$.dirty&5&&r!=((M=s==null?void 0:s.options)==null?void 0:M.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,f,l,u,c,d,m,h,_,g,y,S,T]}class DT extends _e{constructor(e){super(),he(this,e,MT,OT,me,{field:0,key:1})}}const ET=n=>({}),rd=n=>({});function ad(n,e,t){const i=n.slice();return i[48]=e[t],i}const IT=n=>({}),fd=n=>({});function ud(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function cd(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=O(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&le(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function AT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function LT(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let f={};if(a!==void 0&&a[0]&2049)f=dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&2049?dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function dd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[we(Le.call(null,e,"Clear")),K(e,"click",cn(Be(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,ve(i)}}}function pd(n){let e,t,i,l,s,o;const r=[LT,AT],a=[];function f(c,d){return c[10]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[8])&&dd(n);return{c(){e=b("div"),i.c(),l=O(),u&&u.c(),s=O(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),u&&u.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(se(),A(a[m],1,1,()=>{a[m]=null}),oe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?u?u.p(c,d):(u=dd(c),u.c(),u.m(e,s)):u&&(u.d(1),u=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),u&&u.d()}}}function md(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[FT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),z(e,l)}}}function hd(n){let e,t,i,l,s,o,r,a,f=n[17].length&&_d(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=O(),s=b("input"),o=O(),f&&f.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(t,l),k(t,s),re(s,n[17]),k(t,o),f&&f.m(t,null),s.focus(),r||(a=K(s,"input",n[38]),r=!0)},p(u,c){c[0]&8&&p(s,"placeholder",u[3]),c[0]&131072&&s.value!==u[17]&&re(s,u[17]),u[17].length?f?f.p(u,c):(f=_d(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&v(e),f&&f.d(),r=!1,a()}}}function _d(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",cn(Be(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function gd(n){let e,t=n[1]&&bd(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=bd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function bd(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&le(t,i[1])},d(i){i&&v(e)}}}function NT(n){let e=n[48]+"",t;return{c(){t=W(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&le(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function PT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let f={};if(a!==void 0&&a[0]&4202496)f=dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]);else for(let u=0;u{z(f,1)}),oe()}s?(e=Ot(s,o(r,a)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&4202496?dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function kd(n){let e,t,i,l,s,o,r;const a=[PT,NT],f=[];function u(m,h){return m[12]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=O(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),f[t].m(e,null),k(e,l),s=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=u(n),t===_?f[t].p(n,h):(se(),A(f[_],1,1,()=>{f[_]=null}),oe(),i=f[t],i?i.p(n,h):(i=f[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),f[t].d(),o=!1,ve(r)}}}function FT(n){let e,t,i,l,s,o=n[14]&&hd(n);const r=n[35].beforeOptions,a=vt(r,n,n[44],fd);let f=de(n[22]),u=[];for(let _=0;_A(u[_],1,1,()=>{u[_]=null});let d=null;f.length||(d=gd(n));const m=n[35].afterOptions,h=vt(m,n,n[44],rd);return{c(){o&&o.c(),e=O(),a&&a.c(),t=O(),i=b("div");for(let _=0;_A(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=cd(n));let c=!n[5]&&!n[6]&&md(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),oe()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mSe(pt,Fe))||[]}function Ae(te,Fe){te.preventDefault(),y&&d?Z(Fe):U(Fe)}function He(te,Fe){(te.code==="Enter"||te.code==="Space")&&(Ae(te,Fe),S&&Y())}function Je(){ie(),setTimeout(()=>{const te=N==null?void 0:N.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function tt(te){te.stopPropagation(),!h&&!m&&(R==null||R.toggle())}jt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of te)Fe.addEventListener("click",tt);return()=>{for(const Fe of te)Fe.removeEventListener("click",tt)}});const bt=te=>q(te);function at(te){ee[te?"unshift":"push"](()=>{P=te,t(20,P)})}function Pt(){F=this.value,t(17,F)}const Gt=(te,Fe)=>Ae(Fe,te),Me=(te,Fe)=>He(Fe,te);function Ee(te){ee[te?"unshift":"push"](()=>{R=te,t(18,R)})}function ze(te){Te.call(this,n,te)}function ht(te){ee[te?"unshift":"push"](()=>{N=te,t(19,N)})}return n.$$set=te=>{"id"in te&&t(27,r=te.id),"noOptionsText"in te&&t(1,a=te.noOptionsText),"selectPlaceholder"in te&&t(2,f=te.selectPlaceholder),"searchPlaceholder"in te&&t(3,u=te.searchPlaceholder),"items"in te&&t(28,c=te.items),"multiple"in te&&t(4,d=te.multiple),"disabled"in te&&t(5,m=te.disabled),"readonly"in te&&t(6,h=te.readonly),"upside"in te&&t(7,_=te.upside),"selected"in te&&t(0,g=te.selected),"toggle"in te&&t(8,y=te.toggle),"closable"in te&&t(9,S=te.closable),"labelComponent"in te&&t(10,T=te.labelComponent),"labelComponentProps"in te&&t(11,$=te.labelComponentProps),"optionComponent"in te&&t(12,C=te.optionComponent),"optionComponentProps"in te&&t(13,M=te.optionComponentProps),"searchable"in te&&t(14,D=te.searchable),"searchFunc"in te&&t(29,I=te.searchFunc),"class"in te&&t(15,L=te.class),"$$scope"in te&&t(44,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),ie()),n.$$.dirty[0]&268566528&&t(22,i=be(c,F)),n.$$.dirty[0]&1&&t(21,l=function(te){const Fe=j.toArray(g);return j.inArray(Fe,te)})},[g,a,f,u,d,m,h,_,y,S,T,$,C,M,D,L,q,F,R,N,P,l,i,ie,Ae,He,Je,r,c,I,U,Z,G,B,Y,s,bt,at,Pt,Gt,Me,Ee,ze,ht,o]}class Vb extends _e{constructor(e){super(),he(this,e,jT,RT,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function yd(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function HT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&yd(n);return{c(){s&&s.c(),e=O(),t=b("span"),l=W(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=yd(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function zT(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class vd extends _e{constructor(e){super(),he(this,e,zT,HT,me,{item:0})}}const VT=n=>({}),wd=n=>({});function BT(n){let e;const t=n[8].afterOptions,i=vt(t,n,n[12],wd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&St(i,t,l,l[12],e?wt(t,l[12],s,VT):$t(l[12]),wd)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function UT(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[BT]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&62?dt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ct(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function WT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=vd}=e,{optionComponent:c=vd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const M=j.findByKey(r,d,C);M&&$.push(M)}T.length&&!$.length||t(0,f=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){f=T,t(0,f)}function y(T){Te.call(this,n,T)}function S(T){Te.call(this,n,T)}return n.$$set=T=>{e=Pe(Pe({},e),Wt(T)),t(5,l=Ge(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,f=T.selected),"labelComponent"in T&&t(3,u=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(f)},[f,r,a,u,c,l,m,d,s,g,y,S,o]}class hi extends _e{constructor(e){super(),he(this,e,WT,UT,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function YT(n){let e,t,i,l,s,o;function r(f){n[7](f)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Nl({props:a}),ee.push(()=>ge(t,"value",r)),{c(){e=b("div"),V(t.$$.fragment)},m(f,u){w(f,e,u),H(t,e,null),l=!0,s||(o=we(Le.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(f,u){const c={};u&16384&&(c.id=f[14]),u&32768&&(c.readonly=!f[15]),!i&&u&1&&(i=!0,c.value=f[0].options.values,ke(()=>i=!1)),t.$set(c)},i(f){l||(E(t.$$.fragment,f),l=!0)},o(f){A(t.$$.fragment,f),l=!1},d(f){f&&v(e),z(t),s=!1,o()}}}function KT(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function JT(n){let e,t,i,l,s,o,r,a,f,u;return i=new pe({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[YT,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[KT,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),V(i.$$.fragment),l=O(),s=b("div"),o=O(),V(r.$$.fragment),a=O(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),z(i,c),z(r,c)}}}function Sd(n){let e,t;return e=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[ZT,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function ZT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=O(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=K(s,"input",n[6]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function GT(n){let e,t,i=!n[2]&&Sd(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(se(),A(i,1,1,()=>{i=null}),oe()):i?(i.p(l,s),s&4&&E(i,1)):(i=Sd(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function XT(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[GT],default:[JT,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&18?dt(l,[a&2&&{key:r[1]},a&16&&Ct(r[4])]):{};a&98311&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function QT(n,e,t){var S;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,f=a;function u(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,f=a)}function c(){s.options.maxSelect=lt(this.value),t(0,s),t(5,f),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,f),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,f),t(2,a)}function _(T){Te.call(this,n,T)}function g(T){Te.call(this,n,T)}function y(T){Te.call(this,n,T)}return n.$$set=T=>{e=Pe(Pe({},e),Wt(T)),t(4,l=Ge(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&u()},[s,o,a,r,l,f,c,d,m,h,_,g,y]}class xT extends _e{constructor(e){super(),he(this,e,QT,XT,me,{field:0,key:1})}}function eC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=O(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(u,c){w(u,e,c),k(e,t),k(e,i),w(u,s,c),w(u,o,c),re(o,n[0].options.maxSize),a||(f=K(o,"input",n[4]),a=!0)},p(u,c){c&2048&&l!==(l=u[11])&&p(e,"for",l),c&2048&&r!==(r=u[11])&&p(o,"id",r),c&1&<(o.value)!==u[0].options.maxSize&&re(o,u[0].options.maxSize)},d(u){u&&(v(e),v(s),v(o)),a=!1,f()}}}function tC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function nC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $d(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,U,Z,G,B,Y,ue;return{c(){e=b("div"),t=b("div"),i=b("div"),l=W("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=W(` and `),r=b("code"),r.textContent="multipart/form-data",a=W(` requests, the following normalization rules are applied if the `),f=b("code"),f.textContent="json",u=W(` field is a `),c=b("strong"),c.textContent="plain string",d=W(`: `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",_=O(),g=b("li"),g.innerHTML=""false" is converted to the json false",y=O(),S=b("li"),S.innerHTML=""null" is converted to the json null",T=O(),$=b("li"),$.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",C=O(),M=b("li"),I=W(D),L=W(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',F=O(),N=b("li"),N.textContent="numeric strings are converted to json number",P=O(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",U=O(),Z=b("li"),Z.textContent="any other string (empty string too) is double quoted",G=W(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),B=b("code"),B.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ie,be){w(ie,e,be),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,M),k(M,I),k(M,L),k(M,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,U),k(m,Z),k(i,G),k(i,B),ue=!0},i(ie){ue||(ie&&Ye(()=>{ue&&(Y||(Y=Ne(e,xe,{duration:150},!0)),Y.run(1))}),ue=!0)},o(ie){ie&&(Y||(Y=Ne(e,xe,{duration:150},!1)),Y.run(0)),ue=!1},d(ie){ie&&v(e),ie&&Y&&Y.end()}}}function eC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new pe({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[XT,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?xT:QT}let m=d(n),h=m(n),_=n[2]&&wd();return{c(){V(e.$$.fragment),t=O(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=O(),h.c(),r=O(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){H(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=K(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=wd(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(se(),A(_,1,1,()=>{_=null}),oe())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),z(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function tC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[eC]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&10?dt(l,[a&2&&{key:r[1]},a&8&&Ct(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function nC(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=lt(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Te.call(this,n,_)}function m(_){Te.call(this,n,_)}function h(_){Te.call(this,n,_)}return n.$$set=_=>{e=Pe(Pe({},e),Wt(_)),t(3,l=Ge(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class iC extends _e{constructor(e){super(),he(this,e,nC,tC,me,{field:0,key:1})}}function lC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=O(),s=b("small"),r=W(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),w(a,s,f),k(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),f&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function sC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Sd extends _e{constructor(e){super(),he(this,e,sC,lC,me,{item:0})}}const oC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function rC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function aC(n){let e,t,i,l,s,o;return i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[rC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),V(i.$$.fragment),l=O(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const f={};a&16777216&&(f.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),z(i,r)}}}function fC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=O(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=O(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=O(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[K(e,"click",n[9]),K(i,"click",n[10]),K(s,"click",n[11]),K(r,"click",n[12])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,ve(f)}}}function uC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;function $(M){n[8](M)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Sd,optionComponent:Sd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new hi({props:C}),ee.push(()=>ge(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[fC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=O(),h=b("i"),_=O(),V(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(M,D){w(M,e,D),k(e,t),k(e,i),k(e,l),w(M,o,D),H(r,M,D),w(M,f,D),w(M,u,D),k(u,c),k(c,d),k(c,m),k(c,h),k(c,_),H(g,c,null),y=!0,S||(T=we(Le.call(null,l,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,D){(!y||D&8388608&&s!==(s=M[23]))&&p(e,"for",s);const I={};D&8388608&&(I.id=M[23]),D&8&&(I.items=M[3]),!a&&D&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};D&33554433&&(L.$$scope={dirty:D,ctx:M}),g.$set(L)},i(M){y||(E(r.$$.fragment,M),E(g.$$.fragment,M),y=!0)},o(M){A(r.$$.fragment,M),A(g.$$.fragment,M),y=!1},d(M){M&&(v(e),v(o),v(f),v(u)),z(r,M),z(g),S=!1,T()}}}function cC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + data inside an object, eg.`),B=b("code"),B.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ie,be){w(ie,e,be),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,M),k(M,I),k(M,L),k(M,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,U),k(m,Z),k(i,G),k(i,B),ue=!0},i(ie){ue||(ie&&Ye(()=>{ue&&(Y||(Y=Ne(e,xe,{duration:150},!0)),Y.run(1))}),ue=!0)},o(ie){ie&&(Y||(Y=Ne(e,xe,{duration:150},!1)),Y.run(0)),ue=!1},d(ie){ie&&v(e),ie&&Y&&Y.end()}}}function iC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new pe({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[eC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?nC:tC}let m=d(n),h=m(n),_=n[2]&&$d();return{c(){V(e.$$.fragment),t=O(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=O(),h.c(),r=O(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){H(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=K(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=$d(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(se(),A(_,1,1,()=>{_=null}),oe())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),z(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function lC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[iC]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&10?dt(l,[a&2&&{key:r[1]},a&8&&Ct(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function sC(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=lt(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Te.call(this,n,_)}function m(_){Te.call(this,n,_)}function h(_){Te.call(this,n,_)}return n.$$set=_=>{e=Pe(Pe({},e),Wt(_)),t(3,l=Ge(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class oC extends _e{constructor(e){super(),he(this,e,sC,lC,me,{field:0,key:1})}}function rC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=O(),s=b("small"),r=W(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),w(a,s,f),k(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),f&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function aC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Td extends _e{constructor(e){super(),he(this,e,aC,rC,me,{item:0})}}const fC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function uC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function cC(n){let e,t,i,l,s,o;return i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[uC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),V(i.$$.fragment),l=O(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const f={};a&16777216&&(f.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),z(i,r)}}}function dC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=O(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=O(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=O(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[K(e,"click",n[9]),K(i,"click",n[10]),K(s,"click",n[11]),K(r,"click",n[12])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,ve(f)}}}function pC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;function $(M){n[8](M)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Td,optionComponent:Td};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new hi({props:C}),ee.push(()=>ge(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[dC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=O(),h=b("i"),_=O(),V(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(M,D){w(M,e,D),k(e,t),k(e,i),k(e,l),w(M,o,D),H(r,M,D),w(M,f,D),w(M,u,D),k(u,c),k(c,d),k(c,m),k(c,h),k(c,_),H(g,c,null),y=!0,S||(T=we(Le.call(null,l,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,D){(!y||D&8388608&&s!==(s=M[23]))&&p(e,"for",s);const I={};D&8388608&&(I.id=M[23]),D&8&&(I.items=M[3]),!a&&D&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};D&33554433&&(L.$$scope={dirty:D,ctx:M}),g.$set(L)},i(M){y||(E(r.$$.fragment,M),E(g.$$.fragment,M),y=!0)},o(M){A(r.$$.fragment,M),A(g.$$.fragment,M),y=!1},d(M){M&&(v(e),v(o),v(f),v(u)),z(r,M),z(g),S=!1,T()}}}function mC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function dC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C;function M(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Nl({props:D}),ee.push(()=>ge(r,"value",M)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[cC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),g=b("i"),y=O(),V(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),H(r,I,L),w(I,f,L),w(I,u,L),k(u,c),k(u,d),k(u,m),k(m,h),k(m,_),k(m,g),k(m,y),H(S,m,null),T=!0,$||(C=we(Le.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(f),v(u)),z(r,I),z(S),$=!1,C()}}}function pC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Max file size"),l=O(),s=b("input"),r=O(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[14]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&<(s.value)!==c[0].options.maxSize&&re(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function $d(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[mC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function mC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=K(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function hC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[uC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[dC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[pC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&$d(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),a=O(),f=b("div"),V(u.$$.fragment),d=O(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(f,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,a),k(e,f),H(u,f,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),_[2]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(_,g),g&4&&E(h,1)):(h=$d(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(u.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(u.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),z(i),z(o),z(u),h&&h.d()}}}function _C(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Protected",r=O(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),f||(u=K(e,"change",n[7]),f=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),f=!1,u()}}}function gC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[_C,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function bC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[gC],options:[hC],default:[aC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&50331663&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function kC(n,e,t){var F;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=oC.slice(),f=((F=s.options)==null?void 0:F.maxSelect)<=1,u=f;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,f=!0),t(6,u=f)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,u),t(2,f)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,u),t(2,f))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,u),t(2,f))}function $(){s.options.maxSize=lt(this.value),t(0,s),t(6,u),t(2,f)}function C(){s.options.maxSelect=lt(this.value),t(0,s),t(6,u),t(2,f)}function M(N){f=N,t(2,f)}function D(N){s=N,t(0,s),t(6,u),t(2,f)}function I(N){Te.call(this,n,N)}function L(N){Te.call(this,n,N)}function R(N){Te.call(this,n,N)}return n.$$set=N=>{e=Pe(Pe({},e),Wt(N)),t(5,l=Ge(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,f,a,r,l,u,m,h,_,g,y,S,T,$,C,M,D,I,L,R]}class yC extends _e{constructor(e){super(),he(this,e,kC,bC,me,{field:0,key:1})}}function vC(n){let e,t,i,l,s;return{c(){e=b("hr"),t=O(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function wC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[vC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function SC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function $C(n){let e,t,i,l,s,o,r,a,f,u;return i=new pe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[wC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[SC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),V(i.$$.fragment),l=O(),s=b("div"),o=O(),V(r.$$.fragment),a=O(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),z(i,c),z(r,c)}}}function Td(n){let e,t,i,l,s,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[TC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[CC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=O(),l=b("div"),V(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,l,a),H(s,l,null),o=!0},p(r,a){const f={};a&2&&(f.name="schema."+r[1]+".options.minSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a&2&&(u.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),z(t),z(s)}}}function TC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min select"),l=O(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minSelect),r||(a=K(s,"input",n[11]),r=!0)},p(f,u){u&16777216&&i!==(i=f[24])&&p(e,"for",i),u&16777216&&o!==(o=f[24])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.minSelect&&re(s,f[0].options.minSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max select"),l=O(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.maxSelect),a||(f=K(s,"input",n[12]),a=!0)},p(u,c){c&16777216&&i!==(i=u[24])&&p(e,"for",i),c&16777216&&o!==(o=u[24])&&p(s,"id",o),c&1&&r!==(r=u[0].options.minSelect||2)&&p(s,"min",r),c&1&<(s.value)!==u[0].options.maxSelect&&re(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function OC(n){let e,t,i,l,s,o,r,a,f,u,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new hi({props:h}),ee.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=O(),l=b("i"),r=O(),V(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),H(a,_,g),u=!0,c||(d=we(s=Le.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + (eg. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function hC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C;function M(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Nl({props:D}),ee.push(()=>ge(r,"value",M)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[mC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),g=b("i"),y=O(),V(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),H(r,I,L),w(I,f,L),w(I,u,L),k(u,c),k(u,d),k(u,m),k(m,h),k(m,_),k(m,g),k(m,y),H(S,m,null),T=!0,$||(C=we(Le.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(f),v(u)),z(r,I),z(S),$=!1,C()}}}function _C(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Max file size"),l=O(),s=b("input"),r=O(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[14]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&<(s.value)!==c[0].options.maxSize&&re(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Cd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[gC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function gC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=K(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function bC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[pC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[hC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[_C,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Cd(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),a=O(),f=b("div"),V(u.$$.fragment),d=O(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(f,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,a),k(e,f),H(u,f,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),_[2]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(_,g),g&4&&E(h,1)):(h=Cd(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(u.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(u.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),z(i),z(o),z(u),h&&h.d()}}}function kC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Protected",r=O(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),f||(u=K(e,"change",n[7]),f=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),f=!1,u()}}}function yC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[kC,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function vC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[yC],options:[bC],default:[cC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const f=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&50331663&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function wC(n,e,t){var F;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=fC.slice(),f=((F=s.options)==null?void 0:F.maxSelect)<=1,u=f;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,f=!0),t(6,u=f)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,u),t(2,f)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,u),t(2,f))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,u),t(2,f))}function $(){s.options.maxSize=lt(this.value),t(0,s),t(6,u),t(2,f)}function C(){s.options.maxSelect=lt(this.value),t(0,s),t(6,u),t(2,f)}function M(N){f=N,t(2,f)}function D(N){s=N,t(0,s),t(6,u),t(2,f)}function I(N){Te.call(this,n,N)}function L(N){Te.call(this,n,N)}function R(N){Te.call(this,n,N)}return n.$$set=N=>{e=Pe(Pe({},e),Wt(N)),t(5,l=Ge(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,f,a,r,l,u,m,h,_,g,y,S,T,$,C,M,D,I,L,R]}class SC extends _e{constructor(e){super(),he(this,e,wC,vC,me,{field:0,key:1})}}function $C(n){let e,t,i,l,s;return{c(){e=b("hr"),t=O(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function TC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[$C]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function CC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function OC(n){let e,t,i,l,s,o,r,a,f,u;return i=new pe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[TC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[CC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),V(i.$$.fragment),l=O(),s=b("div"),o=O(),V(r.$$.fragment),a=O(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),z(i,c),z(r,c)}}}function Od(n){let e,t,i,l,s,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[MC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[DC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=O(),l=b("div"),V(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,l,a),H(s,l,null),o=!0},p(r,a){const f={};a&2&&(f.name="schema."+r[1]+".options.minSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a&2&&(u.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),z(t),z(s)}}}function MC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min select"),l=O(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minSelect),r||(a=K(s,"input",n[11]),r=!0)},p(f,u){u&16777216&&i!==(i=f[24])&&p(e,"for",i),u&16777216&&o!==(o=f[24])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.minSelect&&re(s,f[0].options.minSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function DC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Max select"),l=O(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.maxSelect),a||(f=K(s,"input",n[12]),a=!0)},p(u,c){c&16777216&&i!==(i=u[24])&&p(e,"for",i),c&16777216&&o!==(o=u[24])&&p(s,"id",o),c&1&&r!==(r=u[0].options.minSelect||2)&&p(s,"min",r),c&1&<(s.value)!==u[0].options.maxSelect&&re(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function EC(n){let e,t,i,l,s,o,r,a,f,u,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new hi({props:h}),ee.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=O(),l=b("i"),r=O(),V(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),H(a,_,g),u=!0,c||(d=we(s=Le.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"})),c=!0)},p(_,g){var S,T;s&&Tt(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=_[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!f&&g&1&&(f=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>f=!1)),a.$set(y)},i(_){u||(E(a.$$.fragment,_),u=!0)},o(_){A(a.$$.fragment,_),u=!1},d(_){_&&(v(e),v(r)),z(a,_),c=!1,d()}}}function MC(n){let e,t,i,l,s,o=!n[2]&&Td(n);return l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[OC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=O(),i=b("div"),V(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),H(l,i,null),s=!0},p(r,a){r[2]?o&&(se(),A(o,1,1,()=>{o=null}),oe()):o?(o.p(r,a),a&4&&E(o,1)):(o=Td(r),o.c(),E(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),z(l)}}}function DC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[MC],default:[$C,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;uge(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Va({props:f}),n[21](l),l.$on("save",n[22]),{c(){V(e.$$.fragment),i=O(),V(l.$$.fragment)},m(u,c){H(e,u,c),w(u,i,c),H(l,u,c),s=!0},p(u,[c]){const d=c&258?dt(o,[c&2&&{key:u[1]},c&256&&Ct(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(E(e.$$.fragment,u),E(l.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),A(l.$$.fragment,u),s=!1},d(u){u&&v(i),z(e,u),n[21](null),z(l,u)}}}function EC(n,e,t){var N;let i,l;const s=["field","key"];let o=Ge(e,s),r;Ue(n,Fn,P=>t(10,r=P));let{field:a}=e,{key:f=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=lt(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=lt(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function M(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Te.call(this,n,P)}function I(P){Te.call(this,n,P)}function L(P){Te.call(this,n,P)}function R(P){ee[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,U;(U=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&U.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Pe(Pe({},e),Wt(P)),t(8,o=Ge(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,f=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,y,S,T,$,C,M,D,I,L,R,F]}class IC extends _e{constructor(e){super(),he(this,e,EC,DC,me,{field:0,key:1})}}const AC=n=>({dragging:n&4,dragover:n&8}),Cd=n=>({dragging:n[2],dragover:n[3]});function LC(n){let e,t,i,l,s;const o=n[10].default,r=vt(o,n,n[9],Cd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Be(n[11])),K(e,"dragleave",Be(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&St(r,o,a,a[9],i?wt(o,a[9],f,AC):$t(a[9]),Cd),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&x(e,"dragging",a[2]),(!i||f&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,ve(s)}}}function NC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:f=!1}=e,{dragHandleClass:u=""}=e,c=!1,d=!1;function m($,C){if(!(!$||f)){if(u&&!$.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||f)return;$.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const D=M.index<<0;D{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,f=$.disabled),"dragHandleClass"in $&&t(8,u=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,f,c,d,m,h,r,a,u,l,i,_,g,y,S,T]}class Os extends _e{constructor(e){super(),he(this,e,NC,LC,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Od(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Md(n){let e,t,i,l,s,o,r,a;return{c(){e=W(`, +`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!f&&g&1&&(f=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>f=!1)),a.$set(y)},i(_){u||(E(a.$$.fragment,_),u=!0)},o(_){A(a.$$.fragment,_),u=!1},d(_){_&&(v(e),v(r)),z(a,_),c=!1,d()}}}function IC(n){let e,t,i,l,s,o=!n[2]&&Od(n);return l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[EC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=O(),i=b("div"),V(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),H(l,i,null),s=!0},p(r,a){r[2]?o&&(se(),A(o,1,1,()=>{o=null}),oe()):o?(o.p(r,a),a&4&&E(o,1)):(o=Od(r),o.c(),E(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),z(l)}}}function AC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[IC],default:[OC,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;uge(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Ua({props:f}),n[21](l),l.$on("save",n[22]),{c(){V(e.$$.fragment),i=O(),V(l.$$.fragment)},m(u,c){H(e,u,c),w(u,i,c),H(l,u,c),s=!0},p(u,[c]){const d=c&258?dt(o,[c&2&&{key:u[1]},c&256&&Ct(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(E(e.$$.fragment,u),E(l.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),A(l.$$.fragment,u),s=!1},d(u){u&&v(i),z(e,u),n[21](null),z(l,u)}}}function LC(n,e,t){var N;let i,l;const s=["field","key"];let o=Ge(e,s),r;Ue(n,Fn,P=>t(10,r=P));let{field:a}=e,{key:f=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=lt(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=lt(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function M(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Te.call(this,n,P)}function I(P){Te.call(this,n,P)}function L(P){Te.call(this,n,P)}function R(P){ee[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,U;(U=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&U.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Pe(Pe({},e),Wt(P)),t(8,o=Ge(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,f=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,y,S,T,$,C,M,D,I,L,R,F]}class NC extends _e{constructor(e){super(),he(this,e,LC,AC,me,{field:0,key:1})}}const PC=n=>({dragging:n&4,dragover:n&8}),Md=n=>({dragging:n[2],dragover:n[3]});function FC(n){let e,t,i,l,s;const o=n[10].default,r=vt(o,n,n[9],Md);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Be(n[11])),K(e,"dragleave",Be(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&St(r,o,a,a[9],i?wt(o,a[9],f,PC):$t(a[9]),Md),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&x(e,"dragging",a[2]),(!i||f&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,ve(s)}}}function RC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:f=!1}=e,{dragHandleClass:u=""}=e,c=!1,d=!1;function m($,C){if(!(!$||f)){if(u&&!$.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||f)return;$.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const D=M.index<<0;D{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,f=$.disabled),"dragHandleClass"in $&&t(8,u=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,f,c,d,m,h,r,a,u,l,i,_,g,y,S,T]}class Ms extends _e{constructor(e){super(),he(this,e,RC,FC,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Dd(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Ed(n){let e,t,i,l,s,o,r,a;return{c(){e=W(`, `),t=b("code"),t.textContent="username",i=W(` , `),l=b("code"),l.textContent="email",s=W(` , `),o=b("code"),o.textContent="emailVisibility",r=W(` , - `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),w(f,l,u),w(f,s,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function PC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Ot(a,f(n)),ee.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&V(e.$$.fragment),i=O()},m(u,c){e&&H(e,u,c),w(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){se();const d=e;A(d.$$.fragment,1,0,()=>{z(d,1)}),oe()}a?(e=Ot(a,f(n)),ee.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(u){l||(e&&E(e.$$.fragment,u),l=!0)},o(u){e&&A(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&z(e,u)}}}function Dd(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[PC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Os({props:r}),ee.push(()=>ge(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function FC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C,M,D=n[0].type==="auth"&&Md(),I=de(n[0].schema);const L=N=>N[19];for(let N=0;Nge($,"collection",R)),{c(){e=b("div"),t=b("p"),i=W(`System fields: + `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),w(f,l,u),w(f,s,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function qC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Ot(a,f(n)),ee.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&V(e.$$.fragment),i=O()},m(u,c){e&&H(e,u,c),w(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){se();const d=e;A(d.$$.fragment,1,0,()=>{z(d,1)}),oe()}a?(e=Ot(a,f(n)),ee.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(u){l||(e&&E(e.$$.fragment,u),l=!0)},o(u){e&&A(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&z(e,u)}}}function Id(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[qC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Ms({props:r}),ee.push(()=>ge(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function jC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C,M,D=n[0].type==="auth"&&Ed(),I=de(n[0].schema);const L=N=>N[19];for(let N=0;Nge($,"collection",R)),{c(){e=b("div"),t=b("p"),i=W(`System fields: `),l=b("code"),l.textContent="id",s=W(` , `),o=b("code"),o.textContent="created",r=W(` , `),a=b("code"),a.textContent="updated",f=O(),D&&D.c(),u=W(` - .`),c=O(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!M){for(let P=0;PI.name===M))}function c(M){return i.findIndex(D=>D===M)}function d(M,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||M===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==M&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,M,D)),l)}function m(M,D,I,L){I[L]=M,t(0,l)}const h=M=>o(M),_=M=>r(M),g=M=>d(M.detail.oldName,M.detail.newName);function y(M){n.$$.not_equal(l.schema,M)&&(l.schema=M,t(0,l))}const S=M=>{if(!M.detail)return;const D=M.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),M.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=M=>a(M.detail);function C(M){l=M,t(0,l)}return n.$$set=M=>{"collection"in M&&t(0,l=M.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(M=>!M.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class qC extends _e{constructor(e){super(),he(this,e,RC,FC,me,{collection:0})}}const jC=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]}),HC=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),zC=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]});function VC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[UC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function BC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ld(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Nd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function UC(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=vt(T,n,n[15],Ad),C=n[12].afterLabel,M=vt(C,n,n[15],Id);let D=!n[9]&&Ld(n);function I(q){n[14](q)}var L=n[7];function R(q,U){let Z={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(Z.value=q[0]),{props:Z}}L&&(m=Ot(L,R(n)),n[13](m),ee.push(()=>ge(m,"value",I)));let F=n[9]&&Nd(n);const N=n[12].default,P=vt(N,n,n[15],Ed);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=O(),l=b("span"),s=W(n[2]),o=O(),a=W(r),f=O(),M&&M.c(),u=O(),D&&D.c(),d=O(),m&&V(m.$$.fragment),_=O(),F&&F.c(),g=O(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,U){w(q,e,U),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),M&&M.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&H(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,U),w(q,y,U),P&&P.m(y,null),S=!0},p(q,U){if($&&$.p&&(!S||U&33280)&&St($,T,q,q[15],S?wt(T,q[15],U,zC):$t(q[15]),Ad),(!S||U&4)&&le(s,q[2]),(!S||U&512)&&r!==(r=q[9]?"- Admins only":"")&&le(a,r),(!S||U&512)&&x(l,"txt-hint",q[9]),M&&M.p&&(!S||U&33280)&&St(M,C,q,q[15],S?wt(C,q[15],U,HC):$t(q[15]),Id),q[9]?D&&(D.d(1),D=null):D?D.p(q,U):(D=Ld(q),D.c(),D.m(t,null)),(!S||U&262144&&c!==(c=q[18]))&&p(t,"for",c),U&128&&L!==(L=q[7])){if(m){se();const Z=m;A(Z.$$.fragment,1,0,()=>{z(Z,1)}),oe()}L?(m=Ot(L,R(q)),q[13](m),ee.push(()=>ge(m,"value",I)),V(m.$$.fragment),E(m.$$.fragment,1),H(m,e,_)):m=null}else if(L){const Z={};U&262144&&(Z.id=q[18]),U&2&&(Z.baseCollection=q[1]),U&512&&(Z.disabled=q[9]),U&544&&(Z.placeholder=q[9]?"":q[5]),!h&&U&1&&(h=!0,Z.value=q[0],ke(()=>h=!1)),m.$set(Z)}q[9]?F?(F.p(q,U),U&512&&E(F,1)):(F=Nd(q),F.c(),E(F,1),F.m(e,null)):F&&(se(),A(F,1,1,()=>{F=null}),oe()),P&&P.p&&(!S||U&33280)&&St(P,N,q,q[15],S?wt(N,q[15],U,jC):$t(q[15]),Ed)},i(q){S||(E($,q),E(M,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(M,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),M&&M.d(q),D&&D.d(),n[13](null),m&&z(m),F&&F.d(),P&&P.d(q)}}}function WC(n){let e,t,i,l;const s=[BC,VC],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Pd;function YC(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=Pd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await nt(()=>import("./FilterAutocompleteInput-OZtUpY4v.js"),__vite__mapDeps([0,1]),import.meta.url)).default),Pd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Xt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class $l extends _e{constructor(e){super(),he(this,e,YC,WC,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Fd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Rd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L=de(n[2]),R=[];for(let F=0;F@request
    filter:",c=O(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=O(),h=b("hr"),_=O(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=O(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=O(),$=b("hr"),C=O(),M=b("p"),M.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Ne(e,xe,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Ne(e,xe,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),rt(R,F),F&&D&&D.end()}}}function qd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&le(i,t)},d(l){l&&v(e)}}}function jd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[KC,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $l({props:c}),ee.push(()=>ge(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new $l({props:m}),ee.push(()=>ge(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new $l({props:_}),ee.push(()=>ge(r,"rule",h)),{c(){V(e.$$.fragment),i=O(),V(l.$$.fragment),o=O(),V(r.$$.fragment)},m(g,y){H(e,g,y),w(g,i,y),H(l,g,y),w(g,o,y),H(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),z(e,g),z(l,g),z(r,g)}}}function Hd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function KC(n){let e,t=!n[10]&&Hd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Hd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function zd(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[JC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new $l({props:s}),ee.push(()=>ge(e,"rule",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function JC(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. + .`),c=O(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!M){for(let P=0;PI.name===M))}function c(M){return i.findIndex(D=>D===M)}function d(M,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||M===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==M&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,M,D)),l)}function m(M,D,I,L){I[L]=M,t(0,l)}const h=M=>o(M),_=M=>r(M),g=M=>d(M.detail.oldName,M.detail.newName);function y(M){n.$$.not_equal(l.schema,M)&&(l.schema=M,t(0,l))}const S=M=>{if(!M.detail)return;const D=M.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),M.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=M=>a(M.detail);function C(M){l=M,t(0,l)}return n.$$set=M=>{"collection"in M&&t(0,l=M.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(M=>!M.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class zC extends _e{constructor(e){super(),he(this,e,HC,jC,me,{collection:0})}}const VC=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),BC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),UC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]});function WC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[KC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function YC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Pd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Fd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function KC(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=vt(T,n,n[15],Nd),C=n[12].afterLabel,M=vt(C,n,n[15],Ld);let D=!n[9]&&Pd(n);function I(q){n[14](q)}var L=n[7];function R(q,U){let Z={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(Z.value=q[0]),{props:Z}}L&&(m=Ot(L,R(n)),n[13](m),ee.push(()=>ge(m,"value",I)));let F=n[9]&&Fd(n);const N=n[12].default,P=vt(N,n,n[15],Ad);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=O(),l=b("span"),s=W(n[2]),o=O(),a=W(r),f=O(),M&&M.c(),u=O(),D&&D.c(),d=O(),m&&V(m.$$.fragment),_=O(),F&&F.c(),g=O(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,U){w(q,e,U),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),M&&M.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&H(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,U),w(q,y,U),P&&P.m(y,null),S=!0},p(q,U){if($&&$.p&&(!S||U&33280)&&St($,T,q,q[15],S?wt(T,q[15],U,UC):$t(q[15]),Nd),(!S||U&4)&&le(s,q[2]),(!S||U&512)&&r!==(r=q[9]?"- Admins only":"")&&le(a,r),(!S||U&512)&&x(l,"txt-hint",q[9]),M&&M.p&&(!S||U&33280)&&St(M,C,q,q[15],S?wt(C,q[15],U,BC):$t(q[15]),Ld),q[9]?D&&(D.d(1),D=null):D?D.p(q,U):(D=Pd(q),D.c(),D.m(t,null)),(!S||U&262144&&c!==(c=q[18]))&&p(t,"for",c),U&128&&L!==(L=q[7])){if(m){se();const Z=m;A(Z.$$.fragment,1,0,()=>{z(Z,1)}),oe()}L?(m=Ot(L,R(q)),q[13](m),ee.push(()=>ge(m,"value",I)),V(m.$$.fragment),E(m.$$.fragment,1),H(m,e,_)):m=null}else if(L){const Z={};U&262144&&(Z.id=q[18]),U&2&&(Z.baseCollection=q[1]),U&512&&(Z.disabled=q[9]),U&544&&(Z.placeholder=q[9]?"":q[5]),!h&&U&1&&(h=!0,Z.value=q[0],ke(()=>h=!1)),m.$set(Z)}q[9]?F?(F.p(q,U),U&512&&E(F,1)):(F=Fd(q),F.c(),E(F,1),F.m(e,null)):F&&(se(),A(F,1,1,()=>{F=null}),oe()),P&&P.p&&(!S||U&33280)&&St(P,N,q,q[15],S?wt(N,q[15],U,VC):$t(q[15]),Ad)},i(q){S||(E($,q),E(M,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(M,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),M&&M.d(q),D&&D.d(),n[13](null),m&&z(m),F&&F.d(),P&&P.d(q)}}}function JC(n){let e,t,i,l;const s=[YC,WC],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Rd;function ZC(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=Rd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await nt(()=>import("./FilterAutocompleteInput-YLbqIy3c.js"),__vite__mapDeps([0,1]),import.meta.url)).default),Rd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Xt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class $l extends _e{constructor(e){super(),he(this,e,ZC,JC,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function qd(n,e,t){const i=n.slice();return i[11]=e[t],i}function jd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L=de(n[2]),R=[];for(let F=0;F@request filter:",c=O(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=O(),h=b("hr"),_=O(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=O(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=O(),$=b("hr"),C=O(),M=b("p"),M.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Ne(e,xe,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Ne(e,xe,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),rt(R,F),F&&D&&D.end()}}}function Hd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&le(i,t)},d(l){l&&v(e)}}}function zd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[GC,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $l({props:c}),ee.push(()=>ge(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new $l({props:m}),ee.push(()=>ge(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new $l({props:_}),ee.push(()=>ge(r,"rule",h)),{c(){V(e.$$.fragment),i=O(),V(l.$$.fragment),o=O(),V(r.$$.fragment)},m(g,y){H(e,g,y),w(g,i,y),H(l,g,y),w(g,o,y),H(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),z(e,g),z(l,g),z(r,g)}}}function Vd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function GC(n){let e,t=!n[10]&&Vd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Vd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Bd(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[XC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new $l({props:s}),ee.push(()=>ge(e,"rule",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function XC(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified - state or email, etc.`,t=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function ZC(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&Rd(n);function M(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new $l({props:D}),ee.push(()=>ge(u,"rule",M));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),ee.push(()=>ge(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&jd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&zd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + state or email, etc.`,t=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function QC(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&jd(n);function M(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new $l({props:D}),ee.push(()=>ge(u,"rule",M));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),ee.push(()=>ge(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&zd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Bd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,l=O(),s=b("button"),r=W(o),a=O(),C&&C.c(),f=O(),V(u.$$.fragment),d=O(),V(m.$$.fragment),_=O(),R&&R.c(),g=O(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,U){w(q,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,f,U),H(u,q,U),w(q,d,U),H(m,q,U),w(q,_,U),R&&R.m(q,U),w(q,g,U),F&&F.m(q,U),w(q,y,U),S=!0,T||($=K(s,"click",n[3]),T=!0)},p(q,[U]){var B,Y;(!S||U&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&le(r,o),q[1]?C?(C.p(q,U),U&2&&E(C,1)):(C=Rd(q),C.c(),E(C,1),C.m(e,null)):C&&(se(),A(C,1,1,()=>{C=null}),oe());const Z={};U&1&&(Z.collection=q[0]),!c&&U&1&&(c=!0,Z.rule=q[0].listRule,ke(()=>c=!1)),u.$set(Z);const G={};U&1&&(G.collection=q[0]),!h&&U&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((B=q[0])==null?void 0:B.type)!=="view"?R?(R.p(q,U),U&1&&E(R,1)):(R=jd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(se(),A(R,1,1,()=>{R=null}),oe()),((Y=q[0])==null?void 0:Y.type)==="auth"?F?(F.p(q,U),U&1&&E(F,1)):(F=zd(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(se(),A(F,1,1,()=>{F=null}),oe())},i(q){S||(E(C),E(u.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(u.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),z(u,q),z(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function GC(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class XC extends _e{constructor(e){super(),he(this,e,GC,ZC,me,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[9]=e[t],i}function QC(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),e.$on("change",a[6]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function xC(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Bd(n){let e,t,i=de(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. + .`,l=O(),s=b("button"),r=W(o),a=O(),C&&C.c(),f=O(),V(u.$$.fragment),d=O(),V(m.$$.fragment),_=O(),R&&R.c(),g=O(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,U){w(q,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,f,U),H(u,q,U),w(q,d,U),H(m,q,U),w(q,_,U),R&&R.m(q,U),w(q,g,U),F&&F.m(q,U),w(q,y,U),S=!0,T||($=K(s,"click",n[3]),T=!0)},p(q,[U]){var B,Y;(!S||U&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&le(r,o),q[1]?C?(C.p(q,U),U&2&&E(C,1)):(C=jd(q),C.c(),E(C,1),C.m(e,null)):C&&(se(),A(C,1,1,()=>{C=null}),oe());const Z={};U&1&&(Z.collection=q[0]),!c&&U&1&&(c=!0,Z.rule=q[0].listRule,ke(()=>c=!1)),u.$set(Z);const G={};U&1&&(G.collection=q[0]),!h&&U&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((B=q[0])==null?void 0:B.type)!=="view"?R?(R.p(q,U),U&1&&E(R,1)):(R=zd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(se(),A(R,1,1,()=>{R=null}),oe()),((Y=q[0])==null?void 0:Y.type)==="auth"?F?(F.p(q,U),U&1&&E(F,1)):(F=Bd(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(se(),A(F,1,1,()=>{F=null}),oe())},i(q){S||(E(C),E(u.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(u.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),z(u,q),z(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function xC(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class e5 extends _e{constructor(e){super(),he(this,e,xC,QC,me,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function t5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),e.$on("change",a[6]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function n5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Wd(n){let e,t,i=de(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,f=O(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(se(),A(m[S],1,1,()=>{m[S]=null}),oe(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Bd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function t5(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[e5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function n5(n,e,t){let i;Ue(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}jt(async()=>{t(2,o=!0);try{t(1,s=(await nt(()=>import("./CodeEditor-AgADv186.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&ii("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class i5 extends _e{constructor(e){super(),he(this,e,n5,t5,me,{collection:0})}}const l5=n=>({active:n&1}),Wd=n=>({active:n[0]});function Yd(n){let e,t,i;const l=n[15].default,s=vt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&St(s,l,o,o[14],i?wt(l,o[14],r,null):$t(o[14]),null)},i(o){i||(E(s,o),o&&Ye(()=>{i&&(t||(t=Ne(e,xe,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Ne(e,xe,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function s5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=vt(a,n,n[14],Wd);let u=n[0]&&Yd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=O(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Be(n[17])),K(t,"drop",Be(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&St(f,a,c,c[14],s?wt(a,c[14],d,l5):$t(c[14]),Wd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Yd(c),u.c(),E(u,1),u.m(e,null)):u&&(se(),A(u,1,1,()=>{u=null}),oe()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,ve(r)}}}function o5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}jt(()=>()=>clearTimeout(r));function T(R){Te.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},M=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,M,D,I,L]}class po extends _e{constructor(e){super(),he(this,e,o5,s5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function r5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function a5(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[r5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function f5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function u5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function c5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?u5:f5}let a=r(n),f=a(n),u=n[3]&&Kd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=O(),i=b("div"),l=O(),f.c(),s=O(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Kd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function d5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Jd(n){let e,t,i,l,s,o,r,a;return i=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[p5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[m5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ye(()=>{a&&(r||(r=Ne(e,xe,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Ne(e,xe,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),z(i),z(o),f&&r&&r.end()}}}function p5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function m5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function h5(n){let e,t,i,l;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[d5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Jd(n);return{c(){V(e.$$.fragment),t=O(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Jd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),z(e,o),s&&s.d(o)}}}function _5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Zd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function b5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?g5:_5}let a=r(n),f=a(n),u=n[2]&&Zd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=O(),i=b("div"),l=O(),f.c(),s=O(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Zd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Gd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ye(()=>{i&&(t||(t=Ne(e,xe,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,xe,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function y5(n){let e,t,i,l;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[k5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&Gd();return{c(){V(e.$$.fragment),t=O(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=Gd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),z(e,o),s&&s.d(o)}}}function v5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Xd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?w5:v5}let a=r(n),f=a(n),u=n[1]&&Xd();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=O(),i=b("div"),l=O(),f.c(),s=O(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=Xd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function $5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Minimum password length"),l=O(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=K(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function T5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[11]),we(Le.call(null,r,{text:`The constraint is applied only for new records. -Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function C5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[12]),we(Le.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` -`),position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function O5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;return l=new po({props:{single:!0,$$slots:{header:[c5],default:[a5]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[b5],default:[h5]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[S5],default:[y5]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[$5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[T5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[C5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),u=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),V(h.$$.fragment),_=O(),V(g.$$.fragment),y=O(),V(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),H(l,i,null),k(i,s),H(o,i,null),k(i,r),H(a,i,null),w($,f,C),w($,u,C),w($,c,C),w($,d,C),w($,m,C),H(h,$,C),w($,_,C),H(g,$,C),w($,y,C),H(S,$,C),T=!0},p($,[C]){const M={};C&16393&&(M.$$scope={dirty:C,ctx:$}),l.$set(M);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(f),v(u),v(c),v(d),v(m),v(_),v(y)),z(l),z(o),z(a),z(h,$),z(g,$),z(S,$)}}}function M5(n,e,t){let i,l,s,o;Ue(n,mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=lt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class D5 extends _e{constructor(e){super(),he(this,e,M5,O5,me,{collection:0})}}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function tp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function np(n){let e,t,i,l,s=n[3]&&ip(n),o=!n[4]&&lp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),s&&s.c(),l=O(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=ip(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=lp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function ip(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed collection - `),l=b("strong"),o=W(s),r=O(),a=b("i"),f=O(),u=b("strong"),d=W(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&le(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&le(d,c)},d(_){_&&v(e)}}}function lp(n){let e,t,i,l=de(n[6]),s=[];for(let u=0;u
    ',i=O(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=O(),f&&f.c(),r=O(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=tp(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=np(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function I5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function A5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=O(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function L5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[A5],header:[I5],default:[E5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),z(e,l)}}}function N5(n,e,t){let i,l,s,o,r,a;const f=st();let u,c,d;async function m(C,M){t(1,c=C),t(2,d=M),await Xt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Te.call(this,n,C)}function $(C){Te.call(this,n,C)}return n.$$.update=()=>{var C,M,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class P5 extends _e{constructor(e){super(),he(this,e,N5,L5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function ap(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function F5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new qC({props:s}),ee.push(()=>ge(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function R5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new i5({props:s}),ee.push(()=>ge(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function fp(n){let e,t,i,l;function s(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new XC({props:o}),ee.push(()=>ge(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),z(t)}}}function up(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new D5({props:o}),ee.push(()=>ge(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Dl)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),z(t)}}}function q5(n){let e,t,i,l,s,o,r;const a=[R5,F5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===ms&&fp(n),d=n[15]&&up(n);return{c(){e=b("div"),t=b("div"),l.c(),s=O(),c&&c.c(),o=O(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(se(),A(f[_],1,1,()=>{f[_]=null}),oe(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===ms?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=fp(m),c.c(),E(c,1),c.m(e,o)):c&&(se(),A(c,1,1,()=>{c=null}),oe()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=up(m),d.c(),E(d,1),d.m(e,null)):d&&(se(),A(d,1,1,()=>{d=null}),oe())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function cp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[j5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),i=b("button"),l=b("i"),s=O(),V(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,f){const u={};f[1]&4194304&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),z(o)}}}function j5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=O(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[26]),K(i,"click",cn(Be(n[27])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function dp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[H5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(s,o){w(s,e,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),z(i,s)}}}function pp(n){let e,t,i,l,s,o=n[50]+"",r,a,f,u,c;function d(){return n[29](n[49])}return{c(){e=b("button"),t=b("i"),l=O(),s=b("span"),r=W(o),a=W(" collection"),f=O(),p(t,"class",i=Wn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[49]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=K(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Wn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[50]+"")&&le(r,o),h[0]&68&&x(e,"selected",n[49]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function H5(n){let e,t=de(Object.entries(n[6])),i=[];for(let l=0;l{F=null}),oe()):F?(F.p(P,q),q[0]&4&&E(F,1)):(F=dp(P),F.c(),E(F,1),F.m(d,null)),(!I||q[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(P[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",$),(!I||q[0]&4&&C!==(C=!!P[2].id))&&(d.disabled=C),P[2].system?N||(N=mp(),N.c(),N.m(D.parentNode,D)):N&&(N.d(1),N=null)},i(P){I||(E(F),I=!0)},o(P){A(F),I=!1},d(P){P&&(v(e),v(l),v(s),v(u),v(c),v(M),v(D)),F&&F.d(),N&&N.d(P),L=!1,R()}}}function hp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=we(t=Le.call(null,e,n[11])),s=!0)},p(r,a){t&&Tt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ye(()=>{l&&(i||(i=Ne(e,Ut,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Ne(e,Ut,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function _p(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function gp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&bp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=K(e,"click",n[33]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=bp(),r.c(),E(r,1),r.m(e,null)):r&&(se(),A(r,1,1,()=>{r=null}),oe()),d[0]&8&&x(e,"active",c[3]===Dl)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function V5(n){var U,Z,G,B,Y,ue,ie;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,M=!j.isEmpty((U=n[5])==null?void 0:U.listRule)||!j.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((B=n[5])==null?void 0:B.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((ie=(ue=n[5])==null?void 0:ue.options)==null?void 0:ie.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&cp(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[z5,({uniqueId:be})=>({48:be}),({uniqueId:be})=>[0,be?131072:0]]},$$scope:{ctx:n}}});let N=y&&hp(n),P=M&&_p(),q=n[15]&&gp(n);return{c(){e=b("h4"),i=W(t),l=O(),F&&F.c(),s=O(),o=b("form"),V(r.$$.fragment),a=O(),f=b("input"),u=O(),c=b("div"),d=b("button"),m=b("span"),_=W(h),g=O(),N&&N.c(),S=O(),T=b("button"),$=b("span"),$.textContent="API Rules",C=O(),P&&P.c(),D=O(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===ms),p(c,"class","tabs-header stretched")},m(be,Ae){w(be,e,Ae),k(e,i),w(be,l,Ae),F&&F.m(be,Ae),w(be,s,Ae),w(be,o,Ae),H(r,o,null),k(o,a),k(o,f),w(be,u,Ae),w(be,c,Ae),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[K(o,"submit",Be(n[30])),K(d,"click",n[31]),K(T,"click",n[32])],L=!0)},p(be,Ae){var Je,tt,bt,at,Pt,Gt,Me;(!I||Ae[0]&4)&&t!==(t=be[2].id?"Edit collection":"New collection")&&le(i,t),be[2].id&&!be[2].system?F?(F.p(be,Ae),Ae[0]&4&&E(F,1)):(F=cp(be),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(se(),A(F,1,1,()=>{F=null}),oe());const He={};Ae[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(be[13]?"disabled":"")),Ae[0]&41028|Ae[1]&4325376&&(He.$$scope={dirty:Ae,ctx:be}),r.$set(He),(!I||Ae[0]&16384)&&h!==(h=be[14]?"Query":"Fields")&&le(_,h),Ae[0]&2048&&(y=!j.isEmpty(be[11])),y?N?(N.p(be,Ae),Ae[0]&2048&&E(N,1)):(N=hp(be),N.c(),E(N,1),N.m(d,null)):N&&(se(),A(N,1,1,()=>{N=null}),oe()),(!I||Ae[0]&8)&&x(d,"active",be[3]===Ci),Ae[0]&32&&(M=!j.isEmpty((Je=be[5])==null?void 0:Je.listRule)||!j.isEmpty((tt=be[5])==null?void 0:tt.viewRule)||!j.isEmpty((bt=be[5])==null?void 0:bt.createRule)||!j.isEmpty((at=be[5])==null?void 0:at.updateRule)||!j.isEmpty((Pt=be[5])==null?void 0:Pt.deleteRule)||!j.isEmpty((Me=(Gt=be[5])==null?void 0:Gt.options)==null?void 0:Me.manageRule)),M?P?Ae[0]&32&&E(P,1):(P=_p(),P.c(),E(P,1),P.m(T,null)):P&&(se(),A(P,1,1,()=>{P=null}),oe()),(!I||Ae[0]&8)&&x(T,"active",be[3]===ms),be[15]?q?q.p(be,Ae):(q=gp(be),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(be){I||(E(F),E(r.$$.fragment,be),E(N),E(P),I=!0)},o(be){A(F),A(r.$$.fragment,be),A(N),A(P),I=!1},d(be){be&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(be),z(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,ve(R)}}}function B5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),r=W(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[K(e,"click",n[24]),K(l,"click",n[25])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function U5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[B5],header:[V5],default:[q5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new P5({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[39](null),z(e,r),n[42](null),z(i,r)}}}const Ci="schema",ms="api_rules",Dl="options",W5="base",kp="auth",yp="view";function Mr(n){return JSON.stringify(n)}function Y5(n,e,t){let i,l,s,o,r,a;Ue(n,mi,te=>t(5,a=te));const f={};f[W5]="Base",f[yp]="View",f[kp]="Auth";const u=st();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Mr(h),T="";function $(te){t(3,y=te)}function C(te){return D(te),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function M(){return c==null?void 0:c.hide()}async function D(te){Jt({}),typeof te<"u"?(t(22,m=te),t(2,h=structuredClone(te))):(t(22,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Xt(),t(23,S=Mr(h))}function I(){h.id?d==null||d.show(m,h):L()}function L(){if(_)return;t(9,_=!0);const te=R();let Fe;h.id?Fe=ae.collections.update(h.id,te):Fe=ae.collections.create(te),Fe.then(Se=>{ya(),Gy(Se),t(10,g=!1),M(),Et(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Se})}).catch(Se=>{ae.error(Se)}).finally(()=>{t(9,_=!1)})}function R(){const te=Object.assign({},h);te.schema=te.schema.slice(0);for(let Fe=te.schema.length-1;Fe>=0;Fe--)te.schema[Fe].toDelete&&te.schema.splice(Fe,1);return te}function F(){m!=null&&m.id&&fn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{M(),Et(`Successfully deleted collection "${m.name}".`),u("delete",m),Xy(m)}).catch(te=>{ae.error(te)}))}function N(te){t(2,h.type=te,h),ii("schema")}function P(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const te=m?structuredClone(m):null;if(te){if(te.id="",te.created="",te.updated="",te.name+="_duplicate",!j.isEmpty(te.schema))for(const Fe of te.schema)Fe.id="";if(!j.isEmpty(te.indexes))for(let Fe=0;FeM(),Z=()=>I(),G=()=>P(),B=()=>F(),Y=te=>{t(2,h.name=j.slugify(te.target.value),h),te.target.value=h.name},ue=te=>N(te),ie=()=>{r&&I()},be=()=>$(Ci),Ae=()=>$(ms),He=()=>$(Dl);function Je(te){h=te,t(2,h),t(22,m)}function tt(te){h=te,t(2,h),t(22,m)}function bt(te){h=te,t(2,h),t(22,m)}function at(te){h=te,t(2,h),t(22,m)}const Pt=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),M()}),!1):!0;function Gt(te){ee[te?"unshift":"push"](()=>{c=te,t(7,c)})}function Me(te){Te.call(this,n,te)}function Ee(te){Te.call(this,n,te)}function ze(te){ee[te?"unshift":"push"](()=>{d=te,t(8,d)})}const ht=()=>L();return n.$$.update=()=>{var te,Fe;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&4194308&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(te=h.indexes)==null?void 0:te.map(Se=>j.replaceIndexTableName(Se,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===kp),n.$$.dirty[0]&4&&t(14,l=h.type===yp),n.$$.dirty[0]&32&&(a.schema||(Fe=a.options)!=null&&Fe.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Mr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Dl&&h.type!=="auth"&&$(Ci)},[$,M,h,y,o,a,f,c,d,_,g,T,r,s,l,i,I,L,F,N,P,C,m,S,U,Z,G,B,Y,ue,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt,Me,Ee,ze,ht]}class Va extends _e{constructor(e){super(),he(this,e,Y5,U5,me,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function K5(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function J5(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Z5(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?J5:K5}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=O(),s=b("span"),r=W(o),a=O(),f=b("span"),y.c(),p(t,"class",i=Wn(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[we(u=Le.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),K(f,"click",cn(Be(n[5]))),we(nn.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Wn(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&le(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Tt(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,ve(h)}}}function G5(n,e,t){let i,l;Ue(n,li,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class qb extends _e{constructor(e){super(),he(this,e,G5,Z5,me,{collection:0,pinnedIds:4})}}function vp(n,e,t){const i=n.slice();return i[22]=e[t],i}function wp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Sp(n){let e,t,i=[],l=new Map,s,o,r=de(n[6]);const a=f=>f[22].id;for(let f=0;fge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function Tp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Cp(),r=de(n[5]);const a=f=>f[22].id;for(let f=0;fge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function Mp(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Dp(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function X5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Sp(n),T=n[5].length&&Tp(n),$=n[3].length&&!n[2].length&&Mp(),C=!n[9]&&Dp(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=O(),o=b("input"),r=O(),a=b("hr"),f=O(),u=b("div"),S&&S.c(),c=O(),T&&T.c(),d=O(),$&&$.c(),m=O(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(M,D){w(M,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(M,r,D),w(M,a,D),w(M,f,D),w(M,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(M,m,D),C&&C.m(M,D),w(M,h,D),_=!0,g||(y=[K(l,"click",n[12]),K(o,"input",n[13])],g=!0)},p(M,D){(!_||D&128)&&x(l,"hidden",!M[7]),D&1&&o.value!==M[0]&&re(o,M[0]),(!_||D&128)&&x(t,"active",M[7]),M[6].length?S?(S.p(M,D),D&64&&E(S,1)):(S=Sp(M),S.c(),E(S,1),S.m(u,c)):S&&(se(),A(S,1,1,()=>{S=null}),oe()),M[5].length?T?(T.p(M,D),D&32&&E(T,1)):(T=Tp(M),T.c(),E(T,1),T.m(u,d)):T&&(se(),A(T,1,1,()=>{T=null}),oe()),M[3].length&&!M[2].length?$||($=Mp(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",M[8]),(!_||D&4)&&x(u,"sidebar-content-compact",M[2].length>20),M[9]?C&&(C.d(1),C=null):C?C.p(M,D):(C=Dp(M),C.c(),C.m(h.parentNode,h))},i(M){_||(E(S),E(T),_=!0)},o(M){A(S),A(T),_=!1},d(M){M&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(M),g=!1,ve(y)}}}function Q5(n){let e,t,i,l;e=new Ab({props:{class:"collection-sidebar",$$slots:{default:[X5]},$$scope:{ctx:n}}});let s={};return i=new Va({props:s}),n[17](i),i.$on("save",n[18]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),z(e,o),n[17](null),z(i,o)}}}const Ep="@pinnedCollections";function x5(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function e6(n,e,t){let i,l,s,o,r,a,f,u,c;Ue(n,Fn,L=>t(11,a=L)),Ue(n,li,L=>t(19,f=L)),Ue(n,So,L=>t(8,u=L)),Ue(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(li,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Ep);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const M=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),x5()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Ep,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,M,D,I]}class t6 extends _e{constructor(e){super(),he(this,e,e6,Q5,me,{})}}function Ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Ap(n){n[18]=n[19].default}function Lp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Np(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Pp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Np();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=O(),s=b("button"),r=W(o),a=O(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=K(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Np(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function Fp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:l6,then:i6,catch:n6,value:19,blocks:[,,,]};return Ga(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&Ga(t,l)||k0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function n6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function i6(n){Ap(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=O()},m(l,s){H(e,l,s),w(l,t,s),i=!0},p(l,s){Ap(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),z(e,l)}}}function l6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Rp(n,e){let t,i,l,s=e[5]===e[14]&&Fp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=Fp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function s6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=de(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function r6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[o6],default:[s6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),z(e,l)}}}function a6(n,e,t){const i={list:{label:"List/Search",component:nt(()=>import("./ListApiDocs-o3IOerVB.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:nt(()=>import("./ViewApiDocs-dkYTmtVs.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:nt(()=>import("./CreateApiDocs-Y1F_-wh9.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:nt(()=>import("./UpdateApiDocs-pnf_K2jX.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:nt(()=>import("./DeleteApiDocs-UGu6GbCv.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:nt(()=>import("./RealtimeApiDocs-HwUV4b-E.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:nt(()=>import("./AuthWithPasswordDocs-RVIqELew.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:nt(()=>import("./AuthWithOAuth2Docs-RDXOM2lB.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:nt(()=>import("./AuthRefreshDocs-MSIqKvjR.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:nt(()=>import("./RequestVerificationDocs-yKFp7OPL.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:nt(()=>import("./ConfirmVerificationDocs-jvmhFPKz.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:nt(()=>import("./RequestPasswordResetDocs-5TAO7hUw.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:nt(()=>import("./ConfirmPasswordResetDocs-TEkFHZVZ.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:nt(()=>import("./RequestEmailChangeDocs-VM_SKuLb.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:nt(()=>import("./ConfirmEmailChangeDocs-Az0ouP1t.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:nt(()=>import("./AuthMethodsDocs-E8qGD5-5.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:nt(()=>import("./ListExternalAuthsDocs-OczUMJjZ.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:nt(()=>import("./UnlinkExternalAuthDocs--pYR2xlr.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Te.call(this,n,y)}function g(y){Te.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class f6 extends _e{constructor(e){super(),he(this,e,a6,r6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function u6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=we(t=Le.call(null,e,{text:n[0].join(` + MAX(balance) as maxBalance).`,f=O(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(se(),A(m[S],1,1,()=>{m[S]=null}),oe(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Wd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function l5(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[i5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function s5(n,e,t){let i;Ue(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}jt(async()=>{t(2,o=!0);try{t(1,s=(await nt(()=>import("./CodeEditor-rWx4HUVf.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class o5 extends _e{constructor(e){super(),he(this,e,s5,l5,me,{collection:0})}}const r5=n=>({active:n&1}),Kd=n=>({active:n[0]});function Jd(n){let e,t,i;const l=n[15].default,s=vt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&St(s,l,o,o[14],i?wt(l,o[14],r,null):$t(o[14]),null)},i(o){i||(E(s,o),o&&Ye(()=>{i&&(t||(t=Ne(e,xe,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Ne(e,xe,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function a5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=vt(a,n,n[14],Kd);let u=n[0]&&Jd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=O(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Be(n[17])),K(t,"drop",Be(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&St(f,a,c,c[14],s?wt(a,c[14],d,r5):$t(c[14]),Kd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Jd(c),u.c(),E(u,1),u.m(e,null)):u&&(se(),A(u,1,1,()=>{u=null}),oe()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,ve(r)}}}function f5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}jt(()=>()=>clearTimeout(r));function T(R){Te.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},M=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,M,D,I,L]}class ho extends _e{constructor(e){super(),he(this,e,f5,a5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function u5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function c5(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[u5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function d5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function p5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Zd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function m5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?p5:d5}let a=r(n),f=a(n),u=n[3]&&Zd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=O(),i=b("div"),l=O(),f.c(),s=O(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Zd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function h5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Gd(n){let e,t,i,l,s,o,r,a;return i=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[_5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[g5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ye(()=>{a&&(r||(r=Ne(e,xe,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Ne(e,xe,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),z(i),z(o),f&&r&&r.end()}}}function _5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function g5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Nl({props:_}),ee.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),l=b("i"),o=O(),V(r.$$.fragment),f=O(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=we(Le.call(null,l,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),z(r,g),d=!1,m()}}}function b5(n){let e,t,i,l;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[h5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Gd(n);return{c(){V(e.$$.fragment),t=O(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Gd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),z(e,o),s&&s.d(o)}}}function k5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function y5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Xd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function v5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?y5:k5}let a=r(n),f=a(n),u=n[2]&&Xd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=O(),i=b("div"),l=O(),f.c(),s=O(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Xd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function w5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Qd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ye(()=>{i&&(t||(t=Ne(e,xe,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,xe,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function S5(n){let e,t,i,l;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[w5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&Qd();return{c(){V(e.$$.fragment),t=O(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=Qd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),z(e,o),s&&s.d(o)}}}function $5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function T5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function C5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?T5:$5}let a=r(n),f=a(n),u=n[1]&&xd();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=O(),i=b("div"),l=O(),f.c(),s=O(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=xd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function O5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Minimum password length"),l=O(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=K(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&<(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function M5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[11]),we(Le.call(null,r,{text:`The constraint is applied only for new records. +Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function D5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[12]),we(Le.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` +`),position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function E5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;return l=new ho({props:{single:!0,$$slots:{header:[m5],default:[c5]},$$scope:{ctx:n}}}),o=new ho({props:{single:!0,$$slots:{header:[v5],default:[b5]},$$scope:{ctx:n}}}),a=new ho({props:{single:!0,$$slots:{header:[C5],default:[S5]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[O5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[M5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[D5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),u=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),V(h.$$.fragment),_=O(),V(g.$$.fragment),y=O(),V(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),H(l,i,null),k(i,s),H(o,i,null),k(i,r),H(a,i,null),w($,f,C),w($,u,C),w($,c,C),w($,d,C),w($,m,C),H(h,$,C),w($,_,C),H(g,$,C),w($,y,C),H(S,$,C),T=!0},p($,[C]){const M={};C&16393&&(M.$$scope={dirty:C,ctx:$}),l.$set(M);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(f),v(u),v(c),v(d),v(m),v(_),v(y)),z(l),z(o),z(a),z(h,$),z(g,$),z(S,$)}}}function I5(n,e,t){let i,l,s,o;Ue(n,mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=lt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class A5 extends _e{constructor(e){super(),he(this,e,I5,E5,me,{collection:0})}}function ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n,e,t){const i=n.slice();return i[18]=e[t],i}function ip(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function lp(n){let e,t,i,l,s=n[3]&&sp(n),o=!n[4]&&op(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),s&&s.c(),l=O(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=sp(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=op(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function sp(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed collection + `),l=b("strong"),o=W(s),r=O(),a=b("i"),f=O(),u=b("strong"),d=W(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&le(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&le(d,c)},d(_){_&&v(e)}}}function op(n){let e,t,i,l=de(n[6]),s=[];for(let u=0;u
    ',i=O(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=O(),f&&f.c(),r=O(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=ip(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=lp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function N5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function P5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=O(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function F5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[P5],header:[N5],default:[L5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),z(e,l)}}}function R5(n,e,t){let i,l,s,o,r,a;const f=st();let u,c,d;async function m(C,M){t(1,c=C),t(2,d=M),await Xt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Te.call(this,n,C)}function $(C){Te.call(this,n,C)}return n.$$.update=()=>{var C,M,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class q5 extends _e{constructor(e){super(),he(this,e,R5,F5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function up(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function j5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new zC({props:s}),ee.push(()=>ge(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function H5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new o5({props:s}),ee.push(()=>ge(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function cp(n){let e,t,i,l;function s(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new e5({props:o}),ee.push(()=>ge(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),z(t)}}}function dp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new A5({props:o}),ee.push(()=>ge(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Dl)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),z(t)}}}function z5(n){let e,t,i,l,s,o,r;const a=[H5,j5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===hs&&cp(n),d=n[15]&&dp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=O(),c&&c.c(),o=O(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(se(),A(f[_],1,1,()=>{f[_]=null}),oe(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===hs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=cp(m),c.c(),E(c,1),c.m(e,o)):c&&(se(),A(c,1,1,()=>{c=null}),oe()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=dp(m),d.c(),E(d,1),d.m(e,null)):d&&(se(),A(d,1,1,()=>{d=null}),oe())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function pp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[V5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),i=b("button"),l=b("i"),s=O(),V(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,f){const u={};f[1]&4194304&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),z(o)}}}function V5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=O(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[26]),K(i,"click",cn(Be(n[27])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function mp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[B5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(s,o){w(s,e,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),z(i,s)}}}function hp(n){let e,t,i,l,s,o=n[50]+"",r,a,f,u,c;function d(){return n[29](n[49])}return{c(){e=b("button"),t=b("i"),l=O(),s=b("span"),r=W(o),a=W(" collection"),f=O(),p(t,"class",i=Wn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[49]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=K(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Wn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[50]+"")&&le(r,o),h[0]&68&&x(e,"selected",n[49]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function B5(n){let e,t=de(Object.entries(n[6])),i=[];for(let l=0;l{F=null}),oe()):F?(F.p(P,q),q[0]&4&&E(F,1)):(F=mp(P),F.c(),E(F,1),F.m(d,null)),(!I||q[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(P[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",$),(!I||q[0]&4&&C!==(C=!!P[2].id))&&(d.disabled=C),P[2].system?N||(N=_p(),N.c(),N.m(D.parentNode,D)):N&&(N.d(1),N=null)},i(P){I||(E(F),I=!0)},o(P){A(F),I=!1},d(P){P&&(v(e),v(l),v(s),v(u),v(c),v(M),v(D)),F&&F.d(),N&&N.d(P),L=!1,R()}}}function gp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=we(t=Le.call(null,e,n[11])),s=!0)},p(r,a){t&&Tt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ye(()=>{l&&(i||(i=Ne(e,Ut,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Ne(e,Ut,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function kp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&yp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=K(e,"click",n[33]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=yp(),r.c(),E(r,1),r.m(e,null)):r&&(se(),A(r,1,1,()=>{r=null}),oe()),d[0]&8&&x(e,"active",c[3]===Dl)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function yp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function W5(n){var U,Z,G,B,Y,ue,ie;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,M=!j.isEmpty((U=n[5])==null?void 0:U.listRule)||!j.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((B=n[5])==null?void 0:B.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((ie=(ue=n[5])==null?void 0:ue.options)==null?void 0:ie.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&pp(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[U5,({uniqueId:be})=>({48:be}),({uniqueId:be})=>[0,be?131072:0]]},$$scope:{ctx:n}}});let N=y&&gp(n),P=M&&bp(),q=n[15]&&kp(n);return{c(){e=b("h4"),i=W(t),l=O(),F&&F.c(),s=O(),o=b("form"),V(r.$$.fragment),a=O(),f=b("input"),u=O(),c=b("div"),d=b("button"),m=b("span"),_=W(h),g=O(),N&&N.c(),S=O(),T=b("button"),$=b("span"),$.textContent="API Rules",C=O(),P&&P.c(),D=O(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===hs),p(c,"class","tabs-header stretched")},m(be,Ae){w(be,e,Ae),k(e,i),w(be,l,Ae),F&&F.m(be,Ae),w(be,s,Ae),w(be,o,Ae),H(r,o,null),k(o,a),k(o,f),w(be,u,Ae),w(be,c,Ae),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[K(o,"submit",Be(n[30])),K(d,"click",n[31]),K(T,"click",n[32])],L=!0)},p(be,Ae){var Je,tt,bt,at,Pt,Gt,Me;(!I||Ae[0]&4)&&t!==(t=be[2].id?"Edit collection":"New collection")&&le(i,t),be[2].id&&!be[2].system?F?(F.p(be,Ae),Ae[0]&4&&E(F,1)):(F=pp(be),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(se(),A(F,1,1,()=>{F=null}),oe());const He={};Ae[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(be[13]?"disabled":"")),Ae[0]&41028|Ae[1]&4325376&&(He.$$scope={dirty:Ae,ctx:be}),r.$set(He),(!I||Ae[0]&16384)&&h!==(h=be[14]?"Query":"Fields")&&le(_,h),Ae[0]&2048&&(y=!j.isEmpty(be[11])),y?N?(N.p(be,Ae),Ae[0]&2048&&E(N,1)):(N=gp(be),N.c(),E(N,1),N.m(d,null)):N&&(se(),A(N,1,1,()=>{N=null}),oe()),(!I||Ae[0]&8)&&x(d,"active",be[3]===Ci),Ae[0]&32&&(M=!j.isEmpty((Je=be[5])==null?void 0:Je.listRule)||!j.isEmpty((tt=be[5])==null?void 0:tt.viewRule)||!j.isEmpty((bt=be[5])==null?void 0:bt.createRule)||!j.isEmpty((at=be[5])==null?void 0:at.updateRule)||!j.isEmpty((Pt=be[5])==null?void 0:Pt.deleteRule)||!j.isEmpty((Me=(Gt=be[5])==null?void 0:Gt.options)==null?void 0:Me.manageRule)),M?P?Ae[0]&32&&E(P,1):(P=bp(),P.c(),E(P,1),P.m(T,null)):P&&(se(),A(P,1,1,()=>{P=null}),oe()),(!I||Ae[0]&8)&&x(T,"active",be[3]===hs),be[15]?q?q.p(be,Ae):(q=kp(be),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(be){I||(E(F),E(r.$$.fragment,be),E(N),E(P),I=!0)},o(be){A(F),A(r.$$.fragment,be),A(N),A(P),I=!1},d(be){be&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(be),z(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,ve(R)}}}function Y5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),r=W(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[K(e,"click",n[24]),K(l,"click",n[25])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function K5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[Y5],header:[W5],default:[z5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new q5({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[39](null),z(e,r),n[42](null),z(i,r)}}}const Ci="schema",hs="api_rules",Dl="options",J5="base",vp="auth",wp="view";function Er(n){return JSON.stringify(n)}function Z5(n,e,t){let i,l,s,o,r,a;Ue(n,mi,te=>t(5,a=te));const f={};f[J5]="Base",f[wp]="View",f[vp]="Auth";const u=st();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Er(h),T="";function $(te){t(3,y=te)}function C(te){return D(te),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function M(){return c==null?void 0:c.hide()}async function D(te){Jt({}),typeof te<"u"?(t(22,m=te),t(2,h=structuredClone(te))):(t(22,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Xt(),t(23,S=Er(h))}function I(){h.id?d==null||d.show(m,h):L()}function L(){if(_)return;t(9,_=!0);const te=R();let Fe;h.id?Fe=ae.collections.update(h.id,te):Fe=ae.collections.create(te),Fe.then(Se=>{wa(),ev(Se),t(10,g=!1),M(),Et(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Se})}).catch(Se=>{ae.error(Se)}).finally(()=>{t(9,_=!1)})}function R(){const te=Object.assign({},h);te.schema=te.schema.slice(0);for(let Fe=te.schema.length-1;Fe>=0;Fe--)te.schema[Fe].toDelete&&te.schema.splice(Fe,1);return te}function F(){m!=null&&m.id&&fn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{M(),Et(`Successfully deleted collection "${m.name}".`),u("delete",m),tv(m)}).catch(te=>{ae.error(te)}))}function N(te){t(2,h.type=te,h),li("schema")}function P(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const te=m?structuredClone(m):null;if(te){if(te.id="",te.created="",te.updated="",te.name+="_duplicate",!j.isEmpty(te.schema))for(const Fe of te.schema)Fe.id="";if(!j.isEmpty(te.indexes))for(let Fe=0;FeM(),Z=()=>I(),G=()=>P(),B=()=>F(),Y=te=>{t(2,h.name=j.slugify(te.target.value),h),te.target.value=h.name},ue=te=>N(te),ie=()=>{r&&I()},be=()=>$(Ci),Ae=()=>$(hs),He=()=>$(Dl);function Je(te){h=te,t(2,h),t(22,m)}function tt(te){h=te,t(2,h),t(22,m)}function bt(te){h=te,t(2,h),t(22,m)}function at(te){h=te,t(2,h),t(22,m)}const Pt=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),M()}),!1):!0;function Gt(te){ee[te?"unshift":"push"](()=>{c=te,t(7,c)})}function Me(te){Te.call(this,n,te)}function Ee(te){Te.call(this,n,te)}function ze(te){ee[te?"unshift":"push"](()=>{d=te,t(8,d)})}const ht=()=>L();return n.$$.update=()=>{var te,Fe;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&4194308&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(te=h.indexes)==null?void 0:te.map(Se=>j.replaceIndexTableName(Se,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===vp),n.$$.dirty[0]&4&&t(14,l=h.type===wp),n.$$.dirty[0]&32&&(a.schema||(Fe=a.options)!=null&&Fe.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Er(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Dl&&h.type!=="auth"&&$(Ci)},[$,M,h,y,o,a,f,c,d,_,g,T,r,s,l,i,I,L,F,N,P,C,m,S,U,Z,G,B,Y,ue,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt,Me,Ee,ze,ht]}class Ua extends _e{constructor(e){super(),he(this,e,Z5,K5,me,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function G5(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function X5(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Q5(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?X5:G5}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=O(),s=b("span"),r=W(o),a=O(),f=b("span"),y.c(),p(t,"class",i=Wn(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[we(u=Le.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),K(f,"click",cn(Be(n[5]))),we(nn.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Wn(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&le(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Tt(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,ve(h)}}}function x5(n,e,t){let i,l;Ue(n,Kn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Bb extends _e{constructor(e){super(),he(this,e,x5,Q5,me,{collection:0,pinnedIds:4})}}function Sp(n,e,t){const i=n.slice();return i[22]=e[t],i}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n){let e,t,i=[],l=new Map,s,o,r=de(n[6]);const a=f=>f[22].id;for(let f=0;fge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function Op(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Mp(),r=de(n[5]);const a=f=>f[22].id;for(let f=0;fge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function Ep(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ip(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function e6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Tp(n),T=n[5].length&&Op(n),$=n[3].length&&!n[2].length&&Ep(),C=!n[9]&&Ip(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=O(),o=b("input"),r=O(),a=b("hr"),f=O(),u=b("div"),S&&S.c(),c=O(),T&&T.c(),d=O(),$&&$.c(),m=O(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(M,D){w(M,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(M,r,D),w(M,a,D),w(M,f,D),w(M,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(M,m,D),C&&C.m(M,D),w(M,h,D),_=!0,g||(y=[K(l,"click",n[12]),K(o,"input",n[13])],g=!0)},p(M,D){(!_||D&128)&&x(l,"hidden",!M[7]),D&1&&o.value!==M[0]&&re(o,M[0]),(!_||D&128)&&x(t,"active",M[7]),M[6].length?S?(S.p(M,D),D&64&&E(S,1)):(S=Tp(M),S.c(),E(S,1),S.m(u,c)):S&&(se(),A(S,1,1,()=>{S=null}),oe()),M[5].length?T?(T.p(M,D),D&32&&E(T,1)):(T=Op(M),T.c(),E(T,1),T.m(u,d)):T&&(se(),A(T,1,1,()=>{T=null}),oe()),M[3].length&&!M[2].length?$||($=Ep(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",M[8]),(!_||D&4)&&x(u,"sidebar-content-compact",M[2].length>20),M[9]?C&&(C.d(1),C=null):C?C.p(M,D):(C=Ip(M),C.c(),C.m(h.parentNode,h))},i(M){_||(E(S),E(T),_=!0)},o(M){A(S),A(T),_=!1},d(M){M&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(M),g=!1,ve(y)}}}function t6(n){let e,t,i,l;e=new Rb({props:{class:"collection-sidebar",$$slots:{default:[e6]},$$scope:{ctx:n}}});let s={};return i=new Ua({props:s}),n[17](i),i.$on("save",n[18]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),z(e,o),n[17](null),z(i,o)}}}const Ap="@pinnedCollections";function n6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function i6(n,e,t){let i,l,s,o,r,a,f,u,c;Ue(n,Fn,L=>t(11,a=L)),Ue(n,Kn,L=>t(19,f=L)),Ue(n,To,L=>t(8,u=L)),Ue(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Kn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Ap);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const M=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),n6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Ap,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,M,D,I]}class l6 extends _e{constructor(e){super(),he(this,e,i6,t6,me,{})}}function Lp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Np(n){n[18]=n[19].default}function Pp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Fp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Rp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Fp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=O(),s=b("button"),r=W(o),a=O(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=K(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Fp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function qp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:r6,then:o6,catch:s6,value:19,blocks:[,,,]};return Qa(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&Qa(t,l)||S0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function s6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function o6(n){Np(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=O()},m(l,s){H(e,l,s),w(l,t,s),i=!0},p(l,s){Np(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),z(e,l)}}}function r6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function jp(n,e){let t,i,l,s=e[5]===e[14]&&qp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=qp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(se(),A(s,1,1,()=>{s=null}),oe())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function a6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=de(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function u6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[f6],default:[a6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),z(e,l)}}}function c6(n,e,t){const i={list:{label:"List/Search",component:nt(()=>import("./ListApiDocs-bfTK9tkG.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:nt(()=>import("./ViewApiDocs-fZDF7bi9.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:nt(()=>import("./CreateApiDocs-SGziFR1e.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:nt(()=>import("./UpdateApiDocs-XdZRybfj.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:nt(()=>import("./DeleteApiDocs-20BG7iGY.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:nt(()=>import("./RealtimeApiDocs-B8Ubzznt.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:nt(()=>import("./AuthWithPasswordDocs-WYTGSxgx.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:nt(()=>import("./AuthWithOAuth2Docs-wpInYmBQ.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:nt(()=>import("./AuthRefreshDocs-MKJO-QLX.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:nt(()=>import("./RequestVerificationDocs-dmeMkvVt.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:nt(()=>import("./ConfirmVerificationDocs-vggZqtpv.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:nt(()=>import("./RequestPasswordResetDocs-E3P_OK0U.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:nt(()=>import("./ConfirmPasswordResetDocs-D_DbjoKG.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:nt(()=>import("./RequestEmailChangeDocs-SM8dNhMn.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:nt(()=>import("./ConfirmEmailChangeDocs-4zuP9S10.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:nt(()=>import("./AuthMethodsDocs-7RQCHeOb.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:nt(()=>import("./ListExternalAuthsDocs-X9goxYp8.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:nt(()=>import("./UnlinkExternalAuthDocs-pKf1Zp4R.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Te.call(this,n,y)}function g(y){Te.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class d6 extends _e{constructor(e){super(),he(this,e,c6,u6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function p6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=we(t=Le.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&Tt(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const qp="yyyy-MM-dd HH:mm:ss.SSS";function c6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,qp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,qp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class jb extends _e{constructor(e){super(),he(this,e,c6,u6,me,{model:1})}}function d6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=O(),V(s.$$.fragment),o=O(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),H(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[we(Le.call(null,r,"Refresh")),K(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&le(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),z(s),f=!1,ve(u)}}}function p6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[d6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>ge(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=O(),V(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),H(l,e,null),a=!0,f||(u=we(r=Le.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Tt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),z(l),f=!1,u()}}}function m6(n,e,t){const i=st();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Xt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Hb extends _e{constructor(e){super(),he(this,e,m6,p6,me,{class:0,length:5})}}function h6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Username",o=O(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function _6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Email",o=O(),r=b("div"),a=b("button"),f=b("span"),u=W("Public: "),d=W(c),h=O(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[we(Le.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",Be(n[6])),K(_,"input",n[7])],S=!0)},p($,C){var M;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&le(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(M=$[1].options)==null?void 0:M.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,ve(T)}}}function jp(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[g6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function g6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Hp(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[b6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[k6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(e,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(e,xe,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),z(l),z(r),u&&a&&a.end()}}}function b6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Hb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password",o=O(),r=b("input"),f=O(),u=b("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),H(c,u,null),d=!0,m||(h=K(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),z(c),m=!1,h()}}}function k6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=K(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[K(e,"change",n[11]),K(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,ve(a)}}}function v6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new pe({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[h6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[_6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&jp(n),_=(n[2]||n[3])&&Hp(n);return d=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[y6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),h&&h.c(),f=O(),_&&_.c(),u=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),H(d,c,null),m=!0},p(y,[S]){var M;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((M=y[1].options)!=null&&M.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(y,S),S&4&&E(h,1)):(h=jp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Hp(y),_.c(),E(_,1),_.m(a,null)):_&&(se(),A(_,1,1,()=>{_=null}),oe());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),z(i),z(o),h&&h.d(),_&&_.d(),z(d)}}}function w6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||fn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),ii("password"),ii("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class S6 extends _e{constructor(e){super(),he(this,e,w6,v6,me,{record:0,collection:1,isNew:2})}}function $6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}jt(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class C6 extends _e{constructor(e){super(),he(this,e,T6,$6,me,{value:0,maxHeight:4})}}function O6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new C6({props:h}),ee.push(()=>ge(u,"value",m)),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),V(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),H(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),z(u,_)}}}function M6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[O6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function D6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class E6 extends _e{constructor(e){super(),he(this,e,D6,M6,me,{field:1,value:0})}}function I6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=K(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&le(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&<(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function A6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function L6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=lt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class N6 extends _e{constructor(e){super(),he(this,e,L6,A6,me,{field:1,value:0})}}function P6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=O(),l=b("label"),o=W(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=K(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&le(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function F6(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[P6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function R6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class q6 extends _e{constructor(e){super(),he(this,e,R6,F6,me,{field:1,value:0})}}function j6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=K(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&le(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function H6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class V6 extends _e{constructor(e){super(),he(this,e,z6,H6,me,{field:1,value:0})}}function B6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=K(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&le(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function U6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Y6 extends _e{constructor(e){super(),he(this,e,W6,U6,me,{field:1,value:0})}}function zp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[we(Le.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,ve(l)}}}function K6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&zp(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new za({props:T}),ee.push(()=>ge(d,"value",y)),ee.push(()=>ge(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),a=W(" (UTC)"),u=O(),g&&g.c(),c=O(),V(d.$$.fragment),p(t,"class",i=Wn(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),H(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Wn(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&le(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=zp($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const M={};C&256&&(M.id=$[8]),!m&&C&4&&(m=!0,M.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,M.formattedValue=$[0],ke(()=>h=!1)),d.$set(M)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),z(d,$)}}}function J6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class G6 extends _e{constructor(e){super(),he(this,e,Z6,J6,me,{field:1,value:0})}}function Vp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=W("Select up to "),l=W(i),s=W(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(l,i)},d(o){o&&v(e)}}}function X6(n){var S,T,$,C,M,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((M=(C=n[1].options)==null?void 0:C.values)==null?void 0:M.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Rb({props:g}),ee.push(()=>ge(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Vp(n);return{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),V(u.$$.fragment),d=O(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),H(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,U,Z;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&le(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((U=(q=I[1].options)==null?void 0:q.values)==null?void 0:U.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((Z=I[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(I,L):(y=Vp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),z(u,I),y&&y.d(I)}}}function Q6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function x6(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class eO extends _e{constructor(e){super(),he(this,e,x6,Q6,me,{field:1,value:0})}}function tO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function nO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function iO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function lO(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Ot(l,s(n)),e.$on("change",n[5])),{c(){e&&V(e.$$.fragment),t=ye()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){se();const a=e;A(a.$$.fragment,1,0,()=>{z(a,1)}),oe()}l?(e=Ot(l,s(o)),e.$on("change",o[5]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&z(e,o)}}}function sO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?nO:tO}let $=T(n),C=$(n);const M=[lO,iO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=M[m](n),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),a=O(),f=b("span"),C.c(),d=O(),h.c(),_=ye(),p(t,"class",i=Wn(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=we(u=Le.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Wn(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&le(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Tt(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(se(),A(D[F],1,1,()=>{D[F]=null}),oe(),h=D[m],h?h.p(L,R):(h=D[m]=M[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function oO(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Bp(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function rO(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function aO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Bp(s);jt(async()=>{try{t(3,o=(await nt(()=>import("./CodeEditor-AgADv186.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Bp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=rO(r))},[s,l,r,o,i,a]}class fO extends _e{constructor(e){super(),he(this,e,aO,oO,me,{field:1,value:0})}}function uO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function cO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function dO(n){let e;function t(s,o){return s[2]?cO:uO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function pO(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class mO extends _e{constructor(e){super(),he(this,e,pO,dO,me,{file:0,size:1})}}function Up(n){let e;function t(s,o){return s[4]==="image"?_O:hO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function hO(n){let e,t;return{c(){e=b("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function _O(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function gO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Up(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Up(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function bO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=K(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function kO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=W(n[2]),i=O(),l=b("i"),s=O(),o=b("div"),r=O(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=K(a,"click",n[0]),f=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function yO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[kO],header:[bO],default:[gO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),z(e,l)}}}function vO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Te.call(this,n,m)}function d(m){Te.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class wO extends _e{constructor(e){super(),he(this,e,vO,yO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function SO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?OO:f[3]==="video"||f[3]==="audio"?CO:TO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=K(e,"click",cn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function $O(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function TO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=K(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Wp(n){let e,t,i={};return e=new wO({props:i}),n[12](e),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),z(e,l)}}}function MO(n){let e,t,i;function l(a,f){return a[2]?$O:SO}let s=l(n),o=s(n),r=n[7]&&Wp(n);return{c(){o.c(),e=O(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Wp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function DO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ba extends _e{constructor(e){super(),he(this,e,DO,MO,me,{record:9,filename:0,size:1})}}function Yp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Kp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function EO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[we(Le.call(null,e,"Remove file")),K(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,ve(i)}}}function IO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=K(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function AO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ba({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?IO:EO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),o=b("a"),a=W(r),c=O(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&le(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),z(i),g.d()}}}function Jp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[AO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Os({props:r}),ee.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function LO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new mO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),V(i.$$.fragment),l=O(),s=b("div"),o=b("small"),o.textContent="New",r=O(),a=b("span"),u=W(f),d=O(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[we(Le.call(null,m,"Remove file")),K(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&le(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),z(i),_=!1,ve(g)}}}function Zp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[LO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Os({props:r}),ee.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function NO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,M,D,I,L,R,F,N=de(n[5]);const P=Z=>Z[34]+Z[3].id;for(let Z=0;ZZ[29].name+Z[31];for(let Z=0;Z{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Ub extends _e{constructor(e){super(),he(this,e,m6,p6,me,{model:1})}}function h6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=O(),V(s.$$.fragment),o=O(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),H(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[we(Le.call(null,r,"Refresh")),K(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&le(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),z(s),f=!1,ve(u)}}}function _6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[h6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>ge(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=O(),V(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),H(l,e,null),a=!0,f||(u=we(r=Le.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Tt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),z(l),f=!1,u()}}}function g6(n,e,t){const i=st();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Xt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Wb extends _e{constructor(e){super(),he(this,e,g6,_6,me,{class:0,length:5})}}function b6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Username",o=O(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function k6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Email",o=O(),r=b("div"),a=b("button"),f=b("span"),u=W("Public: "),d=W(c),h=O(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[we(Le.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",Be(n[6])),K(_,"input",n[7])],S=!0)},p($,C){var M;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&le(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(M=$[1].options)==null?void 0:M.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,ve(T)}}}function zp(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[y6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Vp(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[v6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[w6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(e,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(e,xe,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),z(l),z(r),u&&a&&a.end()}}}function v6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Wb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password",o=O(),r=b("input"),f=O(),u=b("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),H(c,u,null),d=!0,m||(h=K(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),z(c),m=!1,h()}}}function w6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=K(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function S6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[K(e,"change",n[11]),K(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,ve(a)}}}function $6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new pe({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[b6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[k6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&zp(n),_=(n[2]||n[3])&&Vp(n);return d=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[S6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),h&&h.c(),f=O(),_&&_.c(),u=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),H(d,c,null),m=!0},p(y,[S]){var M;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((M=y[1].options)!=null&&M.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(y,S),S&4&&E(h,1)):(h=zp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Vp(y),_.c(),E(_,1),_.m(a,null)):_&&(se(),A(_,1,1,()=>{_=null}),oe());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),z(i),z(o),h&&h.d(),_&&_.d(),z(d)}}}function T6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||fn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class C6 extends _e{constructor(e){super(),he(this,e,T6,$6,me,{record:0,collection:1,isNew:2})}}function O6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}jt(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class D6 extends _e{constructor(e){super(),he(this,e,M6,O6,me,{value:0,maxHeight:4})}}function E6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new D6({props:h}),ee.push(()=>ge(u,"value",m)),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),V(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),H(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),z(u,_)}}}function I6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[E6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function A6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class L6 extends _e{constructor(e){super(),he(this,e,A6,I6,me,{field:1,value:0})}}function N6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=K(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&le(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&<(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function P6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function F6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=lt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class R6 extends _e{constructor(e){super(),he(this,e,F6,P6,me,{field:1,value:0})}}function q6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=O(),l=b("label"),o=W(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=K(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&le(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function j6(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[q6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function H6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class z6 extends _e{constructor(e){super(),he(this,e,H6,j6,me,{field:1,value:0})}}function V6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=K(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&le(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function B6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[V6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function U6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class W6 extends _e{constructor(e){super(),he(this,e,U6,B6,me,{field:1,value:0})}}function Y6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=K(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&le(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function K6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function J6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Z6 extends _e{constructor(e){super(),he(this,e,J6,K6,me,{field:1,value:0})}}function Bp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[we(Le.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,ve(l)}}}function G6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Bp(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Ba({props:T}),ee.push(()=>ge(d,"value",y)),ee.push(()=>ge(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),a=W(" (UTC)"),u=O(),g&&g.c(),c=O(),V(d.$$.fragment),p(t,"class",i=Wn(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),H(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Wn(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&le(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Bp($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const M={};C&256&&(M.id=$[8]),!m&&C&4&&(m=!0,M.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,M.formattedValue=$[0],ke(()=>h=!1)),d.$set(M)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),z(d,$)}}}function X6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[G6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Q6(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class x6 extends _e{constructor(e){super(),he(this,e,Q6,X6,me,{field:1,value:0})}}function Up(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=W("Select up to "),l=W(i),s=W(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(l,i)},d(o){o&&v(e)}}}function eO(n){var S,T,$,C,M,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((M=(C=n[1].options)==null?void 0:C.values)==null?void 0:M.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Vb({props:g}),ee.push(()=>ge(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Up(n);return{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),V(u.$$.fragment),d=O(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),H(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,U,Z;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&le(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((U=(q=I[1].options)==null?void 0:q.values)==null?void 0:U.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((Z=I[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(I,L):(y=Up(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),z(u,I),y&&y.d(I)}}}function tO(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[eO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function nO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class iO extends _e{constructor(e){super(),he(this,e,nO,tO,me,{field:1,value:0})}}function lO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function oO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function rO(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Ot(l,s(n)),e.$on("change",n[5])),{c(){e&&V(e.$$.fragment),t=ye()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){se();const a=e;A(a.$$.fragment,1,0,()=>{z(a,1)}),oe()}l?(e=Ot(l,s(o)),e.$on("change",o[5]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&z(e,o)}}}function aO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?sO:lO}let $=T(n),C=$(n);const M=[rO,oO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=M[m](n),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),a=O(),f=b("span"),C.c(),d=O(),h.c(),_=ye(),p(t,"class",i=Wn(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=we(u=Le.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Wn(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&le(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Tt(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(se(),A(D[F],1,1,()=>{D[F]=null}),oe(),h=D[m],h?h.p(L,R):(h=D[m]=M[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function fO(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[aO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Wp(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function uO(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function cO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Wp(s);jt(async()=>{try{t(3,o=(await nt(()=>import("./CodeEditor-rWx4HUVf.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Wp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=uO(r))},[s,l,r,o,i,a]}class dO extends _e{constructor(e){super(),he(this,e,cO,fO,me,{field:1,value:0})}}function pO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function mO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function hO(n){let e;function t(s,o){return s[2]?mO:pO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function _O(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class gO extends _e{constructor(e){super(),he(this,e,_O,hO,me,{file:0,size:1})}}function Yp(n){let e;function t(s,o){return s[4]==="image"?kO:bO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function bO(n){let e,t;return{c(){e=b("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function kO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function yO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Yp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Yp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function vO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=K(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function wO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=W(n[2]),i=O(),l=b("i"),s=O(),o=b("div"),r=O(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=K(a,"click",n[0]),f=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function SO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[wO],header:[vO],default:[yO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),z(e,l)}}}function $O(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Te.call(this,n,m)}function d(m){Te.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class TO extends _e{constructor(e){super(),he(this,e,$O,SO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function CO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?EO:f[3]==="video"||f[3]==="audio"?DO:MO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=K(e,"click",cn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function OO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function MO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function DO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function EO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=K(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Kp(n){let e,t,i={};return e=new TO({props:i}),n[12](e),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),z(e,l)}}}function IO(n){let e,t,i;function l(a,f){return a[2]?OO:CO}let s=l(n),o=s(n),r=n[7]&&Kp(n);return{c(){o.c(),e=O(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Kp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function AO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Wa extends _e{constructor(e){super(),he(this,e,AO,IO,me,{record:9,filename:0,size:1})}}function Jp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Zp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function LO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[we(Le.call(null,e,"Remove file")),K(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,ve(i)}}}function NO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=K(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function PO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Wa({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?NO:LO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),o=b("a"),a=W(r),c=O(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&le(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),z(i),g.d()}}}function Gp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[PO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Ms({props:r}),ee.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function FO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new gO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),V(i.$$.fragment),l=O(),s=b("div"),o=b("small"),o.textContent="New",r=O(),a=b("span"),u=W(f),d=O(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[we(Le.call(null,m,"Remove file")),K(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&le(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),z(i),_=!1,ve(g)}}}function Xp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[FO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Ms({props:r}),ee.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function RO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,M,D,I,L,R,F,N=de(n[5]);const P=Z=>Z[34]+Z[3].id;for(let Z=0;ZZ[29].name+Z[31];for(let Z=0;Z({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,l||(s=[K(e,"dragover",Be(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[RO,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,l||(s=[K(e,"dragover",Be(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&v(e),z(t),l=!1,ve(s)}}}function FO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,h="";function _(U){j.removeByValue(u,U),t(2,u)}function g(U){j.pushUnique(u,U),t(2,u)}function y(U){j.isEmpty(f[U])||f.splice(U,1),t(1,f)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function T(U){var G,B;U.preventDefault(),t(9,m=!1);const Z=((G=U.dataTransfer)==null?void 0:G.files)||[];if(!(s||!Z.length)){for(const Y of Z){const ue=l.length+f.length-u.length;if(((B=r.options)==null?void 0:B.maxSelect)<=ue)break;f.push(Y)}t(1,f)}}jt(async()=>{t(10,h=await ae.getAdminFileToken(o.collectionId))});const $=U=>_(U),C=U=>g(U);function M(U){a=U,t(0,a),t(6,i),t(4,r)}const D=U=>y(U);function I(U){f=U,t(1,f)}function L(U){ee[U?"unshift":"push"](()=>{c=U,t(7,c)})}const R=()=>{for(let U of c.files)f.push(U);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(U){ee[U?"unshift":"push"](()=>{d=U,t(8,d)})}const P=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,f=U.uploadedFiles),"deletedFileNames"in U&&t(2,u=U.deletedFileNames)},n.$$.update=()=>{var U,Z;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=j.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=j.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((U=r.options)==null?void 0:U.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,y,T,$,C,M,D,I,L,R,F,N,P,q]}class RO extends _e{constructor(e){super(),he(this,e,FO,PO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Gp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function qO(n,e){e=Gp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Gp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Xp(n,e,t){const i=n.slice();i[5]=e[t];const l=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=l,i}function Qp(n,e,t){const i=n.slice();return i[9]=e[t],i}function xp(n){let e,t;return e=new Ba({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&5&&(s.filename=i[9]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function em(n){let e=!j.isEmpty(n[9]),t,i,l=e&&xp(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&5&&(e=!j.isEmpty(s[9])),e?l?(l.p(s,o),o&5&&E(l,1)):(l=xp(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(se(),A(l,1,1,()=>{l=null}),oe())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function tm(n){let e,t,i=de(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oA(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=O();for(let _=0;_t(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,f,u,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,l=((f=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:f.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,s=((c=(u=i==null?void 0:i.schema)==null?void 0:u.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,s,l,i,o]}class Xo extends _e{constructor(e){super(),he(this,e,HO,jO,me,{record:0})}}function nm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function im(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function lm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function sm(n){let e,t=!n[13]&&om(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=om(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function om(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&rm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=O(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=rm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function rm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function zO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function VO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function am(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[we(Le.call(null,t,"Edit")),K(t,"keydown",cn(n[27])),K(t,"click",cn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,ve(l)}}}function fm(n,e){let t,i,l,s,o,r,a,f;function u(g,y){return g[6]?VO:zO}let c=u(e),d=c(e);s=new Xo({props:{record:e[49]}});let m=!e[11]&&am(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=O(),l=b("div"),V(s.$$.fragment),o=O(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),H(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(f=[K(t,"click",h),K(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=u(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=am(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),z(s),m&&m.d(),a=!1,ve(f)}}}function um(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=W("("),i=W(t),l=W(" of MAX "),s=W(n[4]),o=W(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&16&&le(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function BO(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function UO(n){let e,t,i=de(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=O(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(u,c){w(u,e,c),H(t,e,null),k(e,i),k(e,l),w(u,s,c),o=!0,r||(a=K(l,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(u){o||(E(t.$$.fragment,u),o=!0)},o(u){A(t.$$.fragment,u),o=!1},d(u){u&&(v(e),v(s)),z(t),r=!1,a()}}}function dm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[WO,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Os({props:s}),ee.push(()=>ge(e,"list",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function YO(n){let e,t,i,l,s,o=[],r=new Map,a,f,u,c,d,m,h,_,g,y,S,T;t=new Ss({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&lm(n),C=de(n[8]);const M=P=>P[49].id;for(let P=0;P1&&cm(n);const R=[UO,BO],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),V(t.$$.fragment),i=O(),$&&$.c(),l=O(),s=b("div");for(let P=0;P1?L?L.p(P,q):(L=cm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let Z=h;h=N(P),h===Z?F[h].p(P,q):(se(),A(F[Z],1,1,()=>{F[Z]=null}),oe(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;qCancel',t=O(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function ZO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[JO],header:[KO],default:[YO]},$$scope:{ctx:n}};for(let a=0;at(26,m=Se));const h=st(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],M=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,M=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const Se=j.toArray(g);if(!l||!Se.length)return;t(24,R=!0);let pt=[];const Ht=Se.slice(),dn=[];for(;Ht.length>0;){const rn=[];for(const Rn of Ht.splice(0,to))rn.push(`id="${Rn}"`);dn.push(ae.collection(l).getFullList({batch:to,filter:rn.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(rn=>{pt=pt.concat(...rn)}),t(6,M=[]);for(const rn of Se){const Rn=j.findByKey(pt,"id",rn);Rn&&M.push(Rn)}$.trim()||t(8,C=j.filterDuplicatesByKey(M.concat(C))),t(24,R=!1)}catch(rn){rn.isAbort||(ae.error(rn),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&($.trim()?t(8,C=[]):t(8,C=j.toArray(M).slice()));try{const pt=Se?1:D+1,Ht=j.getAllCollectionIdentifiers(s),dn=await ae.collection(l).getList(pt,to,{filter:j.normalizeSearchFilter($,Ht),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(dn.items))),D=dn.page,t(23,I=dn.items.length),t(3,L=!1)}catch(pt){pt.isAbort||(ae.error(pt),t(3,L=!1))}}}function U(Se){i==1?t(6,M=[Se]):f&&(j.pushOrReplaceByKey(M,Se),t(6,M))}function Z(Se){j.removeByKey(M,"id",Se.id),t(6,M)}function G(Se){u(Se)?Z(Se):U(Se)}function B(){var Se;i!=1?t(20,g=M.map(pt=>pt.id)):t(20,g=((Se=M==null?void 0:M[0])==null?void 0:Se.id)||""),h("save",M),N()}function Y(Se){Te.call(this,n,Se)}const ue=()=>N(),ie=()=>B(),be=Se=>t(2,$=Se.detail),Ae=()=>T==null?void 0:T.show(),He=Se=>T==null?void 0:T.show(Se),Je=Se=>G(Se),tt=(Se,pt)=>{(pt.code==="Enter"||pt.code==="Space")&&(pt.preventDefault(),pt.stopPropagation(),G(Se))},bt=()=>t(2,$=""),at=()=>{a&&!L&&q()},Pt=Se=>Z(Se);function Gt(Se){M=Se,t(6,M)}function Me(Se){ee[Se?"unshift":"push"](()=>{S=Se,t(1,S)})}function Ee(Se){Te.call(this,n,Se)}function ze(Se){Te.call(this,n,Se)}function ht(Se){ee[Se?"unshift":"push"](()=>{T=Se,t(7,T)})}const te=Se=>{j.removeByKey(C,"id",Se.detail.record.id),C.unshift(Se.detail.record),t(8,C),U(Se.detail.record)},Fe=Se=>{j.removeByKey(C,"id",Se.detail.id),t(8,C),Z(Se.detail)};return n.$$set=Se=>{e=Pe(Pe({},e),Wt(Se)),t(19,d=Ge(e,c)),"value"in Se&&t(20,g=Se.value),"field"in Se&&t(21,y=Se.field)},n.$$.update=()=>{var Se,pt;n.$$.dirty[0]&2097152&&t(4,i=((Se=y==null?void 0:y.options)==null?void 0:Se.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(pt=y==null?void 0:y.options)==null?void 0:pt.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ht=>Ht.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==to),n.$$.dirty[0]&80&&t(10,f=i===null||i>M.length),n.$$.dirty[0]&64&&t(9,u=function(Ht){return j.findByKey(M,"id",Ht.id)})},[N,S,$,L,i,s,M,T,C,u,f,o,a,r,q,U,Z,G,B,d,g,y,F,I,R,l,m,Y,ue,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt,Me,Ee,ze,ht,te,Fe]}class XO extends _e{constructor(e){super(),he(this,e,GO,ZO,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function pm(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function mm(n,e,t){const i=n.slice();return i[26]=e[t],i}function hm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=we(t=Le.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Tt(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function _m(n){let e,t=n[5]&&gm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=gm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function gm(n){let e,t=de(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function QO(n){let e,t,i,l,s,o,r,a,f,u;i=new Xo({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),o=b("button"),o.innerHTML='',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,f||(u=[we(Le.call(null,o,"Remove")),K(o,"click",c)],f=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),z(i),f=!1,ve(u)}}}function km(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[QO,({dragging:a,dragover:f})=>({24:a,25:f}),({dragging:a,dragover:f})=>(a?16777216:0)|(f?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Os({props:r}),ee.push(()=>ge(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[23]),f&128&&(u.disabled=!e[7]),f&587202576&&(u.$$scope={dirty:f,ctx:e}),!l&&f&16&&(l=!0,u.list=e[4],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function xO(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&hm(n),M=de(n[4]);const D=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Wn(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",f=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,u,R),w(L,c,R),k(c,d);for(let F=0;F({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new pe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new XO({props:o}),n[16](i),i.$on("save",n[17]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),l=!0},p(r,[a]){const f={};a&4&&(f.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(f.name=r[2].name),a&537919735&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a&1&&(u.value=r[0]),a&4&&(u.field=r[2]),i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),z(e,r),n[16](null),z(i,r)}}}const ym=100;function tM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],f=!1,u,c=[];function d(){if(f)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,f=!1);return}t(5,f=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,ym))N.push(`id="${P}"`);L.push(ae.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(ym,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){ae.error(N)}t(5,f=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}bs(()=>{clearTimeout(u)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){ee[D?"unshift":"push"](()=>{o=D,t(1,o)})}const M=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,f=!0),clearTimeout(u),t(10,u=setTimeout(m,0)))},[s,o,l,r,a,f,c,i,h,_,u,g,y,S,T,$,C,M]}class nM extends _e{constructor(e){super(),he(this,e,tM,eM,me,{field:2,value:0,picker:1})}}function iM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),u0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function lM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function sM(n){let e;function t(s,o){return s[1]?lM:iM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function oM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let rM=oM();function Dr(){return window&&window.tinymce?window.tinymce:null}function aM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:f=""}=e,{text:u=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=f,S=s;const T=st();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(f),L.on(a,()=>{t(12,y=L.getContent()),y!==f&&(t(5,f=y),t(6,u=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Dr().init(I)}jt(()=>(Dr()!==null?$():rM.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I;try{g&&((I=Dr())==null||I.remove(g))}catch{}}));function C(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function M(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){ee[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,f=I.value),"text"in I&&t(6,u=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==f&&(g.setContent(f),t(6,u=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,f,u,s,o,r,a,g,y,S,C,M,D]}class Ua extends _e{constructor(e){super(),he(this,e,aM,sM,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function vm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function wm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Sm(n,e,t){const i=n.slice();return i[51]=e[t],i}function fM(n){let e,t,i=[],l=new Map,s,o,r,a,f,u,c,d,m,h,_,g=de(n[7]);const y=S=>S[51].id;for(let S=0;SNew record',c=O(),V(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(u,"type","button"),p(u,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$file field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function $m(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var f;t=b("button"),l=W(i),s=O(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((f=e[8])==null?void 0:f.id)==e[51].id),this.first=t},m(f,u){w(f,t,u),k(t,l),k(t,s),o||(r=K(t,"click",Be(a)),o=!0)},p(f,u){var c;e=f,u[0]&128&&i!==(i=e[51].name+"")&&le(l,i),u[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(f){f&&v(t),o=!1,r()}}}function cM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Tm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=O(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Tm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function dM(n){let e=[],t=new Map,i,l=de(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",Be(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function pM(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=ae.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=ae.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Cm(n){let e,t,i,l,s,o;function r(u,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(u[48])),t?mM:pM}let a=r(n,[-1,-1]),f=a(n);return{c(){e=b("button"),f.c(),i=O(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(u,c){w(u,e,c),f.m(e,null),k(e,i),s||(o=[we(l=Le.call(null,e,n[48]+` + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&v(e),z(t),l=!1,ve(s)}}}function jO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,h="";function _(U){j.removeByValue(u,U),t(2,u)}function g(U){j.pushUnique(u,U),t(2,u)}function y(U){j.isEmpty(f[U])||f.splice(U,1),t(1,f)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function T(U){var G,B;U.preventDefault(),t(9,m=!1);const Z=((G=U.dataTransfer)==null?void 0:G.files)||[];if(!(s||!Z.length)){for(const Y of Z){const ue=l.length+f.length-u.length;if(((B=r.options)==null?void 0:B.maxSelect)<=ue)break;f.push(Y)}t(1,f)}}jt(async()=>{t(10,h=await ae.getAdminFileToken(o.collectionId))});const $=U=>_(U),C=U=>g(U);function M(U){a=U,t(0,a),t(6,i),t(4,r)}const D=U=>y(U);function I(U){f=U,t(1,f)}function L(U){ee[U?"unshift":"push"](()=>{c=U,t(7,c)})}const R=()=>{for(let U of c.files)f.push(U);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(U){ee[U?"unshift":"push"](()=>{d=U,t(8,d)})}const P=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,f=U.uploadedFiles),"deletedFileNames"in U&&t(2,u=U.deletedFileNames)},n.$$.update=()=>{var U,Z;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=j.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=j.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((U=r.options)==null?void 0:U.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,y,T,$,C,M,D,I,L,R,F,N,P,q]}class HO extends _e{constructor(e){super(),he(this,e,jO,qO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Qp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function zO(n,e){e=Qp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Qp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function xp(n,e,t){const i=n.slice();i[5]=e[t];const l=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=l,i}function em(n,e,t){const i=n.slice();return i[9]=e[t],i}function tm(n){let e,t;return e=new Wa({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&5&&(s.filename=i[9]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function nm(n){let e=!j.isEmpty(n[9]),t,i,l=e&&tm(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&5&&(e=!j.isEmpty(s[9])),e?l?(l.p(s,o),o&5&&E(l,1)):(l=tm(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(se(),A(l,1,1,()=>{l=null}),oe())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function im(n){let e,t,i=de(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oA(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=O();for(let _=0;_t(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,f,u,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,l=((f=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:f.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,s=((c=(u=i==null?void 0:i.schema)==null?void 0:u.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,s,l,i,o]}class xo extends _e{constructor(e){super(),he(this,e,BO,VO,me,{record:0})}}function lm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function sm(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function om(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function rm(n){let e,t=!n[13]&&am(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=am(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function am(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&fm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=O(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=fm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function fm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function UO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function WO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function um(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[we(Le.call(null,t,"Edit")),K(t,"keydown",cn(n[27])),K(t,"click",cn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,ve(l)}}}function cm(n,e){let t,i,l,s,o,r,a,f;function u(g,y){return g[6]?WO:UO}let c=u(e),d=c(e);s=new xo({props:{record:e[49]}});let m=!e[11]&&um(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=O(),l=b("div"),V(s.$$.fragment),o=O(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),H(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(f=[K(t,"click",h),K(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=u(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=um(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),z(s),m&&m.d(),a=!1,ve(f)}}}function dm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function pm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=W("("),i=W(t),l=W(" of MAX "),s=W(n[4]),o=W(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&16&&le(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function YO(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function KO(n){let e,t,i=de(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=O(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(u,c){w(u,e,c),H(t,e,null),k(e,i),k(e,l),w(u,s,c),o=!0,r||(a=K(l,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(u){o||(E(t.$$.fragment,u),o=!0)},o(u){A(t.$$.fragment,u),o=!1},d(u){u&&(v(e),v(s)),z(t),r=!1,a()}}}function mm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[JO,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Ms({props:s}),ee.push(()=>ge(e,"list",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function ZO(n){let e,t,i,l,s,o=[],r=new Map,a,f,u,c,d,m,h,_,g,y,S,T;t=new $s({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&om(n),C=de(n[8]);const M=P=>P[49].id;for(let P=0;P1&&pm(n);const R=[KO,YO],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),V(t.$$.fragment),i=O(),$&&$.c(),l=O(),s=b("div");for(let P=0;P1?L?L.p(P,q):(L=pm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let Z=h;h=N(P),h===Z?F[h].p(P,q):(se(),A(F[Z],1,1,()=>{F[Z]=null}),oe(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;qCancel',t=O(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,ve(s)}}}function QO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[XO],header:[GO],default:[ZO]},$$scope:{ctx:n}};for(let a=0;at(26,m=Se));const h=st(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],M=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,M=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const Se=j.toArray(g);if(!l||!Se.length)return;t(24,R=!0);let pt=[];const Ht=Se.slice(),dn=[];for(;Ht.length>0;){const rn=[];for(const Rn of Ht.splice(0,no))rn.push(`id="${Rn}"`);dn.push(ae.collection(l).getFullList({batch:no,filter:rn.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(rn=>{pt=pt.concat(...rn)}),t(6,M=[]);for(const rn of Se){const Rn=j.findByKey(pt,"id",rn);Rn&&M.push(Rn)}$.trim()||t(8,C=j.filterDuplicatesByKey(M.concat(C))),t(24,R=!1)}catch(rn){rn.isAbort||(ae.error(rn),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&($.trim()?t(8,C=[]):t(8,C=j.toArray(M).slice()));try{const pt=Se?1:D+1,Ht=j.getAllCollectionIdentifiers(s),dn=await ae.collection(l).getList(pt,no,{filter:j.normalizeSearchFilter($,Ht),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(dn.items))),D=dn.page,t(23,I=dn.items.length),t(3,L=!1)}catch(pt){pt.isAbort||(ae.error(pt),t(3,L=!1))}}}function U(Se){i==1?t(6,M=[Se]):f&&(j.pushOrReplaceByKey(M,Se),t(6,M))}function Z(Se){j.removeByKey(M,"id",Se.id),t(6,M)}function G(Se){u(Se)?Z(Se):U(Se)}function B(){var Se;i!=1?t(20,g=M.map(pt=>pt.id)):t(20,g=((Se=M==null?void 0:M[0])==null?void 0:Se.id)||""),h("save",M),N()}function Y(Se){Te.call(this,n,Se)}const ue=()=>N(),ie=()=>B(),be=Se=>t(2,$=Se.detail),Ae=()=>T==null?void 0:T.show(),He=Se=>T==null?void 0:T.show(Se),Je=Se=>G(Se),tt=(Se,pt)=>{(pt.code==="Enter"||pt.code==="Space")&&(pt.preventDefault(),pt.stopPropagation(),G(Se))},bt=()=>t(2,$=""),at=()=>{a&&!L&&q()},Pt=Se=>Z(Se);function Gt(Se){M=Se,t(6,M)}function Me(Se){ee[Se?"unshift":"push"](()=>{S=Se,t(1,S)})}function Ee(Se){Te.call(this,n,Se)}function ze(Se){Te.call(this,n,Se)}function ht(Se){ee[Se?"unshift":"push"](()=>{T=Se,t(7,T)})}const te=Se=>{j.removeByKey(C,"id",Se.detail.record.id),C.unshift(Se.detail.record),t(8,C),U(Se.detail.record)},Fe=Se=>{j.removeByKey(C,"id",Se.detail.id),t(8,C),Z(Se.detail)};return n.$$set=Se=>{e=Pe(Pe({},e),Wt(Se)),t(19,d=Ge(e,c)),"value"in Se&&t(20,g=Se.value),"field"in Se&&t(21,y=Se.field)},n.$$.update=()=>{var Se,pt;n.$$.dirty[0]&2097152&&t(4,i=((Se=y==null?void 0:y.options)==null?void 0:Se.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(pt=y==null?void 0:y.options)==null?void 0:pt.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ht=>Ht.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==no),n.$$.dirty[0]&80&&t(10,f=i===null||i>M.length),n.$$.dirty[0]&64&&t(9,u=function(Ht){return j.findByKey(M,"id",Ht.id)})},[N,S,$,L,i,s,M,T,C,u,f,o,a,r,q,U,Z,G,B,d,g,y,F,I,R,l,m,Y,ue,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt,Me,Ee,ze,ht,te,Fe]}class eM extends _e{constructor(e){super(),he(this,e,xO,QO,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function _m(n,e,t){const i=n.slice();return i[26]=e[t],i}function gm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=we(t=Le.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Tt(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function bm(n){let e,t=n[5]&&km(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=km(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function km(n){let e,t=de(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tM(n){let e,t,i,l,s,o,r,a,f,u;i=new xo({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),o=b("button"),o.innerHTML='',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,f||(u=[we(Le.call(null,o,"Remove")),K(o,"click",c)],f=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),z(i),f=!1,ve(u)}}}function vm(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[tM,({dragging:a,dragover:f})=>({24:a,25:f}),({dragging:a,dragover:f})=>(a?16777216:0)|(f?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Ms({props:r}),ee.push(()=>ge(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[23]),f&128&&(u.disabled=!e[7]),f&587202576&&(u.$$scope={dirty:f,ctx:e}),!l&&f&16&&(l=!0,u.list=e[4],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function nM(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&gm(n),M=de(n[4]);const D=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Wn(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",f=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,u,R),w(L,c,R),k(c,d);for(let F=0;F({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new pe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new eM({props:o}),n[16](i),i.$on("save",n[17]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),l=!0},p(r,[a]){const f={};a&4&&(f.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(f.name=r[2].name),a&537919735&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a&1&&(u.value=r[0]),a&4&&(u.field=r[2]),i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),z(e,r),n[16](null),z(i,r)}}}const wm=100;function lM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],f=!1,u,c=[];function d(){if(f)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,f=!1);return}t(5,f=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,wm))N.push(`id="${P}"`);L.push(ae.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(wm,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){ae.error(N)}t(5,f=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}ks(()=>{clearTimeout(u)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){ee[D?"unshift":"push"](()=>{o=D,t(1,o)})}const M=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,f=!0),clearTimeout(u),t(10,u=setTimeout(m,0)))},[s,o,l,r,a,f,c,i,h,_,u,g,y,S,T,$,C,M]}class sM extends _e{constructor(e){super(),he(this,e,lM,iM,me,{field:2,value:0,picker:1})}}function oM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),m0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function rM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function aM(n){let e;function t(s,o){return s[1]?rM:oM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function fM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let uM=fM();function Ir(){return window&&window.tinymce?window.tinymce:null}function cM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:f=""}=e,{text:u=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=f,S=s;const T=st();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(f),L.on(a,()=>{t(12,y=L.getContent()),y!==f&&(t(5,f=y),t(6,u=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Ir().init(I)}jt(()=>(Ir()!==null?$():uM.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I;try{g&&((I=Ir())==null||I.remove(g))}catch{}}));function C(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function M(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){ee[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,f=I.value),"text"in I&&t(6,u=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==f&&(g.setContent(f),t(6,u=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,f,u,s,o,r,a,g,y,S,C,M,D]}class Ya extends _e{constructor(e){super(),he(this,e,cM,aM,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Sm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function $m(n,e,t){const i=n.slice();return i[48]=e[t],i}function Tm(n,e,t){const i=n.slice();return i[51]=e[t],i}function dM(n){let e,t,i=[],l=new Map,s,o,r,a,f,u,c,d,m,h,_,g=de(n[7]);const y=S=>S[51].id;for(let S=0;SNew record',c=O(),V(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(u,"type","button"),p(u,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$file field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Cm(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var f;t=b("button"),l=W(i),s=O(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((f=e[8])==null?void 0:f.id)==e[51].id),this.first=t},m(f,u){w(f,t,u),k(t,l),k(t,s),o||(r=K(t,"click",Be(a)),o=!0)},p(f,u){var c;e=f,u[0]&128&&i!==(i=e[51].name+"")&&le(l,i),u[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(f){f&&v(t),o=!1,r()}}}function mM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Om(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=O(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Om(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function hM(n){let e=[],t=new Map,i,l=de(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",Be(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function _M(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function gM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=ae.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=ae.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Mm(n){let e,t,i,l,s,o;function r(u,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(u[48])),t?gM:_M}let a=r(n,[-1,-1]),f=a(n);return{c(){e=b("button"),f.c(),i=O(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(u,c){w(u,e,c),f.m(e,null),k(e,i),s||(o=[we(l=Le.call(null,e,n[48]+` (record: `+n[44].id+")")),K(e,"click",Be(function(){Tt(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(u,c){n=u,a===(a=r(n,c))&&f?f.p(n,c):(f.d(1),f=a(n),f&&(f.c(),f.m(e,i))),l&&Tt(l.update)&&c[0]&32&&l.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(u){u&&v(e),f.d(),s=!1,ve(o)}}}function Om(n,e){let t,i,l=de(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hM(n){let e,t;function i(r,a){if(r[15])return dM;if(!r[6])return cM}let l=i(n),s=l&&l(n),o=n[6]&&Mm();return{c(){s&&s.c(),e=O(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Mm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function _M(n){let e,t,i,l;const s=[uM,fM],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function gM(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&le(t,i[0])},d(i){i&&v(e)}}}function Dm(n){let e,t;return e=new pe({props:{class:"form-field file-picker-size-select",$$slots:{default:[bM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function bM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function kM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Dm(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),m&&m.c(),s=O(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=f=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),u=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(_,g){var y;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Dm(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(se(),A(m,1,1,()=>{m=null}),oe()),(!u||g[0]&2)&&le(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(E(m),u=!0)},o(_){A(m),u=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,ve(d)}}}function yM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[kM],header:[gM],default:[_M]},$$scope:{ctx:n}};for(let a=0;at(27,f=Ee));const u=st(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,M=[],D=[],I=[],L={},R={},F="";function N(){return Z(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function U(){t(4,y="")}async function Z(Ee=!1){if(L!=null&&L.id){t(6,C=!0),Ee&&q();try{const ze=Ee?1:T+1,ht=j.getAllCollectionIdentifiers(L);let te=j.normalizeSearchFilter(y,ht)||"";te&&(te+=" && "),te+="("+D.map(Se=>`${Se.name}:length>0`).join("||")+")";const Fe=await ae.collection(L.id).getList(ze,Em,{filter:te,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(Fe.items))),T=Fe.page,t(26,$=Fe.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ae.error(ze),t(6,C=!1))}}}function G(){var ze,ht;let Ee=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const te of D)if(j.toArray(R.record[te.name]).includes(R.name)){Ee=Ee.concat(j.toArray((ht=te.options)==null?void 0:ht.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const te of Ee)I.push({label:`${te} thumb`,value:te});F&&!Ee.includes(F)&&t(12,F="")}function B(Ee){let ze=[];for(const ht of D){const te=j.toArray(Ee[ht.name]);for(const Fe of te)h.includes(j.getFileType(Fe))&&ze.push(Fe)}return ze}function Y(Ee,ze){t(9,R={record:Ee,name:ze})}function ue(){o&&(u("submit",Object.assign({size:F},R)),P())}function ie(Ee){F=Ee,t(12,F)}const be=Ee=>{t(8,L=Ee)},Ae=Ee=>t(4,y=Ee.detail),He=()=>g==null?void 0:g.show(),Je=()=>{s&&Z()};function tt(Ee){ee[Ee?"unshift":"push"](()=>{_=Ee,t(3,_)})}function bt(Ee){Te.call(this,n,Ee)}function at(Ee){Te.call(this,n,Ee)}function Pt(Ee){ee[Ee?"unshift":"push"](()=>{g=Ee,t(10,g)})}const Gt=Ee=>{j.removeByKey(S,"id",Ee.detail.record.id),S.unshift(Ee.detail.record),t(5,S);const ze=B(Ee.detail.record);ze.length>0&&Y(Ee.detail.record,ze[0])},Me=Ee=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Ee.detail.id&&t(9,R={}),j.removeByKey(S,"id",Ee.detail.id),t(5,S)};return n.$$set=Ee=>{e=Pe(Pe({},e),Wt(Ee)),t(22,a=Ge(e,r)),"title"in Ee&&t(0,d=Ee.title),"submitText"in Ee&&t(1,m=Ee.submitText),"fileTypes"in Ee&&t(24,h=Ee.fileTypes)},n.$$.update=()=>{var Ee;n.$$.dirty[0]&134217728&&t(7,M=f.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(ht=>{var te,Fe,Se,pt,Ht;return ht.type==="file"&&!((te=ht.options)!=null&&te.protected)&&(!((Se=(Fe=ht.options)==null?void 0:Fe.mimeTypes)!=null&&Se.length)||!!((Ht=(pt=ht.options)==null?void 0:pt.mimeTypes)!=null&&Ht.find(dn=>dn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&M.length>0&&t(8,L=M[0]),n.$$.dirty[0]&256&&(D=(Ee=L==null?void 0:L.schema)==null?void 0:Ee.filter(ze=>{var ht;return ze.type==="file"&&!((ht=ze.options)!=null&&ht.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(U(),G()),n.$$.dirty[0]&512&&R!=null&&R.name&&G(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&Z(!0),n.$$.dirty[0]&512&&t(16,i=(ze,ht)=>{var te;return(R==null?void 0:R.name)==ht&&((te=R==null?void 0:R.record)==null?void 0:te.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>B(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Em),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,M,L,R,g,I,F,o,s,l,i,U,Z,B,Y,ue,a,c,h,N,$,f,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt,Me]}class wM extends _e{constructor(e){super(),he(this,e,vM,yM,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function SM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function $M(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Ua({props:s}),ee.push(()=>ge(e,"value",l)),e.$on("init",n[7]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function TM(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m;const h=[$M,SM],_=[];function g(y,S){return y[4]?0:1}return u=g(n),c=_[u]=h[u](n),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),_[u].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&le(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=u;u=g(y),u===T?_[u].p(y,S):(se(),A(_[T],1,1,()=>{_[T]=null}),oe(),c=_[u],c?c.p(y,S):(c=_[u]=h[u](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(f),v(d)),_[u].d(y)}}}function CM(n){let e,t,i,l;e=new pe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[TM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new wM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),z(e,o),n[8](null),z(i,o)}}}function OM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,f=null;jt(async()=>(typeof s>"u"&&t(0,s=""),f=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(f)}));function u(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ee[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,ae.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,u,c,d,m]}class MM extends _e{constructor(e){super(),he(this,e,OM,CM,me,{field:1,value:0})}}function DM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function EM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=K(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function IM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User API URL"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=K(s,"input",n[7]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function AM(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[DM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[EM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[IM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),p(e,"class","section-title")},m(u,c){w(u,e,c),k(e,t),w(u,i,c),H(l,u,c),w(u,s,c),H(o,u,c),w(u,r,c),H(a,u,c),f=!0},p(u,[c]){(!f||c&4)&&le(t,u[2]);const d={};c&8&&(d.class="form-field "+(u[3]?"required":"")),c&2&&(d.name=u[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&8&&(m.class="form-field "+(u[3]?"required":"")),c&2&&(m.name=u[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:u}),o.$set(m);const h={};c&8&&(h.class="form-field "+(u[3]?"required":"")),c&2&&(h.name=u[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:u}),a.$set(h)},i(u){f||(E(l.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),f=!0)},o(u){A(l.$$.fragment,u),A(o.$$.fragment,u),A(a.$$.fragment,u),f=!1},d(u){u&&(v(e),v(i),v(s),v(r)),z(l,u),z(o,u),z(a,u)}}}function LM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function f(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,f,u]}class Er extends _e{constructor(e){super(),he(this,e,LM,AM,me,{key:1,config:0,required:4,title:2})}}function NM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Display name"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","text"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].displayName),r||(a=K(s,"input",n[2]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].displayName&&re(s,f[0].displayName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function PM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=K(s,"input",n[3]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function FM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=K(s,"input",n[4]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User API URL"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[7]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[7])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[6]),we(Le.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],f=!0)},p(c,d){d&128&&t!==(t=c[7])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&128&&a!==(a=c[7])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function jM(n){let e,t,i,l,s,o,r,a,f,u,c,d;return e=new pe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[NM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[PM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[FM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:n[1]+".userApiUrl",$$slots:{default:[RM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),c=new pe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[qM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),i=b("div"),i.textContent="Endpoints",l=O(),V(s.$$.fragment),o=O(),V(r.$$.fragment),a=O(),V(f.$$.fragment),u=O(),V(c.$$.fragment),p(i,"class","section-title")},m(m,h){H(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),H(s,m,h),w(m,o,h),H(r,m,h),w(m,a,h),H(f,m,h),w(m,u,h),H(c,m,h),d=!0},p(m,[h]){const _={};h&2&&(_.name=m[1]+".displayName"),h&385&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&2&&(g.name=m[1]+".authUrl"),h&385&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&2&&(y.name=m[1]+".tokenUrl"),h&385&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&2&&(S.name=m[1]+".userApiUrl"),h&385&&(S.$$scope={dirty:h,ctx:m}),f.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&385&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(f.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(f.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(u)),z(e,m),z(s,m),z(r,m),z(f,m),z(c,m)}}}function HM(n,e,t){let{key:i=""}=e,{config:l={}}=e;j.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC");function s(){l.displayName=this.value,t(0,l)}function o(){l.authUrl=this.value,t(0,l)}function r(){l.tokenUrl=this.value,t(0,l)}function a(){l.userApiUrl=this.value,t(0,l)}function f(){l.pkce=this.checked,t(0,l)}return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a,f]}class Ir extends _e{constructor(e){super(),he(this,e,HM,jM,me,{key:1,config:0})}}function zM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=W("Auth URL"),l=O(),s=b("input"),a=O(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=K(s,"input",n[2]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&re(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function VM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=W("Token URL"),l=O(),s=b("input"),a=O(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=K(s,"input",n[3]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&re(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function BM(n){let e,t,i,l,s,o;return i=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[zM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[VM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,l,a),H(s,r,a),o=!0},p(r,[a]){const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".authUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".tokenUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),z(i,r),z(s,r)}}}function UM(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class WM extends _e{constructor(e){super(),he(this,e,UM,BM,me,{key:1,config:0})}}function YM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=K(s,"input",n[12]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function KM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Team ID"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[3]),r||(a=K(s,"input",n[13]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&8&&s.value!==f[3]&&re(s,f[3])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function JM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Key ID"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[4]),r||(a=K(s,"input",n[14]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&16&&s.value!==f[4]&&re(s,f[4])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function ZM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=O(),l=b("i"),o=O(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",mo),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[6]),f||(u=[we(Le.call(null,l,{text:`Max ${mo} seconds (~${mo/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&(v(e),v(o),v(r)),f=!1,ve(u)}}}function GM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Private key"),l=O(),s=b("textarea"),r=O(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- +(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(u){u&&v(e),f.d(),s=!1,ve(o)}}}function Dm(n,e){let t,i,l=de(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function bM(n){let e,t;function i(r,a){if(r[15])return hM;if(!r[6])return mM}let l=i(n),s=l&&l(n),o=n[6]&&Em();return{c(){s&&s.c(),e=O(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Em(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function kM(n){let e,t,i,l;const s=[pM,dM],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function yM(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&le(t,i[0])},d(i){i&&v(e)}}}function Im(n){let e,t;return e=new pe({props:{class:"form-field file-picker-size-select",$$slots:{default:[vM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function vM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new hi({props:s}),ee.push(()=>ge(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function wM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Im(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),m&&m.c(),s=O(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=f=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),u=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(_,g){var y;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Im(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(se(),A(m,1,1,()=>{m=null}),oe()),(!u||g[0]&2)&&le(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(E(m),u=!0)},o(_){A(m),u=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,ve(d)}}}function SM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[wM],header:[yM],default:[kM]},$$scope:{ctx:n}};for(let a=0;at(27,f=Ee));const u=st(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,M=[],D=[],I=[],L={},R={},F="";function N(){return Z(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function U(){t(4,y="")}async function Z(Ee=!1){if(L!=null&&L.id){t(6,C=!0),Ee&&q();try{const ze=Ee?1:T+1,ht=j.getAllCollectionIdentifiers(L);let te=j.normalizeSearchFilter(y,ht)||"";te&&(te+=" && "),te+="("+D.map(Se=>`${Se.name}:length>0`).join("||")+")";const Fe=await ae.collection(L.id).getList(ze,Am,{filter:te,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(Fe.items))),T=Fe.page,t(26,$=Fe.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ae.error(ze),t(6,C=!1))}}}function G(){var ze,ht;let Ee=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const te of D)if(j.toArray(R.record[te.name]).includes(R.name)){Ee=Ee.concat(j.toArray((ht=te.options)==null?void 0:ht.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const te of Ee)I.push({label:`${te} thumb`,value:te});F&&!Ee.includes(F)&&t(12,F="")}function B(Ee){let ze=[];for(const ht of D){const te=j.toArray(Ee[ht.name]);for(const Fe of te)h.includes(j.getFileType(Fe))&&ze.push(Fe)}return ze}function Y(Ee,ze){t(9,R={record:Ee,name:ze})}function ue(){o&&(u("submit",Object.assign({size:F},R)),P())}function ie(Ee){F=Ee,t(12,F)}const be=Ee=>{t(8,L=Ee)},Ae=Ee=>t(4,y=Ee.detail),He=()=>g==null?void 0:g.show(),Je=()=>{s&&Z()};function tt(Ee){ee[Ee?"unshift":"push"](()=>{_=Ee,t(3,_)})}function bt(Ee){Te.call(this,n,Ee)}function at(Ee){Te.call(this,n,Ee)}function Pt(Ee){ee[Ee?"unshift":"push"](()=>{g=Ee,t(10,g)})}const Gt=Ee=>{j.removeByKey(S,"id",Ee.detail.record.id),S.unshift(Ee.detail.record),t(5,S);const ze=B(Ee.detail.record);ze.length>0&&Y(Ee.detail.record,ze[0])},Me=Ee=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Ee.detail.id&&t(9,R={}),j.removeByKey(S,"id",Ee.detail.id),t(5,S)};return n.$$set=Ee=>{e=Pe(Pe({},e),Wt(Ee)),t(22,a=Ge(e,r)),"title"in Ee&&t(0,d=Ee.title),"submitText"in Ee&&t(1,m=Ee.submitText),"fileTypes"in Ee&&t(24,h=Ee.fileTypes)},n.$$.update=()=>{var Ee;n.$$.dirty[0]&134217728&&t(7,M=f.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(ht=>{var te,Fe,Se,pt,Ht;return ht.type==="file"&&!((te=ht.options)!=null&&te.protected)&&(!((Se=(Fe=ht.options)==null?void 0:Fe.mimeTypes)!=null&&Se.length)||!!((Ht=(pt=ht.options)==null?void 0:pt.mimeTypes)!=null&&Ht.find(dn=>dn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&M.length>0&&t(8,L=M[0]),n.$$.dirty[0]&256&&(D=(Ee=L==null?void 0:L.schema)==null?void 0:Ee.filter(ze=>{var ht;return ze.type==="file"&&!((ht=ze.options)!=null&&ht.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(U(),G()),n.$$.dirty[0]&512&&R!=null&&R.name&&G(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&Z(!0),n.$$.dirty[0]&512&&t(16,i=(ze,ht)=>{var te;return(R==null?void 0:R.name)==ht&&((te=R==null?void 0:R.record)==null?void 0:te.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>B(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Am),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,M,L,R,g,I,F,o,s,l,i,U,Z,B,Y,ue,a,c,h,N,$,f,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt,Me]}class TM extends _e{constructor(e){super(),he(this,e,$M,SM,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function CM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function OM(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Ya({props:s}),ee.push(()=>ge(e,"value",l)),e.$on("init",n[7]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function MM(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m;const h=[OM,CM],_=[];function g(y,S){return y[4]?0:1}return u=g(n),c=_[u]=h[u](n),{c(){e=b("label"),t=b("i"),l=O(),s=b("span"),r=W(o),f=O(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),_[u].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&le(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=u;u=g(y),u===T?_[u].p(y,S):(se(),A(_[T],1,1,()=>{_[T]=null}),oe(),c=_[u],c?c.p(y,S):(c=_[u]=h[u](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(f),v(d)),_[u].d(y)}}}function DM(n){let e,t,i,l;e=new pe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[MM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new TM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),z(e,o),n[8](null),z(i,o)}}}function EM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,f=null;jt(async()=>(typeof s>"u"&&t(0,s=""),f=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(f)}));function u(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ee[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,ae.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,u,c,d,m]}class IM extends _e{constructor(e){super(),he(this,e,EM,DM,me,{field:1,value:0})}}function AM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function LM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=K(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function NM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User API URL"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=K(s,"input",n[7]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function PM(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[AM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[LM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[NM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),p(e,"class","section-title")},m(u,c){w(u,e,c),k(e,t),w(u,i,c),H(l,u,c),w(u,s,c),H(o,u,c),w(u,r,c),H(a,u,c),f=!0},p(u,[c]){(!f||c&4)&&le(t,u[2]);const d={};c&8&&(d.class="form-field "+(u[3]?"required":"")),c&2&&(d.name=u[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&8&&(m.class="form-field "+(u[3]?"required":"")),c&2&&(m.name=u[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:u}),o.$set(m);const h={};c&8&&(h.class="form-field "+(u[3]?"required":"")),c&2&&(h.name=u[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:u}),a.$set(h)},i(u){f||(E(l.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),f=!0)},o(u){A(l.$$.fragment,u),A(o.$$.fragment,u),A(a.$$.fragment,u),f=!1},d(u){u&&(v(e),v(i),v(s),v(r)),z(l,u),z(o,u),z(a,u)}}}function FM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function f(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,f,u]}class Ar extends _e{constructor(e){super(),he(this,e,FM,PM,me,{key:1,config:0,required:4,title:2})}}function RM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Display name"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","text"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].displayName),r||(a=K(s,"input",n[2]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].displayName&&re(s,f[0].displayName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=K(s,"input",n[3]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function jM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=K(s,"input",n[4]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function HM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User API URL"),l=O(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=K(s,"input",n[5]),r=!0)},p(f,u){u&128&&i!==(i=f[7])&&p(e,"for",i),u&128&&o!==(o=f[7])&&p(s,"id",o),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[7]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[7])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[6]),we(Le.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],f=!0)},p(c,d){d&128&&t!==(t=c[7])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&128&&a!==(a=c[7])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function VM(n){let e,t,i,l,s,o,r,a,f,u,c,d;return e=new pe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[RM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[qM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[jM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:n[1]+".userApiUrl",$$slots:{default:[HM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),c=new pe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[zM,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),i=b("div"),i.textContent="Endpoints",l=O(),V(s.$$.fragment),o=O(),V(r.$$.fragment),a=O(),V(f.$$.fragment),u=O(),V(c.$$.fragment),p(i,"class","section-title")},m(m,h){H(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),H(s,m,h),w(m,o,h),H(r,m,h),w(m,a,h),H(f,m,h),w(m,u,h),H(c,m,h),d=!0},p(m,[h]){const _={};h&2&&(_.name=m[1]+".displayName"),h&385&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&2&&(g.name=m[1]+".authUrl"),h&385&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&2&&(y.name=m[1]+".tokenUrl"),h&385&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&2&&(S.name=m[1]+".userApiUrl"),h&385&&(S.$$scope={dirty:h,ctx:m}),f.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&385&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(f.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(f.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(u)),z(e,m),z(s,m),z(r,m),z(f,m),z(c,m)}}}function BM(n,e,t){let{key:i=""}=e,{config:l={}}=e;j.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC");function s(){l.displayName=this.value,t(0,l)}function o(){l.authUrl=this.value,t(0,l)}function r(){l.tokenUrl=this.value,t(0,l)}function a(){l.userApiUrl=this.value,t(0,l)}function f(){l.pkce=this.checked,t(0,l)}return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a,f]}class Lr extends _e{constructor(e){super(),he(this,e,BM,VM,me,{key:1,config:0})}}function UM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=W("Auth URL"),l=O(),s=b("input"),a=O(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=K(s,"input",n[2]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&re(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function WM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=W("Token URL"),l=O(),s=b("input"),a=O(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=K(s,"input",n[3]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&re(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function YM(n){let e,t,i,l,s,o;return i=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[UM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[WM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,l,a),H(s,r,a),o=!0},p(r,[a]){const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".authUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".tokenUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),z(i,r),z(s,r)}}}function KM(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class JM extends _e{constructor(e){super(),he(this,e,KM,YM,me,{key:1,config:0})}}function ZM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=K(s,"input",n[12]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function GM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Team ID"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[3]),r||(a=K(s,"input",n[13]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&8&&s.value!==f[3]&&re(s,f[3])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function XM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Key ID"),l=O(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[4]),r||(a=K(s,"input",n[14]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&16&&s.value!==f[4]&&re(s,f[4])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function QM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=O(),l=b("i"),o=O(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",_o),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[6]),f||(u=[we(Le.call(null,l,{text:`Max ${_o} seconds (~${_o/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&(v(e),v(o),v(r)),f=!1,ve(u)}}}function xM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Private key"),l=O(),s=b("textarea"),r=O(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[5]),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[16]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&re(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function XM(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return l=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[YM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[KM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[JM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[ZM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[GM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),a=O(),f=b("div"),V(u.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),V(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),k(t,a),k(t,f),H(u,f,null),k(t,c),k(t,d),H(m,d,null),k(t,h),H(_,t,null),g=!0,y||(S=K(e,"submit",Be(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const M={};$&25165832&&(M.$$scope={dirty:$,ctx:T}),r.$set(M);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),u.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(l),z(r),z(u),z(m),z(_),y=!1,S()}}}function QM(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=W("Close"),i=O(),l=b("button"),s=b("i"),o=O(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=K(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function eD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[xM],header:[QM],default:[XM]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),z(e,l)}}}const mo=15777e3;function tD(n,e,t){let i;const l=st(),s="apple_secret_"+j.randomString(5);let o,r,a,f,u,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,f=R.keyId||""),t(5,u=R.privateKey||""),t(6,c=R.duration||mo),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await ae.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Et("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ae.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){f=this.value,t(4,f)}function T(){c=this.value,t(6,c)}function $(){u=this.value,t(5,u)}const C=()=>_(),M=()=>!d;function D(R){ee[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Te.call(this,n,R)}function L(R){Te.call(this,n,R)}return t(8,i=!0),[h,o,r,a,f,u,c,d,i,s,_,m,g,y,S,T,$,C,M,D,I,L]}class nD extends _e{constructor(e){super(),he(this,e,tD,eD,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function iD(n){let e,t,i,l,s,o,r,a,f,u,c={};return r=new nD({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=O(),l=b("span"),l.textContent="Generate secret",o=O(),V(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),H(r,d,m),a=!0,f||(u=K(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),z(r,d),f=!1,u()}}}function lD(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{var u;t(0,l.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",l)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class sD extends _e{constructor(e){super(),he(this,e,lD,iD,me,{key:1,config:0})}}const ho=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:sD},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:WM},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Er,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Er,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Er,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Ir},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Ir},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Ir}];function Im(n,e,t){const i=n.slice();return i[9]=e[t],i}function oD(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function rD(n){let e,t=de(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Am(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=O(),o=b("span"),a=W(r),f=O(),u=b("div"),c=W("ID: "),m=W(d),h=O(),_=b("button"),_.innerHTML='',g=O(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,f),k(e,u),k(u,c),k(u,m),k(e,h),k(e,_),k(e,g),y||(S=K(_,"click",T),y=!0)},p($,C){var M;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&le(a,r),C&2&&d!==(d=n[9].providerId+"")&&le(m,d)},d($){$&&v(e),y=!1,S()}}}function fD(n){let e;function t(s,o){var r;return s[2]?aD:(r=s[0])!=null&&r.id&&s[1].length?rD:oD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function uD(n,e,t){const i=st();let{record:l}=e,s=[],o=!1;function r(d){return ho.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function f(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ae.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ae.error(d)}t(2,o=!1)}function u(d){!(l!=null&&l.id)||!d||fn(`Do you really want to unlink the ${a(d)} provider?`,()=>ae.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Et(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{ae.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,u,c]}class cD extends _e{constructor(e){super(),he(this,e,uD,fD,me,{record:0})}}function Lm(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Nm(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=O(),s=b("div"),o=W(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=O(),f=b("button"),f.innerHTML='',u=O(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(f,"type","button"),p(f,"class","close"),p(f,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,f),k(e,u),k(e,c),m=!0,h||(_=[K(r,"click",n[38]),we(Le.call(null,f,"Discard draft")),K(f,"click",Be(n[39]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=fa(e,xe,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,ve(_)}}}function Pm(n){let e,t,i;return t=new jb({props:{model:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function dD(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y=!n[6]&&Pm(n);return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="id",s=O(),o=b("span"),a=O(),y&&y.c(),f=O(),u=b("input"),p(t,"class",Wn(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(u,"type","text"),p(u,"id",c=n[72]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,f,T),w(S,u,T),re(u,n[3].id),h=!0,_||(g=K(u,"input",n[40]),_=!0)},p(S,T){(!h||T[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?y&&(se(),A(y,1,1,()=>{y=null}),oe()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=Pm(S),y.c(),E(y,1),y.m(f.parentNode,f)),(!h||T[2]&1024&&c!==(c=S[72]))&&p(u,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(u.readOnly=m),T[0]&8&&u.value!==S[3].id&&re(u,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(f),v(u)),y&&y.d(S),_=!1,g()}}}function Fm(n){var f,u;let e,t,i,l,s;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new S6({props:r}),ee.push(()=>ge(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&Rm();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),l=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Rm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),z(e,c),a&&a.d(c)}}}function Rm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function pD(n){let e,t,i;function l(o){n[54](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new nM({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function mD(n){let e,t,i,l,s;function o(u){n[51](u,n[69])}function r(u){n[52](u,n[69])}function a(u){n[53](u,n[69])}let f={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(f.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(f.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(f.deletedFileNames=n[5][n[69].name]),e=new RO({props:f}),ee.push(()=>ge(e,"value",o)),ee.push(()=>ge(e,"uploadedFiles",r)),ee.push(()=>ge(e,"deletedFileNames",a)),{c(){V(e.$$.fragment)},m(u,c){H(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ke(()=>l=!1)),e.$set(d)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),s=!1},d(u){z(e,u)}}}function hD(n){let e,t,i;function l(o){n[50](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new fO({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function _D(n){let e,t,i;function l(o){n[49](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new eO({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function gD(n){let e,t,i;function l(o){n[48](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new G6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function bD(n){let e,t,i;function l(o){n[47](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new MM({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function kD(n){let e,t,i;function l(o){n[46](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new Y6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function yD(n){let e,t,i;function l(o){n[45](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new V6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function vD(n){let e,t,i;function l(o){n[44](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new q6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function wD(n){let e,t,i;function l(o){n[43](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new N6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function SD(n){let e,t,i;function l(o){n[42](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new E6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function qm(n,e){let t,i,l,s,o;const r=[SD,wD,vD,yD,kD,bD,gD,_D,hD,mD,pD],a=[];function f(u,c){return u[69].type==="text"?0:u[69].type==="number"?1:u[69].type==="bool"?2:u[69].type==="email"?3:u[69].type==="url"?4:u[69].type==="editor"?5:u[69].type==="date"?6:u[69].type==="select"?7:u[69].type==="json"?8:u[69].type==="file"?9:u[69].type==="relation"?10:-1}return~(i=f(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,s,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(l&&(se(),A(a[d],1,1,()=>{a[d]=null}),oe()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(u){o||(E(l),o=!0)},o(u){A(l),o=!1},d(u){u&&(v(t),v(s)),~i&&a[i].d(u)}}}function jm(n){let e,t,i;return t=new cD({props:{record:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===hs)},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===hs)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function $D(n){var S;let e,t,i,l,s,o,r=[],a=new Map,f,u,c,d,m=!n[8]&&n[10]&&!n[7]&&Nm(n);l=new pe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[dD,({uniqueId:T})=>({72:T}),({uniqueId:T})=>[0,0,T?1024:0]]},$$scope:{ctx:n}}});let h=n[14]&&Fm(n),_=de(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[69].name;for(let T=0;T<_.length;T+=1){let $=Lm(n,_,T),C=g($);a.set(C,r[T]=qm(C,$))}let y=n[14]&&!n[6]&&jm(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=O(),V(l.$$.fragment),s=O(),h&&h.c(),o=O();for(let T=0;T{m=null}),oe());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&3072&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=Fm(T),h.c(),E(h,1),h.m(t,o)):h&&(se(),A(h,1,1,()=>{h=null}),oe()),$[0]&57&&(_=de(((M=T[0])==null?void 0:M.schema)||[]),se(),r=ct(r,$,g,1,T,_,a,t,It,qm,null,Lm),oe()),(!u||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!u||$[0]&8192)&&x(t,"active",T[13]===Gi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=jm(T),y.c(),E(y,1),y.m(e,null)):y&&(se(),A(y,1,1,()=>{y=null}),oe())},i(T){if(!u){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),u=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;${d=null}),oe()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Hm(h),d.c(),E(d,1),d.m(u.parentNode,u))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(f),v(u)),d&&d.d(h)}}}function CD(n){let e,t,i;return{c(){e=b("span"),t=O(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function Hm(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[OD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),i=b("button"),l=b("i"),s=O(),V(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,f){const u={};f[0]&16388|f[2]&2048&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),z(o)}}}function zm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[32]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Vm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function OD(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&zm(n),f=n[14]&&n[2].email&&Vm(n);return{c(){a&&a.c(),e=O(),f&&f.c(),t=O(),i=b("button"),i.innerHTML=' Duplicate',l=O(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable")},m(u,c){a&&a.m(u,c),w(u,e,c),f&&f.m(u,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),o||(r=[K(i,"click",n[34]),K(s,"click",cn(Be(n[35])))],o=!0)},p(u,c){u[14]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=zm(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[14]&&u[2].email?f?f.p(u,c):(f=Vm(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){u&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(u),f&&f.d(u),o=!1,ve(r)}}}function Bm(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Gi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===hs),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[K(t,"click",n[36]),K(l,"click",n[37])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Gi),a[0]&8192&&x(l,"active",r[13]===hs)},d(r){r&&v(e),s=!1,ve(o)}}}function MD(n){let e,t,i,l,s;const o=[CD,TD],r=[];function a(u,c){return u[7]?0:1}e=a(n),t=r[e]=o[e](n);let f=n[14]&&!n[6]&&Bm(n);return{c(){t.c(),i=O(),f&&f.c(),l=ye()},m(u,c){r[e].m(u,c),w(u,i,c),f&&f.m(u,c),w(u,l,c),s=!0},p(u,c){let d=e;e=a(u),e===d?r[e].p(u,c):(se(),A(r[d],1,1,()=>{r[d]=null}),oe(),t=r[e],t?t.p(u,c):(t=r[e]=o[e](u),t.c()),E(t,1),t.m(i.parentNode,i)),u[14]&&!u[6]?f?f.p(u,c):(f=Bm(u),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(u){s||(E(t),s=!0)},o(u){A(t),s=!1},d(u){u&&(v(i),v(l)),r[e].d(u),f&&f.d(u)}}}function DD(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,f,u,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=O(),s=b("button"),o=b("span"),a=W(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),u||(c=K(e,"click",n[31]),u=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&le(a,r),m[0]&34816&&f!==(f=!d[15]||d[11])&&(s.disabled=f),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),u=!1,c()}}}function ED(n){let e,t,i={class:` +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[5]),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[16]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&re(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function eD(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return l=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[ZM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[GM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[XM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[QM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[xM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),a=O(),f=b("div"),V(u.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),V(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),k(t,a),k(t,f),H(u,f,null),k(t,c),k(t,d),H(m,d,null),k(t,h),H(_,t,null),g=!0,y||(S=K(e,"submit",Be(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const M={};$&25165832&&(M.$$scope={dirty:$,ctx:T}),r.$set(M);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),u.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(l),z(r),z(u),z(m),z(_),y=!1,S()}}}function tD(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nD(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=W("Close"),i=O(),l=b("button"),s=b("i"),o=O(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=K(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function iD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[nD],header:[tD],default:[eD]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),z(e,l)}}}const _o=15777e3;function lD(n,e,t){let i;const l=st(),s="apple_secret_"+j.randomString(5);let o,r,a,f,u,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,f=R.keyId||""),t(5,u=R.privateKey||""),t(6,c=R.duration||_o),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await ae.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Et("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ae.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){f=this.value,t(4,f)}function T(){c=this.value,t(6,c)}function $(){u=this.value,t(5,u)}const C=()=>_(),M=()=>!d;function D(R){ee[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Te.call(this,n,R)}function L(R){Te.call(this,n,R)}return t(8,i=!0),[h,o,r,a,f,u,c,d,i,s,_,m,g,y,S,T,$,C,M,D,I,L]}class sD extends _e{constructor(e){super(),he(this,e,lD,iD,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function oD(n){let e,t,i,l,s,o,r,a,f,u,c={};return r=new sD({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=O(),l=b("span"),l.textContent="Generate secret",o=O(),V(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),H(r,d,m),a=!0,f||(u=K(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),z(r,d),f=!1,u()}}}function rD(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{var u;t(0,l.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",l)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class aD extends _e{constructor(e){super(),he(this,e,rD,oD,me,{key:1,config:0})}}const go=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:aD},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:JM},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Ar,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Ar,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Ar,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Lr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Lr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Lr}];function Lm(n,e,t){const i=n.slice();return i[9]=e[t],i}function fD(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function uD(n){let e,t=de(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Nm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=O(),o=b("span"),a=W(r),f=O(),u=b("div"),c=W("ID: "),m=W(d),h=O(),_=b("button"),_.innerHTML='',g=O(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,f),k(e,u),k(u,c),k(u,m),k(e,h),k(e,_),k(e,g),y||(S=K(_,"click",T),y=!0)},p($,C){var M;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&le(a,r),C&2&&d!==(d=n[9].providerId+"")&&le(m,d)},d($){$&&v(e),y=!1,S()}}}function dD(n){let e;function t(s,o){var r;return s[2]?cD:(r=s[0])!=null&&r.id&&s[1].length?uD:fD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function pD(n,e,t){const i=st();let{record:l}=e,s=[],o=!1;function r(d){return go.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function f(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ae.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ae.error(d)}t(2,o=!1)}function u(d){!(l!=null&&l.id)||!d||fn(`Do you really want to unlink the ${a(d)} provider?`,()=>ae.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Et(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{ae.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,u,c]}class mD extends _e{constructor(e){super(),he(this,e,pD,dD,me,{record:0})}}function Pm(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Fm(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=O(),s=b("div"),o=W(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=O(),f=b("button"),f.innerHTML='',u=O(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(f,"type","button"),p(f,"class","close"),p(f,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,f),k(e,u),k(e,c),m=!0,h||(_=[K(r,"click",n[38]),we(Le.call(null,f,"Discard draft")),K(f,"click",Be(n[39]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=ca(e,xe,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,ve(_)}}}function Rm(n){let e,t,i;return t=new Ub({props:{model:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function hD(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y=!n[6]&&Rm(n);return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="id",s=O(),o=b("span"),a=O(),y&&y.c(),f=O(),u=b("input"),p(t,"class",Wn(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(u,"type","text"),p(u,"id",c=n[72]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,f,T),w(S,u,T),re(u,n[3].id),h=!0,_||(g=K(u,"input",n[40]),_=!0)},p(S,T){(!h||T[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?y&&(se(),A(y,1,1,()=>{y=null}),oe()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=Rm(S),y.c(),E(y,1),y.m(f.parentNode,f)),(!h||T[2]&1024&&c!==(c=S[72]))&&p(u,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(u.readOnly=m),T[0]&8&&u.value!==S[3].id&&re(u,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(f),v(u)),y&&y.d(S),_=!1,g()}}}function qm(n){var f,u;let e,t,i,l,s;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new C6({props:r}),ee.push(()=>ge(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&jm();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),l=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=jm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),z(e,c),a&&a.d(c)}}}function jm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function _D(n){let e,t,i;function l(o){n[54](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new sM({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function gD(n){let e,t,i,l,s;function o(u){n[51](u,n[69])}function r(u){n[52](u,n[69])}function a(u){n[53](u,n[69])}let f={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(f.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(f.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(f.deletedFileNames=n[5][n[69].name]),e=new HO({props:f}),ee.push(()=>ge(e,"value",o)),ee.push(()=>ge(e,"uploadedFiles",r)),ee.push(()=>ge(e,"deletedFileNames",a)),{c(){V(e.$$.fragment)},m(u,c){H(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ke(()=>l=!1)),e.$set(d)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),s=!1},d(u){z(e,u)}}}function bD(n){let e,t,i;function l(o){n[50](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new dO({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function kD(n){let e,t,i;function l(o){n[49](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new iO({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function yD(n){let e,t,i;function l(o){n[48](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new x6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function vD(n){let e,t,i;function l(o){n[47](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new IM({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function wD(n){let e,t,i;function l(o){n[46](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new Z6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function SD(n){let e,t,i;function l(o){n[45](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new W6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function $D(n){let e,t,i;function l(o){n[44](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new z6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function TD(n){let e,t,i;function l(o){n[43](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new R6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function CD(n){let e,t,i;function l(o){n[42](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new L6({props:s}),ee.push(()=>ge(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function Hm(n,e){let t,i,l,s,o;const r=[CD,TD,$D,SD,wD,vD,yD,kD,bD,gD,_D],a=[];function f(u,c){return u[69].type==="text"?0:u[69].type==="number"?1:u[69].type==="bool"?2:u[69].type==="email"?3:u[69].type==="url"?4:u[69].type==="editor"?5:u[69].type==="date"?6:u[69].type==="select"?7:u[69].type==="json"?8:u[69].type==="file"?9:u[69].type==="relation"?10:-1}return~(i=f(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,s,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(l&&(se(),A(a[d],1,1,()=>{a[d]=null}),oe()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(u){o||(E(l),o=!0)},o(u){A(l),o=!1},d(u){u&&(v(t),v(s)),~i&&a[i].d(u)}}}function zm(n){let e,t,i;return t=new mD({props:{record:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===_s)},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===_s)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function OD(n){var S;let e,t,i,l,s,o,r=[],a=new Map,f,u,c,d,m=!n[8]&&n[10]&&!n[7]&&Fm(n);l=new pe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[hD,({uniqueId:T})=>({72:T}),({uniqueId:T})=>[0,0,T?1024:0]]},$$scope:{ctx:n}}});let h=n[14]&&qm(n),_=de(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[69].name;for(let T=0;T<_.length;T+=1){let $=Pm(n,_,T),C=g($);a.set(C,r[T]=Hm(C,$))}let y=n[14]&&!n[6]&&zm(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=O(),V(l.$$.fragment),s=O(),h&&h.c(),o=O();for(let T=0;T{m=null}),oe());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&3072&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=qm(T),h.c(),E(h,1),h.m(t,o)):h&&(se(),A(h,1,1,()=>{h=null}),oe()),$[0]&57&&(_=de(((M=T[0])==null?void 0:M.schema)||[]),se(),r=ct(r,$,g,1,T,_,a,t,It,Hm,null,Pm),oe()),(!u||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!u||$[0]&8192)&&x(t,"active",T[13]===Gi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=zm(T),y.c(),E(y,1),y.m(e,null)):y&&(se(),A(y,1,1,()=>{y=null}),oe())},i(T){if(!u){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),u=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;${d=null}),oe()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Vm(h),d.c(),E(d,1),d.m(u.parentNode,u))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(f),v(u)),d&&d.d(h)}}}function DD(n){let e,t,i;return{c(){e=b("span"),t=O(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function Vm(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[ED]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),i=b("button"),l=b("i"),s=O(),V(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,f){const u={};f[0]&16388|f[2]&2048&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),z(o)}}}function Bm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[32]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ED(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Bm(n),f=n[14]&&n[2].email&&Um(n);return{c(){a&&a.c(),e=O(),f&&f.c(),t=O(),i=b("button"),i.innerHTML=' Duplicate',l=O(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable")},m(u,c){a&&a.m(u,c),w(u,e,c),f&&f.m(u,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),o||(r=[K(i,"click",n[34]),K(s,"click",cn(Be(n[35])))],o=!0)},p(u,c){u[14]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=Bm(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[14]&&u[2].email?f?f.p(u,c):(f=Um(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){u&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(u),f&&f.d(u),o=!1,ve(r)}}}function Wm(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Gi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===_s),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[K(t,"click",n[36]),K(l,"click",n[37])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Gi),a[0]&8192&&x(l,"active",r[13]===_s)},d(r){r&&v(e),s=!1,ve(o)}}}function ID(n){let e,t,i,l,s;const o=[DD,MD],r=[];function a(u,c){return u[7]?0:1}e=a(n),t=r[e]=o[e](n);let f=n[14]&&!n[6]&&Wm(n);return{c(){t.c(),i=O(),f&&f.c(),l=ye()},m(u,c){r[e].m(u,c),w(u,i,c),f&&f.m(u,c),w(u,l,c),s=!0},p(u,c){let d=e;e=a(u),e===d?r[e].p(u,c):(se(),A(r[d],1,1,()=>{r[d]=null}),oe(),t=r[e],t?t.p(u,c):(t=r[e]=o[e](u),t.c()),E(t,1),t.m(i.parentNode,i)),u[14]&&!u[6]?f?f.p(u,c):(f=Wm(u),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(u){s||(E(t),s=!0)},o(u){A(t),s=!1},d(u){u&&(v(i),v(l)),r[e].d(u),f&&f.d(u)}}}function AD(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,f,u,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=O(),s=b("button"),o=b("span"),a=W(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),u||(c=K(e,"click",n[31]),u=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&le(a,r),m[0]&34816&&f!==(f=!d[15]||d[11])&&(s.disabled=f),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),u=!1,c()}}}function LD(n){let e,t,i={class:` record-panel `+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[14]&&!n[6]?"colored-header":"")+` - `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[DD],header:[MD],default:[$D]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[AD],header:[ID],default:[OD]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` record-panel `+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(l[14]&&!l[6]?"colored-header":"")+` - `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[55]),s[0]&60925|s[2]&2048&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[56](null),z(e,l)}}}const Gi="form",hs="providers";function ID(n,e,t){let i,l,s,o,r;const a=st(),f="record_"+j.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Gi,M=!0,D=!0;function I(fe){return N(fe),t(12,g=!0),t(13,C=Gi),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function R(){t(12,g=!1),L()}async function F(fe){if(fe&&typeof fe=="string"){try{return await ae.collection(u.id).getOne(fe)}catch(Ce){Ce.isAbort||(R(),console.warn("resolveModel:",Ce),ni(`Unable to load record with id "${fe}"`))}return null}return fe}async function N(fe){t(7,D=!0),Jt({}),t(4,y={}),t(5,S={}),t(2,d=typeof fe=="string"?{id:fe,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:fe||{}),t(3,m=structuredClone(d)),t(2,d=await F(fe)||{}),t(3,m=structuredClone(d)),await Xt(),t(10,h=U()),!h||B(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function P(fe){var Xe,Yt;Jt({}),t(2,d=fe||{}),t(4,y={}),t(5,S={});const Ce=((Yt=(Xe=u==null?void 0:u.schema)==null?void 0:Xe.filter(et=>et.type!="file"))==null?void 0:Yt.map(et=>et.name))||[];for(let et in fe)Ce.includes(et)||t(3,m[et]=fe[et],m);await Xt(),t(28,T=JSON.stringify(m)),Y()}function q(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function U(fe){try{const Ce=window.localStorage.getItem(q());if(Ce)return JSON.parse(Ce)}catch{}return fe}function Z(fe){try{window.localStorage.setItem(q(),fe)}catch(Ce){console.warn("updateDraft failure:",Ce),window.localStorage.removeItem(q())}}function G(){h&&(t(3,m=h),t(10,h=null))}function B(fe,Ce){var qn;const Xe=structuredClone(fe||{}),Yt=structuredClone(Ce||{}),et=(qn=u==null?void 0:u.schema)==null?void 0:qn.filter(oi=>oi.type==="file");for(let oi of et)delete Xe[oi.name],delete Yt[oi.name];const Qt=["expand","password","passwordConfirm"];for(let oi of Qt)delete Xe[oi],delete Yt[oi];return JSON.stringify(Xe)==JSON.stringify(Yt)}function Y(){t(10,h=null),window.localStorage.removeItem(q())}async function ue(fe=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Ce=be();let Xe;M?Xe=await ae.collection(u.id).create(Ce):Xe=await ae.collection(u.id).update(m.id,Ce),Et(M?"Successfully created record.":"Successfully updated record."),Y(),fe?R():P(Xe),a("save",{isNew:M,record:Xe})}catch(Ce){ae.error(Ce)}t(11,_=!1)}}function ie(){d!=null&&d.id&&fn("Do you really want to delete the selected record?",()=>ae.collection(d.collectionId).delete(d.id).then(()=>{L(),Et("Successfully deleted record."),a("delete",d)}).catch(fe=>{ae.error(fe)}))}function be(){const fe=structuredClone(m||{}),Ce=new FormData,Xe={id:fe.id},Yt={};for(const et of(u==null?void 0:u.schema)||[])Xe[et.name]=!0,et.type=="json"&&(Yt[et.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const et in fe)if(Xe[et]){if(typeof fe[et]>"u"&&(fe[et]=null),Yt[et]&&fe[et]!=="")try{JSON.parse(fe[et])}catch(Qt){const qn={};throw qn[et]={code:"invalid_json",message:Qt.toString()},new bn({status:400,response:{data:qn}})}j.addValueToFormData(Ce,et,fe[et])}for(const et in y){const Qt=j.toArray(y[et]);for(const qn of Qt)Ce.append(et,qn)}for(const et in S){const Qt=j.toArray(S[et]);for(const qn of Qt)Ce.append(et+"."+qn,"")}return Ce}function Ae(){!(u!=null&&u.id)||!(d!=null&&d.email)||fn(`Do you really want to sent verification email to ${d.email}?`,()=>ae.collection(u.id).requestVerification(d.email).then(()=>{Et(`Successfully sent verification email to ${d.email}.`)}).catch(fe=>{ae.error(fe)}))}function He(){!(u!=null&&u.id)||!(d!=null&&d.email)||fn(`Do you really want to sent password reset email to ${d.email}?`,()=>ae.collection(u.id).requestPasswordReset(d.email).then(()=>{Et(`Successfully sent password reset email to ${d.email}.`)}).catch(fe=>{ae.error(fe)}))}function Je(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{tt()}):tt()}async function tt(){let fe=d?structuredClone(d):null;if(fe){fe.id="",fe.created="",fe.updated="";const Ce=(u==null?void 0:u.schema)||[];for(const Xe of Ce)Xe.type==="file"&&delete fe[Xe.name]}Y(),I(fe),await Xt(),t(28,T="")}function bt(fe){(fe.ctrlKey||fe.metaKey)&&fe.code=="KeyS"&&(fe.preventDefault(),fe.stopPropagation(),ue(!1))}const at=()=>L(),Pt=()=>Ae(),Gt=()=>He(),Me=()=>Je(),Ee=()=>ie(),ze=()=>t(13,C=Gi),ht=()=>t(13,C=hs),te=()=>G(),Fe=()=>Y();function Se(){m.id=this.value,t(3,m)}function pt(fe){m=fe,t(3,m)}function Ht(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function dn(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function rn(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Rn(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Ai(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function ol(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function gi(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function De(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function At(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Li(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Kn(fe,Ce){n.$$.not_equal(y[Ce.name],fe)&&(y[Ce.name]=fe,t(4,y))}function rl(fe,Ce){n.$$.not_equal(S[Ce.name],fe)&&(S[Ce.name]=fe,t(5,S))}function Pl(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}const bi=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{R()}),!1):(Jt({}),Y(),!0);function al(fe){ee[fe?"unshift":"push"](()=>{c=fe,t(9,c)})}function fl(fe){Te.call(this,n,fe)}function _t(fe){Te.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,u=fe.collection)},n.$$.update=()=>{var fe;n.$$.dirty[0]&1&&t(14,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((fe=u==null?void 0:u.schema)!=null&&fe.find(Ce=>Ce.type==="editor"))),n.$$.dirty[0]&48&&t(30,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&1879048192&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,M=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(M||o)),n.$$.dirty[0]&536871040&&(D||Z($))},[u,L,d,m,y,S,M,D,o,c,h,_,g,C,i,r,l,f,R,G,Y,ue,ie,Ae,He,Je,bt,I,T,$,s,at,Pt,Gt,Me,Ee,ze,ht,te,Fe,Se,pt,Ht,dn,rn,Rn,Ai,ol,gi,De,At,Li,Kn,rl,Pl,bi,al,fl,_t]}class Wa extends _e{constructor(e){super(),he(this,e,ID,ED,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function AD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LD(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("div"),t=b("div"),i=W(n[2]),l=O(),s=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(f=we(Le.call(null,e,n[3])),a=!0)},p(u,c){c&4&&le(i,u[2]),c&2&&le(o,u[1])},d(u){u&&v(e),a=!1,f()}}}function ND(n){let e;function t(s,o){return s[0]?LD:AD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function PD(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class el extends _e{constructor(e){super(),he(this,e,PD,ND,me,{date:0})}}function Um(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Wm(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ym(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Km(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function FD(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function RD(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function qD(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function jD(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function HD(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&le(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function zD(n){let e,t=[],i=new Map,l,s,o=de(n[16].slice(0,n[17]));const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Zm();return{c(){var f;e=b("div");for(let u=0;uf[17]?a||(a=Zm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||u&2)&&x(e,"multiple",((c=f[1].options)==null?void 0:c.maxSelect)!=1)},i(f){if(!s){for(let u=0;un[11]&&Qm();return{c(){e=b("div"),i.c(),l=O(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),k(e,l),f&&f.m(e,null),s=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(se(),A(r[d],1,1,()=>{r[d]=null}),oe(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),E(i,1),i.m(e,l)),u[9].length>u[11]?f||(f=Qm(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(e),r[t].d(),f&&f.d()}}}function BD(n){let e,t=[],i=new Map,l=de(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function YD(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[we(Le.call(null,e,"Open in new tab")),K(e,"click",cn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,ve(s)}}}function KD(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function JD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ZD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function GD(n){let e,t,i,l;const s=[n8,t8],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Jm(n,e){let t,i,l;return i=new Ba({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),H(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(i,s)}}}function Zm(n){let e;return{c(){e=W("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function XD(n){let e,t=de(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&eh(n);return{c(){e=b("span"),i=W(t),l=O(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,f),f&8&&E(r,1)):(r=eh(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function n8(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function eh(n){let e,t;return e=new sl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function i8(n){let e,t,i,l,s;const o=[GD,ZD,JD,KD,YD,WD,UD,BD,VD,zD,HD,jD],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(u[3])),e?1:u[1].type==="bool"?2:u[1].type==="number"?3:u[1].type==="url"?4:u[1].type==="editor"?5:u[1].type==="date"?6:u[1].type==="select"?7:u[1].type==="relation"?8:u[1].type==="file"?9:u[2]?10:11)}function f(u,c){return c===0?qD(u):c===8?RD(u):c===9?FD(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),l=ye()},m(u,c){r[t].m(u,c),w(u,l,c),s=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(se(),A(r[d],1,1,()=>{r[d]=null}),oe(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(l),r[t].d(u)}}}function l8(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Te.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class zb extends _e{constructor(e){super(),he(this,e,l8,i8,me,{record:0,field:1,short:2})}}function th(n,e,t){const i=n.slice();return i[13]=e[t],i}function nh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new zb({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=W(i),s=O(),o=b("td"),V(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(e,s),k(e,o),H(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[13].name+"")&&le(l,i);const c={};u&1&&(c.field=f[13]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(E(r.$$.fragment,f),a=!0)},o(f){A(r.$$.fragment,f),a=!1},d(f){f&&v(e),z(r)}}}function ih(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=O(),l=b("td"),V(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),H(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),z(s)}}}function lh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=O(),l=b("td"),V(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),H(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),z(s)}}}function s8(n){var M;let e,t,i,l,s,o,r,a,f,u,c=(n[3].id||"...")+"",d,m,h,_,g;a=new sl({props:{value:n[3].id}});let y=de((M=n[0])==null?void 0:M.schema),S=[];for(let D=0;DA(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&ih(n),C=n[3].updated&&lh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=O(),o=b("td"),r=b("div"),V(a.$$.fragment),f=O(),u=b("span"),d=W(c),m=O();for(let D=0;D{$=null}),oe()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=lh(D),C.c(),E(C,1),C.m(t,null)):C&&(se(),A(C,1,1,()=>{C=null}),oe()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function a8(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[r8],header:[o8],default:[s8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),z(e,l)}}}function f8(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return u(g),s==null?void 0:s.show()}function f(){return t(4,r=!1),s==null?void 0:s.hide()}async function u(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await ae.collection(l.id).getOne(g)}catch(y){y.isAbort||(f(),console.warn("resolveModel:",y),ni(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>f();function m(g){ee[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Te.call(this,n,g)}function _(g){Te.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,f,s,o,r,i,a,d,m,h,_]}class u8 extends _e{constructor(e){super(),he(this,e,f8,a8,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function sh(n,e,t){const i=n.slice();return i[63]=e[t],i}function oh(n,e,t){const i=n.slice();return i[66]=e[t],i}function rh(n,e,t){const i=n.slice();return i[66]=e[t],i}function ah(n,e,t){const i=n.slice();return i[59]=e[t],i}function fh(n){let e;function t(s,o){return s[13]?d8:c8}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function c8(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=O(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[32]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function d8(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function uh(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[p8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function p8(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ch(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&dh(n),r=i&&ph(n);return{c(){o&&o.c(),t=O(),r&&r.c(),l=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){f[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,f),f[0]&32&&E(o,1)):(o=dh(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(se(),A(o,1,1,()=>{o=null}),oe()),f[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=ph(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function dh(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[m8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function m8(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ph(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[h8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function h8(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _8(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=O(),s=b("span"),r=W(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,f){f[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[66].name+"")&&le(r,o)},d(a){a&&v(e)}}}function mh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[_8]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new $n({props:r}),ee.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[66].type+" col-field-"+e[66].name),f[0]&524288&&(u.name=e[66].name),f[0]&524288|f[2]&512&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.sort=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function hh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[g8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function g8(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _h(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[b8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function b8(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function gh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function bh(n){let e;function t(s,o){return s[13]?y8:k8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function k8(n){let e,t,i,l;function s(a,f){var u;if((u=a[1])!=null&&u.length)return w8;if(!a[10])return v8}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=O(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function y8(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function v8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function w8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function kh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[K(i,"change",c),K(t,"click",cn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,ve(u)}}}function yh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&vh(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),a=W(r),f=O(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),H(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&le(a,r),d[9]?c?c.p(d,m):(c=vh(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),z(l),c&&c.d()}}}function vh(n){let e;function t(s,o){return s[63].verified?$8:S8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function S8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function $8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function wh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Sh(n),o=i&&$h(n);return{c(){s&&s.c(),t=O(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Sh(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=$h(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Sh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?C8:T8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function T8(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&le(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function C8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $h(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?M8:O8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function O8(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&le(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function M8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Th(n,e){let t,i,l,s;return i=new zb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),z(i)}}}function Ch(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function Oh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function Mh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&kh(e),T=l&&yh(e),$=e[9]&&wh(e),C=de(e[19]);const M=F=>F[66].name;for(let F=0;F',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P{T=null}),oe()),e[9]?$?$.p(e,N):($=wh(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=de(e[19]),se(),r=ct(r,N,M,1,e,C,a,t,It,Th,f,oh),oe()),N[0]&288&&(u=e[8]&&!e[5].includes("@created")),u?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Ch(e),D.c(),E(D,1),D.m(t,c)):D&&(se(),A(D,1,1,()=>{D=null}),oe()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Oh(e),I.c(),E(I,1),I.m(t,m)):I&&(se(),A(I,1,1,()=>{I=null}),oe())},i(F){if(!_){E(T);for(let N=0;NB[66].name;for(let B=0;BB[10]?B[63]:B[63].id;for(let B=0;B{D=null}),oe()),B[9]?I?(I.p(B,Y),Y[0]&512&&E(I,1)):(I=ch(B),I.c(),E(I,1),I.m(i,r)):I&&(se(),A(I,1,1,()=>{I=null}),oe()),Y[0]&524289&&(L=de(B[19]),se(),a=ct(a,Y,R,1,B,L,f,i,It,mh,u,rh),oe()),Y[0]&288&&(c=B[8]&&!B[5].includes("@created")),c?F?(F.p(B,Y),Y[0]&288&&E(F,1)):(F=hh(B),F.c(),E(F,1),F.m(i,d)):F&&(se(),A(F,1,1,()=>{F=null}),oe()),Y[0]&160&&(m=B[7]&&!B[5].includes("@updated")),m?N?(N.p(B,Y),Y[0]&160&&E(N,1)):(N=_h(B),N.c(),E(N,1),N.m(i,h)):N&&(se(),A(N,1,1,()=>{N=null}),oe()),B[16].length?P?P.p(B,Y):(P=gh(B),P.c(),P.m(_,null)):P&&(P.d(1),P=null),Y[0]&9971642&&(q=de(B[3]),se(),S=ct(S,Y,U,1,B,q,T,y,It,Mh,$,sh),oe(),!q.length&&Z?Z.p(B,Y):q.length?Z&&(Z.d(1),Z=null):(Z=bh(B),Z.c(),Z.m(y,$))),B[3].length&&B[18]?G?G.p(B,Y):(G=Dh(B),G.c(),G.m(y,null)):G&&(G.d(1),G=null),(!C||Y[0]&8192)&&x(e,"table-loading",B[13])},i(B){if(!C){E(D),E(I);for(let Y=0;Y({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),H(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(i,s)}}}function I8(n){let e,t,i=[],l=new Map,s,o,r=de(n[16]);const a=f=>f[59].id+f[59].name;for(let f=0;f{i=null}),oe())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ah(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),l=b("strong"),s=W(n[6]),o=O(),a=W(r),f=O(),u=b("button"),u.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[K(u,"click",n[47]),K(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&le(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&le(a,r),(!g||$[0]&16384)&&x(u,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ye(()=>{g&&(_||(_=Ne(e,Pn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Ne(e,Pn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,ve(S)}}}function L8(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[A8],default:[D8]},$$scope:{ctx:n}};e=new Jo({props:s}),n[46](e);let o=n[6]&&Ah(n);return{c(){V(e.$$.fragment),t=O(),o&&o.c(),i=ye()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const f={};a[0]&1030075|a[2]&512&&(f.$$scope={dirty:a,ctx:r}),e.$set(f),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=Ah(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(se(),A(o,1,1,()=>{o=null}),oe())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),z(e,r),o&&o.d(r)}}}const N8=/^([\+\-])?(\w+)$/,Lh=40;function P8(n,e,t){let i,l,s,o,r,a,f,u,c,d,m,h;Ue(n,Fn,De=>t(53,h=De));const _=st();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,M=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function U(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function Z(){if(t(5,N=[]),!!(g!=null&&g.id))try{const De=localStorage.getItem(q);De&&t(5,N=JSON.parse(De)||[])}catch{}}function G(De){return!!$.find(At=>At.id)}async function B(){const De=C;for(let At=1;At<=De;At++)(At===1||f)&&await Y(At,!1)}async function Y(De=1,At=!0){var al,fl,_t;if(!(g!=null&&g.id))return;t(13,I=!0);let Li=y;const Kn=Li.match(N8),rl=Kn?r.find(fe=>fe.name===Kn[2]):null;if(Kn&&rl){const fe=((_t=(fl=(al=h==null?void 0:h.find(Xe=>{var Yt;return Xe.id==((Yt=rl.options)==null?void 0:Yt.collectionId)}))==null?void 0:al.schema)==null?void 0:fl.filter(Xe=>Xe.presentable))==null?void 0:_t.map(Xe=>Xe.name))||[],Ce=[];for(const Xe of fe)Ce.push((Kn[1]||"")+Kn[2]+"."+Xe);Ce.length>0&&(Li=Ce.join(","))}const Pl=j.getAllCollectionIdentifiers(g),bi=o.map(fe=>fe.name+":excerpt(200)").concat(r.map(fe=>"expand."+fe.name+".*:excerpt(200)"));return bi.length&&bi.unshift("*"),ae.collection(g.id).getList(De,Lh,{sort:Li,skipTotal:1,filter:j.normalizeSearchFilter(S,Pl),expand:r.map(fe=>fe.name).join(","),fields:bi.join(","),requestKey:"records_list"}).then(async fe=>{var Ce;if(De<=1&&ue(),t(13,I=!1),t(12,C=fe.page),t(28,M=fe.items.length),_("load",$.concat(fe.items)),o.length)for(let Xe of fe.items)Xe._partial=!0;if(At){const Xe=++R;for(;(Ce=fe.items)!=null&&Ce.length&&R==Xe;){const Yt=fe.items.splice(0,20);for(let et of Yt)j.pushOrReplaceByKey($,et);t(3,$),await j.yieldToMain()}}else{for(let Xe of fe.items)j.pushOrReplaceByKey($,Xe);t(3,$)}}).catch(fe=>{fe!=null&&fe.isAbort||(t(13,I=!1),console.warn(fe),ue(),ae.error(fe,!S||(fe==null?void 0:fe.status)!=400))})}function ue(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,M=0),t(4,D={})}function ie(){c?be():Ae()}function be(){t(4,D={})}function Ae(){for(const De of $)t(4,D[De.id]=De,D);t(4,D)}function He(De){D[De.id]?delete D[De.id]:t(4,D[De.id]=De,D),t(4,D)}function Je(){fn(`Do you really want to delete the selected ${u===1?"record":"records"}?`,tt)}async function tt(){if(L||!u||!(g!=null&&g.id))return;let De=[];for(const At of Object.keys(D))De.push(ae.collection(g.id).delete(At));return t(14,L=!0),Promise.all(De).then(()=>{Et(`Successfully deleted the selected ${u===1?"record":"records"}.`),_("delete",D),be()}).catch(At=>{ae.error(At)}).finally(()=>(t(14,L=!1),B()))}function bt(De){Te.call(this,n,De)}const at=(De,At)=>{At.target.checked?j.removeByValue(N,De.id):j.pushUnique(N,De.id),t(5,N)},Pt=()=>ie();function Gt(De){y=De,t(0,y)}function Me(De){y=De,t(0,y)}function Ee(De){y=De,t(0,y)}function ze(De){y=De,t(0,y)}function ht(De){y=De,t(0,y)}function te(De){y=De,t(0,y)}function Fe(De){ee[De?"unshift":"push"](()=>{F=De,t(15,F)})}const Se=De=>He(De),pt=De=>_("select",De),Ht=(De,At)=>{At.code==="Enter"&&(At.preventDefault(),_("select",De))},dn=()=>t(1,S=""),rn=()=>_("new"),Rn=()=>Y(C+1);function Ai(De){ee[De?"unshift":"push"](()=>{T=De,t(11,T)})}const ol=()=>be(),gi=()=>Je();return n.$$set=De=>{"collection"in De&&t(25,g=De.collection),"sort"in De&&t(0,y=De.sort),"filter"in De&&t(1,S=De.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",Z(),ue()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(De=>De.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(De=>De.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(De=>!N.includes(De.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&Y(1),n.$$.dirty[0]&268435456&&t(18,f=M>=Lh),n.$$.dirty[0]&16&&t(6,u=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&u===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(De=>({id:De.id,name:De.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,Y,$,D,N,u,m,d,l,i,T,C,I,L,F,P,c,f,a,_,ie,be,He,Je,g,G,B,M,s,bt,at,Pt,Gt,Me,Ee,ze,ht,te,Fe,Se,pt,Ht,dn,rn,Rn,Ai,ol,gi]}class F8 extends _e{constructor(e){super(),he(this,e,P8,L8,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function R8(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=O(),l=b("span"),o=W(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[f]){f&5&&s!==(s=(a[2]?"...":a[0])+"")&&le(o,s),f&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function q8(n,e,t){const i=st();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function f(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const u=j.getAllCollectionIdentifiers(l),c=await ae.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,u),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(u){u!=null&&u.isAbort||(t(2,a=!1),console.warn(u))}}}return n.$$set=u=>{"collection"in u&&t(3,l=u.collection),"filter"in u&&t(4,s=u.filter),"totalCount"in u&&t(0,o=u.totalCount),"class"in u&&t(1,r=u.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&f()},[o,r,a,l,s,f]}class j8 extends _e{constructor(e){super(),he(this,e,q8,R8,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function H8(n){let e,t,i,l;return e=new t6({}),i=new kn({props:{class:"flex-content",$$slots:{footer:[U8],default:[B8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function z8(n){let e,t;return e=new kn({props:{center:!0,$$slots:{default:[K8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function V8(n){let e,t;return e=new kn({props:{center:!0,$$slots:{default:[J8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Nh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[we(Le.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,ve(i)}}}function Ph(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function B8(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L,R,F=!n[12]&&Nh(n);c=new Ko({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&Ph(n);y=new Ss({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(Z){n[26](Z)}function q(Z){n[27](Z)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),C=new F8({props:U}),n[25](C),ee.push(()=>ge(C,"filter",P)),ee.push(()=>ge(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=O(),s=b("div"),r=W(o),a=O(),f=b("div"),F&&F.c(),u=O(),V(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=O(),N&&N.c(),g=O(),V(y.$$.fragment),S=O(),T=b("div"),$=O(),V(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(Z,G){w(Z,e,G),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,f),F&&F.m(f,null),k(f,u),H(c,f,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(Z,g,G),H(y,Z,G),w(Z,S,G),w(Z,T,G),w(Z,$,G),H(C,Z,G),I=!0,L||(R=K(h,"click",n[22]),L=!0)},p(Z,G){(!I||G[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[12]?F&&(F.d(1),F=null):F?F.p(Z,G):(F=Nh(Z),F.c(),F.m(f,u)),Z[2].type!=="view"?N?N.p(Z,G):(N=Ph(Z),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const B={};G[0]&1&&(B.value=Z[0]),G[0]&4&&(B.autocompleteCollection=Z[2]),y.$set(B);const Y={};G[0]&4&&(Y.collection=Z[2]),!M&&G[0]&1&&(M=!0,Y.filter=Z[0],ke(()=>M=!1)),!D&&G[0]&2&&(D=!0,Y.sort=Z[1],ke(()=>D=!1)),C.$set(Y)},i(Z){I||(E(c.$$.fragment,Z),E(y.$$.fragment,Z),E(C.$$.fragment,Z),I=!0)},o(Z){A(c.$$.fragment,Z),A(y.$$.fragment,Z),A(C.$$.fragment,Z),I=!1},d(Z){Z&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),z(c),N&&N.d(),z(y,Z),n[25](null),z(C,Z),L=!1,R()}}}function U8(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new j8({props:s}),n[18](e),ee.push(()=>ge(e,"totalCount",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),z(e,o)}}}function W8(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function Y8(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function K8(n){let e,t,i;function l(r,a){return r[12]?Y8:W8}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function J8(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Z8(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[V8,z8,H8],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Va({props:_}),n[31](l);let g={};o=new f6({props:g}),n[32](o);let y={collection:n[2]};a=new Wa({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new u8({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),V(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),H(l,T,$),w(T,s,$),H(o,T,$),w(T,r,$),H(a,T,$),w(T,f,$),H(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(se(),A(m[C],1,1,()=>{m[C]=null}),oe(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),z(l,T),n[32](null),z(o,T),n[33](null),z(a,T),n[37](null),z(u,T)}}}function G8(n,e,t){let i,l,s,o,r,a,f;Ue(n,li,Me=>t(2,l=Me)),Ue(n,Mt,Me=>t(39,s=Me)),Ue(n,So,Me=>t(3,o=Me)),Ue(n,Ro,Me=>t(16,r=Me)),Ue(n,Fn,Me=>t(11,a=Me)),Ue(n,Xi,Me=>t(12,f=Me));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;Qy(T);async function C(Me){await Xt(),(l==null?void 0:l.type)==="view"?h.show(Me):m==null||m.show(Me)}function M(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D()}async function D(){if(!S)return;const Me=j.getAllCollectionIdentifiers(l),Ee=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Ee.filter(ze=>Me.includes(ze)).length!=Ee.length&&(Me.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Me={}){const Ee=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Me);j.replaceHashQueryParams(Ee)}const L=()=>c==null?void 0:c.show();function R(Me){ee[Me?"unshift":"push"](()=>{g=Me,t(9,g)})}function F(Me){$=Me,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),U=()=>m==null?void 0:m.show(),Z=Me=>t(0,y=Me.detail);function G(Me){ee[Me?"unshift":"push"](()=>{_=Me,t(8,_)})}function B(Me){y=Me,t(0,y)}function Y(Me){S=Me,t(1,S)}const ue=Me=>{I({recordId:Me.detail.id});let Ee=Me.detail._partial?Me.detail.id:Me.detail;l.type==="view"?h==null||h.show(Ee):m==null||m.show(Ee)},ie=()=>{g==null||g.reload()},be=()=>m==null?void 0:m.show();function Ae(Me){ee[Me?"unshift":"push"](()=>{c=Me,t(4,c)})}function He(Me){ee[Me?"unshift":"push"](()=>{d=Me,t(5,d)})}function Je(Me){ee[Me?"unshift":"push"](()=>{m=Me,t(6,m)})}const tt=()=>{I({recordId:null})},bt=Me=>{y?g==null||g.reload():Me.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},at=Me=>{(!y||_!=null&&_.hasRecord(Me.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function Pt(Me){ee[Me?"unshift":"push"](()=>{h=Me,t(7,h)})}const Gt=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&Zy(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&M(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(Mt,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,q,U,Z,G,B,Y,ue,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt]}class X8 extends _e{constructor(e){super(),he(this,e,G8,Z8,me,{},null,[-1,-1])}}function Fh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=O(),i=b("a"),i.innerHTML=' Export collections',l=O(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[we(An.call(null,i,{path:"/settings/export-collections/?.*"})),we(nn.call(null,i)),we(An.call(null,s,{path:"/settings/import-collections/?.*"})),we(nn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,ve(r)}}}function Q8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M=!n[0]&&Fh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=O(),l=b("a"),l.innerHTML=' Application',s=O(),o=b("a"),o.innerHTML=' Mail settings',r=O(),a=b("a"),a.innerHTML=' Files storage',f=O(),u=b("a"),u.innerHTML=' Backups',c=O(),M&&M.c(),d=O(),m=b("div"),m.textContent="Authentication",h=O(),_=b("a"),_.innerHTML=' Auth providers',g=O(),y=b("a"),y.innerHTML=' Token options',S=O(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),M&&M.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[we(An.call(null,l,{path:"/settings"})),we(nn.call(null,l)),we(An.call(null,o,{path:"/settings/mail/?.*"})),we(nn.call(null,o)),we(An.call(null,a,{path:"/settings/storage/?.*"})),we(nn.call(null,a)),we(An.call(null,u,{path:"/settings/backups/?.*"})),we(nn.call(null,u)),we(An.call(null,_,{path:"/settings/auth-providers/?.*"})),we(nn.call(null,_)),we(An.call(null,y,{path:"/settings/tokens/?.*"})),we(nn.call(null,y)),we(An.call(null,T,{path:"/settings/admins/?.*"})),we(nn.call(null,T))],$=!0)},p(D,I){D[0]?M&&(M.d(1),M=null):M||(M=Fh(),M.c(),M.m(e,d))},d(D){D&&v(e),M&&M.d(),$=!1,ve(C)}}}function x8(n){let e,t;return e=new Ab({props:{class:"settings-sidebar",$$slots:{default:[Q8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function eE(n,e,t){let i;return Ue(n,Xi,l=>t(0,i=l)),[i]}class _i extends _e{constructor(e){super(),he(this,e,eE,x8,me,{})}}function Rh(n,e,t){const i=n.slice();return i[31]=e[t],i}function qh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[tE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function tE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new jb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="id",o=O(),r=b("div"),V(a.$$.fragment),f=O(),u=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),H(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),z(a)}}}function jh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=O(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=K(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function nE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Email",o=O(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[3]),f||(u=K(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function Hh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[iE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function iE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function zh(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[lE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[sE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(t,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(t,xe,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),z(l),z(r),u&&a&&a.end()}}}function lE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Hb({}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password",o=O(),r=b("input"),f=O(),u=b("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),re(r,n[9]),w(_,f,g),w(_,u,g),H(c,u,null),d=!0,m||(h=K(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&re(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),z(c),m=!1,h()}}}function sE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[10]),f||(u=K(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&re(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function oE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&qh(n),_=de([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=jh(Rh(n,_,T));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[nE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Hh(n),S=(n[5]||n[4])&&zh(n);return{c(){e=b("form"),h&&h.c(),t=O(),i=b("div"),l=b("p"),l.textContent="Avatar",s=O(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=O(),V(a.$$.fragment),f=O(),y&&y.c(),u=O(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),H(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=qh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=de([0,1,2,3,4,5,6,7,8,9]);let M;for(M=0;M<10;M+=1){const D=Rh(T,_,M);g[M]?g[M].p(D,$):(g[M]=jh(D),g[M].c(),g[M].m(o,null))}for(;M<10;M+=1)g[M].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(se(),A(y,1,1,()=>{y=null}),oe()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Hh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=zh(T),S.c(),E(S,1),S.m(e,null)):S&&(se(),A(S,1,1,()=>{S=null}),oe())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),rt(g,T),z(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function rE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=W(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&le(i,t)},d(l){l&&v(e)}}}function Vh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[aE]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=O(),l=b("i"),s=O(),V(o.$$.fragment),r=O(),a=b("div"),p(l,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),H(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),z(o)}}}function aE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function fE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Vh(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",l=O(),s=b("button"),o=b("span"),a=W(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=K(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(se(),A(m,1,1,()=>{m=null}),oe()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Vh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&le(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function uE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[fE],header:[rE],default:[oE]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),z(e,l)}}}function cE(n,e,t){let i,l;const s=st(),o="admin_"+j.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Jt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let B;i?B=ae.admins.create(G):B=ae.admins.update(a.id,G),B.then(async Y=>{var ue;t(8,u=!1),y(),Et(i?"Successfully created admin.":"Successfully updated admin."),((ue=ae.authStore.model)==null?void 0:ue.id)===Y.id&&ae.authStore.save(ae.authStore.token,Y),s("save",Y)}).catch(Y=>{ae.error(Y)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&fn("Do you really want to delete the selected admin?",()=>ae.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Et("Successfully deleted admin."),s("delete",a)}).catch(G=>{ae.error(G)}))}const M=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(G){ee[G?"unshift":"push"](()=>{r=G,t(6,r)})}function U(G){Te.call(this,n,G)}function Z(G){Te.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,M,D,I,L,R,F,N,P,q,U,Z]}class dE extends _e{constructor(e){super(),he(this,e,cE,uE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Bh(n,e,t){const i=n.slice();return i[24]=e[t],i}function pE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function hE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _E(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Uh(n){let e;function t(s,o){return s[5]?bE:gE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function gE(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Wh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=O(),o&&o.c(),s=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Wh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function bE(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Wh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Yh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,M,D,I,L,R,F,N,P,q,U,Z,G;u=new sl({props:{value:e[24].id}});let B=e[24].id===e[7].id&&Yh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Y(){return e[15](e[24])}function ue(...ie){return e[16](e[24],...ie)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=O(),a=b("td"),f=b("div"),V(u.$$.fragment),c=O(),d=b("span"),h=W(m),_=O(),B&&B.c(),g=O(),y=b("td"),S=b("span"),$=W(T),M=O(),D=b("td"),V(I.$$.fragment),L=O(),R=b("td"),V(F.$$.fragment),N=O(),P=b("td"),P.innerHTML='',q=O(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ie,be){w(ie,t,be),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),H(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),B&&B.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,M),k(t,D),H(I,D,null),k(t,L),k(t,R),H(F,R,null),k(t,N),k(t,P),k(t,q),U=!0,Z||(G=[K(t,"click",Y),K(t,"keydown",ue)],Z=!0)},p(ie,be){e=ie,(!U||be&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Ae={};be&16&&(Ae.value=e[24].id),u.$set(Ae),(!U||be&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?B||(B=Yh(),B.c(),B.m(a,null)):B&&(B.d(1),B=null),(!U||be&16)&&T!==(T=e[24].email+"")&&le($,T),(!U||be&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};be&16&&(He.date=e[24].created),I.$set(He);const Je={};be&16&&(Je.date=e[24].updated),F.$set(Je)},i(ie){U||(E(u.$$.fragment,ie),E(I.$$.fragment,ie),E(F.$$.fragment,ie),U=!0)},o(ie){A(u.$$.fragment,ie),A(I.$$.fragment,ie),A(F.$$.fragment,ie),U=!1},d(ie){ie&&v(t),z(u),B&&B.d(),z(I),z(F),Z=!1,ve(G)}}}function kE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],M=new Map,D;function I(Y){n[11](Y)}let L={class:"col-type-text",name:"id",$$slots:{default:[pE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new $n({props:L}),ee.push(()=>ge(o,"sort",I));function R(Y){n[12](Y)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[mE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new $n({props:F}),ee.push(()=>ge(f,"sort",R));function N(Y){n[13](Y)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[hE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new $n({props:P}),ee.push(()=>ge(d,"sort",N));function q(Y){n[14](Y)}let U={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[_E]},$$scope:{ctx:n}};n[2]!==void 0&&(U.sort=n[2]),_=new $n({props:U}),ee.push(()=>ge(_,"sort",q));let Z=de(n[4]);const G=Y=>Y[24].id;for(let Y=0;Yr=!1)),o.$set(ie);const be={};ue&134217728&&(be.$$scope={dirty:ue,ctx:Y}),!u&&ue&4&&(u=!0,be.sort=Y[2],ke(()=>u=!1)),f.$set(be);const Ae={};ue&134217728&&(Ae.$$scope={dirty:ue,ctx:Y}),!m&&ue&4&&(m=!0,Ae.sort=Y[2],ke(()=>m=!1)),d.$set(Ae);const He={};ue&134217728&&(He.$$scope={dirty:ue,ctx:Y}),!g&&ue&4&&(g=!0,He.sort=Y[2],ke(()=>g=!1)),_.$set(He),ue&186&&(Z=de(Y[4]),se(),C=ct(C,ue,G,1,Y,Z,M,$,It,Kh,null,Bh),oe(),!Z.length&&B?B.p(Y,ue):Z.length?B&&(B.d(1),B=null):(B=Uh(Y),B.c(),B.m($,null))),(!D||ue&32)&&x(e,"table-loading",Y[5])},i(Y){if(!D){E(o.$$.fragment,Y),E(f.$$.fragment,Y),E(d.$$.fragment,Y),E(_.$$.fragment,Y);for(let ue=0;ue New admin',h=O(),V(_.$$.fragment),g=O(),y=b("div"),S=O(),V(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),H(a,e,null),k(e,f),k(e,u),k(e,c),k(e,d),k(d,m),w(D,h,I),H(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),H(T,D,I),$=!0,C||(M=K(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&le(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),z(a),z(_,D),z(T,D),C=!1,M()}}}function vE(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=W("Total found: "),l=W(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&le(l,i)},d(s){s&&v(e)}}}function wE(n){let e,t,i,l,s,o;e=new _i({}),i=new kn({props:{$$slots:{footer:[vE],default:[yE]},$$scope:{ctx:n}}});let r={};return s=new dE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),H(s,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[18](null),z(s,a)}}}function SE(n,e,t){let i,l,s;Ue(n,Ro,F=>t(21,i=F)),Ue(n,Mt,F=>t(6,l=F)),Ue(n,wa,F=>t(7,s=F)),xt(Mt,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],f=!1,u=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,f=!0),t(4,a=[]);const F=j.normalizeSearchFilter(u,["id","email","created","updated"]);return ae.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,f=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,f=!1),console.warn(N),m(),ae.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,u=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),M=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,u="");function I(F){ee[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();tl("/settings/admins?"+F),d()}},[d,u,c,r,a,f,l,s,h,_,g,y,S,T,$,C,M,D,I,L,R]}class $E extends _e{constructor(e){super(),he(this,e,SE,wE,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function TE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=K(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CE(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=W("Password"),l=O(),s=b("input"),r=O(),a=b("div"),f=b("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[1]),w(d,r,m),w(d,a,m),k(a,f),u||(c=[K(s,"input",n[5]),we(nn.call(null,f))],u=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&re(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),u=!1,ve(c)}}}function OE(n){let e,t,i,l,s,o,r,a,f,u,c;return l=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[TE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[CE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),H(l,e,null),k(e,s),H(o,e,null),k(e,r),k(e,a),f=!0,u||(c=K(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),z(l),z(o),u=!1,c()}}}function ME(n){let e,t;return e=new V1({props:{$$slots:{default:[OE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function DE(n,e,t){let i;Ue(n,Ro,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ae.admins.authWithPassword(s,o).then(()=>{ya(),tl("/")}).catch(()=>{ni("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class EE extends _e{constructor(e){super(),he(this,e,DE,ME,me,{})}}function IE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[LE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[NE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[PE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Jh(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),u=b("div"),c=b("div"),d=O(),$&&$.c(),m=O(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,M){w(C,e,M),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),H(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=K(h,"click",n[12]),S=!0)},p(C,M){const D={};M&786433&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const I={};M&786433&&(I.$$scope={dirty:M,ctx:C}),o.$set(I);const L={};M&786433&&(L.$$scope={dirty:M,ctx:C}),a.$set(L),C[3]?$?$.p(C,M):($=Jh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||M&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||M&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),z(i),z(o),z(a),$&&$.d(),S=!1,T()}}}function AE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function LE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application name"),l=O(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&re(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function NE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application URL"),l=O(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&re(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function PE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[10]),we(Le.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function Jh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function FE(n){let e,t,i,l,s,o,r,a,f;const u=[AE,IE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=O(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=K(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(se(),A(c[_],1,1,()=>{c[_]=null}),oe(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function RE(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[FE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function qE(n,e,t){let i,l,s,o;Ue(n,Xi,C=>t(13,l=C)),Ue(n,To,C=>t(14,s=C)),Ue(n,Mt,C=>t(15,o=C)),xt(Mt,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await ae.settings.getAll()||{};h(C)}catch(C){ae.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await ae.settings.update(j.filterRedactedProps(a));h(C),Et("Successfully saved application settings.")}catch(C){ae.error(C)}t(2,u=!1)}}function h(C={}){var M,D;xt(To,s=(M=C==null?void 0:C.meta)==null?void 0:M.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class jE extends _e{constructor(e){super(),he(this,e,qE,RE,me,{})}}function HE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=O(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ti(l,a)},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),l.autofocus&&l.focus(),s||(o=[we(Le.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],s=!0)},p(f,u){ti(l,a=dt(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&(v(e),v(i),v(l)),s=!1,ve(o)}}}function VE(n){let e;function t(s,o){return s[3]?zE:HE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function BE(n,e,t){const i=["value","mask"];let l=Ge(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,s=""),t(3,a=!1),await Xt(),r==null||r.focus()}const u=()=>f();function c(m){ee[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(5,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,f,l,u,c,d]}class Ya extends _e{constructor(e){super(),he(this,e,BE,VE,me,{value:0,mask:1})}}function UE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("label"),t=W("Subject"),l=O(),s=b("input"),r=O(),a=b("div"),f=W(`Available placeholder parameters: + `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[55]),s[0]&60925|s[2]&2048&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[56](null),z(e,l)}}}const Gi="form",_s="providers";function ND(n,e,t){let i,l,s,o,r;const a=st(),f="record_"+j.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Gi,M=!0,D=!0;function I(fe){return N(fe),t(12,g=!0),t(13,C=Gi),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function R(){t(12,g=!1),L()}async function F(fe){if(fe&&typeof fe=="string"){try{return await ae.collection(u.id).getOne(fe)}catch(Ce){Ce.isAbort||(R(),console.warn("resolveModel:",Ce),ii(`Unable to load record with id "${fe}"`))}return null}return fe}async function N(fe){t(7,D=!0),Jt({}),t(4,y={}),t(5,S={}),t(2,d=typeof fe=="string"?{id:fe,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:fe||{}),t(3,m=structuredClone(d)),t(2,d=await F(fe)||{}),t(3,m=structuredClone(d)),await Xt(),t(10,h=U()),!h||B(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function P(fe){var Xe,Yt;Jt({}),t(2,d=fe||{}),t(4,y={}),t(5,S={});const Ce=((Yt=(Xe=u==null?void 0:u.schema)==null?void 0:Xe.filter(et=>et.type!="file"))==null?void 0:Yt.map(et=>et.name))||[];for(let et in fe)Ce.includes(et)||t(3,m[et]=fe[et],m);await Xt(),t(28,T=JSON.stringify(m)),Y()}function q(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function U(fe){try{const Ce=window.localStorage.getItem(q());if(Ce)return JSON.parse(Ce)}catch{}return fe}function Z(fe){try{window.localStorage.setItem(q(),fe)}catch(Ce){console.warn("updateDraft failure:",Ce),window.localStorage.removeItem(q())}}function G(){h&&(t(3,m=h),t(10,h=null))}function B(fe,Ce){var qn;const Xe=structuredClone(fe||{}),Yt=structuredClone(Ce||{}),et=(qn=u==null?void 0:u.schema)==null?void 0:qn.filter(oi=>oi.type==="file");for(let oi of et)delete Xe[oi.name],delete Yt[oi.name];const Qt=["expand","password","passwordConfirm"];for(let oi of Qt)delete Xe[oi],delete Yt[oi];return JSON.stringify(Xe)==JSON.stringify(Yt)}function Y(){t(10,h=null),window.localStorage.removeItem(q())}async function ue(fe=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Ce=be();let Xe;M?Xe=await ae.collection(u.id).create(Ce):Xe=await ae.collection(u.id).update(m.id,Ce),Et(M?"Successfully created record.":"Successfully updated record."),Y(),fe?R():P(Xe),a("save",{isNew:M,record:Xe})}catch(Ce){ae.error(Ce)}t(11,_=!1)}}function ie(){d!=null&&d.id&&fn("Do you really want to delete the selected record?",()=>ae.collection(d.collectionId).delete(d.id).then(()=>{L(),Et("Successfully deleted record."),a("delete",d)}).catch(fe=>{ae.error(fe)}))}function be(){const fe=structuredClone(m||{}),Ce=new FormData,Xe={id:fe.id},Yt={};for(const et of(u==null?void 0:u.schema)||[])Xe[et.name]=!0,et.type=="json"&&(Yt[et.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const et in fe)if(Xe[et]){if(typeof fe[et]>"u"&&(fe[et]=null),Yt[et]&&fe[et]!=="")try{JSON.parse(fe[et])}catch(Qt){const qn={};throw qn[et]={code:"invalid_json",message:Qt.toString()},new bn({status:400,response:{data:qn}})}j.addValueToFormData(Ce,et,fe[et])}for(const et in y){const Qt=j.toArray(y[et]);for(const qn of Qt)Ce.append(et,qn)}for(const et in S){const Qt=j.toArray(S[et]);for(const qn of Qt)Ce.append(et+"."+qn,"")}return Ce}function Ae(){!(u!=null&&u.id)||!(d!=null&&d.email)||fn(`Do you really want to sent verification email to ${d.email}?`,()=>ae.collection(u.id).requestVerification(d.email).then(()=>{Et(`Successfully sent verification email to ${d.email}.`)}).catch(fe=>{ae.error(fe)}))}function He(){!(u!=null&&u.id)||!(d!=null&&d.email)||fn(`Do you really want to sent password reset email to ${d.email}?`,()=>ae.collection(u.id).requestPasswordReset(d.email).then(()=>{Et(`Successfully sent password reset email to ${d.email}.`)}).catch(fe=>{ae.error(fe)}))}function Je(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{tt()}):tt()}async function tt(){let fe=d?structuredClone(d):null;if(fe){fe.id="",fe.created="",fe.updated="";const Ce=(u==null?void 0:u.schema)||[];for(const Xe of Ce)Xe.type==="file"&&delete fe[Xe.name]}Y(),I(fe),await Xt(),t(28,T="")}function bt(fe){(fe.ctrlKey||fe.metaKey)&&fe.code=="KeyS"&&(fe.preventDefault(),fe.stopPropagation(),ue(!1))}const at=()=>L(),Pt=()=>Ae(),Gt=()=>He(),Me=()=>Je(),Ee=()=>ie(),ze=()=>t(13,C=Gi),ht=()=>t(13,C=_s),te=()=>G(),Fe=()=>Y();function Se(){m.id=this.value,t(3,m)}function pt(fe){m=fe,t(3,m)}function Ht(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function dn(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function rn(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Rn(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Ai(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function ol(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function gi(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function De(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function At(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Li(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}function Jn(fe,Ce){n.$$.not_equal(y[Ce.name],fe)&&(y[Ce.name]=fe,t(4,y))}function rl(fe,Ce){n.$$.not_equal(S[Ce.name],fe)&&(S[Ce.name]=fe,t(5,S))}function Pl(fe,Ce){n.$$.not_equal(m[Ce.name],fe)&&(m[Ce.name]=fe,t(3,m))}const bi=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{R()}),!1):(Jt({}),Y(),!0);function al(fe){ee[fe?"unshift":"push"](()=>{c=fe,t(9,c)})}function fl(fe){Te.call(this,n,fe)}function _t(fe){Te.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,u=fe.collection)},n.$$.update=()=>{var fe;n.$$.dirty[0]&1&&t(14,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((fe=u==null?void 0:u.schema)!=null&&fe.find(Ce=>Ce.type==="editor"))),n.$$.dirty[0]&48&&t(30,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&1879048192&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,M=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(M||o)),n.$$.dirty[0]&536871040&&(D||Z($))},[u,L,d,m,y,S,M,D,o,c,h,_,g,C,i,r,l,f,R,G,Y,ue,ie,Ae,He,Je,bt,I,T,$,s,at,Pt,Gt,Me,Ee,ze,ht,te,Fe,Se,pt,Ht,dn,rn,Rn,Ai,ol,gi,De,At,Li,Jn,rl,Pl,bi,al,fl,_t]}class Ka extends _e{constructor(e){super(),he(this,e,ND,LD,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function PD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function FD(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("div"),t=b("div"),i=W(n[2]),l=O(),s=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(f=we(Le.call(null,e,n[3])),a=!0)},p(u,c){c&4&&le(i,u[2]),c&2&&le(o,u[1])},d(u){u&&v(e),a=!1,f()}}}function RD(n){let e;function t(s,o){return s[0]?FD:PD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function qD(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class el extends _e{constructor(e){super(),he(this,e,qD,RD,me,{date:0})}}function Ym(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Km(n,e,t){const i=n.slice();return i[13]=e[t],i}function Jm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Zm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function jD(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function HD(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function zD(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function VD(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function BD(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&le(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function UD(n){let e,t=[],i=new Map,l,s,o=de(n[16].slice(0,n[17]));const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Xm();return{c(){var f;e=b("div");for(let u=0;uf[17]?a||(a=Xm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||u&2)&&x(e,"multiple",((c=f[1].options)==null?void 0:c.maxSelect)!=1)},i(f){if(!s){for(let u=0;un[11]&&eh();return{c(){e=b("div"),i.c(),l=O(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),k(e,l),f&&f.m(e,null),s=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(se(),A(r[d],1,1,()=>{r[d]=null}),oe(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),E(i,1),i.m(e,l)),u[9].length>u[11]?f||(f=eh(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(e),r[t].d(),f&&f.d()}}}function YD(n){let e,t=[],i=new Map,l=de(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ZD(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[we(Le.call(null,e,"Open in new tab")),K(e,"click",cn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,ve(s)}}}function GD(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function XD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function QD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function xD(n){let e,t,i,l;const s=[s8,l8],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Gm(n,e){let t,i,l;return i=new Wa({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),H(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(i,s)}}}function Xm(n){let e;return{c(){e=W("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function e8(n){let e,t=de(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&nh(n);return{c(){e=b("span"),i=W(t),l=O(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,f),f&8&&E(r,1)):(r=nh(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function s8(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&le(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function nh(n){let e,t;return e=new sl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function o8(n){let e,t,i,l,s;const o=[xD,QD,XD,GD,ZD,JD,KD,YD,WD,UD,BD,VD],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(u[3])),e?1:u[1].type==="bool"?2:u[1].type==="number"?3:u[1].type==="url"?4:u[1].type==="editor"?5:u[1].type==="date"?6:u[1].type==="select"?7:u[1].type==="relation"?8:u[1].type==="file"?9:u[2]?10:11)}function f(u,c){return c===0?zD(u):c===8?HD(u):c===9?jD(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),l=ye()},m(u,c){r[t].m(u,c),w(u,l,c),s=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(se(),A(r[d],1,1,()=>{r[d]=null}),oe(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(l),r[t].d(u)}}}function r8(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Te.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class Yb extends _e{constructor(e){super(),he(this,e,r8,o8,me,{record:0,field:1,short:2})}}function ih(n,e,t){const i=n.slice();return i[13]=e[t],i}function lh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new Yb({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=W(i),s=O(),o=b("td"),V(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(e,s),k(e,o),H(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[13].name+"")&&le(l,i);const c={};u&1&&(c.field=f[13]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(E(r.$$.fragment,f),a=!0)},o(f){A(r.$$.fragment,f),a=!1},d(f){f&&v(e),z(r)}}}function sh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=O(),l=b("td"),V(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),H(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),z(s)}}}function oh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=O(),l=b("td"),V(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),H(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),z(s)}}}function a8(n){var M;let e,t,i,l,s,o,r,a,f,u,c=(n[3].id||"...")+"",d,m,h,_,g;a=new sl({props:{value:n[3].id}});let y=de((M=n[0])==null?void 0:M.schema),S=[];for(let D=0;DA(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&sh(n),C=n[3].updated&&oh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=O(),o=b("td"),r=b("div"),V(a.$$.fragment),f=O(),u=b("span"),d=W(c),m=O();for(let D=0;D{$=null}),oe()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=oh(D),C.c(),E(C,1),C.m(t,null)):C&&(se(),A(C,1,1,()=>{C=null}),oe()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function c8(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[u8],header:[f8],default:[a8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),z(e,l)}}}function d8(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return u(g),s==null?void 0:s.show()}function f(){return t(4,r=!1),s==null?void 0:s.hide()}async function u(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await ae.collection(l.id).getOne(g)}catch(y){y.isAbort||(f(),console.warn("resolveModel:",y),ii(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>f();function m(g){ee[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Te.call(this,n,g)}function _(g){Te.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,f,s,o,r,i,a,d,m,h,_]}class p8 extends _e{constructor(e){super(),he(this,e,d8,c8,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function rh(n,e,t){const i=n.slice();return i[63]=e[t],i}function ah(n,e,t){const i=n.slice();return i[66]=e[t],i}function fh(n,e,t){const i=n.slice();return i[66]=e[t],i}function uh(n,e,t){const i=n.slice();return i[59]=e[t],i}function ch(n){let e;function t(s,o){return s[13]?h8:m8}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function m8(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=O(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[32]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function h8(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function dh(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[_8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function _8(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ph(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&mh(n),r=i&&hh(n);return{c(){o&&o.c(),t=O(),r&&r.c(),l=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){f[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,f),f[0]&32&&E(o,1)):(o=mh(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(se(),A(o,1,1,()=>{o=null}),oe()),f[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=hh(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(se(),A(r,1,1,()=>{r=null}),oe())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function mh(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[g8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function g8(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function hh(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[b8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function b8(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function k8(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=O(),s=b("span"),r=W(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,f){f[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[66].name+"")&&le(r,o)},d(a){a&&v(e)}}}function _h(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[k8]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new $n({props:r}),ee.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[66].type+" col-field-"+e[66].name),f[0]&524288&&(u.name=e[66].name),f[0]&524288|f[2]&512&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.sort=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function gh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[y8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function y8(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[v8]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new $n({props:s}),ee.push(()=>ge(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function v8(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function yh(n){let e;function t(s,o){return s[13]?S8:w8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function w8(n){let e,t,i,l;function s(a,f){var u;if((u=a[1])!=null&&u.length)return T8;if(!a[10])return $8}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=O(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function S8(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function T8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function vh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[K(i,"change",c),K(t,"click",cn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,ve(u)}}}function wh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&Sh(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),a=W(r),f=O(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),H(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&le(a,r),d[9]?c?c.p(d,m):(c=Sh(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),z(l),c&&c.d()}}}function Sh(n){let e;function t(s,o){return s[63].verified?O8:C8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function C8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function O8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function $h(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Th(n),o=i&&Ch(n);return{c(){s&&s.c(),t=O(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Th(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Ch(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Th(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?D8:M8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function M8(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&le(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function D8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ch(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?I8:E8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function E8(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&le(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function I8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Oh(n,e){let t,i,l,s;return i=new Yb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),z(i)}}}function Mh(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function Dh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function Eh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&vh(e),T=l&&wh(e),$=e[9]&&$h(e),C=de(e[19]);const M=F=>F[66].name;for(let F=0;F',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P{T=null}),oe()),e[9]?$?$.p(e,N):($=$h(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=de(e[19]),se(),r=ct(r,N,M,1,e,C,a,t,It,Oh,f,ah),oe()),N[0]&288&&(u=e[8]&&!e[5].includes("@created")),u?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Mh(e),D.c(),E(D,1),D.m(t,c)):D&&(se(),A(D,1,1,()=>{D=null}),oe()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Dh(e),I.c(),E(I,1),I.m(t,m)):I&&(se(),A(I,1,1,()=>{I=null}),oe())},i(F){if(!_){E(T);for(let N=0;NB[66].name;for(let B=0;BB[10]?B[63]:B[63].id;for(let B=0;B{D=null}),oe()),B[9]?I?(I.p(B,Y),Y[0]&512&&E(I,1)):(I=ph(B),I.c(),E(I,1),I.m(i,r)):I&&(se(),A(I,1,1,()=>{I=null}),oe()),Y[0]&524289&&(L=de(B[19]),se(),a=ct(a,Y,R,1,B,L,f,i,It,_h,u,fh),oe()),Y[0]&288&&(c=B[8]&&!B[5].includes("@created")),c?F?(F.p(B,Y),Y[0]&288&&E(F,1)):(F=gh(B),F.c(),E(F,1),F.m(i,d)):F&&(se(),A(F,1,1,()=>{F=null}),oe()),Y[0]&160&&(m=B[7]&&!B[5].includes("@updated")),m?N?(N.p(B,Y),Y[0]&160&&E(N,1)):(N=bh(B),N.c(),E(N,1),N.m(i,h)):N&&(se(),A(N,1,1,()=>{N=null}),oe()),B[16].length?P?P.p(B,Y):(P=kh(B),P.c(),P.m(_,null)):P&&(P.d(1),P=null),Y[0]&9971642&&(q=de(B[3]),se(),S=ct(S,Y,U,1,B,q,T,y,It,Eh,$,rh),oe(),!q.length&&Z?Z.p(B,Y):q.length?Z&&(Z.d(1),Z=null):(Z=yh(B),Z.c(),Z.m(y,$))),B[3].length&&B[18]?G?G.p(B,Y):(G=Ih(B),G.c(),G.m(y,null)):G&&(G.d(1),G=null),(!C||Y[0]&8192)&&x(e,"table-loading",B[13])},i(B){if(!C){E(D),E(I);for(let Y=0;Y({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),H(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(i,s)}}}function N8(n){let e,t,i=[],l=new Map,s,o,r=de(n[16]);const a=f=>f[59].id+f[59].name;for(let f=0;f{i=null}),oe())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Nh(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),l=b("strong"),s=W(n[6]),o=O(),a=W(r),f=O(),u=b("button"),u.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[K(u,"click",n[47]),K(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&le(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&le(a,r),(!g||$[0]&16384)&&x(u,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ye(()=>{g&&(_||(_=Ne(e,Pn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Ne(e,Pn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,ve(S)}}}function F8(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[P8],default:[A8]},$$scope:{ctx:n}};e=new Go({props:s}),n[46](e);let o=n[6]&&Nh(n);return{c(){V(e.$$.fragment),t=O(),o&&o.c(),i=ye()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const f={};a[0]&1030075|a[2]&512&&(f.$$scope={dirty:a,ctx:r}),e.$set(f),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=Nh(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(se(),A(o,1,1,()=>{o=null}),oe())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),z(e,r),o&&o.d(r)}}}const R8=/^([\+\-])?(\w+)$/,Ph=40;function q8(n,e,t){let i,l,s,o,r,a,f,u,c,d,m,h;Ue(n,Fn,De=>t(53,h=De));const _=st();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,M=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function U(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function Z(){if(t(5,N=[]),!!(g!=null&&g.id))try{const De=localStorage.getItem(q);De&&t(5,N=JSON.parse(De)||[])}catch{}}function G(De){return!!$.find(At=>At.id)}async function B(){const De=C;for(let At=1;At<=De;At++)(At===1||f)&&await Y(At,!1)}async function Y(De=1,At=!0){var al,fl,_t;if(!(g!=null&&g.id))return;t(13,I=!0);let Li=y;const Jn=Li.match(R8),rl=Jn?r.find(fe=>fe.name===Jn[2]):null;if(Jn&&rl){const fe=((_t=(fl=(al=h==null?void 0:h.find(Xe=>{var Yt;return Xe.id==((Yt=rl.options)==null?void 0:Yt.collectionId)}))==null?void 0:al.schema)==null?void 0:fl.filter(Xe=>Xe.presentable))==null?void 0:_t.map(Xe=>Xe.name))||[],Ce=[];for(const Xe of fe)Ce.push((Jn[1]||"")+Jn[2]+"."+Xe);Ce.length>0&&(Li=Ce.join(","))}const Pl=j.getAllCollectionIdentifiers(g),bi=o.map(fe=>fe.name+":excerpt(200)").concat(r.map(fe=>"expand."+fe.name+".*:excerpt(200)"));return bi.length&&bi.unshift("*"),ae.collection(g.id).getList(De,Ph,{sort:Li,skipTotal:1,filter:j.normalizeSearchFilter(S,Pl),expand:r.map(fe=>fe.name).join(","),fields:bi.join(","),requestKey:"records_list"}).then(async fe=>{var Ce;if(De<=1&&ue(),t(13,I=!1),t(12,C=fe.page),t(28,M=fe.items.length),_("load",$.concat(fe.items)),o.length)for(let Xe of fe.items)Xe._partial=!0;if(At){const Xe=++R;for(;(Ce=fe.items)!=null&&Ce.length&&R==Xe;){const Yt=fe.items.splice(0,20);for(let et of Yt)j.pushOrReplaceByKey($,et);t(3,$),await j.yieldToMain()}}else{for(let Xe of fe.items)j.pushOrReplaceByKey($,Xe);t(3,$)}}).catch(fe=>{fe!=null&&fe.isAbort||(t(13,I=!1),console.warn(fe),ue(),ae.error(fe,!S||(fe==null?void 0:fe.status)!=400))})}function ue(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,M=0),t(4,D={})}function ie(){c?be():Ae()}function be(){t(4,D={})}function Ae(){for(const De of $)t(4,D[De.id]=De,D);t(4,D)}function He(De){D[De.id]?delete D[De.id]:t(4,D[De.id]=De,D),t(4,D)}function Je(){fn(`Do you really want to delete the selected ${u===1?"record":"records"}?`,tt)}async function tt(){if(L||!u||!(g!=null&&g.id))return;let De=[];for(const At of Object.keys(D))De.push(ae.collection(g.id).delete(At));return t(14,L=!0),Promise.all(De).then(()=>{Et(`Successfully deleted the selected ${u===1?"record":"records"}.`),_("delete",D),be()}).catch(At=>{ae.error(At)}).finally(()=>(t(14,L=!1),B()))}function bt(De){Te.call(this,n,De)}const at=(De,At)=>{At.target.checked?j.removeByValue(N,De.id):j.pushUnique(N,De.id),t(5,N)},Pt=()=>ie();function Gt(De){y=De,t(0,y)}function Me(De){y=De,t(0,y)}function Ee(De){y=De,t(0,y)}function ze(De){y=De,t(0,y)}function ht(De){y=De,t(0,y)}function te(De){y=De,t(0,y)}function Fe(De){ee[De?"unshift":"push"](()=>{F=De,t(15,F)})}const Se=De=>He(De),pt=De=>_("select",De),Ht=(De,At)=>{At.code==="Enter"&&(At.preventDefault(),_("select",De))},dn=()=>t(1,S=""),rn=()=>_("new"),Rn=()=>Y(C+1);function Ai(De){ee[De?"unshift":"push"](()=>{T=De,t(11,T)})}const ol=()=>be(),gi=()=>Je();return n.$$set=De=>{"collection"in De&&t(25,g=De.collection),"sort"in De&&t(0,y=De.sort),"filter"in De&&t(1,S=De.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",Z(),ue()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(De=>De.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(De=>De.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(De=>!N.includes(De.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&Y(1),n.$$.dirty[0]&268435456&&t(18,f=M>=Ph),n.$$.dirty[0]&16&&t(6,u=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&u===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(De=>({id:De.id,name:De.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,Y,$,D,N,u,m,d,l,i,T,C,I,L,F,P,c,f,a,_,ie,be,He,Je,g,G,B,M,s,bt,at,Pt,Gt,Me,Ee,ze,ht,te,Fe,Se,pt,Ht,dn,rn,Rn,Ai,ol,gi]}class j8 extends _e{constructor(e){super(),he(this,e,q8,F8,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function H8(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=O(),l=b("span"),o=W(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[f]){f&5&&s!==(s=(a[2]?"...":a[0])+"")&&le(o,s),f&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function z8(n,e,t){const i=st();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function f(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const u=j.getAllCollectionIdentifiers(l),c=await ae.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,u),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(u){u!=null&&u.isAbort||(t(2,a=!1),console.warn(u))}}}return n.$$set=u=>{"collection"in u&&t(3,l=u.collection),"filter"in u&&t(4,s=u.filter),"totalCount"in u&&t(0,o=u.totalCount),"class"in u&&t(1,r=u.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&f()},[o,r,a,l,s,f]}class V8 extends _e{constructor(e){super(),he(this,e,z8,H8,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function B8(n){let e,t,i,l;return e=new l6({}),i=new kn({props:{class:"flex-content",$$slots:{footer:[K8],default:[Y8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function U8(n){let e,t;return e=new kn({props:{center:!0,$$slots:{default:[G8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function W8(n){let e,t;return e=new kn({props:{center:!0,$$slots:{default:[X8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Fh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[we(Le.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,ve(i)}}}function Rh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Y8(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L,R,F=!n[12]&&Fh(n);c=new Zo({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&Rh(n);y=new $s({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(Z){n[26](Z)}function q(Z){n[27](Z)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),C=new j8({props:U}),n[25](C),ee.push(()=>ge(C,"filter",P)),ee.push(()=>ge(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=O(),s=b("div"),r=W(o),a=O(),f=b("div"),F&&F.c(),u=O(),V(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=O(),N&&N.c(),g=O(),V(y.$$.fragment),S=O(),T=b("div"),$=O(),V(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(Z,G){w(Z,e,G),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,f),F&&F.m(f,null),k(f,u),H(c,f,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(Z,g,G),H(y,Z,G),w(Z,S,G),w(Z,T,G),w(Z,$,G),H(C,Z,G),I=!0,L||(R=K(h,"click",n[22]),L=!0)},p(Z,G){(!I||G[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[12]?F&&(F.d(1),F=null):F?F.p(Z,G):(F=Fh(Z),F.c(),F.m(f,u)),Z[2].type!=="view"?N?N.p(Z,G):(N=Rh(Z),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const B={};G[0]&1&&(B.value=Z[0]),G[0]&4&&(B.autocompleteCollection=Z[2]),y.$set(B);const Y={};G[0]&4&&(Y.collection=Z[2]),!M&&G[0]&1&&(M=!0,Y.filter=Z[0],ke(()=>M=!1)),!D&&G[0]&2&&(D=!0,Y.sort=Z[1],ke(()=>D=!1)),C.$set(Y)},i(Z){I||(E(c.$$.fragment,Z),E(y.$$.fragment,Z),E(C.$$.fragment,Z),I=!0)},o(Z){A(c.$$.fragment,Z),A(y.$$.fragment,Z),A(C.$$.fragment,Z),I=!1},d(Z){Z&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),z(c),N&&N.d(),z(y,Z),n[25](null),z(C,Z),L=!1,R()}}}function K8(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new V8({props:s}),n[18](e),ee.push(()=>ge(e,"totalCount",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),z(e,o)}}}function J8(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function Z8(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function G8(n){let e,t,i;function l(r,a){return r[12]?Z8:J8}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function X8(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Q8(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[W8,U8,B8],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ua({props:_}),n[31](l);let g={};o=new d6({props:g}),n[32](o);let y={collection:n[2]};a=new Ka({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new p8({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),V(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),H(l,T,$),w(T,s,$),H(o,T,$),w(T,r,$),H(a,T,$),w(T,f,$),H(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(se(),A(m[C],1,1,()=>{m[C]=null}),oe(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),z(l,T),n[32](null),z(o,T),n[33](null),z(a,T),n[37](null),z(u,T)}}}function x8(n,e,t){let i,l,s,o,r,a,f;Ue(n,Kn,Me=>t(2,l=Me)),Ue(n,Mt,Me=>t(39,s=Me)),Ue(n,To,Me=>t(3,o=Me)),Ue(n,jo,Me=>t(16,r=Me)),Ue(n,Fn,Me=>t(11,a=Me)),Ue(n,Xi,Me=>t(12,f=Me));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;Y1(T);async function C(Me){await Xt(),(l==null?void 0:l.type)==="view"?h.show(Me):m==null||m.show(Me)}function M(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D()}async function D(){if(!S)return;const Me=j.getAllCollectionIdentifiers(l),Ee=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Ee.filter(ze=>Me.includes(ze)).length!=Ee.length&&(Me.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Me={}){const Ee=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Me);j.replaceHashQueryParams(Ee)}const L=()=>c==null?void 0:c.show();function R(Me){ee[Me?"unshift":"push"](()=>{g=Me,t(9,g)})}function F(Me){$=Me,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),U=()=>m==null?void 0:m.show(),Z=Me=>t(0,y=Me.detail);function G(Me){ee[Me?"unshift":"push"](()=>{_=Me,t(8,_)})}function B(Me){y=Me,t(0,y)}function Y(Me){S=Me,t(1,S)}const ue=Me=>{I({recordId:Me.detail.id});let Ee=Me.detail._partial?Me.detail.id:Me.detail;l.type==="view"?h==null||h.show(Ee):m==null||m.show(Ee)},ie=()=>{g==null||g.reload()},be=()=>m==null?void 0:m.show();function Ae(Me){ee[Me?"unshift":"push"](()=>{c=Me,t(4,c)})}function He(Me){ee[Me?"unshift":"push"](()=>{d=Me,t(5,d)})}function Je(Me){ee[Me?"unshift":"push"](()=>{m=Me,t(6,m)})}const tt=()=>{I({recordId:null})},bt=Me=>{y?g==null||g.reload():Me.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},at=Me=>{(!y||_!=null&&_.hasRecord(Me.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function Pt(Me){ee[Me?"unshift":"push"](()=>{h=Me,t(7,h)})}const Gt=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&xy(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&M(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(Mt,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,q,U,Z,G,B,Y,ue,ie,be,Ae,He,Je,tt,bt,at,Pt,Gt]}class eE extends _e{constructor(e){super(),he(this,e,x8,Q8,me,{},null,[-1,-1])}}function qh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=O(),i=b("a"),i.innerHTML=' Export collections',l=O(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[we(An.call(null,i,{path:"/settings/export-collections/?.*"})),we(nn.call(null,i)),we(An.call(null,s,{path:"/settings/import-collections/?.*"})),we(nn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,ve(r)}}}function tE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M=!n[0]&&qh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=O(),l=b("a"),l.innerHTML=' Application',s=O(),o=b("a"),o.innerHTML=' Mail settings',r=O(),a=b("a"),a.innerHTML=' Files storage',f=O(),u=b("a"),u.innerHTML=' Backups',c=O(),M&&M.c(),d=O(),m=b("div"),m.textContent="Authentication",h=O(),_=b("a"),_.innerHTML=' Auth providers',g=O(),y=b("a"),y.innerHTML=' Token options',S=O(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),M&&M.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[we(An.call(null,l,{path:"/settings"})),we(nn.call(null,l)),we(An.call(null,o,{path:"/settings/mail/?.*"})),we(nn.call(null,o)),we(An.call(null,a,{path:"/settings/storage/?.*"})),we(nn.call(null,a)),we(An.call(null,u,{path:"/settings/backups/?.*"})),we(nn.call(null,u)),we(An.call(null,_,{path:"/settings/auth-providers/?.*"})),we(nn.call(null,_)),we(An.call(null,y,{path:"/settings/tokens/?.*"})),we(nn.call(null,y)),we(An.call(null,T,{path:"/settings/admins/?.*"})),we(nn.call(null,T))],$=!0)},p(D,I){D[0]?M&&(M.d(1),M=null):M||(M=qh(),M.c(),M.m(e,d))},d(D){D&&v(e),M&&M.d(),$=!1,ve(C)}}}function nE(n){let e,t;return e=new Rb({props:{class:"settings-sidebar",$$slots:{default:[tE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function iE(n,e,t){let i;return Ue(n,Xi,l=>t(0,i=l)),[i]}class _i extends _e{constructor(e){super(),he(this,e,iE,nE,me,{})}}function jh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Hh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[lE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function lE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Ub({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="id",o=O(),r=b("div"),V(a.$$.fragment),f=O(),u=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),H(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),z(a)}}}function zh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=O(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=K(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function sE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Email",o=O(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[3]),f||(u=K(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function Vh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[oE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function oE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bh(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[rE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[aE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(t,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(t,xe,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),z(l),z(r),u&&a&&a.end()}}}function rE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Wb({}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password",o=O(),r=b("input"),f=O(),u=b("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),re(r,n[9]),w(_,f,g),w(_,u,g),H(c,u,null),d=!0,m||(h=K(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&re(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),z(c),m=!1,h()}}}function aE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[10]),f||(u=K(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&re(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function fE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&Hh(n),_=de([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=zh(jh(n,_,T));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[sE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Vh(n),S=(n[5]||n[4])&&Bh(n);return{c(){e=b("form"),h&&h.c(),t=O(),i=b("div"),l=b("p"),l.textContent="Avatar",s=O(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=O(),V(a.$$.fragment),f=O(),y&&y.c(),u=O(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),H(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=Hh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=de([0,1,2,3,4,5,6,7,8,9]);let M;for(M=0;M<10;M+=1){const D=jh(T,_,M);g[M]?g[M].p(D,$):(g[M]=zh(D),g[M].c(),g[M].m(o,null))}for(;M<10;M+=1)g[M].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(se(),A(y,1,1,()=>{y=null}),oe()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Vh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Bh(T),S.c(),E(S,1),S.m(e,null)):S&&(se(),A(S,1,1,()=>{S=null}),oe())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),rt(g,T),z(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function uE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=W(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&le(i,t)},d(l){l&&v(e)}}}function Uh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[cE]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=O(),l=b("i"),s=O(),V(o.$$.fragment),r=O(),a=b("div"),p(l,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),H(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),z(o)}}}function cE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function dE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Uh(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",l=O(),s=b("button"),o=b("span"),a=W(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=K(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(se(),A(m,1,1,()=>{m=null}),oe()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Uh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&le(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function pE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[dE],header:[uE],default:[fE]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),z(e,l)}}}function mE(n,e,t){let i,l;const s=st(),o="admin_"+j.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Jt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let B;i?B=ae.admins.create(G):B=ae.admins.update(a.id,G),B.then(async Y=>{var ue;t(8,u=!1),y(),Et(i?"Successfully created admin.":"Successfully updated admin."),((ue=ae.authStore.model)==null?void 0:ue.id)===Y.id&&ae.authStore.save(ae.authStore.token,Y),s("save",Y)}).catch(Y=>{ae.error(Y)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&fn("Do you really want to delete the selected admin?",()=>ae.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Et("Successfully deleted admin."),s("delete",a)}).catch(G=>{ae.error(G)}))}const M=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(G){ee[G?"unshift":"push"](()=>{r=G,t(6,r)})}function U(G){Te.call(this,n,G)}function Z(G){Te.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,M,D,I,L,R,F,N,P,q,U,Z]}class hE extends _e{constructor(e){super(),he(this,e,mE,pE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Wh(n,e,t){const i=n.slice();return i[24]=e[t],i}function _E(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function gE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Yh(n){let e;function t(s,o){return s[5]?vE:yE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function yE(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Kh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=O(),o&&o.c(),s=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Kh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function vE(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Jh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Zh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,M,D,I,L,R,F,N,P,q,U,Z,G;u=new sl({props:{value:e[24].id}});let B=e[24].id===e[7].id&&Jh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Y(){return e[15](e[24])}function ue(...ie){return e[16](e[24],...ie)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=O(),a=b("td"),f=b("div"),V(u.$$.fragment),c=O(),d=b("span"),h=W(m),_=O(),B&&B.c(),g=O(),y=b("td"),S=b("span"),$=W(T),M=O(),D=b("td"),V(I.$$.fragment),L=O(),R=b("td"),V(F.$$.fragment),N=O(),P=b("td"),P.innerHTML='',q=O(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ie,be){w(ie,t,be),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),H(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),B&&B.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,M),k(t,D),H(I,D,null),k(t,L),k(t,R),H(F,R,null),k(t,N),k(t,P),k(t,q),U=!0,Z||(G=[K(t,"click",Y),K(t,"keydown",ue)],Z=!0)},p(ie,be){e=ie,(!U||be&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Ae={};be&16&&(Ae.value=e[24].id),u.$set(Ae),(!U||be&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?B||(B=Jh(),B.c(),B.m(a,null)):B&&(B.d(1),B=null),(!U||be&16)&&T!==(T=e[24].email+"")&&le($,T),(!U||be&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};be&16&&(He.date=e[24].created),I.$set(He);const Je={};be&16&&(Je.date=e[24].updated),F.$set(Je)},i(ie){U||(E(u.$$.fragment,ie),E(I.$$.fragment,ie),E(F.$$.fragment,ie),U=!0)},o(ie){A(u.$$.fragment,ie),A(I.$$.fragment,ie),A(F.$$.fragment,ie),U=!1},d(ie){ie&&v(t),z(u),B&&B.d(),z(I),z(F),Z=!1,ve(G)}}}function wE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],M=new Map,D;function I(Y){n[11](Y)}let L={class:"col-type-text",name:"id",$$slots:{default:[_E]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new $n({props:L}),ee.push(()=>ge(o,"sort",I));function R(Y){n[12](Y)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[gE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new $n({props:F}),ee.push(()=>ge(f,"sort",R));function N(Y){n[13](Y)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[bE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new $n({props:P}),ee.push(()=>ge(d,"sort",N));function q(Y){n[14](Y)}let U={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[kE]},$$scope:{ctx:n}};n[2]!==void 0&&(U.sort=n[2]),_=new $n({props:U}),ee.push(()=>ge(_,"sort",q));let Z=de(n[4]);const G=Y=>Y[24].id;for(let Y=0;Yr=!1)),o.$set(ie);const be={};ue&134217728&&(be.$$scope={dirty:ue,ctx:Y}),!u&&ue&4&&(u=!0,be.sort=Y[2],ke(()=>u=!1)),f.$set(be);const Ae={};ue&134217728&&(Ae.$$scope={dirty:ue,ctx:Y}),!m&&ue&4&&(m=!0,Ae.sort=Y[2],ke(()=>m=!1)),d.$set(Ae);const He={};ue&134217728&&(He.$$scope={dirty:ue,ctx:Y}),!g&&ue&4&&(g=!0,He.sort=Y[2],ke(()=>g=!1)),_.$set(He),ue&186&&(Z=de(Y[4]),se(),C=ct(C,ue,G,1,Y,Z,M,$,It,Zh,null,Wh),oe(),!Z.length&&B?B.p(Y,ue):Z.length?B&&(B.d(1),B=null):(B=Yh(Y),B.c(),B.m($,null))),(!D||ue&32)&&x(e,"table-loading",Y[5])},i(Y){if(!D){E(o.$$.fragment,Y),E(f.$$.fragment,Y),E(d.$$.fragment,Y),E(_.$$.fragment,Y);for(let ue=0;ue New admin',h=O(),V(_.$$.fragment),g=O(),y=b("div"),S=O(),V(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),H(a,e,null),k(e,f),k(e,u),k(e,c),k(e,d),k(d,m),w(D,h,I),H(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),H(T,D,I),$=!0,C||(M=K(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&le(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),z(a),z(_,D),z(T,D),C=!1,M()}}}function $E(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=W("Total found: "),l=W(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&le(l,i)},d(s){s&&v(e)}}}function TE(n){let e,t,i,l,s,o;e=new _i({}),i=new kn({props:{$$slots:{footer:[$E],default:[SE]},$$scope:{ctx:n}}});let r={};return s=new hE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),H(s,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[18](null),z(s,a)}}}function CE(n,e,t){let i,l,s;Ue(n,jo,F=>t(21,i=F)),Ue(n,Mt,F=>t(6,l=F)),Ue(n,$a,F=>t(7,s=F)),xt(Mt,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],f=!1,u=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,f=!0),t(4,a=[]);const F=j.normalizeSearchFilter(u,["id","email","created","updated"]);return ae.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,f=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,f=!1),console.warn(N),m(),ae.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,u=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),M=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,u="");function I(F){ee[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();tl("/settings/admins?"+F),d()}},[d,u,c,r,a,f,l,s,h,_,g,y,S,T,$,C,M,D,I,L,R]}class OE extends _e{constructor(e){super(),he(this,e,CE,TE,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function ME(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=O(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=K(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function DE(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=W("Password"),l=O(),s=b("input"),r=O(),a=b("div"),f=b("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[1]),w(d,r,m),w(d,a,m),k(a,f),u||(c=[K(s,"input",n[5]),we(nn.call(null,f))],u=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&re(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),u=!1,ve(c)}}}function EE(n){let e,t,i,l,s,o,r,a,f,u,c;return l=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[ME,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[DE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=O(),V(l.$$.fragment),s=O(),V(o.$$.fragment),r=O(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),H(l,e,null),k(e,s),H(o,e,null),k(e,r),k(e,a),f=!0,u||(c=K(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),z(l),z(o),u=!1,c()}}}function IE(n){let e,t;return e=new K1({props:{$$slots:{default:[EE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function AE(n,e,t){let i;Ue(n,jo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ae.admins.authWithPassword(s,o).then(()=>{wa(),tl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class LE extends _e{constructor(e){super(),he(this,e,AE,IE,me,{})}}function NE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[FE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[RE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[qE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Gh(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),u=b("div"),c=b("div"),d=O(),$&&$.c(),m=O(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,M){w(C,e,M),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),H(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=K(h,"click",n[12]),S=!0)},p(C,M){const D={};M&786433&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const I={};M&786433&&(I.$$scope={dirty:M,ctx:C}),o.$set(I);const L={};M&786433&&(L.$$scope={dirty:M,ctx:C}),a.$set(L),C[3]?$?$.p(C,M):($=Gh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||M&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||M&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),z(i),z(o),z(a),$&&$.d(),S=!1,T()}}}function PE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function FE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application name"),l=O(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&re(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application URL"),l=O(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&re(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[10]),we(Le.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function Gh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function jE(n){let e,t,i,l,s,o,r,a,f;const u=[PE,NE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=O(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=K(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(se(),A(c[_],1,1,()=>{c[_]=null}),oe(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function HE(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[jE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function zE(n,e,t){let i,l,s,o;Ue(n,Xi,C=>t(13,l=C)),Ue(n,Oo,C=>t(14,s=C)),Ue(n,Mt,C=>t(15,o=C)),xt(Mt,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await ae.settings.getAll()||{};h(C)}catch(C){ae.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await ae.settings.update(j.filterRedactedProps(a));h(C),Et("Successfully saved application settings.")}catch(C){ae.error(C)}t(2,u=!1)}}function h(C={}){var M,D;xt(Oo,s=(M=C==null?void 0:C.meta)==null?void 0:M.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class VE extends _e{constructor(e){super(),he(this,e,zE,HE,me,{})}}function BE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=O(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),l.autofocus&&l.focus(),s||(o=[we(Le.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],s=!0)},p(f,u){ni(l,a=dt(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&(v(e),v(i),v(l)),s=!1,ve(o)}}}function WE(n){let e;function t(s,o){return s[3]?UE:BE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function YE(n,e,t){const i=["value","mask"];let l=Ge(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,s=""),t(3,a=!1),await Xt(),r==null||r.focus()}const u=()=>f();function c(m){ee[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Wt(m)),t(5,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,f,l,u,c,d]}class Ja extends _e{constructor(e){super(),he(this,e,YE,WE,me,{value:0,mask:1})}}function KE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("label"),t=W("Subject"),l=O(),s=b("input"),r=O(),a=b("div"),f=W(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=W(`, - `),d=b("button"),d.textContent="{APP_URL} ",m=W("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),re(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),h||(_=[K(s,"input",n[13]),K(u,"click",n[14]),K(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&re(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,ve(_)}}}function WE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y;return{c(){e=b("label"),t=W("Action URL"),l=O(),s=b("input"),r=O(),a=b("div"),f=W(`Available placeholder parameters: + `),d=b("button"),d.textContent="{APP_URL} ",m=W("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),re(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),h||(_=[K(s,"input",n[13]),K(u,"click",n[14]),K(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&re(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,ve(_)}}}function JE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y;return{c(){e=b("label"),t=W("Action URL"),l=O(),s=b("input"),r=O(),a=b("div"),f=W(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=W(`, `),d=b("button"),d.textContent="{APP_URL} ",m=W(`, - `),h=b("button"),h.textContent="{TOKEN} ",_=W("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),re(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[K(s,"input",n[16]),K(u,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&re(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,ve(y)}}}function YE(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),re(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&re(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function KE(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function JE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;const C=[KE,YE],M=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=M[s]=C[s](n),{c(){e=b("label"),t=W("Body (HTML)"),l=O(),o.c(),r=O(),a=b("div"),f=W(`Available placeholder parameters: + `),h=b("button"),h.textContent="{TOKEN} ",_=W("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),re(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[K(s,"input",n[16]),K(u,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&re(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,ve(y)}}}function ZE(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),re(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&re(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function GE(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Ot(o,r(n)),ee.push(()=>ge(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,f){e&&H(e,a,f),w(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>ge(e,"value",s)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function XE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;const C=[GE,ZE],M=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=M[s]=C[s](n),{c(){e=b("label"),t=W("Body (HTML)"),l=O(),o.c(),r=O(),a=b("div"),f=W(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=W(`, `),d=b("button"),d.textContent="{APP_URL} ",m=W(`, `),h=b("button"),h.textContent="{TOKEN} ",_=W(`, - `),g=b("button"),g.textContent="{ACTION_URL} ",y=W("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),M[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[K(u,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?M[s].p(I,L):(se(),A(M[R],1,1,()=>{M[R]=null}),oe(),o=M[s],o?o.p(I,L):(o=M[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),M[s].d(I),T=!1,ve($)}}}function ZE(n){let e,t,i,l,s,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[UE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[WE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[JE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,l,a),H(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),z(e,r),z(i,r),z(s,r)}}}function Zh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function GE(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Zh();return{c(){e=b("div"),t=b("i"),i=O(),l=b("span"),s=W(n[2]),o=O(),r=b("div"),a=O(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&le(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Zh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function XE(n){let e,t;const i=[n[8]];let l={$$slots:{header:[GE],default:[ZE]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=Gh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await nt(()=>import("./CodeEditor-AgADv186.js"),__vite__mapDeps([2,1]),import.meta.url)).default),Gh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),wo(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const M=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function U(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function Z(Y){Te.call(this,n,Y)}function G(Y){Te.call(this,n,Y)}function B(Y){Te.call(this,n,Y)}return n.$$set=Y=>{e=Pe(Pe({},e),Wt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||ii(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,M,D,I,L,R,F,N,P,q,U,Z,G,B]}class Ka extends _e{constructor(e){super(),he(this,e,QE,XE,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Xh(n,e,t){const i=n.slice();return i[21]=e[t],i}function Qh(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=a0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=O(),o=b("label"),a=W(r),u=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=K(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function xE(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[eI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),H(t,e,null),k(e,i),H(l,e,null),s=!0,o||(r=K(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),z(t),z(l),o=!1,r()}}}function nI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function iI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=W("Close"),i=O(),l=b("button"),s=b("i"),o=O(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=K(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function lI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[iI],header:[nI],default:[tI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),z(e,l)}}}const Ar="last_email_test",xh="email_test_request";function sI(n,e,t){let i;const l=st(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Ar),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Ar)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Ar,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(xh),ni("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:xh}),Et("Successfully sent test email."),l("submit"),t(4,u=!1),await Xt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Te.call(this,n,D)}function M(D){Te.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,M]}class oI extends _e{constructor(e){super(),he(this,e,sI,lI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function rI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[fI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[uI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&e_(n),M=!n[0].meta.resetPasswordTemplate.hidden&&t_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&n_(n);h=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[cI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&i_(n);function L(N,P){return N[5]?wI:vI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),C&&C.c(),f=O(),M&&M.c(),u=O(),D&&D.c(),c=O(),d=b("hr"),m=O(),V(h.$$.fragment),_=O(),I&&I.c(),g=O(),y=b("div"),S=b("div"),T=O(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),M&&M.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),H(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const U={};P[0]&1|P[1]&24&&(U.$$scope={dirty:P,ctx:N}),o.$set(U),N[0].meta.verificationTemplate.hidden?C&&(se(),A(C,1,1,()=>{C=null}),oe()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=e_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?M&&(se(),A(M,1,1,()=>{M=null}),oe()):M?(M.p(N,P),P[0]&1&&E(M,1)):(M=t_(N),M.c(),E(M,1),M.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(se(),A(D,1,1,()=>{D=null}),oe()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=n_(N),D.c(),E(D,1),D.m(a,null));const Z={};P[0]&1|P[1]&24&&(Z.$$scope={dirty:P,ctx:N}),h.$set(Z),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=i_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(se(),A(I,1,1,()=>{I=null}),oe()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(M),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(M),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),z(i),z(o),C&&C.d(),M&&M.d(),D&&D.d(),z(h,N),I&&I.d(N),F.d()}}}function aI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function fI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender name"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=K(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function uI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender address"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=K(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function e_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Ka({props:s}),ee.push(()=>ge(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function t_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Ka({props:s}),ee.push(()=>ge(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function n_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Ka({props:s}),ee.push(()=>ge(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function cI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[18]),we(Le.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function i_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[dI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[pI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[mI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[hI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?gI:_I}let M=C(n),D=M(n),I=n[4]&&l_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),a=O(),f=b("div"),V(u.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),_=b("button"),D.c(),g=O(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),k(t,a),k(t,f),H(u,f,null),k(t,c),k(t,d),H(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=K(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),M!==(M=C(L))&&(D.d(1),D=M(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=l_(L),I.c(),E(I,1),I.m(e,null)):I&&(se(),A(I,1,1,()=>{I=null}),oe())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ye(()=>{S&&(y||(y=Ne(e,xe,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Ne(e,xe,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),z(l),z(r),z(u),z(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function dI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=K(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function pI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Port"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=K(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&<(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function mI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Username"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=K(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function hI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ya({props:f}),ee.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=W("Password"),l=O(),V(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function _I(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=O(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function gI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=O(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function l_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new pe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[bI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[kI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[yI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(f.$$.fragment),u=O(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ye(()=>{m&&(d||(d=Ne(e,xe,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Ne(e,xe,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),z(i),z(o),z(f),h&&d&&d.end()}}}function bI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),l=O(),V(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function kI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),l=O(),V(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function yI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=O(),l=b("i"),o=O(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[we(Le.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),K(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,ve(u)}}}function vI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function wI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[K(e,"click",n[27]),K(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,ve(a)}}}function SI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[aI,rI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[6]),r=O(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=K(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&le(o,$[6]);let M=d;d=T($),d===M?S[d].p($,C):(se(),A(S[M],1,1,()=>{S[M]=null}),oe(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function $I(n){let e,t,i,l,s,o;e=new _i({}),i=new kn({props:{$$slots:{default:[SI]},$$scope:{ctx:n}}});let r={};return s=new oI({props:r}),n[31](s),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),H(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[31](null),z(s,a)}}}function TI(n,e,t){let i,l,s;Ue(n,Mt,ie=>t(6,s=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(Mt,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const ie=await ae.settings.getAll()||{};g(ie)}catch(ie){ae.error(ie)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const ie=await ae.settings.update(j.filterRedactedProps(u));g(ie),Jt({}),Et("Successfully saved mail settings.")}catch(ie){ae.error(ie)}t(3,d=!1)}}function g(ie={}){t(0,u={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(ie){n.$$.not_equal(u.meta.verificationTemplate,ie)&&(u.meta.verificationTemplate=ie,t(0,u))}function C(ie){n.$$.not_equal(u.meta.resetPasswordTemplate,ie)&&(u.meta.resetPasswordTemplate=ie,t(0,u))}function M(ie){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ie)&&(u.meta.confirmEmailChangeTemplate=ie,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=lt(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(ie){n.$$.not_equal(u.smtp.password,ie)&&(u.smtp.password=ie,t(0,u))}const N=()=>{t(4,m=!m)};function P(ie){n.$$.not_equal(u.smtp.tls,ie)&&(u.smtp.tls=ie,t(0,u))}function q(ie){n.$$.not_equal(u.smtp.authMethod,ie)&&(u.smtp.authMethod=ie,t(0,u))}function U(){u.smtp.localName=this.value,t(0,u)}const Z=()=>y(),G=()=>_(),B=()=>a==null?void 0:a.show(),Y=()=>_();function ue(ie){ee[ie?"unshift":"push"](()=>{a=ie,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,M,D,I,L,R,F,N,P,q,U,Z,G,B,Y,ue]}class CI extends _e{constructor(e){super(),he(this,e,TI,$I,me,{},null,[-1,-1])}}const OI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),s_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function MI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&le(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M;return i=new pe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[DI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[EI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[II,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[AI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[LI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new pe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[NI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(f.$$.fragment),u=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),g=O(),y=b("div"),V(S.$$.fragment),T=O(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(f,a,null),k(e,u),k(e,c),H(d,c,null),k(e,m),k(e,h),H(_,h,null),k(e,g),k(e,y),H(S,y,null),k(e,T),k(e,$),M=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){M||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ye(()=>{M&&(C||(C=Ne(e,xe,{duration:150},!0)),C.run(1))}),M=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Ne(e,xe,{duration:150},!1)),C.run(0)),M=!1},d(D){D&&v(e),z(i),z(o),z(f),z(d),z(_),z(S),D&&C&&C.end()}}}function DI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function EI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Bucket"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=K(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function II(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Region"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=K(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function AI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Access key"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=K(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function LI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ya({props:f}),ee.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=W("Secret"),l=O(),V(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function NI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[14]),we(Le.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function PI(n){let e,t,i,l,s;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[MI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=vt(o,n,n[15],s_);let a=n[0].enabled&&o_(n);return{c(){V(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),l=ye()},m(f,u){H(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&St(r,o,f,f[15],s?wt(o,f[15],u,OI):$t(f[15]),s_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=o_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(se(),A(a,1,1,()=>{a=null}),oe())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),z(e,f),r&&r.d(f),a&&a.d(f)}}}const Lr="s3_test_request";function FI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(Lr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(Lr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:Lr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}jt(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function M(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||ii(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,M,l]}class Vb extends _e{constructor(e){super(),he(this,e,FI,PI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function RI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[jI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new Vb({props:$}),ee.push(()=>ge(e,"config",y)),ee.push(()=>ge(e,"isTesting",S)),ee.push(()=>ge(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&a_(n),M=n[6]&&f_(n);return{c(){V(e.$$.fragment),s=O(),o=b("div"),r=b("div"),a=O(),C&&C.c(),f=O(),M&&M.c(),u=O(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){H(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),M&&M.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=K(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=a_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?M?M.p(I,L):(M=f_(I),M.c(),M.m(o,u)):M&&(M.d(1),M=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),z(e,I),C&&C.d(),M&&M.d(),_=!1,g()}}}function qI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function r_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,M,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=O(),s=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually + `),g=b("button"),g.textContent="{ACTION_URL} ",y=W("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),M[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[K(u,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?M[s].p(I,L):(se(),A(M[R],1,1,()=>{M[R]=null}),oe(),o=M[s],o?o.p(I,L):(o=M[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),M[s].d(I),T=!1,ve($)}}}function QE(n){let e,t,i,l,s,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[KE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[JE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[XE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,l,a),H(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),z(e,r),z(i,r),z(s,r)}}}function Xh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=we(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function xE(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Xh();return{c(){e=b("div"),t=b("i"),i=O(),l=b("span"),s=W(n[2]),o=O(),r=b("div"),a=O(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&le(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Xh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(se(),A(u,1,1,()=>{u=null}),oe())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function eI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[xE],default:[QE]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=Qh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await nt(()=>import("./CodeEditor-rWx4HUVf.js"),__vite__mapDeps([2,1]),import.meta.url)).default),Qh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),$o(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const M=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function U(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function Z(Y){Te.call(this,n,Y)}function G(Y){Te.call(this,n,Y)}function B(Y){Te.call(this,n,Y)}return n.$$set=Y=>{e=Pe(Pe({},e),Wt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,M,D,I,L,R,F,N,P,q,U,Z,G,B]}class Za extends _e{constructor(e){super(),he(this,e,tI,eI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function xh(n,e,t){const i=n.slice();return i[21]=e[t],i}function e_(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=d0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=O(),o=b("label"),a=W(r),u=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=K(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function nI(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[iI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),H(t,e,null),k(e,i),H(l,e,null),s=!0,o||(r=K(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),z(t),z(l),o=!1,r()}}}function sI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=W("Close"),i=O(),l=b("button"),s=b("i"),o=O(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=K(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function rI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[oI],header:[sI],default:[lI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),z(e,l)}}}const Nr="last_email_test",t_="email_test_request";function aI(n,e,t){let i;const l=st(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Nr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Nr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(t_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:t_}),Et("Successfully sent test email."),l("submit"),t(4,u=!1),await Xt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Te.call(this,n,D)}function M(D){Te.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,M]}class fI extends _e{constructor(e){super(),he(this,e,aI,rI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function uI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[dI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[pI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&n_(n),M=!n[0].meta.resetPasswordTemplate.hidden&&i_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&l_(n);h=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[mI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&s_(n);function L(N,P){return N[5]?TI:$I}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),C&&C.c(),f=O(),M&&M.c(),u=O(),D&&D.c(),c=O(),d=b("hr"),m=O(),V(h.$$.fragment),_=O(),I&&I.c(),g=O(),y=b("div"),S=b("div"),T=O(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),M&&M.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),H(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const U={};P[0]&1|P[1]&24&&(U.$$scope={dirty:P,ctx:N}),o.$set(U),N[0].meta.verificationTemplate.hidden?C&&(se(),A(C,1,1,()=>{C=null}),oe()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=n_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?M&&(se(),A(M,1,1,()=>{M=null}),oe()):M?(M.p(N,P),P[0]&1&&E(M,1)):(M=i_(N),M.c(),E(M,1),M.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(se(),A(D,1,1,()=>{D=null}),oe()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=l_(N),D.c(),E(D,1),D.m(a,null));const Z={};P[0]&1|P[1]&24&&(Z.$$scope={dirty:P,ctx:N}),h.$set(Z),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=s_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(se(),A(I,1,1,()=>{I=null}),oe()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(M),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(M),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),z(i),z(o),C&&C.d(),M&&M.d(),D&&D.d(),z(h,N),I&&I.d(N),F.d()}}}function cI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function dI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender name"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=K(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function pI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender address"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=K(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function n_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Za({props:s}),ee.push(()=>ge(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function i_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Za({props:s}),ee.push(()=>ge(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function l_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Za({props:s}),ee.push(()=>ge(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function mI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[18]),we(Le.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function s_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[hI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[_I,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[gI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[bI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?yI:kI}let M=C(n),D=M(n),I=n[4]&&o_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),a=O(),f=b("div"),V(u.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),_=b("button"),D.c(),g=O(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),k(t,a),k(t,f),H(u,f,null),k(t,c),k(t,d),H(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=K(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),M!==(M=C(L))&&(D.d(1),D=M(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=o_(L),I.c(),E(I,1),I.m(e,null)):I&&(se(),A(I,1,1,()=>{I=null}),oe())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ye(()=>{S&&(y||(y=Ne(e,xe,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Ne(e,xe,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),z(l),z(r),z(u),z(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function hI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=K(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function _I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Port"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=K(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&<(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function gI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Username"),l=O(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=K(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function bI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ja({props:f}),ee.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=W("Password"),l=O(),V(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function kI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=O(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function yI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=O(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new pe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[vI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[wI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[SI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(f.$$.fragment),u=O(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ye(()=>{m&&(d||(d=Ne(e,xe,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Ne(e,xe,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),z(i),z(o),z(f),h&&d&&d.end()}}}function vI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),l=O(),V(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function wI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),l=O(),V(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function SI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=O(),l=b("i"),o=O(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[we(Le.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),K(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,ve(u)}}}function $I(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function TI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[K(e,"click",n[27]),K(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,ve(a)}}}function CI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[cI,uI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[6]),r=O(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=K(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&le(o,$[6]);let M=d;d=T($),d===M?S[d].p($,C):(se(),A(S[M],1,1,()=>{S[M]=null}),oe(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function OI(n){let e,t,i,l,s,o;e=new _i({}),i=new kn({props:{$$slots:{default:[CI]},$$scope:{ctx:n}}});let r={};return s=new fI({props:r}),n[31](s),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),H(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[31](null),z(s,a)}}}function MI(n,e,t){let i,l,s;Ue(n,Mt,ie=>t(6,s=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(Mt,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const ie=await ae.settings.getAll()||{};g(ie)}catch(ie){ae.error(ie)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const ie=await ae.settings.update(j.filterRedactedProps(u));g(ie),Jt({}),Et("Successfully saved mail settings.")}catch(ie){ae.error(ie)}t(3,d=!1)}}function g(ie={}){t(0,u={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(ie){n.$$.not_equal(u.meta.verificationTemplate,ie)&&(u.meta.verificationTemplate=ie,t(0,u))}function C(ie){n.$$.not_equal(u.meta.resetPasswordTemplate,ie)&&(u.meta.resetPasswordTemplate=ie,t(0,u))}function M(ie){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ie)&&(u.meta.confirmEmailChangeTemplate=ie,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=lt(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(ie){n.$$.not_equal(u.smtp.password,ie)&&(u.smtp.password=ie,t(0,u))}const N=()=>{t(4,m=!m)};function P(ie){n.$$.not_equal(u.smtp.tls,ie)&&(u.smtp.tls=ie,t(0,u))}function q(ie){n.$$.not_equal(u.smtp.authMethod,ie)&&(u.smtp.authMethod=ie,t(0,u))}function U(){u.smtp.localName=this.value,t(0,u)}const Z=()=>y(),G=()=>_(),B=()=>a==null?void 0:a.show(),Y=()=>_();function ue(ie){ee[ie?"unshift":"push"](()=>{a=ie,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,M,D,I,L,R,F,N,P,q,U,Z,G,B,Y,ue]}class DI extends _e{constructor(e){super(),he(this,e,MI,OI,me,{},null,[-1,-1])}}const EI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),r_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function II(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&le(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function a_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M;return i=new pe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[AI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[LI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[NI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[PI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[FI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new pe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[RI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=O(),s=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(f.$$.fragment),u=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),g=O(),y=b("div"),V(S.$$.fragment),T=O(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(f,a,null),k(e,u),k(e,c),H(d,c,null),k(e,m),k(e,h),H(_,h,null),k(e,g),k(e,y),H(S,y,null),k(e,T),k(e,$),M=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){M||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ye(()=>{M&&(C||(C=Ne(e,xe,{duration:150},!0)),C.run(1))}),M=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Ne(e,xe,{duration:150},!1)),C.run(0)),M=!1},d(D){D&&v(e),z(i),z(o),z(f),z(d),z(_),z(S),D&&C&&C.end()}}}function AI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Bucket"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=K(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function NI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Region"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=K(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function PI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Access key"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=K(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function FI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ja({props:f}),ee.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=W("Secret"),l=O(),V(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function RI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[14]),we(Le.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function qI(n){let e,t,i,l,s;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[II,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=vt(o,n,n[15],r_);let a=n[0].enabled&&a_(n);return{c(){V(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),l=ye()},m(f,u){H(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&St(r,o,f,f[15],s?wt(o,f[15],u,EI):$t(f[15]),r_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=a_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(se(),A(a,1,1,()=>{a=null}),oe())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),z(e,f),r&&r.d(f),a&&a.d(f)}}}const Pr="s3_test_request";function jI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(Pr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(Pr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:Pr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}jt(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function M(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,M,l]}class Kb extends _e{constructor(e){super(),he(this,e,jI,qI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function HI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[VI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new Kb({props:$}),ee.push(()=>ge(e,"config",y)),ee.push(()=>ge(e,"isTesting",S)),ee.push(()=>ge(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&u_(n),M=n[6]&&c_(n);return{c(){V(e.$$.fragment),s=O(),o=b("div"),r=b("div"),a=O(),C&&C.c(),f=O(),M&&M.c(),u=O(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){H(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),M&&M.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=K(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=u_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?M?M.p(I,L):(M=c_(I),M.c(),M.m(o,u)):M&&(M.d(1),M=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),z(e,I),C&&C.d(),M&&M.d(),_=!1,g()}}}function zI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function f_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,M,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=O(),s=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),f=W(a),u=W(` to the @@ -126,20 +126,20 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),y=b("a"),y.textContent=`rclone `,S=W(`, `),T=b("a"),T.textContent=`s5cmd - `,$=W(", etc."),C=O(),M=b("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(R,F){w(R,e,F),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(r,f),k(s,u),k(s,c),k(c,m),k(s,h),k(s,_),k(s,g),k(s,y),k(s,S),k(s,T),k(s,$),k(e,C),k(e,M),I=!0},p(R,F){var N;(!I||F&1)&&a!==(a=(N=R[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(f,a),(!I||F&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(R){I||(R&&Ye(()=>{I&&(D||(D=Ne(e,xe,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Ne(e,xe,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function jI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&r_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=r_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(se(),A(t,1,1,()=>{t=null}),oe())},d(l){l&&v(e),t&&t.d(l)}}}function a_(n){let e;function t(s,o){return s[4]?VI:s[5]?zI:HI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function HI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function zI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=we(t=Le.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Tt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function VI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function f_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function BI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[qI,RI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[7]),r=O(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=K(f,"submit",Be(n[16])),_=!0)},p($,C){(!h||C&128)&&le(o,$[7]);let M=d;d=T($),d===M?S[d].p($,C):(se(),A(S[M],1,1,()=>{S[M]=null}),oe(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function UI(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[BI]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}const WI="s3_test_request";function YI(n,e,t){let i,l,s;Ue(n,Mt,M=>t(7,s=M)),xt(Mt,s="Files storage",s);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await ae.settings.getAll()||{};h(M)}catch(M){ae.error(M)}t(2,a=!1)}async function m(){if(!(f||!l)){t(3,f=!0);try{ae.cancelRequest(WI);const M=await ae.settings.update(j.filterRedactedProps(r));Jt({}),await h(M),ya(),c?Jy("Successfully saved but failed to establish S3 connection."):Et("Successfully saved files storage settings.")}catch(M){ae.error(M)}t(3,f=!1)}}async function h(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function y(M){u=M,t(4,u)}function S(M){c=M,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,f,u,c,l,s,m,_,i,g,y,S,T,$,C]}class KI extends _e{constructor(e){super(),he(this,e,YI,UI,me,{})}}function JI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&2&&(e.checked=f[1].enabled),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function ZI(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Client ID"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[1].clientId),a||(f=K(s,"input",n[12]),a=!0)},p(u,c){c&1048576&&i!==(i=u[20])&&p(e,"for",i),c&1048576&&o!==(o=u[20])&&p(s,"id",o),c&2&&r!==(r=u[1].enabled)&&(s.required=r),c&2&&s.value!==u[1].clientId&&re(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function GI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(f.value=n[1].clientSecret),s=new Ya({props:f}),ee.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=W("Client secret"),l=O(),V(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),c&2&&(d.required=u[1].enabled),!o&&c&2&&(o=!0,d.value=u[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function u_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(f){n[14](f)}var r=n[3].optionsComponent;function a(f,u){let c={};if(u!==void 0&&u&8)c=dt(s,[{key:f[3].key},Ct(f[3].optionsComponentProps||{})]);else for(let d=0;dge(t,"config",o))),{c(){e=b("div"),t&&V(t.$$.fragment),p(e,"class","col-lg-12")},m(f,u){w(f,e,u),t&&H(t,e,null),l=!0},p(f,u){if(u&8&&r!==(r=f[3].optionsComponent)){if(t){se();const c=t;A(c.$$.fragment,1,0,()=>{z(c,1)}),oe()}r?(t=Ot(r,a(f,u)),ee.push(()=>ge(t,"config",o)),V(t.$$.fragment),E(t.$$.fragment,1),H(t,e,null)):t=null}else if(r){const c=u&8?dt(s,[{key:f[3].key},Ct(f[3].optionsComponentProps||{})]):{};!i&&u&2&&(i=!0,c.config=f[1],ke(()=>i=!1)),t.$set(c)}},i(f){l||(t&&E(t.$$.fragment,f),l=!0)},o(f){t&&A(t.$$.fragment,f),l=!1},d(f){f&&v(e),t&&z(t)}}}function XI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[JI,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[ZI,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[GI,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&u_(n);return{c(){e=b("form"),t=b("div"),V(i.$$.fragment),l=O(),s=b("button"),s.innerHTML='Clear all fields',o=O(),V(r.$$.fragment),a=O(),V(f.$$.fragment),u=O(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),H(i,t,null),k(t,l),k(t,s),k(e,o),H(r,e,null),k(e,a),H(f,e,null),k(e,u),h&&h.m(e,null),c=!0,d||(m=[K(s,"click",n[8]),K(e,"submit",Be(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=u_(_),h.c(),E(h,1),h.m(e,null)):h&&(se(),A(h,1,1,()=>{h=null}),oe())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(f.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(f.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),z(i),z(r),z(f),h&&h.d(),d=!1,ve(m)}}}function QI(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=W(t),l=W(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&le(i,t)},d(s){s&&v(e)}}}function xI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Close"),i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function eA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[xI],header:[QI],default:[XI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),z(e,l)}}}function tA(n,e,t){let i;const l=st(),s="provider_popup_"+j.randomString(5);let o,r={},a={},f=!1,u="";function c(D,I){Jt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,u=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,f=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await ae.settings.update(D);Jt({}),Et("Successfully updated provider settings."),l("submit",I),d()}catch(D){ae.error(D)}t(4,f=!1)}function h(){for(let D in a)t(1,a[D]="",a);t(1,a.enabled=!1,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){ee[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Te.call(this,n,D)}function M(D){Te.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,s,m,h,c,u,_,g,y,S,T,$,C,M]}class nA extends _e{constructor(e){super(),he(this,e,tA,eA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function c_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function d_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function iA(n){let e,t,i,l,s=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&c_(n),M=n[0].enabled&&d_(),D={};return y=new nA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=O(),l=b("div"),o=W(s),r=O(),a=b("em"),f=W("("),c=W(u),d=W(")"),m=O(),M&&M.c(),h=O(),_=b("button"),_.innerHTML='',g=O(),V(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,f),k(a,c),k(a,d),k(e,m),M&&M.m(e,null),k(e,h),k(e,_),w(I,g,L),H(y,I,L),S=!0,T||($=K(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=c_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&le(o,s),(!S||L&2)&&u!==(u=I[1].key.slice(0,-4)+"")&&le(c,u),I[0].enabled?M||(M=d_(),M.c(),M.m(e,h)):M&&(M.d(1),M=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),M&&M.d(),n[4](null),z(y,I),T=!1,$()}}}function lA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0}))};function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{f.detail[i.key]&&t(0,l=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class Bb extends _e{constructor(e){super(),he(this,e,lA,iA,me,{provider:1,config:0})}}function p_(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function m_(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function sA(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,f,u=de(n[3]);const c=_=>_[9].key;for(let _=0;_0&&n[2].length>0&&__(),m=de(n[2]);const h=_=>_[9].key;for(let _=0;_0&&_[2].length>0?d||(d=__(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=de(_[2]),se(),r=ct(r,g,h,1,_,m,a,o,It,g_,null,p_),oe())},i(_){if(!f){for(let g=0;gge(i,"config",r)),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),s=O(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),H(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!l&&u&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),z(i)}}}function __(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function g_(n,e){let t,i,l,s,o;function r(f){e[6](f,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new Bb({props:a}),ee.push(()=>ge(i,"config",r)),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),s=O(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),H(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!l&&u&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),z(i)}}}function rA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;const _=[oA,sA],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[4]),r=O(),a=b("div"),f=b("div"),u=b("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","m-b-base"),p(f,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,f),k(f,u),k(f,c),g[d].m(f,null),h=!0},p(S,T){(!h||T&16)&&le(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(se(),A(g[$],1,1,()=>{g[$]=null}),oe(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(f,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function aA(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[rA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function fA(n,e,t){let i,l,s;Ue(n,Mt,d=>t(4,s=d)),xt(Mt,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ae.settings.getAll()||{};f(d)}catch(d){ae.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of ho)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function u(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=ho.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=ho.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,u,c]}class uA extends _e{constructor(e){super(),he(this,e,fA,aA,me,{})}}function cA(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),s=O(),o=b("input"),a=O(),f=b("div"),u=b("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),x(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),re(o,n[0]),w(m,a,h),w(m,f,h),k(f,u),c||(d=[K(o,"input",n[4]),K(u,"click",n[5])],c=!0)},p(m,h){h&8&&le(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&<(o.value)!==m[0]&&re(o,m[0]),h&2&&x(u,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(f)),c=!1,ve(d)}}}function dA(n){let e,t;return e=new pe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[cA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function pA(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=lt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,l=f.label),"duration"in f&&t(0,s=f.duration),"secret"in f&&t(1,o=f.secret)},[s,o,i,l,r,a]}class Ub extends _e{constructor(e){super(),he(this,e,pA,dA,me,{key:2,label:3,duration:0,secret:1})}}function b_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function k_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function mA(n){let e,t,i=[],l=new Map,s,o,r,a,f,u=[],c=new Map,d,m,h,_,g,y,S,T,$,C,M,D=de(n[5]);const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nge(i,"duration",r)),ee.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),H(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),z(i,u)}}}function v_(n,e){let t,i,l,s,o;function r(u){e[13](u,e[19])}function a(u){e[14](u,e[19])}let f={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(f.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(f.secret=e[0][e[19].key].secret),i=new Ub({props:f}),ee.push(()=>ge(i,"duration",r)),ee.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),H(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),z(i,u)}}}function w_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function _A(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[hA,mA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[4]),r=O(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Adjust common token options.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content m-b-sm txt-xl"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=K(f,"submit",Be(n[7])),_=!0)},p($,C){(!h||C&16)&&le(o,$[4]);let M=d;d=T($),d===M?S[d].p($,C):(se(),A(S[M],1,1,()=>{S[M]=null}),oe(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function gA(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[_A]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function bA(n,e,t){let i,l,s;Ue(n,Mt,M=>t(4,s=M));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(Mt,s="Token options",s);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const M=await ae.settings.getAll()||{};h(M)}catch(M){ae.error(M)}t(1,u=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const M=await ae.settings.update(j.filterRedactedProps(f));h(M),Et("Successfully saved tokens options.")}catch(M){ae.error(M)}t(2,c=!1)}}function h(M){var I;M=M||{},t(0,f={});const D=o.concat(r);for(const L of D)t(0,f[L.key]={duration:((I=M[L.key])==null?void 0:I.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function g(M,D){n.$$.not_equal(f[D.key].duration,M)&&(f[D.key].duration=M,t(0,f))}function y(M,D){n.$$.not_equal(f[D.key].secret,M)&&(f[D.key].secret=M,t(0,f))}function S(M,D){n.$$.not_equal(f[D.key].duration,M)&&(f[D.key].duration=M,t(0,f))}function T(M,D){n.$$.not_equal(f[D.key].secret,M)&&(f[D.key].secret=M,t(0,f))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(f))},[f,u,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class kA extends _e{constructor(e){super(),he(this,e,bA,gA,me,{})}}function yA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return o=new ja({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=O(),i=b("div"),l=b("button"),l.innerHTML='Copy',s=O(),V(o.$$.fragment),r=O(),a=b("div"),f=b("div"),u=O(),c=b("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(f,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,g){w(_,e,g),w(_,t,g),w(_,i,g),k(i,l),k(i,s),H(o,i,null),n[8](i),w(_,r,g),w(_,a,g),k(a,f),k(a,u),k(a,c),d=!0,m||(h=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(_,g){const y={};g&4&&(y.content=_[2]),o.$set(y)},i(_){d||(E(o.$$.fragment,_),d=!0)},o(_){A(o.$$.fragment,_),d=!1},d(_){_&&(v(e),v(t),v(i),v(r),v(a)),z(o),n[8](null),m=!1,ve(h)}}}function vA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function wA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[vA,yA],h=[];function _(g,y){return g[1]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[3]),r=O(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y&8)&&le(o,g[3]);let S=u;u=_(g),u===S?h[u].p(g,y):(se(),A(h[S],1,1,()=>{h[S]=null}),oe(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function SA(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[wA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function $A(n,e,t){let i,l;Ue(n,Mt,g=>t(3,l=g)),xt(Mt,l="Export collections",l);const s="export_"+j.randomString(5);let o,r=[],a=!1;f();async function f(){t(1,a=!0);try{t(6,r=await ae.collections.getFullList(100,{$cancelKey:s,sort:"updated"}));for(let g of r)delete g.created,delete g.updated}catch(g){ae.error(g)}t(1,a=!1)}function u(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),wo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(g){ee[g?"unshift":"push"](()=>{o=g,t(0,o)})}const h=g=>{if(g.ctrlKey&&g.code==="KeyA"){g.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},_=()=>u();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,u,c,r,d,m,h,_]}class TA extends _e{constructor(e){super(),he(this,e,$A,SA,me,{})}}function S_(n,e,t){const i=n.slice();return i[14]=e[t],i}function $_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function T_(n,e,t){const i=n.slice();return i[14]=e[t],i}function C_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function O_(n,e,t){const i=n.slice();return i[14]=e[t],i}function M_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function D_(n,e,t){const i=n.slice();return i[30]=e[t],i}function CA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&E_(),a=n[0].name!==n[1].name&&I_(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),l=b("strong"),o=W(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(f,u){f[9]?r||(r=E_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].name!==f[1].name?a?a.p(f,u):(a=I_(f),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[0]&2&&s!==(s=f[1].name+"")&&le(o,s)},d(f){f&&v(e),r&&r.d(),a&&a.d()}}}function OA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),s=W(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&1&&l!==(l=((f=r[0])==null?void 0:f.name)+"")&&le(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function MA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=O(),i=b("strong"),s=W(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&2&&l!==(l=((f=r[1])==null?void 0:f.name)+"")&&le(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function E_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function I_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=O(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function A_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,f,u,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=O(),s=b("td"),o=b("pre"),a=W(r),f=O(),u=b("td"),c=b("pre"),m=W(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&_n((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(u,"class","svelte-lmkr38"),x(u,"changed-new-col",!n[5]&&_n((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(u,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",_n(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,u),k(u,c),k(c,m)},p(g,y){var S,T,$,C,M,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&le(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&_n((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&le(m,d),y[0]&2083&&x(u,"changed-new-col",!g[5]&&_n((M=g[0])==null?void 0:M[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(u,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",_n((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function L_(n){let e,t=de(n[6]),i=[];for(let l=0;lProps Old New',s=O(),o=b("tbody");for(let $=0;$!["schema","created","updated"].includes(y));function _(){t(4,u=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,u=u.concat(f.filter(y=>!u.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=f.filter(y=>!u.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=u.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=u.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,s,l,h,g]}class IA extends _e{constructor(e){super(),he(this,e,EA,DA,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function z_(n,e,t){const i=n.slice();return i[17]=e[t],i}function V_(n){let e,t;return e=new IA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function AA(n){let e,t,i=de(n[2]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{I&&(D||(D=Ne(e,xe,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Ne(e,xe,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function VI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&f_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=f_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(se(),A(t,1,1,()=>{t=null}),oe())},d(l){l&&v(e),t&&t.d(l)}}}function u_(n){let e;function t(s,o){return s[4]?WI:s[5]?UI:BI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function BI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function UI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=we(t=Le.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Tt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function WI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function c_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function YI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[zI,HI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[7]),r=O(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=K(f,"submit",Be(n[16])),_=!0)},p($,C){(!h||C&128)&&le(o,$[7]);let M=d;d=T($),d===M?S[d].p($,C):(se(),A(S[M],1,1,()=>{S[M]=null}),oe(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function KI(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[YI]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}const JI="s3_test_request";function ZI(n,e,t){let i,l,s;Ue(n,Mt,M=>t(7,s=M)),xt(Mt,s="Files storage",s);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await ae.settings.getAll()||{};h(M)}catch(M){ae.error(M)}t(2,a=!1)}async function m(){if(!(f||!l)){t(3,f=!0);try{ae.cancelRequest(JI);const M=await ae.settings.update(j.filterRedactedProps(r));Jt({}),await h(M),wa(),c?Qy("Successfully saved but failed to establish S3 connection."):Et("Successfully saved files storage settings.")}catch(M){ae.error(M)}t(3,f=!1)}}async function h(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function y(M){u=M,t(4,u)}function S(M){c=M,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,f,u,c,l,s,m,_,i,g,y,S,T,$,C]}class GI extends _e{constructor(e){super(),he(this,e,ZI,KI,me,{})}}function XI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&2&&(e.checked=f[1].enabled),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function QI(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=W("Client ID"),l=O(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[1].clientId),a||(f=K(s,"input",n[12]),a=!0)},p(u,c){c&1048576&&i!==(i=u[20])&&p(e,"for",i),c&1048576&&o!==(o=u[20])&&p(s,"id",o),c&2&&r!==(r=u[1].enabled)&&(s.required=r),c&2&&s.value!==u[1].clientId&&re(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function xI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(f.value=n[1].clientSecret),s=new Ja({props:f}),ee.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=W("Client secret"),l=O(),V(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),H(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),c&2&&(d.required=u[1].enabled),!o&&c&2&&(o=!0,d.value=u[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),z(s,u)}}}function d_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(f){n[14](f)}var r=n[3].optionsComponent;function a(f,u){let c={};if(u!==void 0&&u&8)c=dt(s,[{key:f[3].key},Ct(f[3].optionsComponentProps||{})]);else for(let d=0;dge(t,"config",o))),{c(){e=b("div"),t&&V(t.$$.fragment),p(e,"class","col-lg-12")},m(f,u){w(f,e,u),t&&H(t,e,null),l=!0},p(f,u){if(u&8&&r!==(r=f[3].optionsComponent)){if(t){se();const c=t;A(c.$$.fragment,1,0,()=>{z(c,1)}),oe()}r?(t=Ot(r,a(f,u)),ee.push(()=>ge(t,"config",o)),V(t.$$.fragment),E(t.$$.fragment,1),H(t,e,null)):t=null}else if(r){const c=u&8?dt(s,[{key:f[3].key},Ct(f[3].optionsComponentProps||{})]):{};!i&&u&2&&(i=!0,c.config=f[1],ke(()=>i=!1)),t.$set(c)}},i(f){l||(t&&E(t.$$.fragment,f),l=!0)},o(f){t&&A(t.$$.fragment,f),l=!1},d(f){f&&v(e),t&&z(t)}}}function eA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[XI,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[QI,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[xI,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&d_(n);return{c(){e=b("form"),t=b("div"),V(i.$$.fragment),l=O(),s=b("button"),s.innerHTML='Clear all fields',o=O(),V(r.$$.fragment),a=O(),V(f.$$.fragment),u=O(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),H(i,t,null),k(t,l),k(t,s),k(e,o),H(r,e,null),k(e,a),H(f,e,null),k(e,u),h&&h.m(e,null),c=!0,d||(m=[K(s,"click",n[8]),K(e,"submit",Be(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=d_(_),h.c(),E(h,1),h.m(e,null)):h&&(se(),A(h,1,1,()=>{h=null}),oe())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(f.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(f.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),z(i),z(r),z(f),h&&h.d(),d=!1,ve(m)}}}function tA(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=W(t),l=W(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&le(i,t)},d(s){s&&v(e)}}}function nA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Close"),i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function iA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[nA],header:[tA],default:[eA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),z(e,l)}}}function lA(n,e,t){let i;const l=st(),s="provider_popup_"+j.randomString(5);let o,r={},a={},f=!1,u="";function c(D,I){Jt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,u=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,f=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await ae.settings.update(D);Jt({}),Et("Successfully updated provider settings."),l("submit",I),d()}catch(D){ae.error(D)}t(4,f=!1)}function h(){for(let D in a)t(1,a[D]="",a);t(1,a.enabled=!1,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){ee[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Te.call(this,n,D)}function M(D){Te.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,s,m,h,c,u,_,g,y,S,T,$,C,M]}class sA extends _e{constructor(e){super(),he(this,e,lA,iA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function p_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function m_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function oA(n){let e,t,i,l,s=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&p_(n),M=n[0].enabled&&m_(),D={};return y=new sA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=O(),l=b("div"),o=W(s),r=O(),a=b("em"),f=W("("),c=W(u),d=W(")"),m=O(),M&&M.c(),h=O(),_=b("button"),_.innerHTML='',g=O(),V(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,f),k(a,c),k(a,d),k(e,m),M&&M.m(e,null),k(e,h),k(e,_),w(I,g,L),H(y,I,L),S=!0,T||($=K(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=p_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&le(o,s),(!S||L&2)&&u!==(u=I[1].key.slice(0,-4)+"")&&le(c,u),I[0].enabled?M||(M=m_(),M.c(),M.m(e,h)):M&&(M.d(1),M=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),M&&M.d(),n[4](null),z(y,I),T=!1,$()}}}function rA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0}))};function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{f.detail[i.key]&&t(0,l=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class Jb extends _e{constructor(e){super(),he(this,e,rA,oA,me,{provider:1,config:0})}}function h_(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function __(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function aA(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,f,u=de(n[3]);const c=_=>_[9].key;for(let _=0;_0&&n[2].length>0&&b_(),m=de(n[2]);const h=_=>_[9].key;for(let _=0;_0&&_[2].length>0?d||(d=b_(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=de(_[2]),se(),r=ct(r,g,h,1,_,m,a,o,It,k_,null,h_),oe())},i(_){if(!f){for(let g=0;gge(i,"config",r)),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),s=O(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),H(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!l&&u&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),z(i)}}}function b_(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function k_(n,e){let t,i,l,s,o;function r(f){e[6](f,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new Jb({props:a}),ee.push(()=>ge(i,"config",r)),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),s=O(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),H(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!l&&u&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),z(i)}}}function uA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;const _=[fA,aA],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[4]),r=O(),a=b("div"),f=b("div"),u=b("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","m-b-base"),p(f,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,f),k(f,u),k(f,c),g[d].m(f,null),h=!0},p(S,T){(!h||T&16)&&le(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(se(),A(g[$],1,1,()=>{g[$]=null}),oe(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(f,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function cA(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[uA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function dA(n,e,t){let i,l,s;Ue(n,Mt,d=>t(4,s=d)),xt(Mt,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ae.settings.getAll()||{};f(d)}catch(d){ae.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of go)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function u(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=go.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=go.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,u,c]}class pA extends _e{constructor(e){super(),he(this,e,dA,cA,me,{})}}function mA(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),s=O(),o=b("input"),a=O(),f=b("div"),u=b("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),x(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),re(o,n[0]),w(m,a,h),w(m,f,h),k(f,u),c||(d=[K(o,"input",n[4]),K(u,"click",n[5])],c=!0)},p(m,h){h&8&&le(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&<(o.value)!==m[0]&&re(o,m[0]),h&2&&x(u,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(f)),c=!1,ve(d)}}}function hA(n){let e,t;return e=new pe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[mA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function _A(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=lt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,l=f.label),"duration"in f&&t(0,s=f.duration),"secret"in f&&t(1,o=f.secret)},[s,o,i,l,r,a]}class Zb extends _e{constructor(e){super(),he(this,e,_A,hA,me,{key:2,label:3,duration:0,secret:1})}}function y_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function v_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function gA(n){let e,t,i=[],l=new Map,s,o,r,a,f,u=[],c=new Map,d,m,h,_,g,y,S,T,$,C,M,D=de(n[5]);const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nge(i,"duration",r)),ee.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),H(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),z(i,u)}}}function S_(n,e){let t,i,l,s,o;function r(u){e[13](u,e[19])}function a(u){e[14](u,e[19])}let f={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(f.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(f.secret=e[0][e[19].key].secret),i=new Zb({props:f}),ee.push(()=>ge(i,"duration",r)),ee.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),H(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),z(i,u)}}}function $_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function kA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[bA,gA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[4]),r=O(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Adjust common token options.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content m-b-sm txt-xl"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=K(f,"submit",Be(n[7])),_=!0)},p($,C){(!h||C&16)&&le(o,$[4]);let M=d;d=T($),d===M?S[d].p($,C):(se(),A(S[M],1,1,()=>{S[M]=null}),oe(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function yA(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[kA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function vA(n,e,t){let i,l,s;Ue(n,Mt,M=>t(4,s=M));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(Mt,s="Token options",s);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const M=await ae.settings.getAll()||{};h(M)}catch(M){ae.error(M)}t(1,u=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const M=await ae.settings.update(j.filterRedactedProps(f));h(M),Et("Successfully saved tokens options.")}catch(M){ae.error(M)}t(2,c=!1)}}function h(M){var I;M=M||{},t(0,f={});const D=o.concat(r);for(const L of D)t(0,f[L.key]={duration:((I=M[L.key])==null?void 0:I.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function g(M,D){n.$$.not_equal(f[D.key].duration,M)&&(f[D.key].duration=M,t(0,f))}function y(M,D){n.$$.not_equal(f[D.key].secret,M)&&(f[D.key].secret=M,t(0,f))}function S(M,D){n.$$.not_equal(f[D.key].duration,M)&&(f[D.key].duration=M,t(0,f))}function T(M,D){n.$$.not_equal(f[D.key].secret,M)&&(f[D.key].secret=M,t(0,f))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(f))},[f,u,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class wA extends _e{constructor(e){super(),he(this,e,vA,yA,me,{})}}function SA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return o=new za({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=O(),i=b("div"),l=b("button"),l.innerHTML='Copy',s=O(),V(o.$$.fragment),r=O(),a=b("div"),f=b("div"),u=O(),c=b("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(f,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,g){w(_,e,g),w(_,t,g),w(_,i,g),k(i,l),k(i,s),H(o,i,null),n[8](i),w(_,r,g),w(_,a,g),k(a,f),k(a,u),k(a,c),d=!0,m||(h=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(_,g){const y={};g&4&&(y.content=_[2]),o.$set(y)},i(_){d||(E(o.$$.fragment,_),d=!0)},o(_){A(o.$$.fragment,_),d=!1},d(_){_&&(v(e),v(t),v(i),v(r),v(a)),z(o),n[8](null),m=!1,ve(h)}}}function $A(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function TA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[$A,SA],h=[];function _(g,y){return g[1]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[3]),r=O(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y&8)&&le(o,g[3]);let S=u;u=_(g),u===S?h[u].p(g,y):(se(),A(h[S],1,1,()=>{h[S]=null}),oe(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function CA(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[TA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function OA(n,e,t){let i,l;Ue(n,Mt,g=>t(3,l=g)),xt(Mt,l="Export collections",l);const s="export_"+j.randomString(5);let o,r=[],a=!1;f();async function f(){t(1,a=!0);try{t(6,r=await ae.collections.getFullList(100,{$cancelKey:s,sort:"updated"}));for(let g of r)delete g.created,delete g.updated}catch(g){ae.error(g)}t(1,a=!1)}function u(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),$o("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(g){ee[g?"unshift":"push"](()=>{o=g,t(0,o)})}const h=g=>{if(g.ctrlKey&&g.code==="KeyA"){g.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},_=()=>u();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,u,c,r,d,m,h,_]}class MA extends _e{constructor(e){super(),he(this,e,OA,CA,me,{})}}function T_(n,e,t){const i=n.slice();return i[14]=e[t],i}function C_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function O_(n,e,t){const i=n.slice();return i[14]=e[t],i}function M_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function D_(n,e,t){const i=n.slice();return i[14]=e[t],i}function E_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function I_(n,e,t){const i=n.slice();return i[30]=e[t],i}function DA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&A_(),a=n[0].name!==n[1].name&&L_(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),l=b("strong"),o=W(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(f,u){f[9]?r||(r=A_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].name!==f[1].name?a?a.p(f,u):(a=L_(f),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[0]&2&&s!==(s=f[1].name+"")&&le(o,s)},d(f){f&&v(e),r&&r.d(),a&&a.d()}}}function EA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),s=W(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&1&&l!==(l=((f=r[0])==null?void 0:f.name)+"")&&le(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function IA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=O(),i=b("strong"),s=W(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&2&&l!==(l=((f=r[1])==null?void 0:f.name)+"")&&le(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function A_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function L_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=O(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function N_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,f,u,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=O(),s=b("td"),o=b("pre"),a=W(r),f=O(),u=b("td"),c=b("pre"),m=W(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&_n((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(u,"class","svelte-lmkr38"),x(u,"changed-new-col",!n[5]&&_n((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(u,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",_n(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,u),k(u,c),k(c,m)},p(g,y){var S,T,$,C,M,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&le(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&_n((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&le(m,d),y[0]&2083&&x(u,"changed-new-col",!g[5]&&_n((M=g[0])==null?void 0:M[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(u,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",_n((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function P_(n){let e,t=de(n[6]),i=[];for(let l=0;lProps Old New',s=O(),o=b("tbody");for(let $=0;$!["schema","created","updated"].includes(y));function _(){t(4,u=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,u=u.concat(f.filter(y=>!u.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=f.filter(y=>!u.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=u.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=u.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,s,l,h,g]}class NA extends _e{constructor(e){super(),he(this,e,LA,AA,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function B_(n,e,t){const i=n.slice();return i[17]=e[t],i}function U_(n){let e,t;return e=new NA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function PA(n){let e,t,i=de(n[2]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await ae.collections.import(o,a),Et("Successfully imported collections configuration."),i("submit")}catch($){ae.error($)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function y($){ee[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Te.call(this,n,$)}function T($){Te.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,y,S,T]}class RA extends _e{constructor(e){super(),he(this,e,FA,PA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function B_(n,e,t){const i=n.slice();return i[32]=e[t],i}function U_(n,e,t){const i=n.slice();return i[35]=e[t],i}function W_(n,e,t){const i=n.slice();return i[32]=e[t],i}function qA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[HA,({uniqueId:P})=>({40:P}),({uniqueId:P})=>[0,P?512:0]]},$$scope:{ctx:n}}});let I=!1,L=n[6]&&n[1].length&&!n[7]&&K_(),R=n[6]&&n[1].length&&n[7]&&J_(n),F=n[13].length&&sg(n),N=!!n[0]&&og(n);return{c(){e=b("input"),t=O(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=O(),V(a.$$.fragment),f=O(),u=O(),L&&L.c(),c=O(),R&&R.c(),d=O(),F&&F.c(),m=O(),h=b("div"),N&&N.c(),_=O(),g=b("div"),y=O(),S=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p(T,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=$=!n[14],p(h,"class","flex m-t-base")},m(P,q){w(P,e,q),n[19](e),w(P,t,q),w(P,i,q),k(i,l),k(l,s),k(l,o),w(P,r,q),H(a,P,q),w(P,f,q),w(P,u,q),L&&L.m(P,q),w(P,c,q),R&&R.m(P,q),w(P,d,q),F&&F.m(P,q),w(P,m,q),w(P,h,q),N&&N.m(h,null),k(h,_),k(h,g),k(h,y),k(h,S),k(S,T),C=!0,M||(D=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],M=!0)},p(P,q){(!C||q[0]&4096)&&x(o,"btn-loading",P[12]);const U={};q[0]&64&&(U.class="form-field "+(P[6]?"":"field-error")),q[0]&65|q[1]&1536&&(U.$$scope={dirty:q,ctx:P}),a.$set(U),P[6]&&P[1].length&&!P[7]?L||(L=K_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),P[6]&&P[1].length&&P[7]?R?R.p(P,q):(R=J_(P),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),P[13].length?F?F.p(P,q):(F=sg(P),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),P[0]?N?N.p(P,q):(N=og(P),N.c(),N.m(h,_)):N&&(N.d(1),N=null),(!C||q[0]&16384&&$!==($=!P[14]))&&(S.disabled=$)},i(P){C||(E(a.$$.fragment,P),E(I),C=!0)},o(P){A(a.$$.fragment,P),A(I),C=!1},d(P){P&&(v(e),v(t),v(i),v(r),v(f),v(u),v(c),v(d),v(m),v(h)),n[19](null),z(a,P),L&&L.d(P),R&&R.d(P),F&&F.d(P),N&&N.d(),M=!1,ve(D)}}}function jA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Y_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function HA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&Y_();return{c(){e=b("label"),t=W("Collections"),l=O(),s=b("textarea"),r=O(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(s,"id",o=n[40]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=K(s,"input",n[22]),f=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(s,"id",o),m[0]&1&&re(s,d[0]),d[0]&&!d[6]?c||(c=Y_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),f=!1,u()}}}function K_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function J_(n){let e,t,i,l,s,o=n[9].length&&Z_(n),r=n[4].length&&Q_(n),a=n[8].length&&ng(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),l=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),o&&o.m(i,null),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=Z_(f),o.c(),o.m(i,l)):o&&(o.d(1),o=null),f[4].length?r?r.p(f,u):(r=Q_(f),r.c(),r.m(i,s)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=ng(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Z_(n){let e=[],t=new Map,i,l=de(n[9]);const s=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=O(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await ae.collections.import(o,a),Et("Successfully imported collections configuration."),i("submit")}catch($){ae.error($)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function y($){ee[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Te.call(this,n,$)}function T($){Te.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,y,S,T]}class HA extends _e{constructor(e){super(),he(this,e,jA,qA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function W_(n,e,t){const i=n.slice();return i[32]=e[t],i}function Y_(n,e,t){const i=n.slice();return i[35]=e[t],i}function K_(n,e,t){const i=n.slice();return i[32]=e[t],i}function zA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[BA,({uniqueId:P})=>({40:P}),({uniqueId:P})=>[0,P?512:0]]},$$scope:{ctx:n}}});let I=!1,L=n[6]&&n[1].length&&!n[7]&&Z_(),R=n[6]&&n[1].length&&n[7]&&G_(n),F=n[13].length&&rg(n),N=!!n[0]&&ag(n);return{c(){e=b("input"),t=O(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=O(),V(a.$$.fragment),f=O(),u=O(),L&&L.c(),c=O(),R&&R.c(),d=O(),F&&F.c(),m=O(),h=b("div"),N&&N.c(),_=O(),g=b("div"),y=O(),S=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p(T,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=$=!n[14],p(h,"class","flex m-t-base")},m(P,q){w(P,e,q),n[19](e),w(P,t,q),w(P,i,q),k(i,l),k(l,s),k(l,o),w(P,r,q),H(a,P,q),w(P,f,q),w(P,u,q),L&&L.m(P,q),w(P,c,q),R&&R.m(P,q),w(P,d,q),F&&F.m(P,q),w(P,m,q),w(P,h,q),N&&N.m(h,null),k(h,_),k(h,g),k(h,y),k(h,S),k(S,T),C=!0,M||(D=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],M=!0)},p(P,q){(!C||q[0]&4096)&&x(o,"btn-loading",P[12]);const U={};q[0]&64&&(U.class="form-field "+(P[6]?"":"field-error")),q[0]&65|q[1]&1536&&(U.$$scope={dirty:q,ctx:P}),a.$set(U),P[6]&&P[1].length&&!P[7]?L||(L=Z_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),P[6]&&P[1].length&&P[7]?R?R.p(P,q):(R=G_(P),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),P[13].length?F?F.p(P,q):(F=rg(P),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),P[0]?N?N.p(P,q):(N=ag(P),N.c(),N.m(h,_)):N&&(N.d(1),N=null),(!C||q[0]&16384&&$!==($=!P[14]))&&(S.disabled=$)},i(P){C||(E(a.$$.fragment,P),E(I),C=!0)},o(P){A(a.$$.fragment,P),A(I),C=!1},d(P){P&&(v(e),v(t),v(i),v(r),v(f),v(u),v(c),v(d),v(m),v(h)),n[19](null),z(a,P),L&&L.d(P),R&&R.d(P),F&&F.d(P),N&&N.d(),M=!1,ve(D)}}}function VA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function J_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function BA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&J_();return{c(){e=b("label"),t=W("Collections"),l=O(),s=b("textarea"),r=O(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(s,"id",o=n[40]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=K(s,"input",n[22]),f=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(s,"id",o),m[0]&1&&re(s,d[0]),d[0]&&!d[6]?c||(c=J_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),f=!1,u()}}}function Z_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function G_(n){let e,t,i,l,s,o=n[9].length&&X_(n),r=n[4].length&&eg(n),a=n[8].length&&lg(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),l=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),o&&o.m(i,null),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=X_(f),o.c(),o.m(i,l)):o&&(o.d(1),o=null),f[4].length?r?r.p(f,u):(r=eg(f),r.c(),r.m(i,s)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=lg(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function X_(n){let e=[],t=new Map,i,l=de(n[9]);const s=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=O(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,s=O(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(f){f&&v(e),r=!1,a()}}}function og(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function zA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[jA,qA],h=[];function _(g,y){return g[5]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[15]),r=O(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y[0]&32768)&&le(o,g[15]);let S=u;u=_(g),u===S?h[u].p(g,y):(se(),A(h[S],1,1,()=>{h[S]=null}),oe(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function VA(n){let e,t,i,l,s,o;e=new _i({}),i=new kn({props:{$$slots:{default:[zA]},$$scope:{ctx:n}}});let r={};return s=new RA({props:r}),n[27](s),s.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),H(s,a,f),o=!0},p(a,f){const u={};f[0]&65535|f[1]&1024&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[27](null),z(s,a)}}}function BA(n,e,t){let i,l,s,o,r,a,f;Ue(n,Mt,Y=>t(15,f=Y)),xt(Mt,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1;T();async function T(){t(5,S=!0);try{t(2,_=await ae.collections.getFullList(200));for(let Y of _)delete Y.created,delete Y.updated}catch(Y){ae.error(Y)}t(5,S=!1)}function $(){if(t(4,y=[]),!!i)for(let Y of h){const ue=j.findByKey(_,"id",Y.id);!(ue!=null&&ue.id)||!j.hasCollectionChanges(ue,Y,g)||y.push({new:Y,old:ue})}}function C(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let Y of h)delete Y.created,delete Y.updated,Y.schema=j.filterDuplicatesByKey(Y.schema)}function M(){var Y,ue;for(let ie of h){const be=j.findByKey(_,"name",ie.name)||j.findByKey(_,"id",ie.id);if(!be)continue;const Ae=ie.id,He=be.id;ie.id=He;const Je=Array.isArray(be.schema)?be.schema:[],tt=Array.isArray(ie.schema)?ie.schema:[];for(const bt of tt){const at=j.findByKey(Je,"name",bt.name);at&&at.id&&(bt.id=at.id)}for(let bt of h)if(Array.isArray(bt.schema))for(let at of bt.schema)(Y=at.options)!=null&&Y.collectionId&&((ue=at.options)==null?void 0:ue.collectionId)===Ae&&(at.options.collectionId=He)}t(0,d=JSON.stringify(h,null,4))}function D(Y){t(12,m=!0);const ue=new FileReader;ue.onload=async ie=>{t(12,m=!1),t(10,u.value="",u),t(0,d=ie.target.result),await Xt(),h.length||(ni("Invalid collections configuration."),I())},ue.onerror=ie=>{console.warn(ie),ni("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},ue.readAsText(Y)}function I(){t(0,d=""),t(10,u.value="",u),Jt({})}function L(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(10,u)})}const R=()=>{u.files.length&&D(u.files[0])},F=()=>{u.click()};function N(){d=this.value,t(0,d)}function P(){g=this.checked,t(3,g)}const q=()=>M(),U=()=>I(),Z=()=>c==null?void 0:c.show(_,h,g);function G(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(11,c)})}const B=()=>I();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(Y=>!!Y.id&&!!Y.name).length),n.$$.dirty[0]&78&&t(9,l=_.filter(Y=>i&&g&&!j.findByKey(h,"id",Y.id))),n.$$.dirty[0]&70&&t(8,s=h.filter(Y=>i&&!j.findByKey(_,"id",Y.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof g<"u")&&$(),n.$$.dirty[0]&785&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(Y=>{let ue=j.findByKey(_,"name",Y.name)||j.findByKey(_,"id",Y.id);if(!ue)return!1;if(ue.id!=Y.id)return!0;const ie=Array.isArray(ue.schema)?ue.schema:[],be=Array.isArray(Y.schema)?Y.schema:[];for(const Ae of be){if(j.findByKey(ie,"id",Ae.id))continue;const Je=j.findByKey(ie,"name",Ae.name);if(Je&&Ae.id!=Je.id)return!0}return!1}))},[d,h,_,g,y,S,i,o,s,l,u,c,m,a,r,f,M,D,I,L,R,F,N,P,q,U,Z,G,B]}class UA extends _e{constructor(e){super(),he(this,e,BA,VA,me,{},null,[-1,-1])}}function WA(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Backup name"),l=O(),s=b("input"),r=O(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[2]),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[7]),f=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&re(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function YA(n){let e,t,i,l,s,o,r;return l=new pe({props:{class:"form-field m-0",name:"name",$$slots:{default:[WA,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + to.`,s=O(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(f){f&&v(e),r=!1,a()}}}function ag(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function UA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[VA,zA],h=[];function _(g,y){return g[5]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[15]),r=O(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y[0]&32768)&&le(o,g[15]);let S=u;u=_(g),u===S?h[u].p(g,y):(se(),A(h[S],1,1,()=>{h[S]=null}),oe(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function WA(n){let e,t,i,l,s,o;e=new _i({}),i=new kn({props:{$$slots:{default:[UA]},$$scope:{ctx:n}}});let r={};return s=new HA({props:r}),n[27](s),s.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),l=O(),V(s.$$.fragment)},m(a,f){H(e,a,f),w(a,t,f),H(i,a,f),w(a,l,f),H(s,a,f),o=!0},p(a,f){const u={};f[0]&65535|f[1]&1024&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[27](null),z(s,a)}}}function YA(n,e,t){let i,l,s,o,r,a,f;Ue(n,Mt,Y=>t(15,f=Y)),xt(Mt,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1;T();async function T(){t(5,S=!0);try{t(2,_=await ae.collections.getFullList(200));for(let Y of _)delete Y.created,delete Y.updated}catch(Y){ae.error(Y)}t(5,S=!1)}function $(){if(t(4,y=[]),!!i)for(let Y of h){const ue=j.findByKey(_,"id",Y.id);!(ue!=null&&ue.id)||!j.hasCollectionChanges(ue,Y,g)||y.push({new:Y,old:ue})}}function C(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let Y of h)delete Y.created,delete Y.updated,Y.schema=j.filterDuplicatesByKey(Y.schema)}function M(){var Y,ue;for(let ie of h){const be=j.findByKey(_,"name",ie.name)||j.findByKey(_,"id",ie.id);if(!be)continue;const Ae=ie.id,He=be.id;ie.id=He;const Je=Array.isArray(be.schema)?be.schema:[],tt=Array.isArray(ie.schema)?ie.schema:[];for(const bt of tt){const at=j.findByKey(Je,"name",bt.name);at&&at.id&&(bt.id=at.id)}for(let bt of h)if(Array.isArray(bt.schema))for(let at of bt.schema)(Y=at.options)!=null&&Y.collectionId&&((ue=at.options)==null?void 0:ue.collectionId)===Ae&&(at.options.collectionId=He)}t(0,d=JSON.stringify(h,null,4))}function D(Y){t(12,m=!0);const ue=new FileReader;ue.onload=async ie=>{t(12,m=!1),t(10,u.value="",u),t(0,d=ie.target.result),await Xt(),h.length||(ii("Invalid collections configuration."),I())},ue.onerror=ie=>{console.warn(ie),ii("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},ue.readAsText(Y)}function I(){t(0,d=""),t(10,u.value="",u),Jt({})}function L(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(10,u)})}const R=()=>{u.files.length&&D(u.files[0])},F=()=>{u.click()};function N(){d=this.value,t(0,d)}function P(){g=this.checked,t(3,g)}const q=()=>M(),U=()=>I(),Z=()=>c==null?void 0:c.show(_,h,g);function G(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(11,c)})}const B=()=>I();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(Y=>!!Y.id&&!!Y.name).length),n.$$.dirty[0]&78&&t(9,l=_.filter(Y=>i&&g&&!j.findByKey(h,"id",Y.id))),n.$$.dirty[0]&70&&t(8,s=h.filter(Y=>i&&!j.findByKey(_,"id",Y.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof g<"u")&&$(),n.$$.dirty[0]&785&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(Y=>{let ue=j.findByKey(_,"name",Y.name)||j.findByKey(_,"id",Y.id);if(!ue)return!1;if(ue.id!=Y.id)return!0;const ie=Array.isArray(ue.schema)?ue.schema:[],be=Array.isArray(Y.schema)?Y.schema:[];for(const Ae of be){if(j.findByKey(ie,"id",Ae.id))continue;const Je=j.findByKey(ie,"name",Ae.name);if(Je&&Ae.id!=Je.id)return!0}return!1}))},[d,h,_,g,y,S,i,o,s,l,u,c,m,a,r,f,M,D,I,L,R,F,N,P,q,U,Z,G,B]}class KA extends _e{constructor(e){super(),he(this,e,YA,WA,me,{},null,[-1,-1])}}function JA(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=W("Backup name"),l=O(),s=b("input"),r=O(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[2]),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[7]),f=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&re(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function ZA(n){let e,t,i,l,s,o,r;return l=new pe({props:{class:"form-field m-0",name:"name",$$slots:{default:[JA,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the database will be temporary "locked" (this usually happens only during the ZIP generation).

    If you are using S3 storage for the collections file upload, you'll have to backup them - separately since they are not locally stored and will not be included in the final backup!

    `,t=O(),i=b("form"),V(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),H(l,i,null),s=!0,o||(r=K(i,"submit",Be(n[5])),o=!0)},p(a,f){const u={};f&98308&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(E(l.$$.fragment,a),s=!0)},o(a){A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),z(l),o=!1,r()}}}function KA(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JA(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,f){f&8&&(e.disabled=a[3]),f&8&&(l.disabled=a[3]),f&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function ZA(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[JA],header:[KA],default:[YA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),z(e,l)}}}function GA(n,e,t){const i=st(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function f(S){Jt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function u(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{u()},1500);try{await ae.backups.create(o,{$cancelKey:l}),t(3,r=!1),u(),i("submit"),Et("Successfully generated new backup.")}catch(S){S.isAbort||ae.error(S)}clearTimeout(a),t(3,r=!1)}}bs(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(wo("A backup has already been started, please wait."),!1):!0,h=()=>(r&&wo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _(S){ee[S?"unshift":"push"](()=>{s=S,t(1,s)})}function g(S){Te.call(this,n,S)}function y(S){Te.call(this,n,S)}return[u,s,o,r,l,c,f,d,m,h,_,g,y]}class XA extends _e{constructor(e){super(),he(this,e,GA,ZA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function QA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=O(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&32768&&i!==(i=f[15])&&p(e,"for",i),u&32768&&o!==(o=f[15])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function xA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;return f=new sl({props:{value:n[1]}}),m=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[QA,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please proceed with caution. + separately since they are not locally stored and will not be included in the final backup!

    `,t=O(),i=b("form"),V(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),H(l,i,null),s=!0,o||(r=K(i,"submit",Be(n[5])),o=!0)},p(a,f){const u={};f&98308&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(E(l.$$.fragment,a),s=!0)},o(a){A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),z(l),o=!1,r()}}}function GA(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function XA(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,f){f&8&&(e.disabled=a[3]),f&8&&(l.disabled=a[3]),f&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function QA(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[XA],header:[GA],default:[ZA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),z(e,l)}}}function xA(n,e,t){const i=st(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function f(S){Jt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function u(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{u()},1500);try{await ae.backups.create(o,{$cancelKey:l}),t(3,r=!1),u(),i("submit"),Et("Successfully generated new backup.")}catch(S){S.isAbort||ae.error(S)}clearTimeout(a),t(3,r=!1)}}ks(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?($o("A backup has already been started, please wait."),!1):!0,h=()=>(r&&$o("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _(S){ee[S?"unshift":"push"](()=>{s=S,t(1,s)})}function g(S){Te.call(this,n,S)}function y(S){Te.call(this,n,S)}return[u,s,o,r,l,c,f,d,m,h,_,g,y]}class eL extends _e{constructor(e){super(),he(this,e,xA,QA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function tL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=O(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&32768&&i!==(i=f[15])&&p(e,"for",i),u&32768&&o!==(o=f[15])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function nL(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;return f=new sl({props:{value:n[1]}}),m=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[tL,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please proceed with caution.
    Backup restore is still experimental and currently works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from the backup and will restart the application process.

    Nothing will happen if the backup file is invalid or incompatible.

    `,t=O(),i=b("div"),l=W(`Type the backup name `),s=b("div"),o=b("span"),r=W(n[1]),a=O(),V(f.$$.fragment),u=W(` - to confirm:`),c=O(),d=b("form"),V(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),H(f,s,null),k(i,u),w(y,c,S),w(y,d,S),H(m,d,null),h=!0,_||(g=K(d,"submit",Be(n[7])),_=!0)},p(y,S){(!h||S&2)&&le(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(f.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(f.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),z(f),z(m),_=!1,g()}}}function eL(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&le(l,s[1])},d(s){s&&v(e)}}}function tL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=O(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function nL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[tL],header:[eL],default:[xA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}function iL(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,f=null;function u(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await ae.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(f),T!=null&&T.isAbort||(t(4,a=!1),ni(((S=T.response)==null?void 0:S.message)||T.message))}}}bs(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ee[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Te.call(this,n,S)}function y(S){Te.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,y]}class lL extends _e{constructor(e){super(),he(this,e,iL,nL,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function rg(n,e,t){const i=n.slice();return i[22]=e[t],i}function ag(n,e,t){const i=n.slice();return i[19]=e[t],i}function sL(n){let e=[],t=new Map,i,l,s=de(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ug(n,e){let t,i,l,s,o,r=e[22].key+"",a,f,u,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,M,D,I,L,R,F,N,P,q,U,Z,G;function B(){return e[10](e[22])}function Y(){return e[11](e[22])}function ue(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=O(),s=b("div"),o=b("span"),a=W(r),u=O(),c=b("span"),d=W("("),h=W(m),_=W(")"),g=O(),y=b("div"),S=b("button"),T=b("i"),C=O(),M=b("button"),D=b("i"),L=O(),R=b("button"),F=b("i"),P=O(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",f=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(M,"type","button"),p(M,"class","btn btn-sm btn-circle btn-hint btn-transparent"),M.disabled=I=e[6][e[22].key],p(M,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ie,be){w(ie,t,be),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,M),k(M,D),k(y,L),k(y,R),k(R,F),k(t,P),U=!0,Z||(G=[we(Le.call(null,S,"Download")),K(S,"click",Be(B)),we(Le.call(null,M,"Restore")),K(M,"click",Be(Y)),we(Le.call(null,R,"Delete")),K(R,"click",Be(ue))],Z=!0)},p(ie,be){e=ie,(!U||be&8)&&r!==(r=e[22].key+"")&&le(a,r),(!U||be&8&&f!==(f=e[22].key))&&p(o,"title",f),(!U||be&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&le(h,m),(!U||be&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!U||be&40)&&x(S,"btn-loading",e[5][e[22].key]),(!U||be&72&&I!==(I=e[6][e[22].key]))&&(M.disabled=I),(!U||be&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!U||be&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ie){U||(ie&&Ye(()=>{U&&(q||(q=Ne(t,xe,{duration:150},!0)),q.run(1))}),U=!0)},o(ie){ie&&(q||(q=Ne(t,xe,{duration:150},!1)),q.run(0)),U=!1},d(ie){ie&&v(t),ie&&q&&q.end(),Z=!1,ve(G)}}}function cg(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function rL(n){let e,t,i;return{c(){e=b("span"),t=O(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function aL(n){let e,t,i;return{c(){e=b("i"),t=O(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function fL(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;const g=[oL,sL],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?aL:rL}let $=T(n),C=$(n),M={};u=new XA({props:M}),n[14](u),u.$on("submit",n[15]);let D={};return d=new lL({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=O(),o=b("div"),r=b("button"),C.c(),f=O(),V(u.$$.fragment),c=O(),V(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,f,L),H(u,I,L),w(I,c,L),H(d,I,L),m=!0,h||(_=K(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(se(),A(y[R],1,1,()=>{y[R]=null}),oe(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};u.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(u.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(u.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(f),v(c)),y[i].d(),C.d(),n[14](null),z(u,I),n[16](null),z(d,I),h=!1,_()}}}function uL(n,e,t){let i,l,s=[],o=!1,r={},a={},f=!0;u(),h();async function u(){t(4,o=!0);try{t(3,s=await ae.backups.getFullList()),s.sort((M,D)=>M.modifiedD.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(ae.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const D=await ae.getAdminFileToken(),I=ae.backups.getDownloadUrl(D,M);j.download(I)}catch(D){D.isAbort||ae.error(D)}delete r[M],t(5,r)}}function d(M){fn(`Do you really want to delete ${M}?`,()=>m(M))}async function m(M){if(!a[M]){t(6,a[M]=!0,a);try{await ae.backups.delete(M),j.removeByKey(s,"name",M),u(),Et(`Successfully deleted ${M}.`)}catch(D){D.isAbort||ae.error(D)}delete a[M],t(6,a)}}async function h(){var M;try{const D=await ae.health.check({$autoCancel:!1}),I=f;t(7,f=((M=D==null?void 0:D.data)==null?void 0:M.canBackup)||!1),I!=f&&f&&u()}catch{}}jt(()=>{let M=setInterval(()=>{h()},3e3);return()=>{clearInterval(M)}});const _=M=>c(M.key),g=M=>l.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function T(M){ee[M?"unshift":"push"](()=>{i=M,t(1,i)})}const $=()=>{u()};function C(M){ee[M?"unshift":"push"](()=>{l=M,t(2,l)})}return[u,i,l,s,o,r,a,f,c,d,_,g,y,S,T,$,C]}class cL extends _e{constructor(e){super(),he(this,e,uL,fL,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function dL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=O(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,f){w(a,e,f),k(e,t),w(a,l,f),w(a,s,f),n[5](s),o||(r=[we(Le.call(null,e,"Upload backup")),K(e,"click",n[4]),K(s,"change",n[3])],o=!0)},p(a,[f]){f&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),f&5&&x(e,"btn-loading",a[2]),f&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,ve(r)}}}const dg="upload_backup";function pL(n,e,t){const i=st();let{class:l=""}=e,s,o=!1;async function r(u){var d,m,h,_,g;if(o||!((m=(d=u==null?void 0:u.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",u.target.files[0]);try{await ae.backups.upload(c,{requestKey:dg}),t(2,o=!1),i("success"),Et("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ni(y.response.data.file.message):ae.error(y))}}bs(()=>{ae.cancelRequest(dg)});const a=()=>s==null?void 0:s.click();function f(u){ee[u?"unshift":"push"](()=>{s=u,t(1,s)})}return n.$$set=u=>{"class"in u&&t(0,l=u.class)},[l,s,o,r,a,f]}class mL extends _e{constructor(e){super(),he(this,e,pL,dL,me,{class:0})}}function hL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function _L(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function pg(n){var U,Z,G;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[gL,({uniqueId:B})=>({31:B}),({uniqueId:B})=>[0,B?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&mg(n);function L(B){n[24](B)}function R(B){n[25](B)}function F(B){n[26](B)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new Vb({props:N}),ee.push(()=>ge(r,"config",L)),ee.push(()=>ge(r,"isTesting",R)),ee.push(()=>ge(r,"testError",F));let P=((G=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:G.enabled)&&!n[9]&&!n[5]&&hg(n),q=n[9]&&_g(n);return{c(){e=b("form"),V(t.$$.fragment),i=O(),I&&I.c(),l=O(),s=b("div"),o=O(),V(r.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),P&&P.c(),_=O(),q&&q.c(),g=O(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(B,Y){w(B,e,Y),H(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),H(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,M||(D=[K(y,"click",n[28]),K(e,"submit",Be(n[11]))],M=!0)},p(B,Y){var be,Ae,He;const ue={};Y[0]&4|Y[1]&3&&(ue.$$scope={dirty:Y,ctx:B}),t.$set(ue),B[2]?I?(I.p(B,Y),Y[0]&4&&E(I,1)):(I=mg(B),I.c(),E(I,1),I.m(e,l)):I&&(se(),A(I,1,1,()=>{I=null}),oe());const ie={};Y[0]&1&&(ie.originalConfig=(be=B[0].backups)==null?void 0:be.s3),!a&&Y[0]&2&&(a=!0,ie.config=B[1].backups.s3,ke(()=>a=!1)),!f&&Y[0]&128&&(f=!0,ie.isTesting=B[7],ke(()=>f=!1)),!u&&Y[0]&256&&(u=!0,ie.testError=B[8],ke(()=>u=!1)),r.$set(ie),(He=(Ae=B[1].backups)==null?void 0:Ae.s3)!=null&&He.enabled&&!B[9]&&!B[5]?P?P.p(B,Y):(P=hg(B),P.c(),P.m(d,_)):P&&(P.d(1),P=null),B[9]?q?q.p(B,Y):(q=_g(B),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||Y[0]&544&&T!==(T=!B[9]||B[5]))&&(y.disabled=T),(!C||Y[0]&32)&&x(y,"btn-loading",B[5])},i(B){C||(E(t.$$.fragment,B),E(I),E(r.$$.fragment,B),B&&Ye(()=>{C&&($||($=Ne(e,xe,{duration:150},!0)),$.run(1))}),C=!0)},o(B){A(t.$$.fragment,B),A(I),A(r.$$.fragment,B),B&&($||($=Ne(e,xe,{duration:150},!1)),$.run(0)),C=!1},d(B){B&&v(e),z(t),I&&I.d(),z(r),P&&P.d(),q&&q.d(),B&&$&&$.end(),M=!1,ve(D)}}}function gL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[17]),r=!0)},p(f,u){u[1]&1&&t!==(t=f[31])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&1&&o!==(o=f[31])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function mg(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[kL,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[yL,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(e,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(e,xe,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),z(l),z(r),u&&a&&a.end()}}}function bL(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=O(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=O(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=O(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[K(e,"click",n[19]),K(i,"click",n[20]),K(s,"click",n[21]),K(r,"click",n[22])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,ve(f)}}}function kL(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[bL]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=W("Cron expression"),l=O(),s=b("input"),a=O(),f=b("div"),u=b("button"),c=b("span"),c.textContent="Presets",d=O(),m=b("i"),h=O(),V(_.$$.fragment),g=O(),y=b("div"),S=b("p"),T=W(`Supports numeric list, steps, ranges or + to confirm:`),c=O(),d=b("form"),V(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),H(f,s,null),k(i,u),w(y,c,S),w(y,d,S),H(m,d,null),h=!0,_||(g=K(d,"submit",Be(n[7])),_=!0)},p(y,S){(!h||S&2)&&le(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(f.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(f.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),z(f),z(m),_=!1,g()}}}function iL(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&le(l,s[1])},d(s){s&&v(e)}}}function lL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=O(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function sL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[lL],header:[iL],default:[nL]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}function oL(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,f=null;function u(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await ae.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(f),T!=null&&T.isAbort||(t(4,a=!1),ii(((S=T.response)==null?void 0:S.message)||T.message))}}}ks(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ee[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Te.call(this,n,S)}function y(S){Te.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,y]}class rL extends _e{constructor(e){super(),he(this,e,oL,sL,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function fg(n,e,t){const i=n.slice();return i[22]=e[t],i}function ug(n,e,t){const i=n.slice();return i[19]=e[t],i}function aL(n){let e=[],t=new Map,i,l,s=de(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function dg(n,e){let t,i,l,s,o,r=e[22].key+"",a,f,u,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,M,D,I,L,R,F,N,P,q,U,Z,G;function B(){return e[10](e[22])}function Y(){return e[11](e[22])}function ue(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=O(),s=b("div"),o=b("span"),a=W(r),u=O(),c=b("span"),d=W("("),h=W(m),_=W(")"),g=O(),y=b("div"),S=b("button"),T=b("i"),C=O(),M=b("button"),D=b("i"),L=O(),R=b("button"),F=b("i"),P=O(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",f=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(M,"type","button"),p(M,"class","btn btn-sm btn-circle btn-hint btn-transparent"),M.disabled=I=e[6][e[22].key],p(M,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ie,be){w(ie,t,be),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,M),k(M,D),k(y,L),k(y,R),k(R,F),k(t,P),U=!0,Z||(G=[we(Le.call(null,S,"Download")),K(S,"click",Be(B)),we(Le.call(null,M,"Restore")),K(M,"click",Be(Y)),we(Le.call(null,R,"Delete")),K(R,"click",Be(ue))],Z=!0)},p(ie,be){e=ie,(!U||be&8)&&r!==(r=e[22].key+"")&&le(a,r),(!U||be&8&&f!==(f=e[22].key))&&p(o,"title",f),(!U||be&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&le(h,m),(!U||be&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!U||be&40)&&x(S,"btn-loading",e[5][e[22].key]),(!U||be&72&&I!==(I=e[6][e[22].key]))&&(M.disabled=I),(!U||be&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!U||be&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ie){U||(ie&&Ye(()=>{U&&(q||(q=Ne(t,xe,{duration:150},!0)),q.run(1))}),U=!0)},o(ie){ie&&(q||(q=Ne(t,xe,{duration:150},!1)),q.run(0)),U=!1},d(ie){ie&&v(t),ie&&q&&q.end(),Z=!1,ve(G)}}}function pg(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function uL(n){let e,t,i;return{c(){e=b("span"),t=O(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function cL(n){let e,t,i;return{c(){e=b("i"),t=O(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function dL(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;const g=[fL,aL],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?cL:uL}let $=T(n),C=$(n),M={};u=new eL({props:M}),n[14](u),u.$on("submit",n[15]);let D={};return d=new rL({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=O(),o=b("div"),r=b("button"),C.c(),f=O(),V(u.$$.fragment),c=O(),V(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,f,L),H(u,I,L),w(I,c,L),H(d,I,L),m=!0,h||(_=K(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(se(),A(y[R],1,1,()=>{y[R]=null}),oe(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};u.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(u.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(u.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(f),v(c)),y[i].d(),C.d(),n[14](null),z(u,I),n[16](null),z(d,I),h=!1,_()}}}function pL(n,e,t){let i,l,s=[],o=!1,r={},a={},f=!0;u(),h();async function u(){t(4,o=!0);try{t(3,s=await ae.backups.getFullList()),s.sort((M,D)=>M.modifiedD.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(ae.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const D=await ae.getAdminFileToken(),I=ae.backups.getDownloadUrl(D,M);j.download(I)}catch(D){D.isAbort||ae.error(D)}delete r[M],t(5,r)}}function d(M){fn(`Do you really want to delete ${M}?`,()=>m(M))}async function m(M){if(!a[M]){t(6,a[M]=!0,a);try{await ae.backups.delete(M),j.removeByKey(s,"name",M),u(),Et(`Successfully deleted ${M}.`)}catch(D){D.isAbort||ae.error(D)}delete a[M],t(6,a)}}async function h(){var M;try{const D=await ae.health.check({$autoCancel:!1}),I=f;t(7,f=((M=D==null?void 0:D.data)==null?void 0:M.canBackup)||!1),I!=f&&f&&u()}catch{}}jt(()=>{let M=setInterval(()=>{h()},3e3);return()=>{clearInterval(M)}});const _=M=>c(M.key),g=M=>l.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function T(M){ee[M?"unshift":"push"](()=>{i=M,t(1,i)})}const $=()=>{u()};function C(M){ee[M?"unshift":"push"](()=>{l=M,t(2,l)})}return[u,i,l,s,o,r,a,f,c,d,_,g,y,S,T,$,C]}class mL extends _e{constructor(e){super(),he(this,e,pL,dL,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function hL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=O(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,f){w(a,e,f),k(e,t),w(a,l,f),w(a,s,f),n[5](s),o||(r=[we(Le.call(null,e,"Upload backup")),K(e,"click",n[4]),K(s,"change",n[3])],o=!0)},p(a,[f]){f&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),f&5&&x(e,"btn-loading",a[2]),f&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,ve(r)}}}const mg="upload_backup";function _L(n,e,t){const i=st();let{class:l=""}=e,s,o=!1;async function r(u){var d,m,h,_,g;if(o||!((m=(d=u==null?void 0:u.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",u.target.files[0]);try{await ae.backups.upload(c,{requestKey:mg}),t(2,o=!1),i("success"),Et("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ii(y.response.data.file.message):ae.error(y))}}ks(()=>{ae.cancelRequest(mg)});const a=()=>s==null?void 0:s.click();function f(u){ee[u?"unshift":"push"](()=>{s=u,t(1,s)})}return n.$$set=u=>{"class"in u&&t(0,l=u.class)},[l,s,o,r,a,f]}class gL extends _e{constructor(e){super(),he(this,e,_L,hL,me,{class:0})}}function bL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function kL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hg(n){var U,Z,G;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[yL,({uniqueId:B})=>({31:B}),({uniqueId:B})=>[0,B?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&_g(n);function L(B){n[24](B)}function R(B){n[25](B)}function F(B){n[26](B)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new Kb({props:N}),ee.push(()=>ge(r,"config",L)),ee.push(()=>ge(r,"isTesting",R)),ee.push(()=>ge(r,"testError",F));let P=((G=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:G.enabled)&&!n[9]&&!n[5]&&gg(n),q=n[9]&&bg(n);return{c(){e=b("form"),V(t.$$.fragment),i=O(),I&&I.c(),l=O(),s=b("div"),o=O(),V(r.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),P&&P.c(),_=O(),q&&q.c(),g=O(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(B,Y){w(B,e,Y),H(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),H(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,M||(D=[K(y,"click",n[28]),K(e,"submit",Be(n[11]))],M=!0)},p(B,Y){var be,Ae,He;const ue={};Y[0]&4|Y[1]&3&&(ue.$$scope={dirty:Y,ctx:B}),t.$set(ue),B[2]?I?(I.p(B,Y),Y[0]&4&&E(I,1)):(I=_g(B),I.c(),E(I,1),I.m(e,l)):I&&(se(),A(I,1,1,()=>{I=null}),oe());const ie={};Y[0]&1&&(ie.originalConfig=(be=B[0].backups)==null?void 0:be.s3),!a&&Y[0]&2&&(a=!0,ie.config=B[1].backups.s3,ke(()=>a=!1)),!f&&Y[0]&128&&(f=!0,ie.isTesting=B[7],ke(()=>f=!1)),!u&&Y[0]&256&&(u=!0,ie.testError=B[8],ke(()=>u=!1)),r.$set(ie),(He=(Ae=B[1].backups)==null?void 0:Ae.s3)!=null&&He.enabled&&!B[9]&&!B[5]?P?P.p(B,Y):(P=gg(B),P.c(),P.m(d,_)):P&&(P.d(1),P=null),B[9]?q?q.p(B,Y):(q=bg(B),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||Y[0]&544&&T!==(T=!B[9]||B[5]))&&(y.disabled=T),(!C||Y[0]&32)&&x(y,"btn-loading",B[5])},i(B){C||(E(t.$$.fragment,B),E(I),E(r.$$.fragment,B),B&&Ye(()=>{C&&($||($=Ne(e,xe,{duration:150},!0)),$.run(1))}),C=!0)},o(B){A(t.$$.fragment,B),A(I),A(r.$$.fragment,B),B&&($||($=Ne(e,xe,{duration:150},!1)),$.run(0)),C=!1},d(B){B&&v(e),z(t),I&&I.d(),z(r),P&&P.d(),q&&q.d(),B&&$&&$.end(),M=!1,ve(D)}}}function yL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[17]),r=!0)},p(f,u){u[1]&1&&t!==(t=f[31])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&1&&o!==(o=f[31])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function _g(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[wL,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[SL,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(e,xe,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(e,xe,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),z(l),z(r),u&&a&&a.end()}}}function vL(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=O(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=O(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=O(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[K(e,"click",n[19]),K(i,"click",n[20]),K(s,"click",n[21]),K(r,"click",n[22])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,ve(f)}}}function wL(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[vL]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=W("Cron expression"),l=O(),s=b("input"),a=O(),f=b("div"),u=b("button"),c=b("span"),c.textContent="Presets",d=O(),m=b("i"),h=O(),V(_.$$.fragment),g=O(),y=b("div"),S=b("p"),T=W(`Supports numeric list, steps, ranges or `),$=b("span"),$.textContent="macros",C=W(`. `),M=b("br"),D=W(` The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((N=(F=n[0])==null?void 0:F.backups)!=null&&N.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(u,"type","button"),p(u,"class","btn btn-sm btn-outline p-r-0"),p(f,"class","form-field-addon"),p($,"class","link-primary"),p(y,"class","help-block")},m(F,N){var P,q;w(F,e,N),k(e,t),w(F,l,N),w(F,s,N),re(s,n[1].backups.cron),w(F,a,N),w(F,f,N),k(f,u),k(u,c),k(u,d),k(u,m),k(u,h),H(_,u,null),w(F,g,N),w(F,y,N),k(y,S),k(S,T),k(S,$),k(S,C),k(S,M),k(S,D),I=!0,(q=(P=n[0])==null?void 0:P.backups)!=null&&q.cron||s.focus(),L||(R=[K(s,"input",n[18]),we(Le.call(null,$,`@yearly @@ -148,10 +148,10 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t @weekly @daily @midnight -@hourly`))],L=!0)},p(F,N){var q,U;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((U=(q=F[0])==null?void 0:q.backups)!=null&&U.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),z(_),L=!1,ve(R)}}}function yL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=O(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=K(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&<(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function hg(n){let e;function t(s,o){return s[7]?SL:s[8]?wL:vL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function vL(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wL(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=we(t=Le.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Tt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function SL(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _g(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function $L(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L,R,F;m=new Ko({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new mL({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new cL({props:N}),n[15](y);function P(G,B){return G[6]?_L:hL}let q=P(n),U=q(n),Z=n[6]&&!n[4]&&pg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[10]),r=O(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=O(),V(m.$$.fragment),h=O(),V(_.$$.fragment),g=O(),V(y.$$.fragment),S=O(),T=b("hr"),$=O(),C=b("button"),M=b("span"),M.textContent="Backups options",D=O(),U.c(),I=O(),Z&&Z.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(M,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,B){w(G,e,B),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,B),w(G,a,B),k(a,f),k(f,u),k(u,c),k(u,d),H(m,u,null),k(u,h),H(_,u,null),k(f,g),H(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,M),k(C,D),U.m(C,null),k(f,I),Z&&Z.m(f,null),L=!0,R||(F=[K(C,"click",n[16]),K(f,"submit",Be(n[11]))],R=!0)},p(G,B){(!L||B[0]&1024)&&le(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(U.d(1),U=q(G),U&&(U.c(),U.m(C,null))),(!L||B[0]&16)&&(C.disabled=G[4]),(!L||B[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?Z?(Z.p(G,B),B[0]&80&&E(Z,1)):(Z=pg(G),Z.c(),E(Z,1),Z.m(f,null)):Z&&(se(),A(Z,1,1,()=>{Z=null}),oe())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(Z),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(Z),L=!1},d(G){G&&(v(e),v(r),v(a)),z(m),z(_),n[15](null),z(y),U.d(),Z&&Z.d(),R=!1,ve(F)}}}function TL(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[$L]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function CL(n,e,t){let i,l;Ue(n,Mt,B=>t(10,l=B)),xt(Mt,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const B=await ae.settings.getAll()||{};y(B)}catch(B){ae.error(B)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const B=await ae.settings.update(j.filterRedactedProps(r));await T(),y(B),Et("Successfully saved application settings.")}catch(B){ae.error(B)}t(5,f=!1)}}function y(B={}){t(1,r={backups:(B==null?void 0:B.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(B){ee[B?"unshift":"push"](()=>{s=B,t(3,s)})}const C=()=>t(6,d=!d);function M(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=lt(this.value),t(1,r),t(2,c)}function P(B){n.$$.not_equal(r.backups.s3,B)&&(r.backups.s3=B,t(1,r),t(2,c))}function q(B){m=B,t(7,m)}function U(B){h=B,t(8,h)}const Z=()=>S(),G=()=>g();return n.$$.update=()=>{var B;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(B=r==null?void 0:r.backups)!=null&&B.cron&&(ii("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,M,D,I,L,R,F,N,P,q,U,Z,G]}class OL extends _e{constructor(e){super(),he(this,e,CL,TL,me,{},null,[-1,-1])}}const Lt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],ML={"/login":Dt({component:EE,conditions:Lt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Dt({asyncComponent:()=>nt(()=>import("./PageAdminRequestPasswordReset-u3IJQ56t.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Dt({asyncComponent:()=>nt(()=>import("./PageAdminConfirmPasswordReset-2bhyqO-h.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Dt({component:X8,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Dt({component:ZS,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Dt({component:jE,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Dt({component:$E,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Dt({component:CI,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Dt({component:KI,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Dt({component:uA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Dt({component:kA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Dt({component:TA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Dt({component:UA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Dt({component:OL,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmPasswordReset-CxQguUVC.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmPasswordReset-CxQguUVC.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmVerification-SM6lccm5.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmVerification-SM6lccm5.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmEmailChange-4ADie32V.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmEmailChange-4ADie32V.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Dt({asyncComponent:()=>nt(()=>import("./PageOAuth2RedirectSuccess-YNXI3rVf.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Dt({asyncComponent:()=>nt(()=>import("./PageOAuth2RedirectFailure-r6JT1XbI.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"*":Dt({component:vv,userData:{showAppSidebar:!1}})};function DL(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Yo}=i;return{delay:u,duration:Tt(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function gg(n,e,t){const i=n.slice();return i[2]=e[t],i}function EL(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function IL(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function AL(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function LL(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function bg(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(M,D){return M[2].type==="info"?LL:M[2].type==="success"?AL:M[2].type==="warning"?IL:EL}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=O(),s=b("div"),r=W(o),a=O(),f=b("button"),f.innerHTML='',u=O(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,D){w(M,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=K(f,"click",Be(C)),g=!0)},p(M,D){e=M,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&le(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){h0(t),h(),Og(t,m)},a(){h(),h=m0(t,m,DL,{duration:150})},i(M){_||(M&&Ye(()=>{_&&(d&&d.end(1),c=Eg(t,xe,{duration:150}),c.start())}),_=!0)},o(M){c&&c.invalidate(),M&&(d=fa(t,os,{duration:150})),_=!1},d(M){M&&v(t),$.d(),M&&d&&d.end(),g=!1,y()}}}function NL(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>H1(s)]}class FL extends _e{constructor(e){super(),he(this,e,PL,NL,me,{})}}function RL(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&le(i,t)},d(s){s&&v(e)}}}function qL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=O(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[K(e,"click",n[4]),K(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,ve(r)}}}function jL(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[qL],header:[RL]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),z(e,l)}}}function HL(n,e,t){let i;Ue(n,Ha,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Xt(),t(3,o=!1),Lb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class zL extends _e{constructor(e){super(),he(this,e,HL,jL,me,{})}}function kg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[VL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=O(),l=b("nav"),s=b("a"),s.innerHTML='',o=O(),r=b("a"),r.innerHTML='',a=O(),f=b("a"),f.innerHTML='',u=O(),c=b("figure"),d=b("img"),h=O(),V(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),H(_,c,null),g=!0,y||(S=[we(nn.call(null,t)),we(nn.call(null,s)),we(An.call(null,s,{path:"/collections/?.*",className:"current-route"})),we(Le.call(null,s,{text:"Collections",position:"right"})),we(nn.call(null,r)),we(An.call(null,r,{path:"/logs/?.*",className:"current-route"})),we(Le.call(null,r,{text:"Logs",position:"right"})),we(nn.call(null,f)),we(An.call(null,f,{path:"/settings/?.*",className:"current-route"})),we(Le.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var M;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((M=T[0])==null?void 0:M.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(_),y=!1,ve(S)}}}function VL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=O(),i=b("hr"),l=O(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[we(nn.call(null,e)),K(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,ve(r)}}}function yg(n){let e,t,i;return t=new Ua({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function BL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&kg(n);o=new D0({props:{routes:ML}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new FL({}),u=new zL({});let _=n[1]&&!n[2]&&yg(n);return{c(){t=O(),i=b("div"),h&&h.c(),l=O(),s=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),V(u.$$.fragment),c=O(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),H(o,s,null),k(s,r),H(a,s,null),w(y,f,S),H(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=kg(y),h.c(),E(h,1),h.m(i,l)):h&&(se(),A(h,1,1,()=>{h=null}),oe()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=yg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(se(),A(_,1,1,()=>{_=null}),oe())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),z(o),z(a),z(u,y),_&&_.d(y)}}}function UL(n,e,t){let i,l,s,o;Ue(n,Xi,_=>t(10,i=_)),Ue(n,To,_=>t(3,l=_)),Ue(n,wa,_=>t(0,s=_)),Ue(n,Mt,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(Mt,o="",o),Jt({}),Lb())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(To,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class WL extends _e{constructor(e){super(),he(this,e,UL,BL,me,{})}}new WL({target:document.getElementById("app")});export{ve as A,Et as B,j as C,tl as D,ye as E,V1 as F,qo as G,lo as H,jt as I,Ue as J,Fn as K,st as L,ee as M,ja as N,de as O,ct as P,Ii as Q,It as R,_e as S,rt as T,u0 as U,A as a,O as b,V as c,z as d,b as e,p as f,w as g,k as h,he as i,we as j,se as k,nn as l,H as m,oe as n,v as o,ae as p,pe as q,x as r,me as s,E as t,K as u,Be as v,W as w,le as x,Q as y,re as z}; +@hourly`))],L=!0)},p(F,N){var q,U;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((U=(q=F[0])==null?void 0:q.backups)!=null&&U.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),z(_),L=!1,ve(R)}}}function SL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=O(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=K(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&<(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function gg(n){let e;function t(s,o){return s[7]?CL:s[8]?TL:$L}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function $L(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TL(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=we(t=Le.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Tt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function CL(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function OL(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M,D,I,L,R,F;m=new Zo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new gL({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new mL({props:N}),n[15](y);function P(G,B){return G[6]?kL:bL}let q=P(n),U=q(n),Z=n[6]&&!n[4]&&hg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=O(),s=b("div"),o=W(n[10]),r=O(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=O(),V(m.$$.fragment),h=O(),V(_.$$.fragment),g=O(),V(y.$$.fragment),S=O(),T=b("hr"),$=O(),C=b("button"),M=b("span"),M.textContent="Backups options",D=O(),U.c(),I=O(),Z&&Z.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(M,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,B){w(G,e,B),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,B),w(G,a,B),k(a,f),k(f,u),k(u,c),k(u,d),H(m,u,null),k(u,h),H(_,u,null),k(f,g),H(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,M),k(C,D),U.m(C,null),k(f,I),Z&&Z.m(f,null),L=!0,R||(F=[K(C,"click",n[16]),K(f,"submit",Be(n[11]))],R=!0)},p(G,B){(!L||B[0]&1024)&&le(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(U.d(1),U=q(G),U&&(U.c(),U.m(C,null))),(!L||B[0]&16)&&(C.disabled=G[4]),(!L||B[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?Z?(Z.p(G,B),B[0]&80&&E(Z,1)):(Z=hg(G),Z.c(),E(Z,1),Z.m(f,null)):Z&&(se(),A(Z,1,1,()=>{Z=null}),oe())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(Z),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(Z),L=!1},d(G){G&&(v(e),v(r),v(a)),z(m),z(_),n[15](null),z(y),U.d(),Z&&Z.d(),R=!1,ve(F)}}}function ML(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[OL]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function DL(n,e,t){let i,l;Ue(n,Mt,B=>t(10,l=B)),xt(Mt,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const B=await ae.settings.getAll()||{};y(B)}catch(B){ae.error(B)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const B=await ae.settings.update(j.filterRedactedProps(r));await T(),y(B),Et("Successfully saved application settings.")}catch(B){ae.error(B)}t(5,f=!1)}}function y(B={}){t(1,r={backups:(B==null?void 0:B.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(B){ee[B?"unshift":"push"](()=>{s=B,t(3,s)})}const C=()=>t(6,d=!d);function M(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=lt(this.value),t(1,r),t(2,c)}function P(B){n.$$.not_equal(r.backups.s3,B)&&(r.backups.s3=B,t(1,r),t(2,c))}function q(B){m=B,t(7,m)}function U(B){h=B,t(8,h)}const Z=()=>S(),G=()=>g();return n.$$.update=()=>{var B;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(B=r==null?void 0:r.backups)!=null&&B.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,M,D,I,L,R,F,N,P,q,U,Z,G]}class EL extends _e{constructor(e){super(),he(this,e,DL,ML,me,{},null,[-1,-1])}}const Lt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],IL={"/login":Dt({component:LE,conditions:Lt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Dt({asyncComponent:()=>nt(()=>import("./PageAdminRequestPasswordReset-X0rySEZT.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Dt({asyncComponent:()=>nt(()=>import("./PageAdminConfirmPasswordReset-rlk6ZeZ-.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Dt({component:eE,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Dt({component:QS,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Dt({component:VE,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Dt({component:OE,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Dt({component:DI,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Dt({component:GI,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Dt({component:pA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Dt({component:wA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Dt({component:MA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Dt({component:KA,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Dt({component:EL,conditions:Lt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmPasswordReset-Kc5FhBPO.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmPasswordReset-Kc5FhBPO.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmVerification-Jpu6HXVR.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmVerification-Jpu6HXVR.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmEmailChange-mmZcf5-I.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Dt({asyncComponent:()=>nt(()=>import("./PageRecordConfirmEmailChange-mmZcf5-I.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Dt({asyncComponent:()=>nt(()=>import("./PageOAuth2RedirectSuccess-TnkusHkS.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Dt({asyncComponent:()=>nt(()=>import("./PageOAuth2RedirectFailure-QKXWWgns.js"),__vite__mapDeps([]),import.meta.url),conditions:Lt,userData:{showAppSidebar:!1}}),"*":Dt({component:$v,userData:{showAppSidebar:!1}})};function AL(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Jo}=i;return{delay:u,duration:Tt(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function kg(n,e,t){const i=n.slice();return i[2]=e[t],i}function LL(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function NL(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function PL(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function FL(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function yg(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(M,D){return M[2].type==="info"?FL:M[2].type==="success"?PL:M[2].type==="warning"?NL:LL}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=O(),s=b("div"),r=W(o),a=O(),f=b("button"),f.innerHTML='',u=O(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,D){w(M,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=K(f,"click",Be(C)),g=!0)},p(M,D){e=M,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&le(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){k0(t),h(),Eg(t,m)},a(){h(),h=b0(t,m,AL,{duration:150})},i(M){_||(M&&Ye(()=>{_&&(d&&d.end(1),c=Lg(t,xe,{duration:150}),c.start())}),_=!0)},o(M){c&&c.invalidate(),M&&(d=ca(t,rs,{duration:150})),_=!1},d(M){M&&v(t),$.d(),M&&d&&d.end(),g=!1,y()}}}function RL(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>B1(s)]}class jL extends _e{constructor(e){super(),he(this,e,qL,RL,me,{})}}function HL(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&le(i,t)},d(s){s&&v(e)}}}function zL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=O(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[K(e,"click",n[4]),K(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,ve(r)}}}function VL(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[zL],header:[HL]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),z(e,l)}}}function BL(n,e,t){let i;Ue(n,Va,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Xt(),t(3,o=!1),qb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class UL extends _e{constructor(e){super(),he(this,e,BL,VL,me,{})}}function vg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[WL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=O(),l=b("nav"),s=b("a"),s.innerHTML='',o=O(),r=b("a"),r.innerHTML='',a=O(),f=b("a"),f.innerHTML='',u=O(),c=b("figure"),d=b("img"),h=O(),V(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),H(_,c,null),g=!0,y||(S=[we(nn.call(null,t)),we(nn.call(null,s)),we(An.call(null,s,{path:"/collections/?.*",className:"current-route"})),we(Le.call(null,s,{text:"Collections",position:"right"})),we(nn.call(null,r)),we(An.call(null,r,{path:"/logs/?.*",className:"current-route"})),we(Le.call(null,r,{text:"Logs",position:"right"})),we(nn.call(null,f)),we(An.call(null,f,{path:"/settings/?.*",className:"current-route"})),we(Le.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var M;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((M=T[0])==null?void 0:M.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(_),y=!1,ve(S)}}}function WL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=O(),i=b("hr"),l=O(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[we(nn.call(null,e)),K(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,ve(r)}}}function wg(n){let e,t,i;return t=new Ya({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function YL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&vg(n);o=new L0({props:{routes:IL}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new jL({}),u=new UL({});let _=n[1]&&!n[2]&&wg(n);return{c(){t=O(),i=b("div"),h&&h.c(),l=O(),s=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),f=O(),V(u.$$.fragment),c=O(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),H(o,s,null),k(s,r),H(a,s,null),w(y,f,S),H(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=vg(y),h.c(),E(h,1),h.m(i,l)):h&&(se(),A(h,1,1,()=>{h=null}),oe()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=wg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(se(),A(_,1,1,()=>{_=null}),oe())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),z(o),z(a),z(u,y),_&&_.d(y)}}}function KL(n,e,t){let i,l,s,o;Ue(n,Xi,_=>t(10,i=_)),Ue(n,Oo,_=>t(3,l=_)),Ue(n,$a,_=>t(0,s=_)),Ue(n,Mt,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(Mt,o="",o),Jt({}),qb())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Oo,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class JL extends _e{constructor(e){super(),he(this,e,KL,YL,me,{})}}new JL({target:document.getElementById("app")});export{ae as A,Et as B,j as C,tl as D,ye as E,K1 as F,Ho as G,so as H,jt as I,Ue as J,Fn as K,st as L,ee as M,za as N,de as O,ct as P,Ii as Q,It as R,_e as S,rt as T,m0 as U,A as a,O as b,V as c,z as d,b as e,p as f,w as g,k as h,he as i,we as j,se as k,nn as l,H as m,oe as n,v as o,pe as p,x as q,K as r,me as s,E as t,Be as u,W as v,le as w,Q as x,re as y,ve as z}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./FilterAutocompleteInput-OZtUpY4v.js","./index-u64XbdBO.js","./CodeEditor-AgADv186.js","./ListApiDocs-o3IOerVB.js","./SdkTabs-ZFbexUF1.js","./SdkTabs-JQVpi1cs.css","./FieldsQueryParam-pO449pwf.js","./ListApiDocs-4XQLQO2L.css","./ViewApiDocs-dkYTmtVs.js","./CreateApiDocs-Y1F_-wh9.js","./UpdateApiDocs-pnf_K2jX.js","./DeleteApiDocs-UGu6GbCv.js","./RealtimeApiDocs-HwUV4b-E.js","./AuthWithPasswordDocs-RVIqELew.js","./AuthWithOAuth2Docs-RDXOM2lB.js","./AuthRefreshDocs-MSIqKvjR.js","./RequestVerificationDocs-yKFp7OPL.js","./ConfirmVerificationDocs-jvmhFPKz.js","./RequestPasswordResetDocs-5TAO7hUw.js","./ConfirmPasswordResetDocs-TEkFHZVZ.js","./RequestEmailChangeDocs-VM_SKuLb.js","./ConfirmEmailChangeDocs-Az0ouP1t.js","./AuthMethodsDocs-E8qGD5-5.js","./ListExternalAuthsDocs-OczUMJjZ.js","./UnlinkExternalAuthDocs--pYR2xlr.js"] + __vite__mapDeps.viteFileDeps = ["./FilterAutocompleteInput-YLbqIy3c.js","./index-u64XbdBO.js","./CodeEditor-rWx4HUVf.js","./ListApiDocs-bfTK9tkG.js","./SdkTabs-7yshYvVF.js","./SdkTabs-JQVpi1cs.css","./FieldsQueryParam-N-1EL4Av.js","./ListApiDocs-4XQLQO2L.css","./ViewApiDocs-fZDF7bi9.js","./CreateApiDocs-SGziFR1e.js","./UpdateApiDocs-XdZRybfj.js","./DeleteApiDocs-20BG7iGY.js","./RealtimeApiDocs-B8Ubzznt.js","./AuthWithPasswordDocs-WYTGSxgx.js","./AuthWithOAuth2Docs-wpInYmBQ.js","./AuthRefreshDocs-MKJO-QLX.js","./RequestVerificationDocs-dmeMkvVt.js","./ConfirmVerificationDocs-vggZqtpv.js","./RequestPasswordResetDocs-E3P_OK0U.js","./ConfirmPasswordResetDocs-D_DbjoKG.js","./RequestEmailChangeDocs-SM8dNhMn.js","./ConfirmEmailChangeDocs-4zuP9S10.js","./AuthMethodsDocs-7RQCHeOb.js","./ListExternalAuthsDocs-X9goxYp8.js","./UnlinkExternalAuthDocs-pKf1Zp4R.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/ui/dist/index.html b/ui/dist/index.html index b0f1b131..686644ba 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -47,7 +47,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/src/stores/collections.js b/ui/src/stores/collections.js index c13063a8..a03eb26c 100644 --- a/ui/src/stores/collections.js +++ b/ui/src/stores/collections.js @@ -1,4 +1,4 @@ -import { writable } from "svelte/store"; +import { writable, get } from "svelte/store"; import ApiClient from "@/utils/ApiClient"; import CommonHelper from "@/utils/CommonHelper"; @@ -7,6 +7,20 @@ export const activeCollection = writable({}); export const isCollectionsLoading = writable(false); export const protectedFilesCollectionsCache = writable({}); +let notifyChannel; + +if (typeof BroadcastChannel != "undefined") { + notifyChannel = new BroadcastChannel("collections"); + + notifyChannel.onmessage = () => { + loadCollections(get(activeCollection)?.id) + } +} + +function notifyOtherTabs() { + notifyChannel?.postMessage("reload"); +} + export function changeActiveCollectionById(collectionId) { collections.update((list) => { const found = CommonHelper.findByKey(list, "id", collectionId); @@ -32,6 +46,8 @@ export function addCollection(collection) { refreshProtectedFilesCollectionsCache(); + notifyOtherTabs(); + return CommonHelper.sortCollections(list); }); } @@ -49,6 +65,8 @@ export function removeCollection(collection) { refreshProtectedFilesCollectionsCache(); + notifyOtherTabs(); + return list; }); }