From c8ef3c405003d3acb7de0b1311aee0f060d963ce Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Wed, 16 Aug 2023 22:38:56 +0300 Subject: [PATCH] updated ui/dist --- ...63a36db.js => AuthMethodsDocs-f6471d93.js} | 10 +- ...e19bb1d.js => AuthRefreshDocs-2a227aa4.js} | 12 +- ...f2ab.js => AuthWithOAuth2Docs-e8983e95.js} | 2 +- ...3f.js => AuthWithPasswordDocs-583707fb.js} | 16 +- ui/dist/assets/CodeEditor-04174b89.js | 14 + ui/dist/assets/CodeEditor-8fadd9a5.js | 14 - ....js => ConfirmEmailChangeDocs-18835cec.js} | 10 +- ...s => ConfirmPasswordResetDocs-9860c6ec.js} | 10 +- ...js => ConfirmVerificationDocs-4dc49abd.js} | 8 +- ...-4f05d49f.js => CreateApiDocs-26ff026a.js} | 20 +- ...-85dc6d56.js => DeleteApiDocs-339172a8.js} | 10 +- ...be0d79.js => FieldsQueryParam-d00fc8d6.js} | 2 +- ...js => FilterAutocompleteInput-0a758632.js} | 2 +- ...cs-63cb84c3.js => ListApiDocs-ff0e14ff.js} | 30 +- ...c.js => ListExternalAuthsDocs-e75a87f6.js} | 12 +- ...PageAdminConfirmPasswordReset-3e640056.js} | 2 +- ...PageAdminRequestPasswordReset-147aa187.js} | 2 +- ...7cdd.js => PageOAuth2Redirect-b0382fc8.js} | 2 +- ... PageRecordConfirmEmailChange-b6d59150.js} | 6 +- ...PageRecordConfirmPasswordReset-686cbfc4.js | 4 + ...PageRecordConfirmPasswordReset-c41f6637.js | 4 - ...PageRecordConfirmVerification-b5a8f47c.js} | 4 +- ...f5b9787.js => RealtimeApiDocs-688ce291.js} | 14 +- ....js => RequestEmailChangeDocs-9dfe810b.js} | 10 +- ...s => RequestPasswordResetDocs-e1a9e426.js} | 10 +- ...js => RequestVerificationDocs-dd991b38.js} | 8 +- ui/dist/assets/SdkTabs-0096fda4.js | 1 - ui/dist/assets/SdkTabs-17fc08c7.js | 1 + ....js => UnlinkExternalAuthDocs-b79405e3.js} | 10 +- ...-470faa57.js => UpdateApiDocs-84870d7b.js} | 24 +- ...cs-bddeeafe.js => ViewApiDocs-a8491c7b.js} | 12 +- ui/dist/assets/index-3379c20e.js | 231 -------- ui/dist/assets/index-352a0704.js | 231 ++++++++ .../{index-fd4289fb.js => index-eb24c20e.js} | 16 +- ui/dist/index.html | 2 +- ui/package-lock.json | 528 +++++++++--------- ui/package.json | 2 +- 37 files changed, 648 insertions(+), 648 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-d63a36db.js => AuthMethodsDocs-f6471d93.js} (76%) rename ui/dist/assets/{AuthRefreshDocs-4e19bb1d.js => AuthRefreshDocs-2a227aa4.js} (75%) rename ui/dist/assets/{AuthWithOAuth2Docs-6757f2ab.js => AuthWithOAuth2Docs-e8983e95.js} (97%) rename ui/dist/assets/{AuthWithPasswordDocs-688d563f.js => AuthWithPasswordDocs-583707fb.js} (74%) create mode 100644 ui/dist/assets/CodeEditor-04174b89.js delete mode 100644 ui/dist/assets/CodeEditor-8fadd9a5.js rename ui/dist/assets/{ConfirmEmailChangeDocs-92660280.js => ConfirmEmailChangeDocs-18835cec.js} (86%) rename ui/dist/assets/{ConfirmPasswordResetDocs-8f0f20ec.js => ConfirmPasswordResetDocs-9860c6ec.js} (77%) rename ui/dist/assets/{ConfirmVerificationDocs-c9a2216e.js => ConfirmVerificationDocs-4dc49abd.js} (71%) rename ui/dist/assets/{CreateApiDocs-4f05d49f.js => CreateApiDocs-26ff026a.js} (87%) rename ui/dist/assets/{DeleteApiDocs-85dc6d56.js => DeleteApiDocs-339172a8.js} (74%) rename ui/dist/assets/{FieldsQueryParam-aebe0d79.js => FieldsQueryParam-d00fc8d6.js} (88%) rename ui/dist/assets/{FilterAutocompleteInput-0c84d8aa.js => FilterAutocompleteInput-0a758632.js} (92%) rename ui/dist/assets/{ListApiDocs-63cb84c3.js => ListApiDocs-ff0e14ff.js} (82%) rename ui/dist/assets/{ListExternalAuthsDocs-4a5594ac.js => ListExternalAuthsDocs-e75a87f6.js} (77%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-2ba29ad7.js => PageAdminConfirmPasswordReset-3e640056.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-4a4bbc63.js => PageAdminRequestPasswordReset-147aa187.js} (98%) rename ui/dist/assets/{PageOAuth2Redirect-a1b27cdd.js => PageOAuth2Redirect-b0382fc8.js} (74%) rename ui/dist/assets/{PageRecordConfirmEmailChange-e64c535f.js => PageRecordConfirmEmailChange-b6d59150.js} (73%) create mode 100644 ui/dist/assets/PageRecordConfirmPasswordReset-686cbfc4.js delete mode 100644 ui/dist/assets/PageRecordConfirmPasswordReset-c41f6637.js rename ui/dist/assets/{PageRecordConfirmVerification-2bcbd7e4.js => PageRecordConfirmVerification-b5a8f47c.js} (77%) rename ui/dist/assets/{RealtimeApiDocs-cf5b9787.js => RealtimeApiDocs-688ce291.js} (94%) rename ui/dist/assets/{RequestEmailChangeDocs-2c584fa4.js => RequestEmailChangeDocs-9dfe810b.js} (75%) rename ui/dist/assets/{RequestPasswordResetDocs-1b1b244e.js => RequestPasswordResetDocs-e1a9e426.js} (74%) rename ui/dist/assets/{RequestVerificationDocs-1d25bdc1.js => RequestVerificationDocs-dd991b38.js} (66%) delete mode 100644 ui/dist/assets/SdkTabs-0096fda4.js create mode 100644 ui/dist/assets/SdkTabs-17fc08c7.js rename ui/dist/assets/{UnlinkExternalAuthDocs-12d77ab0.js => UnlinkExternalAuthDocs-b79405e3.js} (87%) rename ui/dist/assets/{UpdateApiDocs-470faa57.js => UpdateApiDocs-84870d7b.js} (85%) rename ui/dist/assets/{ViewApiDocs-bddeeafe.js => ViewApiDocs-a8491c7b.js} (79%) delete mode 100644 ui/dist/assets/index-3379c20e.js create mode 100644 ui/dist/assets/index-352a0704.js rename ui/dist/assets/{index-fd4289fb.js => index-eb24c20e.js} (83%) diff --git a/ui/dist/assets/AuthMethodsDocs-d63a36db.js b/ui/dist/assets/AuthMethodsDocs-f6471d93.js similarity index 76% rename from ui/dist/assets/AuthMethodsDocs-d63a36db.js rename to ui/dist/assets/AuthMethodsDocs-f6471d93.js index b5da7c66..ade1797d 100644 --- a/ui/dist/assets/AuthMethodsDocs-d63a36db.js +++ b/ui/dist/assets/AuthMethodsDocs-f6471d93.js @@ -1,4 +1,4 @@ -import{S as $e,i as Se,s as ye,e as c,w,b as k,c as oe,f as h,g as d,h as a,m as se,x as G,N as we,P as Te,k as je,Q as Ae,n as Be,t as U,a as W,o as u,d as ae,C as Fe,p as Oe,r as V,u as Qe,M as Ne}from"./index-3379c20e.js";import{S as He}from"./SdkTabs-0096fda4.js";import{F as Ke}from"./FieldsQueryParam-aebe0d79.js";function ve(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l){let o,s=l[5].code+"",_,p,i,f;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),p=k(),h(o,"class","tab-item"),V(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,p),i||(f=Qe(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&V(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,f()}}}function Me(n,l){let o,s,_,p;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),oe(s.$$.fragment),_=k(),h(o,"class","tab-item"),V(o,"active",l[1]===l[5].code),this.first=o},m(i,f){d(i,o,f),se(s,o,null),a(o,_),p=!0},p(i,f){l=i;const m={};f&4&&(m.content=l[5].body),s.$set(m),(!p||f&6)&&V(o,"active",l[1]===l[5].code)},i(i){p||(U(s.$$.fragment,i),p=!0)},o(i){W(s.$$.fragment,i),p=!1},d(i){i&&u(o),ae(s)}}}function qe(n){var _e,be;let l,o,s=n[0].name+"",_,p,i,f,m,v,C,H=n[0].name+"",L,ne,E,P,I,j,J,M,K,ie,q,A,ce,Y,z=n[0].name+"",X,re,R,B,Z,$,x,de,ee,T,te,F,le,S,O,g=[],ue=new Map,fe,Q,b=[],me=new Map,y;P=new He({props:{js:` +import{S as Me,i as Se,s as ye,e as c,w,b as k,c as oe,f as h,g as d,h as a,m as se,x as G,O as we,P as Te,k as je,Q as Ae,n as Be,t as U,a as W,o as u,d as ae,C as Oe,p as Fe,r as V,u as Qe,N as Ne}from"./index-352a0704.js";import{S as He}from"./SdkTabs-17fc08c7.js";import{F as Ke}from"./FieldsQueryParam-d00fc8d6.js";function ve(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l){let o,s=l[5].code+"",_,p,i,f;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),p=k(),h(o,"class","tab-item"),V(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,p),i||(f=Qe(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&V(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,f()}}}function $e(n,l){let o,s,_,p;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),oe(s.$$.fragment),_=k(),h(o,"class","tab-item"),V(o,"active",l[1]===l[5].code),this.first=o},m(i,f){d(i,o,f),se(s,o,null),a(o,_),p=!0},p(i,f){l=i;const m={};f&4&&(m.content=l[5].body),s.$set(m),(!p||f&6)&&V(o,"active",l[1]===l[5].code)},i(i){p||(U(s.$$.fragment,i),p=!0)},o(i){W(s.$$.fragment,i),p=!1},d(i){i&&u(o),ae(s)}}}function qe(n){var _e,be;let l,o,s=n[0].name+"",_,p,i,f,m,v,C,H=n[0].name+"",L,ne,E,P,I,j,J,$,K,ie,q,A,ce,Y,z=n[0].name+"",X,re,R,B,Z,M,x,de,ee,T,te,O,le,S,F,g=[],ue=new Map,fe,Q,b=[],me=new Map,y;P=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); @@ -14,9 +14,9 @@ import{S as $e,i as Se,s as ye,e as c,w,b as k,c as oe,f as h,g as d,h as a,m as ... final result = await pb.collection('${(be=n[0])==null?void 0:be.name}').listAuthMethods(); - `}}),T=new Ke({});let D=n[2];const pe=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam + `}}),T=new Ke({});let D=n[2];const pe=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type - Description`,de=k(),ee=c("tbody"),oe(T.$$.fragment),te=k(),F=c("div"),F.textContent="Responses",le=k(),S=c("div"),O=c("div");for(let e=0;eDescription`,de=k(),ee=c("tbody"),oe(T.$$.fragment),te=k(),O=c("div"),O.textContent="Responses",le=k(),S=c("div"),F=c("div");for(let e=0;eo(1,p=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Fe.getApiExampleUrl(Oe.baseUrl)),o(2,i=[{code:200,body:` + `),P.$set(r),(!y||t&1)&&z!==(z=e[0].name+"")&&G(X,z),t&6&&(D=e[2],g=we(g,t,pe,1,e,D,ue,F,Te,Pe,null,Ce)),t&6&&(N=e[2],je(),b=we(b,t,he,1,e,N,me,Q,Ae,$e,null,ve),Be())},i(e){if(!y){U(P.$$.fragment,e),U(T.$$.fragment,e);for(let t=0;to(1,p=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Oe.getApiExampleUrl(Fe.baseUrl)),o(2,i=[{code:200,body:` { "usernamePassword": true, "emailPassword": true, @@ -63,4 +63,4 @@ import{S as $e,i as Se,s as ye,e as c,w,b as k,c as oe,f as h,g as d,h as a,m as } ] } - `}]),[_,p,i,s,f]}class We extends $e{constructor(l){super(),Se(this,l,ze,qe,ye,{collection:0})}}export{We as default}; + `}]),[_,p,i,s,f]}class We extends Me{constructor(l){super(),Se(this,l,ze,qe,ye,{collection:0})}}export{We as default}; diff --git a/ui/dist/assets/AuthRefreshDocs-4e19bb1d.js b/ui/dist/assets/AuthRefreshDocs-2a227aa4.js similarity index 75% rename from ui/dist/assets/AuthRefreshDocs-4e19bb1d.js rename to ui/dist/assets/AuthRefreshDocs-2a227aa4.js index 33cab3f0..954fb83b 100644 --- a/ui/dist/assets/AuthRefreshDocs-4e19bb1d.js +++ b/ui/dist/assets/AuthRefreshDocs-2a227aa4.js @@ -1,4 +1,4 @@ -import{S as Ue,i as je,s as xe,M as Qe,e as s,w as k,b as p,c as J,f as b,g as d,h as o,m as K,x as ce,N as Oe,P as Je,k as Ke,Q as Ie,n as We,t as N,a as V,o as u,d as I,C as Ee,p as Ge,r as W,u as Xe}from"./index-3379c20e.js";import{S as Ye}from"./SdkTabs-0096fda4.js";import{F as Ze}from"./FieldsQueryParam-aebe0d79.js";function Le(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l){let a,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m($,w){d($,a,w),o(a,m),o(a,_),i||(f=Xe(a,"click",v),i=!0)},p($,w){l=$,w&4&&n!==(n=l[5].code+"")&&ce(m,n),w&6&&W(a,"active",l[1]===l[5].code)},d($){$&&u(a),i=!1,f()}}}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"),J(n.$$.fragment),m=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m(i,f){d(i,a,f),K(n,a,null),o(a,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&W(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),I(n)}}}function et(r){var qe,De;let l,a,n=r[0].name+"",m,_,i,f,v,$,w,B,G,S,z,de,Q,q,ue,X,U=r[0].name+"",Y,pe,fe,j,Z,D,ee,T,te,he,F,C,oe,be,le,me,h,_e,R,ke,ve,$e,ae,ge,se,ye,Se,we,ne,Te,Ce,M,re,H,ie,P,O,y=[],Pe=new Map,Re,E,g=[],Me=new Map,A;$=new Ye({props:{js:` +import{S as Ue,i as je,s as xe,N as Qe,e as s,w as k,b as p,c as J,f as b,g as d,h as o,m as K,x as ce,O as He,P as Je,k as Ke,Q as Ie,n as We,t as N,a as V,o as u,d as I,C as Ee,p as Ge,r as W,u as Xe}from"./index-352a0704.js";import{S as Ye}from"./SdkTabs-17fc08c7.js";import{F as Ze}from"./FieldsQueryParam-d00fc8d6.js";function Le(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l){let a,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m($,w){d($,a,w),o(a,m),o(a,_),i||(f=Xe(a,"click",v),i=!0)},p($,w){l=$,w&4&&n!==(n=l[5].code+"")&&ce(m,n),w&6&&W(a,"active",l[1]===l[5].code)},d($){$&&u(a),i=!1,f()}}}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"),J(n.$$.fragment),m=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m(i,f){d(i,a,f),K(n,a,null),o(a,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&W(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),I(n)}}}function et(r){var qe,De;let l,a,n=r[0].name+"",m,_,i,f,v,$,w,M,G,S,z,de,Q,q,ue,X,U=r[0].name+"",Y,pe,fe,j,Z,D,ee,T,te,he,F,C,oe,be,le,me,h,_e,R,ke,ve,$e,ae,ge,se,ye,Se,we,ne,Te,Ce,A,re,O,ie,P,H,y=[],Pe=new Map,Re,E,g=[],Ae=new Map,B;$=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); @@ -24,10 +24,10 @@ import{S as Ue,i as je,s as xe,M as Qe,e as s,w as k,b as p,c as J,f as b,g as d print(pb.authStore.isValid); print(pb.authStore.token); print(pb.authStore.model.id); - `}}),R=new Qe({props:{content:"?expand=relField1,relField2.subRelField"}}),M=new Ze({});let x=r[2];const Ae=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 Qe({props:{content:"?expand=relField1,relField2.subRelField"}}),A=new Ze({});let x=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.

`,v=p(),J($.$$.fragment),w=p(),B=s("h6"),B.textContent="API details",G=p(),S=s("div"),z=s("strong"),z.textContent="POST",de=p(),Q=s("div"),q=s("p"),ue=k("/api/collections/"),X=s("strong"),Y=k(U),pe=k("/auth-refresh"),fe=p(),j=s("p"),j.innerHTML="Requires record Authorization:TOKEN header",Z=p(),D=s("div"),D.textContent="Query parameters",ee=p(),T=s("table"),te=s("thead"),te.innerHTML=`Param + data in pb.authStore is still valid and up-to-date.

`,v=p(),J($.$$.fragment),w=p(),M=s("h6"),M.textContent="API details",G=p(),S=s("div"),z=s("strong"),z.textContent="POST",de=p(),Q=s("div"),q=s("p"),ue=k("/api/collections/"),X=s("strong"),Y=k(U),pe=k("/auth-refresh"),fe=p(),j=s("p"),j.innerHTML="Requires record Authorization:TOKEN header",Z=p(),D=s("div"),D.textContent="Query parameters",ee=p(),T=s("table"),te=s("thead"),te.innerHTML=`Param Type Description`,he=p(),F=s("tbody"),C=s("tr"),oe=s("td"),oe.textContent="expand",be=p(),le=s("td"),le.innerHTML='String',me=p(),h=s("td"),_e=k(`Auto expand record relations. Ex.: `),J(R.$$.fragment),ke=k(` @@ -35,7 +35,7 @@ import{S as Ue,i as je,s as xe,M as Qe,e as s,w as k,b as p,c as J,f as b,g as d The expanded relations will be appended to the record under the `),ae=s("code"),ae.textContent="expand",ge=k(" property (eg. "),se=s("code"),se.textContent='"expand": {"relField1": {...}, ...}',ye=k(`). `),Se=s("br"),we=k(` - Only the relations to which the request user has permissions to `),ne=s("strong"),ne.textContent="view",Te=k(" will be expanded."),Ce=p(),J(M.$$.fragment),re=p(),H=s("div"),H.textContent="Responses",ie=p(),P=s("div"),O=s("div");for(let e=0;ea(1,_=v.code);return r.$$set=v=>{"collection"in v&&a(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Ee.dummyCollectionRecord(m)},null,2)},{code:401,body:` + `),$.$set(c),(!B||t&1)&&U!==(U=e[0].name+"")&&ce(Y,U),t&6&&(x=e[2],y=He(y,t,Be,1,e,x,Pe,H,Je,Ve,null,Ne)),t&6&&(L=e[2],Ke(),g=He(g,t,Me,1,e,L,Ae,E,Ie,ze,null,Le),We())},i(e){if(!B){N($.$$.fragment,e),N(R.$$.fragment,e),N(A.$$.fragment,e);for(let t=0;ta(1,_=v.code);return r.$$set=v=>{"collection"in v&&a(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Ee.dummyCollectionRecord(m)},null,2)},{code:401,body:` { "code": 401, "message": "The request requires valid record authorization token to be set.", diff --git a/ui/dist/assets/AuthWithOAuth2Docs-6757f2ab.js b/ui/dist/assets/AuthWithOAuth2Docs-e8983e95.js similarity index 97% rename from ui/dist/assets/AuthWithOAuth2Docs-6757f2ab.js rename to ui/dist/assets/AuthWithOAuth2Docs-e8983e95.js index c1091382..de4e23ea 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-6757f2ab.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-e8983e95.js @@ -1,4 +1,4 @@ -import{S as Ve,i as Le,s as Ee,M as je,e as s,w as k,b as h,c as z,f as p,g as r,h as a,m as I,x as he,N as xe,P as Je,k as Ne,Q as Qe,n as ze,t as V,a as L,o as c,d as K,C as We,p as Ie,r as G,u as Ke}from"./index-3379c20e.js";import{S as Ge}from"./SdkTabs-0096fda4.js";import{F as Xe}from"./FieldsQueryParam-aebe0d79.js";function Ue(i,l,o){const n=i.slice();return n[5]=l[o],n}function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l){let o,n=l[5].code+"",m,g,u,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=k(n),g=h(),p(o,"class","tab-item"),G(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,m),a(o,g),u||(b=Ke(o,"click",_),u=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&he(m,n),A&6&&G(o,"active",l[1]===l[5].code)},d(v){v&&c(o),u=!1,b()}}}function He(i,l){let o,n,m,g;return n=new je({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),z(n.$$.fragment),m=h(),p(o,"class","tab-item"),G(o,"active",l[1]===l[5].code),this.first=o},m(u,b){r(u,o,b),I(n,o,null),a(o,m),g=!0},p(u,b){l=u;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&G(o,"active",l[1]===l[5].code)},i(u){g||(V(n.$$.fragment,u),g=!0)},o(u){L(n.$$.fragment,u),g=!1},d(u){u&&c(o),K(n)}}}function Ye(i){let l,o,n=i[0].name+"",m,g,u,b,_,v,A,P,X,S,E,pe,J,M,be,Y,N=i[0].name+"",Z,fe,ee,R,te,x,ae,W,le,y,oe,me,U,$,se,ge,ne,ke,f,_e,C,ve,we,Oe,ie,Ae,re,Se,ye,$e,ce,Te,Ce,q,ue,B,de,T,F,O=[],qe=new Map,De,H,w=[],Pe=new Map,D;v=new Ge({props:{js:` +import{S as Ve,i as Le,s as Ee,N as je,e as s,w as k,b as h,c as z,f as p,g as r,h as a,m as I,x as he,O as xe,P as Je,k as Ne,Q as Qe,n as ze,t as V,a as L,o as c,d as K,C as We,p as Ie,r as G,u as Ke}from"./index-352a0704.js";import{S as Ge}from"./SdkTabs-17fc08c7.js";import{F as Xe}from"./FieldsQueryParam-d00fc8d6.js";function Ue(i,l,o){const n=i.slice();return n[5]=l[o],n}function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l){let o,n=l[5].code+"",m,g,u,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=k(n),g=h(),p(o,"class","tab-item"),G(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,m),a(o,g),u||(b=Ke(o,"click",_),u=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&he(m,n),A&6&&G(o,"active",l[1]===l[5].code)},d(v){v&&c(o),u=!1,b()}}}function He(i,l){let o,n,m,g;return n=new je({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),z(n.$$.fragment),m=h(),p(o,"class","tab-item"),G(o,"active",l[1]===l[5].code),this.first=o},m(u,b){r(u,o,b),I(n,o,null),a(o,m),g=!0},p(u,b){l=u;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&G(o,"active",l[1]===l[5].code)},i(u){g||(V(n.$$.fragment,u),g=!0)},o(u){L(n.$$.fragment,u),g=!1},d(u){u&&c(o),K(n)}}}function Ye(i){let l,o,n=i[0].name+"",m,g,u,b,_,v,A,P,X,S,E,pe,J,M,be,Y,N=i[0].name+"",Z,fe,ee,R,te,x,ae,W,le,y,oe,me,U,$,se,ge,ne,ke,f,_e,C,ve,we,Oe,ie,Ae,re,Se,ye,$e,ce,Te,Ce,q,ue,B,de,T,F,O=[],qe=new Map,De,H,w=[],Pe=new Map,D;v=new Ge({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-688d563f.js b/ui/dist/assets/AuthWithPasswordDocs-583707fb.js similarity index 74% rename from ui/dist/assets/AuthWithPasswordDocs-688d563f.js rename to ui/dist/assets/AuthWithPasswordDocs-583707fb.js index 41ad3d31..193c442c 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-688d563f.js +++ b/ui/dist/assets/AuthWithPasswordDocs-583707fb.js @@ -1,4 +1,4 @@ -import{S as we,i as ye,s as ge,M as ve,e as s,w as f,b as d,c as at,f as h,g as r,h as e,m as st,x as Ut,N as ue,P as $e,k as Pe,Q as Re,n as Ce,t as Z,a as x,o as c,d as nt,C as fe,p as Ae,r as it,u as Oe}from"./index-3379c20e.js";import{S as Te}from"./SdkTabs-0096fda4.js";import{F as Me}from"./FieldsQueryParam-aebe0d79.js";function pe(n,l,o){const i=n.slice();return i[8]=l[o],i}function be(n,l,o){const i=n.slice();return i[8]=l[o],i}function Ue(n){let l;return{c(){l=f("email")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function De(n){let l;return{c(){l=f("username")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function Ee(n){let l;return{c(){l=f("username/email")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function me(n){let l;return{c(){l=s("strong"),l.textContent="username"},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function he(n){let l;return{c(){l=f("or")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function _e(n){let l;return{c(){l=s("strong"),l.textContent="email"},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function ke(n,l){let o,i=l[8].code+"",S,m,p,u;function _(){return l[7](l[8])}return{key:n,first:null,c(){o=s("button"),S=f(i),m=d(),h(o,"class","tab-item"),it(o,"active",l[3]===l[8].code),this.first=o},m(R,C){r(R,o,C),e(o,S),e(o,m),p||(u=Oe(o,"click",_),p=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Ut(S,i),C&24&&it(o,"active",l[3]===l[8].code)},d(R){R&&c(o),p=!1,u()}}}function Se(n,l){let o,i,S,m;return i=new ve({props:{content:l[8].body}}),{key:n,first:null,c(){o=s("div"),at(i.$$.fragment),S=d(),h(o,"class","tab-item"),it(o,"active",l[3]===l[8].code),this.first=o},m(p,u){r(p,o,u),st(i,o,null),e(o,S),m=!0},p(p,u){l=p;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!m||u&24)&&it(o,"active",l[3]===l[8].code)},i(p){m||(Z(i.$$.fragment,p),m=!0)},o(p){x(i.$$.fragment,p),m=!1},d(p){p&&c(o),nt(i)}}}function We(n){var ie,re;let l,o,i=n[0].name+"",S,m,p,u,_,R,C,A,B,Dt,rt,T,ct,N,dt,M,tt,Et,et,I,Wt,ut,lt=n[0].name+"",ft,Lt,pt,V,bt,U,mt,Bt,Q,D,ht,qt,_t,Ft,$,Ht,kt,St,vt,Yt,wt,yt,j,gt,E,$t,Nt,J,W,Pt,It,Rt,Vt,k,Qt,q,jt,Jt,Kt,Ct,zt,At,Gt,Xt,Zt,Ot,xt,te,F,Tt,K,Mt,L,z,O=[],ee=new Map,le,G,v=[],oe=new Map,H;function ae(t,a){if(t[1]&&t[2])return Ee;if(t[1])return De;if(t[2])return Ue}let Y=ae(n),P=Y&&Y(n);T=new Te({props:{js:` +import{S as we,i as ye,s as ge,N as ve,e as s,w as f,b as d,c as at,f as h,g as r,h as e,m as st,x as Mt,O as ue,P as $e,k as Pe,Q as Re,n as Ce,t as Z,a as x,o as c,d as nt,C as fe,p as Oe,r as it,u as Ae}from"./index-352a0704.js";import{S as Te}from"./SdkTabs-17fc08c7.js";import{F as Ue}from"./FieldsQueryParam-d00fc8d6.js";function pe(n,l,o){const i=n.slice();return i[8]=l[o],i}function be(n,l,o){const i=n.slice();return i[8]=l[o],i}function Me(n){let l;return{c(){l=f("email")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function De(n){let l;return{c(){l=f("username")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function Ee(n){let l;return{c(){l=f("username/email")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function me(n){let l;return{c(){l=s("strong"),l.textContent="username"},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function he(n){let l;return{c(){l=f("or")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function _e(n){let l;return{c(){l=s("strong"),l.textContent="email"},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function ke(n,l){let o,i=l[8].code+"",S,m,p,u;function _(){return l[7](l[8])}return{key:n,first:null,c(){o=s("button"),S=f(i),m=d(),h(o,"class","tab-item"),it(o,"active",l[3]===l[8].code),this.first=o},m(R,C){r(R,o,C),e(o,S),e(o,m),p||(u=Ae(o,"click",_),p=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Mt(S,i),C&24&&it(o,"active",l[3]===l[8].code)},d(R){R&&c(o),p=!1,u()}}}function Se(n,l){let o,i,S,m;return i=new ve({props:{content:l[8].body}}),{key:n,first:null,c(){o=s("div"),at(i.$$.fragment),S=d(),h(o,"class","tab-item"),it(o,"active",l[3]===l[8].code),this.first=o},m(p,u){r(p,o,u),st(i,o,null),e(o,S),m=!0},p(p,u){l=p;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!m||u&24)&&it(o,"active",l[3]===l[8].code)},i(p){m||(Z(i.$$.fragment,p),m=!0)},o(p){x(i.$$.fragment,p),m=!1},d(p){p&&c(o),nt(i)}}}function We(n){var ie,re;let l,o,i=n[0].name+"",S,m,p,u,_,R,C,O,B,Dt,rt,T,ct,N,dt,U,tt,Et,et,I,Wt,ut,lt=n[0].name+"",ft,Lt,pt,V,bt,M,mt,Bt,Q,D,ht,qt,_t,Ft,$,Ht,kt,St,vt,Yt,wt,yt,j,gt,E,$t,Nt,J,W,Pt,It,Rt,Vt,k,Qt,q,jt,Jt,Kt,Ct,zt,Ot,Gt,Xt,Zt,At,xt,te,F,Tt,K,Ut,L,z,A=[],ee=new Map,le,G,v=[],oe=new Map,H;function ae(t,a){if(t[1]&&t[2])return Ee;if(t[1])return De;if(t[2])return Me}let Y=ae(n),P=Y&&Y(n);T=new Te({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[6]}'); @@ -36,9 +36,9 @@ import{S as we,i as ye,s as ge,M as ve,e as s,w as f,b as d,c as at,f as h,g as // "logout" the last authenticated account pb.authStore.clear(); - `}});let w=n[1]&&me(),y=n[1]&&n[2]&&he(),g=n[2]&&_e();q=new ve({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Me({});let ot=n[4];const se=t=>t[8].code;for(let t=0;tt[8].code;for(let t=0;tParam + `}});let w=n[1]&&me(),y=n[1]&&n[2]&&he(),g=n[2]&&_e();q=new ve({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Ue({});let ot=n[4];const se=t=>t[8].code;for(let t=0;tt[8].code;for(let t=0;tParam Type Description`,Bt=d(),Q=s("tbody"),D=s("tr"),ht=s("td"),ht.innerHTML=`
Required identity
`,qt=d(),_t=s("td"),_t.innerHTML='String',Ft=d(),$=s("td"),Ht=f(`The @@ -52,9 +52,9 @@ import{S as we,i as ye,s as ge,M as ve,e as s,w as f,b as d,c as at,f as h,g as `),at(q.$$.fragment),jt=f(` Supports up to 6-levels depth nested relations expansion. `),Jt=s("br"),Kt=f(` The expanded relations will be appended to the record under the - `),Ct=s("code"),Ct.textContent="expand",zt=f(" property (eg. "),At=s("code"),At.textContent='"expand": {"relField1": {...}, ...}',Gt=f(`). + `),Ct=s("code"),Ct.textContent="expand",zt=f(" property (eg. "),Ot=s("code"),Ot.textContent='"expand": {"relField1": {...}, ...}',Gt=f(`). `),Xt=s("br"),Zt=f(` - Only the relations to which the request user has permissions to `),Ot=s("strong"),Ot.textContent="view",xt=f(" will be expanded."),te=d(),at(F.$$.fragment),Tt=d(),K=s("div"),K.textContent="Responses",Mt=d(),L=s("div"),z=s("div");for(let t=0;to(3,_=A.code);return n.$$set=A=>{"collection"in A&&o(0,u=A.collection)},n.$$.update=()=>{var A,B;n.$$.dirty&1&&o(2,S=(A=u==null?void 0:u.options)==null?void 0:A.allowEmailAuth),n.$$.dirty&1&&o(1,m=(B=u==null?void 0:u.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&o(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&o(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:fe.dummyCollectionRecord(u)},null,2)},{code:400,body:` + `),T.$set(b),(!H||a&1)&<!==(lt=t[0].name+"")&&Mt(ft,lt),t[1]?w||(w=me(),w.c(),w.m($,kt)):w&&(w.d(1),w=null),t[1]&&t[2]?y||(y=he(),y.c(),y.m($,St)):y&&(y.d(1),y=null),t[2]?g||(g=_e(),g.c(),g.m($,vt)):g&&(g.d(1),g=null),a&24&&(ot=t[4],A=ue(A,a,se,1,t,ot,ee,z,$e,ke,null,be)),a&24&&(X=t[4],Pe(),v=ue(v,a,ne,1,t,X,oe,G,Re,Se,null,pe),Ce())},i(t){if(!H){Z(T.$$.fragment,t),Z(q.$$.fragment,t),Z(F.$$.fragment,t);for(let a=0;ao(3,_=O.code);return n.$$set=O=>{"collection"in O&&o(0,u=O.collection)},n.$$.update=()=>{var O,B;n.$$.dirty&1&&o(2,S=(O=u==null?void 0:u.options)==null?void 0:O.allowEmailAuth),n.$$.dirty&1&&o(1,m=(B=u==null?void 0:u.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&o(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&o(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:fe.dummyCollectionRecord(u)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -103,4 +103,4 @@ import{S as we,i as ye,s as ge,M as ve,e as s,w as f,b as d,c as at,f as h,g as } } } - `}])},o(6,i=fe.getApiExampleUrl(Ae.baseUrl)),[u,m,S,_,R,p,i,C]}class He extends we{constructor(l){super(),ye(this,l,Le,We,ge,{collection:0})}}export{He as default}; + `}])},o(6,i=fe.getApiExampleUrl(Oe.baseUrl)),[u,m,S,_,R,p,i,C]}class He extends we{constructor(l){super(),ye(this,l,Le,We,ge,{collection:0})}}export{He as default}; diff --git a/ui/dist/assets/CodeEditor-04174b89.js b/ui/dist/assets/CodeEditor-04174b89.js new file mode 100644 index 00000000..239cdbbb --- /dev/null +++ b/ui/dist/assets/CodeEditor-04174b89.js @@ -0,0 +1,14 @@ +import{S as $t,i as gt,s as mt,e as Xt,f as Pt,T as J,g as Zt,y as ze,o as bt,J as kt,K as xt,L as wt,I as yt,C as Yt,M as Tt}from"./index-352a0704.js";import{P as vt,N as Ut,u as Vt,D as Rt,v as Te,T as L,I as ve,w as oe,x as n,y as _t,L as ce,z as Qe,A as E,B as ue,F as xO,G as fe,H as q,J as wO,K as yO,M as YO,E as U,O as N,Q as Ct,R as Wt,U as TO,V as P,W as qt,X as jt,a as j,h as zt,b as Gt,c as It,d as At,e as Et,s as Nt,t as Bt,f as Dt,g as Jt,r as Mt,i as Lt,k as Ft,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as M}from"./index-eb24c20e.js";class ee{constructor(e,a,t,i,s,r,l,o,Q,f=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=i,this.pos=s,this.score=r,this.buffer=l,this.bufferBase=o,this.curContext=Q,this.lookAhead=f,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 i=e.parser.context;return new ee(e,[],a,t,t,0,[],0,i?new Ie(i,i.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,i=e&65535,{parser:s}=this.p,r=s.dynamicPrecedence(i);if(r&&(this.score+=r),t==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((a=this.p.parser.nodeSet.types[i])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,a,t,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&r.buffer[l-4]==0&&r.buffer[l-1]>-1){if(a==t)return;if(r.buffer[l-2]>=a){r.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,i);else{let r=this.buffer.length;if(r>0&&this.buffer[r-4]!=0)for(;r>0&&this.buffer[r-2]>t;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4);this.buffer[r]=e,this.buffer[r+1]=a,this.buffer[r+2]=t,this.buffer[r+3]=i}}shift(e,a,t){let i=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=t,this.shiftContext(a,i),a<=this.p.parser.maxNode&&this.buffer.push(a,i,t,4);else{let s=e,{parser:r}=this.p;(t>this.pos||a<=r.maxNode)&&(this.pos=t,r.stateFlag(s,1)||(this.reducePos=t)),this.pushState(s,i),this.shiftContext(a,i),a<=r.maxNode&&this.buffer.push(a,i,t,4)}}apply(e,a,t){e&65536?this.reduce(e):this.shift(e,a,t)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(a,i),this.buffer.push(t,i,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),i=e.bufferBase+a;for(;e&&i==e.bufferBase;)e=e.parent;return new ee(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,i,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 ia(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 i=[];for(let s=0,r;so&1&&l==r)||i.push(a[s],r)}a=i}let t=[];for(let i=0;i>19,i=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;a=r}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=(i,s)=>{if(!a.includes(i))return a.push(i),e.allActions(i,r=>{if(!(r&393216))if(r&65536){let l=(r>>19)-s;if(l>1){let o=r&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}else{let l=t(r,s+1);if(l!=null)return l}})};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.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 Ie{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}var Ae;(function(O){O[O.Insert=200]="Insert",O[O.Delete=190]="Delete",O[O.Reduce=100]="Reduce",O[O.MaxNext=4]="MaxNext",O[O.MaxInsertStackDepth=300]="MaxInsertStackDepth",O[O.DampenInsertStackDepth=120]="DampenInsertStackDepth",O[O.MinBigReduction=2e3]="MinBigReduction"})(Ae||(Ae={}));class ia{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 i=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=i}}class Oe{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 Oe(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 Oe(this.stack,this.pos,this.index)}}function A(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,i=0;t=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}a?a[i++]=s:a=new e(s)}return a}class F{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ee=new F;class ra{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ee,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,i=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];s+=r.from-t.to,t=r}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,i;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}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=Ee,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 i of this.ranges){if(i.from>=a)break;i.to>e&&(t+=this.input.read(Math.max(i.from,e),Math.min(i.to,a)))}return t}}class _{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;vO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}_.prototype.contextual=_.prototype.fallback=_.prototype.extend=!1;class te{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?A(e):e}token(e,a){let t=e.pos,i=0;for(;;){let s=e.next<0,r=e.resolveOffset(1,1);if(vO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,r==null)break;e.reset(r,e.token)}i&&(e.reset(t,e.token),e.acceptToken(this.elseToken,i))}}te.prototype.contextual=_.prototype.fallback=_.prototype.extend=!1;class b{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function vO(O,e,a,t,i,s){let r=0,l=1<0){let p=O[u];if(o.allows(p)&&(e.token.value==-1||e.token.value==p||sa(p,e.token.value,i,s))){e.acceptToken(p);break}}let f=e.next,c=0,h=O[r+2];if(e.next<0&&h>c&&O[Q+h*3-3]==65535&&O[Q+h*3-3]==65535){r=O[Q+h*3-1];continue e}for(;c>1,p=Q+u+(u<<1),g=O[p],$=O[p+1]||65536;if(f=$)c=u+1;else{r=O[p+2],e.advance();continue e}}break}}function Ne(O,e,a){for(let t=e,i;(i=O[t])!=65535;t++)if(i==a)return t-e;return-1}function sa(O,e,a,t){let i=Ne(a,t,e);return i<0||Ne(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 la{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?De(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?De(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=r,null;if(s instanceof L){if(r==e){if(r=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(r),this.index.push(0))}else this.index[a]++,this.nextStart=r+s.length}}}class na{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new F)}getActions(e){let a=0,t=null,{parser:i}=e.p,{tokenizers:s}=i,r=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let h=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!f.extend&&(t=c,a>h))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!t&&e.pos==this.stream.end&&(t=new F,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 F,{pos:t,p:i}=e;return a.start=t,a.end=Math.min(t+1,i.stream.end),a.value=t==i.stream.end?i.parser.eofTerm:0,a}updateCachedToken(e,a,t){let i=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(i,e),t),e.value>-1){let{parser:s}=t.p;for(let r=0;r=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,a,t,i){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[r]=e;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;ra)t.push(l);else{if(this.advanceStack(l,t,e))continue;{i||(i=[],s=[]),i.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!t.length){let r=i&&Qa(i);if(r)return this.stackToTree(r);if(this.parser.strict)throw Z&&i&&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&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,t);if(r)return this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(t.length>r)for(t.sort((l,o)=>o.score-l.score);t.length>r;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let r=0;r500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(r--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let r=1;r ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,f=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(i);c;){let h=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(h>-1&&c.length&&(!Q||(c.prop(Te.contextHash)||0)==f))return e.useNode(c,h),Z&&console.log(r+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof L)||c.children.length==0||c.positions[0]>0)break;let u=c.children[0];if(u instanceof L&&c.positions[0]==0)c=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(r+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qi?a.push(p):t.push(p)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Me(e,a),!0}}runRecovery(e,a,t){let i=null,s=!1;for(let r=0;r ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(f+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),h=f;for(let u=0;c.forceReduce()&&u<10&&(Z&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));u++)Z&&(h=this.stackID(c)+" -> ");for(let u of l.recoverByInsert(o))Z&&console.log(f+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(f+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),Me(l,t)):(!i||i.scoreO;class UO{constructor(e){this.start=e.start,this.shift=e.shift||de,this.reduce=e.reduce||de,this.reuse=e.reuse||de,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class V extends vt{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 l=0;le.topRules[l][1]),i=[];for(let l=0;l=0)s(f,o,l[Q++]);else{let c=l[Q+-f];for(let h=-f;h>0;h--)s(l[Q++],o,c);Q++}}}this.nodeSet=new Ut(a.map((l,o)=>Vt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:i[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Rt;let r=A(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new _(r,l):l),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 i=new oa(this,e,a,t);for(let s of this.wrappers)i=s(i,e,a,t);return i}getGoto(e,a,t=!1){let i=this.goto;if(a>=i[0])return-1;for(let s=i[a+1];;){let r=i[s++],l=r&1,o=i[s++];if(l&&t)return o;for(let Q=s+(r>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),i=t?a(t):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=x(this.data,s+2);else break;i=a(x(this.data,s+1))}return i}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 i=this.data[t+1];a.some((s,r)=>r&1&&s==i)||a.push(this.data[t],i)}}return a}configure(e){let a=Object.assign(Object.create(V.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 i=e.tokenizers.find(s=>s.from==t);return i?i.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,i)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let r=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[i]=Le(r),r})),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 r=a.indexOf(s);r>=0&&(t[r]=!0)}let i=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 ua=54,fa=1,ha=55,da=2,pa=56,Sa=3,Fe=4,$a=5,ae=6,VO=7,RO=8,_O=9,CO=10,ga=11,ma=12,Xa=13,pe=57,Pa=14,Ke=58,WO=20,Za=22,qO=23,ba=24,ke=26,jO=27,ka=28,xa=31,wa=34,ya=36,Ya=37,Ta=0,va=1,Ua={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},Va={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},He={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 Ra(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function zO(O){return O==9||O==10||O==13||O==32}let eO=null,OO=null,tO=0;function xe(O,e){let a=O.pos+e;if(tO==a&&OO==O)return eO;let t=O.peek(e);for(;zO(t);)t=O.peek(++e);let i="";for(;Ra(t);)i+=String.fromCharCode(t),t=O.peek(++e);return OO=O,tO=a,eO=i?i.toLowerCase():t==_a||t==Ca?void 0:null}const GO=60,ie=62,Ue=47,_a=63,Ca=33,Wa=45;function aO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new aO(xe(t,1)||"",O):O},reduce(O,e){return e==WO&&O?O.parent:O},reuse(O,e,a,t){let i=e.type.id;return i==ae||i==ya?new aO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new b((O,e)=>{if(O.next!=GO){O.next<0&&e.context&&O.acceptToken(pe);return}O.advance();let a=O.next==Ue;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Pa:ae);let i=e.context?e.context.name:null;if(a){if(t==i)return O.acceptToken(ga);if(i&&Va[i])return O.acceptToken(pe,-2);if(e.dialectEnabled(Ta))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Xa)}else{if(t=="script")return O.acceptToken(VO);if(t=="style")return O.acceptToken(RO);if(t=="textarea")return O.acceptToken(_O);if(Ua.hasOwnProperty(t))return O.acceptToken(CO);i&&He[i]&&He[i][t]?O.acceptToken(pe,-1):O.acceptToken(ae)}},{contextual:!0}),Ga=new b(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Ke);break}if(O.next==Wa)e++;else if(O.next==ie&&e>=2){a>3&&O.acceptToken(Ke,-2);break}else e=0;O.advance()}});function Ia(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new b((O,e)=>{if(O.next==Ue&&O.peek(1)==ie){let a=e.dialectEnabled(va)||Ia(e.context);O.acceptToken(a?$a:Fe,2)}else O.next==ie&&O.acceptToken(Fe,1)});function Ve(O,e,a){let t=2+O.length;return new b(i=>{for(let s=0,r=0,l=0;;l++){if(i.next<0){l&&i.acceptToken(e);break}if(s==0&&i.next==GO||s==1&&i.next==Ue||s>=2&&sr?i.acceptToken(e,-r):i.acceptToken(a,-(r-2));break}else if((i.next==10||i.next==13)&&l){i.acceptToken(e,1);break}else s=r=0;i.advance()}})}const Ea=Ve("script",ua,fa),Na=Ve("style",ha,da),Ba=Ve("textarea",pa,Sa),Da=oe({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),Ja=V.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:ja,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"]],propSources:[Da],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=l.type.id;if(Q==ka)return Se(l,o,a);if(Q==xa)return Se(l,o,t);if(Q==wa)return Se(l,o,i);if(Q==WO&&s.length){let f=l.node,c=f.firstChild,h=c&&iO(c,o),u;if(h){for(let p of s)if(p.tag==h&&(!p.attrs||p.attrs(u||(u=IO(f,o))))){let g=f.lastChild;return{parser:p.parser,overlay:[{from:c.to,to:g.type.id==Ya?g.from:f.to}]}}}}if(r&&Q==qO){let f=l.node,c;if(c=f.firstChild){let h=r[o.read(c.from,c.to)];if(h)for(let u of h){if(u.tagName&&u.tagName!=iO(f.parent,o))continue;let p=f.lastChild;if(p.type.id==ke){let g=p.from+1,$=p.lastChild,k=p.to-($&&$.isError?0:1);if(k>g)return{parser:u.parser,overlay:[{from:g,to:k}]}}else if(p.type.id==jO)return{parser:u.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const Ma=96,rO=1,La=97,Fa=98,sO=2,EO=[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],Ka=58,Ha=40,NO=95,ei=91,K=45,Oi=46,ti=35,ai=37;function re(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function ii(O){return O>=48&&O<=57}const ri=new b((O,e)=>{for(let a=!1,t=0,i=0;;i++){let{next:s}=O;if(re(s)||s==K||s==NO||a&&ii(s))!a&&(s!=K||i>0)&&(a=!0),t===i&&s==K&&t++,O.advance();else{a&&O.acceptToken(s==Ha?La:t==2&&e.canShift(sO)?sO:Fa);break}}}),si=new b(O=>{if(EO.includes(O.peek(-1))){let{next:e}=O;(re(e)||e==NO||e==ti||e==Oi||e==ei||e==Ka||e==K)&&O.acceptToken(Ma)}}),li=new b(O=>{if(!EO.includes(O.peek(-1))){let{next:e}=O;if(e==ai&&(O.advance(),O.acceptToken(rO)),re(e)){do O.advance();while(re(O.next));O.acceptToken(rO)}}}),ni=oe({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),oi={__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:134},ci={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qi={__proto__:null,not:128,only:128},ui=V.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[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!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[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!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[si,li,ri,1,2,3,4,new te("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>oi[O]||-1},{term:56,get:O=>ci[O]||-1},{term:98,get:O=>Qi[O]||-1}],tokenPrec:1169});let $e=null;function ge(){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,i=>"-"+i.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const lO=["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})),nO=["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}))),fi=["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})),Y=/^(\w[\w-]*|-\w[\w-]*|)$/,hi=/^-(-[\w-]*)?$/;function di(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 oO=new wO,pi=["Declaration"];function Si(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function BO(O,e,a){if(e.to-e.from>4096){let t=oO.get(e);if(t)return t;let i=[],s=new Set,r=e.cursor(ve.IncludeAnonymous);if(r.firstChild())do for(let l of BO(O,r.node,a))s.has(l.label)||(s.add(l.label),i.push(l));while(r.nextSibling());return oO.set(e,i),i}else{let t=[],i=new Set;return e.cursor().iterate(s=>{var r;if(a(s)&&s.matchContext(pi)&&((r=s.node.nextSibling)===null||r===void 0?void 0:r.name)==":"){let l=O.sliceString(s.from,s.to);i.has(l)||(i.add(l),t.push({label:l,type:"variable"}))}}),t}}const $i=O=>e=>{let{state:a,pos:t}=e,i=q(a).resolveInner(t,-1),s=i.type.isError&&i.from==i.to-1&&a.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:ge(),validFor:Y};if(i.name=="ValueName")return{from:i.from,options:nO,validFor:Y};if(i.name=="PseudoClassName")return{from:i.from,options:lO,validFor:Y};if(O(i)||(e.explicit||s)&&di(i,a.doc))return{from:O(i)||s?i.from:t,options:BO(a.doc,Si(i),O),validFor:hi};if(i.name=="TagName"){for(let{parent:o}=i;o;o=o.parent)if(o.name=="Block")return{from:i.from,options:ge(),validFor:Y};return{from:i.from,options:fi,validFor:Y}}if(!e.explicit)return null;let r=i.resolve(t),l=r.childBefore(t);return l&&l.name==":"&&r.name=="PseudoClassSelector"?{from:t,options:lO,validFor:Y}:l&&l.name==":"&&r.name=="Declaration"||r.name=="ArgList"?{from:t,options:nO,validFor:Y}:r.name=="Block"||r.name=="Styles"?{from:t,options:ge(),validFor:Y}:null},gi=$i(O=>O.name=="VariableName"),se=ce.define({name:"css",parser:ui.configure({props:[Qe.add({Declaration:E()}),ue.add({"Block KeyframeList":xO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mi(){return new fe(se,se.data.of({autocomplete:gi}))}const Xi=303,cO=1,Pi=2,Zi=304,bi=306,ki=307,xi=3,wi=4,yi=[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],DO=125,Yi=59,QO=47,Ti=42,vi=43,Ui=45,Vi=new UO({start:!1,shift(O,e){return e==xi||e==wi||e==bi?O:e==ki},strict:!1}),Ri=new b((O,e)=>{let{next:a}=O;(a==DO||a==-1||e.context)&&O.acceptToken(Zi)},{contextual:!0,fallback:!0}),_i=new b((O,e)=>{let{next:a}=O,t;yi.indexOf(a)>-1||a==QO&&((t=O.peek(1))==QO||t==Ti)||a!=DO&&a!=Yi&&a!=-1&&!e.context&&O.acceptToken(Xi)},{contextual:!0}),Ci=new b((O,e)=>{let{next:a}=O;if((a==vi||a==Ui)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(cO);O.acceptToken(t?cO:Pi)}},{contextual:!0}),Wi=oe({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,LineComment:n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),qi={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,using:413,interface:419,enum:423,namespace:429,module:431,declare:435,global:439,for:458,of:467,while:470,with:474,do:478,if:482,else:484,switch:488,case:494,try:500,catch:504,finally:508,return:512,throw:516,break:520,continue:524,debugger:528},ji={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},zi={__proto__:null,"<":137},Gi=V.deserialize({version:14,states:"$6tO`QUOOO%TQUOOO'WQWOOP(eOSOOO*sQ(CjO'#CfO*zOpO'#CgO+YO!bO'#CgO+hO07`O'#DZO-yQUO'#DaO.ZQUO'#DlO%TQUO'#DvO0_QUO'#EOOOQ(CY'#EW'#EWO0xQSO'#ETOOQO'#Ei'#EiOOQO'#Ic'#IcO1QQSO'#GkO1]QSO'#EhO1bQSO'#EhO3dQ(CjO'#JdO6TQ(CjO'#JeO6qQSO'#FWO6vQ#tO'#FoOOQ(CY'#F`'#F`O7RO&jO'#F`O7aQ,UO'#FvO8wQSO'#FuOOQ(CY'#Je'#JeOOQ(CW'#Jd'#JdO8|QSO'#GoOOQQ'#KP'#KPO9XQSO'#IPO9^Q(C[O'#IQOOQQ'#JQ'#JQOOQQ'#IU'#IUQ`QUOOO%TQUO'#DnO9fQUO'#DzO9mQUO'#D|O9SQSO'#GkO9tQ,UO'#ClO:SQSO'#EgO:_QSO'#ErO:dQ,UO'#F_O;RQSO'#GkOOQO'#KQ'#KQO;WQSO'#KQO;fQSO'#GsO;fQSO'#GtO;fQSO'#GvO9SQSO'#GyO<]QSO'#G|O=tQSO'#CbO>UQSO'#HYO>^QSO'#H`O>^QSO'#HbO`QUO'#HdO>^QSO'#HfO>^QSO'#HiO>cQSO'#HoO>hQ(C]O'#HuO%TQUO'#HwO>sQ(C]O'#HyO?OQ(C]O'#H{O9^Q(C[O'#H}O?ZQ(CjO'#CfO@]QWO'#DfQOQSOOO%TQUO'#D|O@sQSO'#EPO9tQ,UO'#EgOAOQSO'#EgOAZQ`O'#F_OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jh'#JhO%TQUO'#JhOOQO'#Jl'#JlOOQO'#I`'#I`OBZQWO'#E`OOQ(CW'#E_'#E_OCVQ(C`O'#E`OCaQWO'#ESOOQO'#Jk'#JkOCuQWO'#JlOESQWO'#ESOCaQWO'#E`PEaO?MpO'#C`POOO)CDo)CDoOOOO'#IV'#IVOElOpO,59ROOQ(CY,59R,59ROOOO'#IW'#IWOEzO!bO,59RO%TQUO'#D]OOOO'#IY'#IYOFYO07`O,59uOOQ(CY,59u,59uOFhQUO'#IZOF{QSO'#JfOH}QbO'#JfO+vQUO'#JfOIUQSO,59{OIlQSO'#EiOIyQSO'#JtOJUQSO'#JsOJUQSO'#JsOJ^QSO,5;VOJcQSO'#JrOOQ(CY,5:W,5:WOJjQUO,5:WOLkQ(CjO,5:bOM[QSO,5:jOMuQ(C[O'#JqOM|QSO'#JpO8|QSO'#JpONbQSO'#JpONjQSO,5;UONoQSO'#JpO!!wQbO'#JeOOQ(CY'#Cf'#CfO%TQUO'#EOO!#gQ`O,5:oOOQO'#Jm'#JmOOQO-EkOOQQ'#JY'#JYOOQQ,5>l,5>lOOQQ-EqQ(CjO,5:hOOQO,5@l,5@lO!?bQ,UO,5=VO!?pQ(C[O'#JZO8wQSO'#JZO!@RQ(C[O,59WO!@^QWO,59WO!@fQ,UO,59WO9tQ,UO,59WO!@qQSO,5;SO!@yQSO'#HXO!A[QSO'#KUO%TQUO,5;wO!7[QWO,5;yO!AdQSO,5=rO!AiQSO,5=rO!AnQSO,5=rO9^Q(C[O,5=rO;fQSO,5=bOOQO'#Cr'#CrO!A|QWO,5=_O!BUQ,UO,5=`O!BaQSO,5=bO!BfQ`O,5=eO!BnQSO'#KQO>cQSO'#HOO9SQSO'#HQO!BsQSO'#HQO9tQ,UO'#HSO!BxQSO'#HSOOQQ,5=h,5=hO!B}QSO'#HTO!CVQSO'#ClO!C[QSO,58|O!CfQSO,58|O!EkQUO,58|OOQQ,58|,58|O!E{Q(C[O,58|O%TQUO,58|O!HWQUO'#H[OOQQ'#H]'#H]OOQQ'#H^'#H^O`QUO,5=tO!HnQSO,5=tO`QUO,5=zO`QUO,5=|O!HsQSO,5>OO`QUO,5>QO!HxQSO,5>TO!H}QUO,5>ZOOQQ,5>a,5>aO%TQUO,5>aO9^Q(C[O,5>cOOQQ,5>e,5>eO!MXQSO,5>eOOQQ,5>g,5>gO!MXQSO,5>gOOQQ,5>i,5>iO!M^QWO'#DXO%TQUO'#JhO!M{QWO'#JhO!NjQWO'#DgO!N{QWO'#DgO##^QUO'#DgO##eQSO'#JgO##mQSO,5:QO##rQSO'#EmO#$QQSO'#JuO#$YQSO,5;WO#$_QWO'#DgO#$lQWO'#EROOQ(CY,5:k,5:kO%TQUO,5:kO#$sQSO,5:kO>cQSO,5;RO!@^QWO,5;RO!@fQ,UO,5;RO9tQ,UO,5;RO#${QSO,5@SO#%QQ!LQO,5:oOOQO-E<^-E<^O#&WQ(C`O,5:zOCaQWO,5:nO#&bQWO,5:nOCaQWO,5:zO!@RQ(C[O,5:nOOQ(CW'#Ec'#EcOOQO,5:z,5:zO%TQUO,5:zO#&oQ(C[O,5:zO#&zQ(C[O,5:zO!@^QWO,5:nOOQO,5;Q,5;QO#'YQ(C[O,5:zPOOO'#IT'#ITP#'nO?MpO,58zPOOO,58z,58zOOOO-EuO+vQUO,5>uOOQO,5>{,5>{O#(YQUO'#IZOOQO-E^QSO1G3jO$.OQUO1G3lO$2SQUO'#HkOOQQ1G3o1G3oO$2aQSO'#HqO>cQSO'#HsOOQQ1G3u1G3uO$2iQUO1G3uO9^Q(C[O1G3{OOQQ1G3}1G3}OOQ(CW'#GW'#GWO9^Q(C[O1G4PO9^Q(C[O1G4RO$6pQSO,5@SO!){QUO,5;XO8|QSO,5;XO>cQSO,5:RO!){QUO,5:RO!@^QWO,5:RO$6uQ$IUO,5:ROOQO,5;X,5;XO$7PQWO'#I[O$7gQSO,5@ROOQ(CY1G/l1G/lO$7oQWO'#IbO$7yQSO,5@aOOQ(CW1G0r1G0rO!N{QWO,5:ROOQO'#I_'#I_O$8RQWO,5:mOOQ(CY,5:m,5:mO#$vQSO1G0VOOQ(CY1G0V1G0VO%TQUO1G0VOOQ(CY1G0m1G0mO>cQSO1G0mO!@^QWO1G0mO!@fQ,UO1G0mOOQ(CW1G5n1G5nO!@RQ(C[O1G0YOOQO1G0f1G0fO%TQUO1G0fO$8YQ(C[O1G0fO$8eQ(C[O1G0fO!@^QWO1G0YOCaQWO1G0YO$8sQ(C[O1G0fOOQO1G0Y1G0YO$9XQ(CjO1G0fPOOO-EuO$9uQSO1G5lO$9}QSO1G5yO$:VQbO1G5zO8|QSO,5>{O$:aQ(CjO1G5wO%TQUO1G5wO$:qQ(C[O1G5wO$;SQSO1G5vO$;SQSO1G5vO8|QSO1G5vO$;[QSO,5?OO8|QSO,5?OOOQO,5?O,5?OO$;pQSO,5?OO$$QQSO,5?OOOQO-EqQ(CjO,5VOOQQ,5>V,5>VO%TQUO'#HlO%(SQSO'#HnOOQQ,5>],5>]O8|QSO,5>]OOQQ,5>_,5>_OOQQ7+)a7+)aOOQQ7+)g7+)gOOQQ7+)k7+)kOOQQ7+)m7+)mO%(XQWO1G5nO%(mQ$IUO1G0sO%(wQSO1G0sOOQO1G/m1G/mO%)SQ$IUO1G/mO>cQSO1G/mO!){QUO'#DgOOQO,5>v,5>vOOQO-E|,5>|OOQO-E<`-E<`O!@^QWO1G/mOOQO-E<]-E<]OOQ(CY1G0X1G0XOOQ(CY7+%q7+%qO#$vQSO7+%qOOQ(CY7+&X7+&XO>cQSO7+&XO!@^QWO7+&XOOQO7+%t7+%tO$9XQ(CjO7+&QOOQO7+&Q7+&QO%TQUO7+&QO%)^Q(C[O7+&QO!@RQ(C[O7+%tO!@^QWO7+%tO%)iQ(C[O7+&QO%)wQ(CjO7++cO%TQUO7++cO%*XQSO7++bO%*XQSO7++bOOQO1G4j1G4jO8|QSO1G4jO%*aQSO1G4jOOQO7+%y7+%yO#$vQSO<wOOQO-ExO%TQUO,5>xOOQO-E<[-E<[O%2aQSO1G5pOOQ(CY<QQ$IUO1G0xO%>XQ$IUO1G0xO%@PQ$IUO1G0xO%@dQ(CjO<WOOQQ,5>Y,5>YO%M}QSO1G3wO8|QSO7+&_O!){QUO7+&_OOQO7+%X7+%XO%NSQ$IUO1G5zO>cQSO7+%XOOQ(CY<cQSO<cQSO7+)cO&5kQSO<zAN>zO%TQUOAN?WOOQO<TQSOANAxOOQQANAzANAzO9^Q(C[OANAzO#MsQSOANAzOOQO'#HV'#HVOOQO7+*d7+*dOOQQG22tG22tOOQQANEOANEOOOQQANEPANEPOOQQANBSANBSO&>]QSOANBSOOQQ<bQSOLD,iO&>jQ$IUO7+'sO&@`Q$IUO7+'uO&BUQ,UOG26{OOQO<ROPYXXYXkYXyYXzYX|YX!eYX!fYX!hYX!lYX#XYX#dcX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#oYX#qYX#sYX#uYX#vYX#{YX(SYX(cYX(jYX(kYX!VYX!WYX~O#yYX~P#@lOP$[OX:XOk9{Oy#xOz#yO|#zO!e9}O!f#vO!h#wO!l$[O#g9yO#h9zO#i9zO#j9zO#k9|O#l9}O#m9}O#n:WO#o9}O#q:OO#s:QO#u:SO#v:TO(SVO(c$YO(j#{O(k#|O~O#y.hO~P#ByO#X:YO#{:YO#y(XX!W(XX~PN}O^'Za!V'Za'l'Za'j'Za!g'Za!S'Zao'Za!X'Za%a'Za!a'Za~P!7sOP#fiX#fi^#fik#fiz#fi!V#fi!e#fi!f#fi!h#fi!l#fi#g#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi'l#fi(S#fi(c#fi'j#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~P#,`O^#zi!V#zi'l#zi'j#zi!S#zi!g#zio#zi!X#zi%a#zi!a#zi~P!7sO$W.mO$Y.mO~O$W.nO$Y.nO~O!a)^O#X.oO!X$^X$T$^X$W$^X$Y$^X$a$^X~O!U.pO~O!X)aO$T.rO$W)`O$Y)`O$a.sO~O!V:UO!W(WX~P#ByO!W.tO~O!a)^O$a(lX~O$a.vO~Oq)pO(T)qO(U.yO~O!S.}O~P!&VO!VcX!acX!gcX!g$sX(ccX~P!/ZO!g/TO~P#,`O!V/UO!a#tO(c'fO!g(pX~O!g/ZO~O!U*RO'u%_O!g(pP~O#d/]O~O!S$sX!V$sX!a$zX~P!/ZO!V/^O!S(qX~P#,`O!a/`O~O!S/bO~Ok/fO!a#tO!h%]O(O%QO(c'fO~O'u/hO~O!a+XO~O^%fO!V/lO'l%fO~O!W/nO~P!3XO!]/oO!^/oO'v!kO(V!lO~O|/qO(V!lO~O#T/rO~O'u&POd'`X!V'`X~O!V*kOd(Pa~Od/wO~Oy/xOz/xO|/yOgva(jva(kva!Vva#Xva~Odva#yva~P$ aOy)uO|)vOg$la(j$la(k$la!V$la#X$la~Od$la#y$la~P$!VOy)uO|)vOg$na(j$na(k$na!V$na#X$na~Od$na#y$na~P$!xO#d/{O~Od$|a!V$|a#X$|a#y$|a~P!0dO!a#tO~O#d0OO~O!V*|O^(ua'l(ua~Oy#xOz#yO|#zO!f#vO!h#wO(SVOP!niX!nik!ni!V!ni!e!ni!l!ni#g!ni#h!ni#i!ni#j!ni#k!ni#l!ni#m!ni#n!ni#o!ni#q!ni#s!ni#u!ni#v!ni(c!ni(j!ni(k!ni~O^!ni'l!ni'j!ni!S!ni!g!nio!ni!X!ni%a!ni!a!ni~P$$gOg.TO!X'UO%a.SO~Oi0YO'u0XO~P!1UO!a+XO^'}a!X'}a'l'}a!V'}a~O#d0`O~OXYX!VcX!WcX~O!V0aO!W(yX~O!W0cO~OX0dO~O'u+aO'wTO'zUO~O!X%vO'u%_O]'hX!V'hX~O!V+fO](xa~O!g0iO~P!7sOX0lO~O]0mO~O#X0pO~Og0sO!X${O~O(V(sO!W(vP~Og0|O!X0yO%a0{O(O%QO~OX1WO!V1UO!W(wX~O!W1XO~O]1ZO^%fO'l%fO~O'u#lO'wTO'zUO~O#X$dO#{$dOP(XXX(XXk(XXy(XXz(XX|(XX!V(XX!e(XX!h(XX!l(XX#g(XX#h(XX#i(XX#j(XX#k(XX#l(XX#m(XX#n(XX#q(XX#s(XX#u(XX#v(XX(S(XX(c(XX(j(XX(k(XX~O#o1^O&R1_O^(XX!f(XX~P$+]O#X$dO#o1^O&R1_O~O^1aO~P%TO^1cO~O&[1fOP&YiQ&YiV&Yi^&Yia&Yib&Yii&Yik&Yil&Yim&Yis&Yiu&Yiw&Yi|&Yi!Q&Yi!R&Yi!X&Yi!c&Yi!h&Yi!k&Yi!l&Yi!m&Yi!o&Yi!q&Yi!t&Yi!x&Yi#p&Yi$Q&Yi$U&Yi%`&Yi%b&Yi%d&Yi%e&Yi%f&Yi%i&Yi%k&Yi%n&Yi%o&Yi%q&Yi%}&Yi&T&Yi&V&Yi&X&Yi&Z&Yi&^&Yi&d&Yi&j&Yi&l&Yi&n&Yi&p&Yi&r&Yi'j&Yi'u&Yi'w&Yi'z&Yi(S&Yi(b&Yi(o&Yi!W&Yi_&Yi&a&Yi~O_1lO!W1jO&a1kO~P`O!XXO!h1nO~O&h,iOP&ciQ&ciV&ci^&cia&cib&cii&cik&cil&cim&cis&ciu&ciw&ci|&ci!Q&ci!R&ci!X&ci!c&ci!h&ci!k&ci!l&ci!m&ci!o&ci!q&ci!t&ci!x&ci#p&ci$Q&ci$U&ci%`&ci%b&ci%d&ci%e&ci%f&ci%i&ci%k&ci%n&ci%o&ci%q&ci%}&ci&T&ci&V&ci&X&ci&Z&ci&^&ci&d&ci&j&ci&l&ci&n&ci&p&ci&r&ci'j&ci'u&ci'w&ci'z&ci(S&ci(b&ci(o&ci!W&ci&[&ci_&ci&a&ci~O!S1tO~O!V!Za!W!Za~P#ByOl!mO|!nO!U1zO(V!lO!V'OX!W'OX~P?wO!V,yO!W(Za~O!V'UX!W'UX~P!6{O!V,|O!W(ia~O!W2RO~P'WO^%fO#X2[O'l%fO~O^%fO!a#tO#X2[O'l%fO~O^%fO!a#tO!l2`O#X2[O'l%fO(c'fO~O^%fO'l%fO~P!7sO!V$`Oo$ka~O!S&}i!V&}i~P!7sO!V'zO!S(Yi~O!V(RO!S(gi~O!S(hi!V(hi~P!7sO!V(ei!g(ei^(ei'l(ei~P!7sO#X2bO!V(ei!g(ei^(ei'l(ei~O!V(_O!g(di~O|%`O!X%aO!x]O#b2gO#c2fO'u%_O~O|%`O!X%aO#c2fO'u%_O~Og2nO!X'UO%a2mO~Og2nO!X'UO%a2mO(O%QO~O#dvaPvaXva^vakva!eva!fva!hva!lva#gva#hva#iva#jva#kva#lva#mva#nva#ova#qva#sva#uva#vva'lva(Sva(cva!gva!Sva'jvaova!Xva%ava!ava~P$ aO#d$laP$laX$la^$lak$laz$la!e$la!f$la!h$la!l$la#g$la#h$la#i$la#j$la#k$la#l$la#m$la#n$la#o$la#q$la#s$la#u$la#v$la'l$la(S$la(c$la!g$la!S$la'j$lao$la!X$la%a$la!a$la~P$!VO#d$naP$naX$na^$nak$naz$na!e$na!f$na!h$na!l$na#g$na#h$na#i$na#j$na#k$na#l$na#m$na#n$na#o$na#q$na#s$na#u$na#v$na'l$na(S$na(c$na!g$na!S$na'j$nao$na!X$na%a$na!a$na~P$!xO#d$|aP$|aX$|a^$|ak$|az$|a!V$|a!e$|a!f$|a!h$|a!l$|a#g$|a#h$|a#i$|a#j$|a#k$|a#l$|a#m$|a#n$|a#o$|a#q$|a#s$|a#u$|a#v$|a'l$|a(S$|a(c$|a!g$|a!S$|a'j$|a#X$|ao$|a!X$|a%a$|a!a$|a~P#,`O^#[q!V#[q'l#[q'j#[q!S#[q!g#[qo#[q!X#[q%a#[q!a#[q~P!7sOd'PX!V'PX~P!'oO!V.^Od(]a~O!U2vO!V'QX!g'QX~P%TO!V.aO!g(^a~O!V.aO!g(^a~P!7sO!S2yO~O#y!ja!W!ja~PJqO#y!ba!V!ba!W!ba~P#ByO#y!na!W!na~P!:^O#y!pa!W!pa~P!`O^#wy!V#wy'l#wy'j#wy!S#wy!g#wyo#wy!X#wy%a#wy!a#wy~P!7sOg;lOy)uO|)vO(j)xO(k)zO~OP#fiX#fik#fiz#fi!e#fi!f#fi!h#fi!l#fi#g#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi#y#fi(S#fi(c#fi!V#fi!W#fi~P%AWO!f#vOP(RXX(RXg(RXk(RXy(RXz(RX|(RX!e(RX!h(RX!l(RX#g(RX#h(RX#i(RX#j(RX#k(RX#l(RX#m(RX#n(RX#o(RX#q(RX#s(RX#u(RX#v(RX#y(RX(S(RX(c(RX(j(RX(k(RX!V(RX!W(RX~O#y#zi!V#zi!W#zi~P#ByO#y!ni!W!ni~P$$gO!W6_O~O!V'Za!W'Za~P#ByO!a#tO(c'fO!V'[a!g'[a~O!V/UO!g(pi~O!V/UO!a#tO!g(pi~Od$uq!V$uq#X$uq#y$uq~P!0dO!S'^a!V'^a~P#,`O!a6fO~O!V/^O!S(qi~P#,`O!V/^O!S(qi~O!S6jO~O!a#tO#o6oO~Ok6pO!a#tO(c'fO~O!S6rO~Od$wq!V$wq#X$wq#y$wq~P!0dO^$iy!V$iy'l$iy'j$iy!S$iy!g$iyo$iy!X$iy%a$iy!a$iy~P!7sO!a5jO~O!V4VO!X(ra~O^#[y!V#[y'l#[y'j#[y!S#[y!g#[yo#[y!X#[y%a#[y!a#[y~P!7sOX6wO~O!V0aO!W(yi~O]6}O~O(V(sO!V'cX!W'cX~O!V4mO!W(va~OikO'u7UO~P.bO!W7XO~P%$gOl!mO|7YO'wTO'zUO(V!lO(b!rO~O!X0yO~O!X0yO%a7[O~Og7_O!X0yO%a7[O~OX7dO!V'fa!W'fa~O!V1UO!W(wi~O!g7hO~O!g7iO~O!g7lO~O!g7lO~P%TO^7nO~O!a7oO~O!g7pO~O!V(hi!W(hi~P#ByO^%fO#X7xO'l%fO~O!V(ey!g(ey^(ey'l(ey~P!7sO!V(_O!g(dy~O!X'UO%a7{O~O#d$uqP$uqX$uq^$uqk$uqz$uq!V$uq!e$uq!f$uq!h$uq!l$uq#g$uq#h$uq#i$uq#j$uq#k$uq#l$uq#m$uq#n$uq#o$uq#q$uq#s$uq#u$uq#v$uq'l$uq(S$uq(c$uq!g$uq!S$uq'j$uq#X$uqo$uq!X$uq%a$uq!a$uq~P#,`O#d$wqP$wqX$wq^$wqk$wqz$wq!V$wq!e$wq!f$wq!h$wq!l$wq#g$wq#h$wq#i$wq#j$wq#k$wq#l$wq#m$wq#n$wq#o$wq#q$wq#s$wq#u$wq#v$wq'l$wq(S$wq(c$wq!g$wq!S$wq'j$wq#X$wqo$wq!X$wq%a$wq!a$wq~P#,`O!V'Qi!g'Qi~P!7sO#y#[q!V#[q!W#[q~P#ByOy/xOz/xO|/yOPvaXvagvakva!eva!fva!hva!lva#gva#hva#iva#jva#kva#lva#mva#nva#ova#qva#sva#uva#vva#yva(Sva(cva(jva(kva!Vva!Wva~Oy)uO|)vOP$laX$lag$lak$laz$la!e$la!f$la!h$la!l$la#g$la#h$la#i$la#j$la#k$la#l$la#m$la#n$la#o$la#q$la#s$la#u$la#v$la#y$la(S$la(c$la(j$la(k$la!V$la!W$la~Oy)uO|)vOP$naX$nag$nak$naz$na!e$na!f$na!h$na!l$na#g$na#h$na#i$na#j$na#k$na#l$na#m$na#n$na#o$na#q$na#s$na#u$na#v$na#y$na(S$na(c$na(j$na(k$na!V$na!W$na~OP$|aX$|ak$|az$|a!e$|a!f$|a!h$|a!l$|a#g$|a#h$|a#i$|a#j$|a#k$|a#l$|a#m$|a#n$|a#o$|a#q$|a#s$|a#u$|a#v$|a#y$|a(S$|a(c$|a!V$|a!W$|a~P%AWO#y$hq!V$hq!W$hq~P#ByO#y$iq!V$iq!W$iq~P#ByO!W8VO~O#y8WO~P!0dO!a#tO!V'[i!g'[i~O!a#tO(c'fO!V'[i!g'[i~O!V/UO!g(pq~O!S'^i!V'^i~P#,`O!V/^O!S(qq~O!S8^O~P#,`O!S8^O~Od(Qy!V(Qy~P!0dO!V'aa!X'aa~P#,`O^%Tq!X%Tq'l%Tq!V%Tq~P#,`OX8cO~O!V0aO!W(yq~O#X8gO!V'ca!W'ca~O!V4mO!W(vi~P#ByOPYXXYXkYXyYXzYX|YX!SYX!VYX!eYX!fYX!hYX!lYX#XYX#dcX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#oYX#qYX#sYX#uYX#vYX#{YX(SYX(cYX(jYX(kYX~O!a%RX#o%RX~P&2WO!X0yO%a8kO~O'wTO'zUO(V8pO~O!V1UO!W(wq~O!g8sO~O!g8tO~O!g8uO~O!g8uO~P%TO#X8xO!V#ay!W#ay~O!V#ay!W#ay~P#ByO!X'UO%a8}O~O#y#wy!V#wy!W#wy~P#ByOP$uiX$uik$uiz$ui!e$ui!f$ui!h$ui!l$ui#g$ui#h$ui#i$ui#j$ui#k$ui#l$ui#m$ui#n$ui#o$ui#q$ui#s$ui#u$ui#v$ui#y$ui(S$ui(c$ui!V$ui!W$ui~P%AWOy)uO|)vO(k)zOP%XiX%Xig%Xik%Xiz%Xi!e%Xi!f%Xi!h%Xi!l%Xi#g%Xi#h%Xi#i%Xi#j%Xi#k%Xi#l%Xi#m%Xi#n%Xi#o%Xi#q%Xi#s%Xi#u%Xi#v%Xi#y%Xi(S%Xi(c%Xi(j%Xi!V%Xi!W%Xi~Oy)uO|)vOP%ZiX%Zig%Zik%Ziz%Zi!e%Zi!f%Zi!h%Zi!l%Zi#g%Zi#h%Zi#i%Zi#j%Zi#k%Zi#l%Zi#m%Zi#n%Zi#o%Zi#q%Zi#s%Zi#u%Zi#v%Zi#y%Zi(S%Zi(c%Zi(j%Zi(k%Zi!V%Zi!W%Zi~O#y$iy!V$iy!W$iy~P#ByO#y#[y!V#[y!W#[y~P#ByO!a#tO!V'[q!g'[q~O!V/UO!g(py~O!S'^q!V'^q~P#,`O!S9UO~P#,`O!V0aO!W(yy~O!V4mO!W(vq~O!X0yO%a9]O~O!g9`O~O!X'UO%a9eO~OP$uqX$uqk$uqz$uq!e$uq!f$uq!h$uq!l$uq#g$uq#h$uq#i$uq#j$uq#k$uq#l$uq#m$uq#n$uq#o$uq#q$uq#s$uq#u$uq#v$uq#y$uq(S$uq(c$uq!V$uq!W$uq~P%AWOP$wqX$wqk$wqz$wq!e$wq!f$wq!h$wq!l$wq#g$wq#h$wq#i$wq#j$wq#k$wq#l$wq#m$wq#n$wq#o$wq#q$wq#s$wq#u$wq#v$wq#y$wq(S$wq(c$wq!V$wq!W$wq~P%AWOd%]!Z!V%]!Z#X%]!Z#y%]!Z~P!0dO!V'cq!W'cq~P#ByO!V#a!Z!W#a!Z~P#ByO#d%]!ZP%]!ZX%]!Z^%]!Zk%]!Zz%]!Z!V%]!Z!e%]!Z!f%]!Z!h%]!Z!l%]!Z#g%]!Z#h%]!Z#i%]!Z#j%]!Z#k%]!Z#l%]!Z#m%]!Z#n%]!Z#o%]!Z#q%]!Z#s%]!Z#u%]!Z#v%]!Z'l%]!Z(S%]!Z(c%]!Z!g%]!Z!S%]!Z'j%]!Z#X%]!Zo%]!Z!X%]!Z%a%]!Z!a%]!Z~P#,`OP%]!ZX%]!Zk%]!Zz%]!Z!e%]!Z!f%]!Z!h%]!Z!l%]!Z#g%]!Z#h%]!Z#i%]!Z#j%]!Z#k%]!Z#l%]!Z#m%]!Z#n%]!Z#o%]!Z#q%]!Z#s%]!Z#u%]!Z#v%]!Z#y%]!Z(S%]!Z(c%]!Z!V%]!Z!W%]!Z~P%AWOo(WX~P1jO'v!kO~P!){O!ScX!VcX#XcX~P&2WOPYXXYXkYXyYXzYX|YX!VYX!VcX!eYX!fYX!hYX!lYX#XYX#XcX#dcX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#oYX#qYX#sYX#uYX#vYX#{YX(SYX(cYX(jYX(kYX~O!acX!gYX!gcX(ccX~P&GnOP9pOQ9pOa;aOb!hOikOk9pOlkOmkOskOu9pOw9pO|WO!QkO!RkO!XXO!c9sO!hZO!k9pO!l9pO!m9pO!o9tO!q9wO!t!gO$Q!jO$UfO'u)TO'wTO'zUO(SVO(b[O(o;_O~O!V:UO!W$ka~Oi%ROk$sOl$rOm$rOs%SOu%TOw:[O|$zO!X${O!c;fO!h$wO#c:bO$Q%XO$m:^O$o:`O$r%YO'u(kO'wTO'zUO(O%QO(S$tO~O#p)[O~P&LdO!WYX!WcX~P&GnO#d9xO~O!a#tO#d9xO~O#X:YO~O#o9}O~O#X:dO!V(hX!W(hX~O#X:YO!V(fX!W(fX~O#d:eO~Od:gO~P!0dO#d:lO~O#d:mO~O!a#tO#d:nO~O!a#tO#d:eO~O#y:oO~P#ByO#d:pO~O#d:qO~O#d:rO~O#d:sO~O#d:tO~O#d:uO~O#y:vO~P!0dO#y:wO~P!0dO$U~!f!|!}#P#Q#T#b#c#n(o$m$o$r%U%`%a%b%i%k%n%o%q%s~'pR$U(o#h!R'n'v#il#g#jky'o(V'o'u$W$Y$W~",goto:"$&a(}PPPP)OP)RP)cP*r.uPPPP5UPP5kP;f>mP?QP?QPPP?QP@rP?QP?QP?QP@vPP@{PAfPF]PPPFaPPPPFaIaPPPIgJbPFaPLoPPPPN}FaPPPFaPFaP!#]FaP!&p!'r!'{P!(n!(r!(nPPPPP!+|!'rPP!,j!-dP!0WFaFa!0]!3f!7z!7z!;oPPP!;vFaPPPPPPPPPPP!?SP!@ePPFa!ArPFaPFaFaFaFaPFa!CUPP!F]P!I`P!Id!In!Ir!IrP!FYP!Iv!IvP!LyP!L}FaFa!MT#!V?QP?QP?Q?QP##a?Q?Q#%]?Q#'l?Q#)b?Q?Q#*O#+|#+|#,Q#,Y#+|#,bP#+|P?Q#,z?Q#.T?Q?Q5UPPP#/aPPP#/y#/yP#/yP#0`#/yPP#0fP#0]P#0]#0x#0]#1d#1j5R)R#1m)RP#1t#1t#1tP)RP)RP)RP)RPP)RP#1z#1}P#1})RP#2RP#2UP)RP)RP)RP)RP)RP)R)RPP#2[#2b#2l#2r#2x#3O#3U#3d#3j#3p#3z#4Q#4[#4k#4q#5b#5t#5z#6Q#6`#6u#8W#8f#8l#8r#8x#9O#9Y#9`#9f#9p#:S#:YPPPPPPPPPP#:`PPPPPPP#;S#>ZP#?j#?q#?yPPPP#DX#F}#Me#Mh#Mk#Nd#Ng#Nj#Nq#NyPP$ P$ T$ {$!z$#O$#dPP$#h$#n$#rP$#u$#y$#|$$r$%Y$%p$%t$%w$%z$&Q$&T$&X$&]R!zRmqOXs!Y#b%e&h&j&k&m,a,f1f1iY!tQ'U-R0y4tQ%kuQ%sxQ%z{Q&`!US&|!d,yQ'[!hS'b!q!wS*^${*cQ+_%tQ+l%|Q,Q&YQ-P'TQ-Z']Q-c'cQ/o*eQ1T,RR:c9t$|dOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{,^,a,f-V-_-m-s.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2v4q4{5]5^5a5t7Y7_7n7xS#o]9q!r)V$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ*n%UQ+d%vQ,S&]Q,Z&eQ.W:ZQ0V+VQ0Z+XQ0f+eQ1],XQ2j.TQ4_0aQ5S1UQ6Q2nQ6W:[Q6y4`R8O6R&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bt!mQ!q!t!w!x&|'T'U'b'c'd,y-P-R-c0y4t4v$^$ri#t#v$b$c$w$z%V%W%[)p)v)y){)|*T*Z*i*j+U+X+p+s.S.^/O/]/^/`/{0p0s0{2m3e3o3w3}4V4X4z6O6f6o7[7{8W8k8}9]9e:W:X:]:^:_:`:a:b:h:i:j:k:l:m:p:q:r:s:v:w;_;g;h;k;lQ%}{Q&z!dS'Q%a,|Q+d%vQ/z*rQ0f+eQ0k+kQ1[,WQ1],XQ4_0aQ4h0mQ5V1WQ5W1ZQ6y4`Q6|4eQ7g5YQ8f6}R8q7dpnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iR,U&a&t^OPXYstuvy!Y!_!f!i!n#Q#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y'W'h'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;a;b[#ZWZ#U#X&}'x!S%bm#f#g#j%]%`(R(](^(_*y*z*|,],s-q-w-x-y-{1n2f2g5j5{Q%nwQ%rxS%w{%|Q&T!SQ'X!gQ'Z!hQ(f#qS*Q$w*US+^%s%tQ+b%vQ+{&WQ,P&YS-Y'[']Q.V(gQ/Y*RQ0_+_Q0e+eQ0g+fQ0j+jQ1O+|S1S,Q,RQ2W-ZQ3f/UQ4^0aQ4b0dQ4g0lQ5R1TQ6c3gQ6x4`Q6{4dQ8b6wR9W8cv$yi#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;h!S%px!h!s%r%s%t&{'Z'[']'a'k*]+^+_,v-Y-Z-b/g0_2P2W2_3yQ+W%nQ+q&QQ+t&RQ,O&YQ.U(fQ0}+{U1R,P,Q,RQ2o.VQ4|1OS5Q1S1TQ7c5R#O;c#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lg;d:W:X:^:`:b:i:k:m:q:s:wW%Oi%Q*k;_S&Q!P&_Q&R!QQ&S!RR+o&O$_$}i#t#v$b$c$w$z%V%W%[)p)v)y){)|*T*Z*i*j+U+X+p+s.S.^/O/]/^/`/{0p0s0{2m3e3o3w3}4V4X4z6O6f6o7[7{8W8k8}9]9e:W:X:]:^:_:`:a:b:h:i:j:k:l:m:p:q:r:s:v:w;_;g;h;k;lT)q$t)rV*o%U:Z:[U'Q!d%a,|S(t#x#yQ+i%yS.O(b(cQ0t+uQ4O/xR7R4m&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;b$i$_c#W#c%i%j%l'w'}(i(p(x(y(z({(|(})O)P)Q)R)S)U)X)])g+S+h,w-f-k-p-r.].c.g.i.j.k.z/|1u1x2Y2a2u2z2{2|2}3O3P3Q3R3S3T3U3V3W3Z3[3a4S4[5m5s5x6U6V6[6]7T7r7v8P8T8U8z9Y9a9r;UT#RV#S&{kOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ'O!dR1{,yv!mQ!d!q!t!w!x&|'T'U'b'c'd,y-P-R-c0y4t4vS*]${*cS/g*^*eQ/p*fQ0v+wQ3y/oR3|/rlqOXs!Y#b%e&h&j&k&m,a,f1f1iQ&o!]Q'l!vS(h#s9xQ+[%qQ+y&TQ+z&VQ-W'YQ-e'eS.[(m:eS/}*w:nQ0]+]Q0x+xQ1m,hQ1o,iQ1w,tQ2U-XQ2X-]S4T0O:tQ4Y0^S4]0`:uQ5l1yQ5p2VQ5u2^Q6v4ZQ7s5nQ7t5qQ7w5vR8w7p$d$^c#W#c%j%l'w'}(i(p(x(y(z({(|(})O)P)Q)R)S)U)X)])g+S+h,w-f-k-p-r.].c.g.j.k.z/|1u1x2Y2a2u2z2{2|2}3O3P3Q3R3S3T3U3V3W3Z3[3a4S4[5m5s5x6U6V6[6]7T7r7v8P8T8U8z9Y9a9r;US(e#n'_U*h$|(l3YS+R%i.iQ2k0VQ5}2jQ7}6QR9O8O$d$]c#W#c%j%l'w'}(i(p(x(y(z({(|(})O)P)Q)R)S)U)X)])g+S+h,w-f-k-p-r.].c.g.j.k.z/|1u1x2Y2a2u2z2{2|2}3O3P3Q3R3S3T3U3V3W3Z3[3a4S4[5m5s5x6U6V6[6]7T7r7v8P8T8U8z9Y9a9r;US(d#n'_S(v#y$^S+Q%i.iS.P(c(eQ.l)WQ0S+RR2h.Q&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bS#o]9qQ&j!WQ&k!XQ&m!ZQ&n![R1e,dQ'V!gQ+T%nQ-U'XS.R(f+WQ2S-TW2l.U.V0U0WQ5o2TU5|2i2k2oS7z5}6PS8|7|7}S9c8{9OQ9k9dR9n9lU!uQ'U-RT4r0y4t!O_OXZ`s!U!Y#b#f%]%e&_&a&h&j&k&m(_,a,f-x1f1i]!oQ!q'U-R0y4tT#o]9q%WzOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xS(t#x#yS.O(b(c!s:{$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bY!sQ'U-R0y4tQ'a!qS'k!t!wS'm!x4vS-b'b'cQ-d'dR2_-cQ'j!sS(Z#e1`S-a'a'mQ/X*QQ/e*]Q2`-dQ3k/YS3t/f/pQ6b3fS6m3z3|Q8Y6cR8a6pQ#ubQ'i!sS(Y#e1`S([#k*vQ*x%^Q+Y%oQ+`%uU-`'a'j'mQ-t(ZQ/W*QQ/d*]Q/j*`Q0[+ZQ1P+}S2]-a-dQ2e-|S3j/X/YS3s/e/pQ3v/iQ3x/kQ5O1QQ5w2`Q6a3fQ6e3kS6i3t3|Q6n3{Q7a5PS8X6b6cQ8]6jQ8_6mQ8n7bQ9S8YQ9T8^Q9V8aQ9_8oQ9g9UQ;O:yQ;Z;SR;[;TV!uQ'U-R%WaOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xS#uy!i!r:x$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bR;O;a%WbOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xQ%^j!S%ox!h!s%r%s%t&{'Z'[']'a'k*]+^+_,v-Y-Z-b/g0_2P2W2_3yS%uy!iQ+Z%pQ+}&YW1Q,O,P,Q,RU5P1R1S1TS7b5Q5RQ8o7c!r:y$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ;S;`R;T;a$zeOPXYstuv!Y!_!f!n#Q#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&h&j&k&m&q&y'W'h'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xY#`WZ#U#X'x!S%bm#f#g#j%]%`(R(](^(_*y*z*|,],s-q-w-x-y-{1n2f2g5j5{Q,[&e!p:z$Z$l)i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bR:}&}S'R!d%aR1},|$|dOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{,^,a,f-V-_-m-s.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2v4q4{5]5^5a5t7Y7_7n7x!r)V$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ,Z&eQ0V+VQ2j.TQ6Q2nR8O6R!f$Tc#W%i'w'}(i(p)P)Q)R)S)X)]+h-f-k-p-r.].c.z/|2Y2a2u3W4S4[5s5x6U7v8z9r!T:P)U)g,w.i1u1x2z3S3T3U3V3Z3a5m6V6[6]7T7r8P8T8U9Y9a;U!b$Vc#W%i'w'}(i(p)R)S)X)]+h-f-k-p-r.].c.z/|2Y2a2u3W4S4[5s5x6U7v8z9r!P:R)U)g,w.i1u1x2z3U3V3Z3a5m6V6[6]7T7r8P8T8U9Y9a;U!^$Zc#W%i'w'}(i(p)X)]+h-f-k-p-r.].c.z/|2Y2a2u3W4S4[5s5x6U7v8z9rQ3e/Sz;b)U)g,w.i1u1x2z3Z3a5m6V6[6]7T7r8P8T8U9Y9a;UQ;g;iR;h;j&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bS$mh$nR3^.o'RgOPWXYZhstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l$n%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.o.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bT$if$oQ$gfS)`$j)dR)l$oT$hf$oT)b$j)d'RhOPWXYZhstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l$n%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.o.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bT$mh$nQ$phR)k$n%WjOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7x!s;`$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;b#alOPXZs!Y!_!n#Q#b#m#z$l%e&a&d&e&h&j&k&m&q&y'W(u)i*{+V,^,a,f-V.T.p/y0|1^1_1a1c1f1i1k2n3]4q4{5]5^5a6R7Y7_7nv$|i#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;h#O(l#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lQ*s%YQ.{)ug3Y:W:X:^:`:b:i:k:m:q:s:wv$xi#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;hQ*V$yS*`${*cQ*t%ZQ/k*a#O;Q#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lf;R:W:X:^:`:b:i:k:m:q:s:wQ;V;cQ;W;dQ;X;eR;Y;fv$|i#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;h#O(l#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lg3Y:W:X:^:`:b:i:k:m:q:s:wloOXs!Y#b%e&h&j&k&m,a,f1f1iQ*Y$zQ,o&tQ,p&vR3n/^$^$}i#t#v$b$c$w$z%V%W%[)p)v)y){)|*T*Z*i*j+U+X+p+s.S.^/O/]/^/`/{0p0s0{2m3e3o3w3}4V4X4z6O6f6o7[7{8W8k8}9]9e:W:X:]:^:_:`:a:b:h:i:j:k:l:m:p:q:r:s:v:w;_;g;h;k;lQ+r&RQ0r+tQ4k0qR7Q4lT*b${*cS*b${*cT4s0y4tS/i*_4qT3{/q7YQ+Y%oQ/j*`Q0[+ZQ1P+}Q5O1QQ7a5PQ8n7bR9_8on)y$u(n*u/[/s/t2s3l4R6`6q9R;P;];^!Y:h(j)Z*P*X.Z.w.|/S/a0T0o0q2r3m3q4j4l6S6T6g6k6s6u8[8`9f;i;j]:i3X6Z8Q9P9Q9op){$u(n*u/Q/[/s/t2s3l4R6`6q9R;P;];^![:j(j)Z*P*X.Z.w.|/S/a0T0o0q2p2r3m3q4j4l6S6T6g6k6s6u8[8`9f;i;j_:k3X6Z8Q8R9P9Q9opnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iQ&[!TR,^&epnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iR&[!TQ+v&SR0n+oqnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iQ0z+{S4y0}1OU7Z4w4x4|S8j7]7^S9Z8i8lQ9h9[R9m9iQ&c!UR,V&_R5V1WS%w{%|R0g+fQ&h!VR,a&iR,g&nT1g,f1iR,k&oQ,j&oR1p,kQ'o!yR-g'oQsOQ#bXT%hs#bQ!|TR'q!|Q#PUR's#PQ)r$tR.x)rQ#SVR'u#SQ#VWU'{#V'|-nQ'|#WR-n'}Q,z'OR1|,zQ._(nR2t._Q.b(pS2w.b2xR2x.cQ-R'UR2Q-RY!qQ'U-R0y4tR'`!qS#]W%`U(S#](T-oQ(T#^R-o(OQ,}'RR2O,}r`OXs!U!Y#b%e&_&a&h&j&k&m,a,f1f1iS#fZ%]U#p`#f-xR-x(_Q(`#hQ-u([W-}(`-u2c5yQ2c-vR5y2dQ)d$jR.q)dQ$nhR)j$nQ$acU)Y$a-j:VQ-j9rR:V)gQ/V*QW3h/V3i6d8ZU3i/W/X/YS6d3j3kR8Z6e#o)w$u(j(n)Z*P*X*p*q*u.X.Y.Z.w.|/Q/R/S/[/a/s/t0T0o0q2p2q2r2s3X3l3m3q4R4j4l6S6T6X6Y6Z6`6g6k6q6s6u8Q8R8S8[8`9P9Q9R9f9o;P;];^;i;jQ/_*XU3p/_3r6hQ3r/aR6h3qQ*c${R/m*cQ*l%PR/v*lQ4W0TR6t4WQ*}%cR0R*}Q4n0tS7S4n8hR8h7TQ+x&TR0w+xQ4t0yR7W4tQ1V,SS5T1V7eR7e5VQ0b+bW4a0b4c6z8dQ4c0eQ6z4bR8d6{Q+g%wR0h+gQ1i,fR5e1iWrOXs#bQ&l!YQ+P%eQ,`&hQ,b&jQ,c&kQ,e&mQ1d,aS1g,f1iR5d1fQ%gpQ&p!^Q&s!`Q&u!aQ&w!bQ'g!sQ+O%dQ+[%qQ+n%}Q,U&cQ,m&rW-^'a'i'j'mQ-e'eQ/l*bQ0]+]S1Y,V,YQ1q,lQ1r,oQ1s,pQ2X-]W2Z-`-a-d-fQ4Y0^Q4f0kQ4i0oQ4}1PQ5X1[Q5c1eU5r2Y2]2`Q5u2^Q6v4ZQ7O4hQ7P4jQ7V4sQ7`5OQ7f5WS7u5s5wQ7w5vQ8e6|Q8m7aQ8r7gQ8y7vQ9X8fQ9^8nQ9b8zR9j9_Q%qxQ'Y!hQ'e!sU+]%r%s%tQ,t&{U-X'Z'[']S-]'a'kQ/c*]S0^+^+_Q1y,vS2V-Y-ZQ2^-bQ3u/gQ4Z0_Q5n2PQ5q2WQ5v2_R6l3yS$vi;_R*m%QU%Pi%Q;_R/u*kQ$uiS(j#t+XQ(n#vS)Z$b$cQ*P$wQ*X$zQ*p%VQ*q%WQ*u%[Q.X:]Q.Y:_Q.Z:aQ.w)pS.|)v/OQ/Q)yQ/R){Q/S)|Q/[*TQ/a*ZQ/s*iQ/t*jh0T+U.S0{2m4z6O7[7{8k8}9]9eQ0o+pQ0q+sQ2p:hQ2q:jQ2r:lQ2s.^S3X:W:XQ3l/]Q3m/^Q3q/`Q4R/{Q4j0pQ4l0sQ6S:pQ6T:rQ6X:^Q6Y:`Q6Z:bQ6`3eQ6g3oQ6k3wQ6q3}Q6s4VQ6u4XQ8Q:mQ8R:iQ8S:kQ8[6fQ8`6oQ9P:qQ9Q:sQ9R8WQ9f:vQ9o:wQ;P;_Q;];gQ;^;hQ;i;kR;j;llpOXs!Y#b%e&h&j&k&m,a,f1f1iQ!ePS#dZ#mQ&r!_U'^!n4q7YQ't#QQ(w#zQ)h$lS,Y&a&dQ,_&eQ,l&qQ,q&yQ-T'WQ.e(uQ.u)iQ0P*{Q0W+VQ1b,^Q2T-VQ2k.TQ3`.pQ4P/yQ4x0|Q5Z1^Q5[1_Q5`1aQ5b1cQ5g1kQ5}2nQ6^3]Q7^4{Q7j5]Q7k5^Q7m5aQ7}6RQ8l7_R8v7n#UcOPXZs!Y!_!n#b#m#z%e&a&d&e&h&j&k&m&q&y'W(u*{+V,^,a,f-V.T/y0|1^1_1a1c1f1i1k2n4q4{5]5^5a6R7Y7_7nQ#WWQ#cYQ%itQ%juS%lv!fS'w#U'zQ'}#XQ(i#sQ(p#wQ(x#}Q(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)U$ZQ)X$`Q)]$dW)g$l)i.p3]Q+S%kQ+h%xS,w&}1zQ-f'hS-k'x-mQ-p(QQ-r(XQ.](mQ.c(qQ.g9pQ.i9sQ.j9tQ.k9wQ.z)tQ/|*wQ1u,rQ1x,uQ2Y-_Q2a-sQ2u.aQ2z9xQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W.hQ3Z:YQ3[:cQ3a:UQ4S0OQ4[0`Q5m:dQ5s2[Q5x2bQ6U2vQ6V:eQ6[:gQ6]:nQ7T4oQ7r5kQ7v5tQ8P:oQ8T:tQ8U:uQ8z7xQ9Y8gQ9a8xQ9r#QR;U;bR#YWR'P!dY!sQ'U-R0y4tS&{!d,yQ'a!qS'k!t!wS'm!x4vS,v&|'TS-b'b'cQ-d'dQ2P-PR2_-cR(o#vR(r#wQ!eQT-Q'U-R]!pQ!q'U-R0y4tQ#n]R'_9qT#iZ%]S#hZ%]S%cm,]U([#f#g#jS-v(](^Q-z(_Q0Q*|Q2d-wU2e-x-y-{S5z2f2gR7y5{`#[W#U#X%`'x(R*y-qr#eZm#f#g#j%](](^(_*|-w-x-y-{2f2g5{Q1`,]Q1v,sQ5i1nQ7q5jT:|&}*zT#_W%`S#^W%`S'y#U(RS(O#X*yS,x&}*zT-l'x-qT'S!d%aQ$jfR)n$oT)c$j)dR3_.oT*S$w*UR*[$zQ0U+UQ2i.SQ4w0{Q6P2mQ7]4zQ7|6OQ8i7[Q8{7{Q9[8kQ9d8}Q9i9]R9l9elqOXs!Y#b%e&h&j&k&m,a,f1f1iQ&b!UR,U&_rmOXs!T!U!Y#b%e&_&h&j&k&m,a,f1f1iR,]&eT%dm,]R0u+uR,T&]Q%{{R+m%|R+c%vT&f!V&iT&g!V&iT1h,f1i",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > 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 JSXStartTag 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:366,context:Vi,nodeProps:[["group",-26,6,14,16,62,199,203,207,208,210,213,216,226,228,234,236,238,240,243,249,255,257,259,261,263,265,266,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[Wi],skippedNodes:[0,3,4,269],repeatNodeCount:33,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$d&j'xp'{!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$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$d&j'{!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'{!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$d&j'xpOY(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'xpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'xp'{!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$d&j'xp'{!b'n(;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'y#S$d&j'o(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$d&j'xp'{!b'o(;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`$d&j!l$Ip'xp'{!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`#q$Id$d&j'xp'{!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_#q$Id$d&j'xp'{!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$2b3l_'w$(n$d&j'{!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$d&j'{!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$d&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$_#t$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$_#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$_#t$d&j'{!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'{!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$_#t'{!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$d&j'xp'{!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$d&j'xp'{!b(V!LY'u&;d$W#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P+d@`k$d&j'xp'{!b$W#tOY%ZYZ&cZr%Zrs&}st%Ztu@Tuw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![@T![!^%Z!^!_*g!_!c%Z!c!}@T!}#O%Z#O#P&c#P#R%Z#R#S@T#S#T%Z#T#o@T#o#p*g#p$g%Z$g;'S@T;'S;=`BT<%lO@T+dBWP;=`<%l@T(CSB^P;=`<%l>P%#SBl`$d&j'xp'{!b#i$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Cn!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SCy_$d&j#{$Id'xp'{!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%DfETa(k%Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>fi$d&j'xp'{!bl$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#>Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#b%Z#b#c#5T#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#@b_!a$b$d&j#y%Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$JT>P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(CS$=Uk$d&j'xp'{!b'o(;d(V!LY'u&;d$W#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P",tokenizers:[_i,Ci,2,3,4,5,6,7,8,9,10,11,12,13,Ri,new te("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOq~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!O~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(U~~",141,327),new te("j~RQYZXz{^~^O'r~~aP!P!Qd~iO's~~",25,309)],topRules:{Script:[0,5],SingleExpression:[1,267],SingleClassItem:[2,268]},dialects:{jsx:12794,ts:12796},dynamicPrecedences:{76:1,78:1,163:1,191:1},specialized:[{term:313,get:O=>qi[O]||-1},{term:329,get:O=>ji[O]||-1},{term:67,get:O=>zi[O]||-1}],tokenPrec:12820}),Ii=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),P("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),P(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),P(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),P('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),P('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],uO=new wO,JO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function z(O){return(e,a)=>{let t=e.node.getChild("VariableDefinition");return t&&a(t,O),!0}}const Ai=["FunctionDeclaration"],Ei={FunctionDeclaration:z("function"),ClassDeclaration:z("class"),ClassExpression:()=>!0,EnumDeclaration:z("constant"),TypeAliasDeclaration:z("type"),NamespaceDeclaration:z("namespace"),VariableDefinition(O,e){O.matchContext(Ai)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function MO(O,e){let a=uO.get(e);if(a)return a;let t=[],i=!0;function s(r,l){let o=O.sliceString(r.from,r.to);t.push({label:o,type:l})}return e.cursor(ve.IncludeAnonymous).iterate(r=>{if(i)i=!1;else if(r.name){let l=Ei[r.name];if(l&&l(r,s)||JO.has(r.name))return!1}else if(r.to-r.from>8192){for(let l of MO(O,r.node))t.push(l);return!1}}),uO.set(e,t),t}const fO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,LO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Ni(O){let e=q(O.state).resolveInner(O.pos,-1);if(LO.indexOf(e.name)>-1)return null;let a=e.name=="VariableName"||e.to-e.from<20&&fO.test(O.state.sliceDoc(e.from,e.to));if(!a&&!O.explicit)return null;let t=[];for(let i=e;i;i=i.parent)JO.has(i.name)&&(t=t.concat(MO(O.state.doc,i)));return{options:t,from:a?e.from:O.pos,validFor:fO}}const w=ce.define({name:"javascript",parser:Gi.configure({props:[Qe.add({IfStatement:E({except:/^\s*({|else\b)/}),TryStatement:E({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Ct,SwitchBody:O=>{let e=O.textAfter,a=/^\s*\}/.test(e),t=/^\s*(case|default)\b/.test(e);return O.baseIndent+(a?0:t?1:2)*O.unit},Block:Wt({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":E({except:/^{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),ue.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":xO,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),FO={test:O=>/^JSX/.test(O.name),facet:qt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},KO=w.configure({dialect:"ts"},"typescript"),HO=w.configure({dialect:"jsx",props:[TO.add(O=>O.isTop?[FO]:void 0)]}),et=w.configure({dialect:"jsx ts",props:[TO.add(O=>O.isTop?[FO]:void 0)]},"typescript"),Bi="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(O=>({label:O,type:"keyword"}));function Ot(O={}){let e=O.jsx?O.typescript?et:HO:O.typescript?KO:w;return new fe(e,[w.data.of({autocomplete:yO(LO,YO(Ii.concat(Bi)))}),w.data.of({autocomplete:Ni}),O.jsx?Li:[]])}function Di(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function hO(O,e,a=O.length){for(let t=e==null?void 0:e.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return O.sliceString(t.from,Math.min(t.to,a));return""}function Ji(O){return O&&(O.name=="JSXEndTag"||O.name=="JSXSelfCloseEndTag")}const Mi=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Li=U.inputHandler.of((O,e,a,t)=>{if((Mi?O.composing:O.compositionStarted)||O.state.readOnly||e!=a||t!=">"&&t!="/"||!w.isActiveAt(O.state,e,-1))return!1;let{state:i}=O,s=i.changeByRange(r=>{var l;let{head:o}=r,Q=q(i).resolveInner(o,-1),f;if(Q.name=="JSXStartTag"&&(Q=Q.parent),!(Q.name=="JSXAttributeValue"&&Q.to>o)){if(t==">"&&Q.name=="JSXFragmentTag")return{range:N.cursor(o+1),changes:{from:o,insert:">"}};if(t=="/"&&Q.name=="JSXFragmentTag"){let c=Q.parent,h=c==null?void 0:c.parent;if(c.from==o-1&&((l=h.lastChild)===null||l===void 0?void 0:l.name)!="JSXEndTag"&&(f=hO(i.doc,h==null?void 0:h.firstChild,o))){let u=`/${f}>`;return{range:N.cursor(o+u.length),changes:{from:o,insert:u}}}}else if(t==">"){let c=Di(Q);if(c&&!Ji(c.lastChild)&&i.sliceDoc(o,o+2)!="`}}}}return{range:r}});return s.changes.empty?!1:(O.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)}),G=["_blank","_self","_top","_parent"],me=["ascii","utf-8","utf-16","latin1","latin1"],Xe=["get","post","put","delete"],Pe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],X=["true","false"],d={},Fi={a:{attrs:{href:null,ping:null,type:null,media:null,target:G,hreflang:null}},abbr:d,address:d,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:d,aside:d,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:d,base:{attrs:{href:null,target:G}},bdi:d,bdo:d,blockquote:{attrs:{cite:null}},body:d,br:d,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Pe,formmethod:Xe,formnovalidate:["novalidate"],formtarget:G,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:d,center:d,cite:d,code:d,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:d,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:d,div:d,dl:d,dt:d,em:d,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:d,figure:d,footer:d,form:{attrs:{action:null,name:null,"accept-charset":me,autocomplete:["on","off"],enctype:Pe,method:Xe,novalidate:["novalidate"],target:G}},h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:d,hgroup:d,hr:d,html:{attrs:{manifest:null}},i:d,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Pe,formmethod:Xe,formnovalidate:["novalidate"],formtarget:G,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:d,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:d,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:d,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:me,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:d,noscript:d,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:d,param:{attrs:{name:null,value:null}},pre:d,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:d,rt:d,ruby:d,samp:d,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:me}},section:d,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:d,source:{attrs:{src:null,type:null,media:null}},span:d,strong:d,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:d,summary:d,sup:d,table:d,tbody:d,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:d,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:d,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:d,time:{attrs:{datetime:null}},title:d,tr:d,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:d,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:d},tt={accesskey:null,class:null,contenteditable:X,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:X,autocorrect:X,autocapitalize:X,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":X,"aria-autocomplete":["inline","list","both","none"],"aria-busy":X,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":X,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":X,"aria-hidden":X,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":X,"aria-multiselectable":X,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":X,"aria-relevant":null,"aria-required":X,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},at="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(O=>"on"+O);for(let O of at)tt[O]=null;class le{constructor(e,a){this.tags=Object.assign(Object.assign({},Fi),e),this.globalAttrs=Object.assign(Object.assign({},tt),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}le.default=new le;function C(O,e,a=O.length){if(!e)return"";let t=e.firstChild,i=t&&t.getChild("TagName");return i?O.sliceString(i.from,Math.min(i.to,a)):""}function W(O,e=!1){for(;O;O=O.parent)if(O.name=="Element")if(e)e=!1;else return O;return null}function it(O,e,a){let t=a.tags[C(O,W(e))];return(t==null?void 0:t.children)||a.allTags}function Re(O,e){let a=[];for(let t=W(e);t&&!t.type.isTop;t=W(t.parent)){let i=C(O,t);if(i&&t.lastChild.name=="CloseTag")break;i&&a.indexOf(i)<0&&(e.name=="EndTag"||e.from>=t.firstChild.to)&&a.push(i)}return a}const rt=/^[:\-\.\w\u00b7-\uffff]*$/;function dO(O,e,a,t,i){let s=/\s*>/.test(O.sliceDoc(i,i+5))?"":">",r=W(a,!0);return{from:t,to:i,options:it(O.doc,r,e).map(l=>({label:l,type:"type"})).concat(Re(O.doc,a).map((l,o)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-o}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function pO(O,e,a,t){let i=/\s*>/.test(O.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:Re(O.doc,e).map((s,r)=>({label:s,apply:s+i,type:"type",boost:99-r})),validFor:rt}}function Ki(O,e,a,t){let i=[],s=0;for(let r of it(O.doc,a,e))i.push({label:"<"+r,type:"type"});for(let r of Re(O.doc,a))i.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Hi(O,e,a,t,i){let s=W(a),r=s?e.tags[C(O.doc,s)]:null,l=r&&r.attrs?Object.keys(r.attrs):[],o=r&&r.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:t,to:i,options:o.map(Q=>({label:Q,type:"property"})),validFor:rt}}function er(O,e,a,t,i){var s;let r=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],o;if(r){let Q=O.sliceDoc(r.from,r.to),f=e.globalAttrs[Q];if(!f){let c=W(a),h=c?e.tags[C(O.doc,c)]:null;f=(h==null?void 0:h.attrs)&&h.attrs[Q]}if(f){let c=O.sliceDoc(t,i).toLowerCase(),h='"',u='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",u=O.sliceDoc(i,i+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let p of f)l.push({label:p,apply:h+p+u,type:"constant"})}}return{from:t,to:i,options:l,validFor:o}}function Or(O,e){let{state:a,pos:t}=e,i=q(a).resolveInner(t,-1),s=i.resolve(t);for(let r=t,l;s==i&&(l=i.childBefore(r));){let o=l.lastChild;if(!o||!o.type.isError||o.fromOr(t,i)}const st=[{tag:"script",attrs:O=>O.type=="text/typescript"||O.lang=="ts",parser:KO.parser},{tag:"script",attrs:O=>O.type=="text/babel"||O.type=="text/jsx",parser:HO.parser},{tag:"script",attrs:O=>O.type=="text/typescript-jsx",parser:et.parser},{tag:"script",attrs(O){return!O.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(O.type)},parser:w.parser},{tag:"style",attrs(O){return(!O.lang||O.lang=="css")&&(!O.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(O.type))},parser:se.parser}],lt=[{name:"style",parser:se.parser.configure({top:"Styles"})}].concat(at.map(O=>({name:O,parser:w.parser}))),nt=ce.define({name:"html",parser:Ja.configure({props:[Qe.add({Element(O){let e=/^(\s*)(<\/)?/.exec(O.textAfter);return O.node.to<=O.pos+e[0].length?O.continue():O.lineIndent(O.node.from)+(e[2]?0:O.unit)},"OpenTag CloseTag SelfClosingTag"(O){return O.column(O.node.from)+O.unit},Document(O){if(O.pos+/\s*/.exec(O.textAfter)[0].lengthO.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),H=nt.configure({wrap:AO(st,lt)});function ar(O={}){let e="",a;O.matchClosingTags===!1&&(e="noMatch"),O.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(a=AO((O.nestedLanguages||[]).concat(st),(O.nestedAttributes||[]).concat(lt)));let t=a?nt.configure({wrap:a,dialect:e}):e?H.configure({dialect:e}):H;return new fe(t,[H.data.of({autocomplete:tr(O)}),O.autoCloseTags!==!1?ir:[],Ot().support,mi().support])}const SO=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ir=U.inputHandler.of((O,e,a,t)=>{if(O.composing||O.state.readOnly||e!=a||t!=">"&&t!="/"||!H.isActiveAt(O.state,e,-1))return!1;let{state:i}=O,s=i.changeByRange(r=>{var l,o,Q;let{head:f}=r,c=q(i).resolveInner(f,-1),h;if((c.name=="TagName"||c.name=="StartTag")&&(c=c.parent),t==">"&&c.name=="OpenTag"){if(((o=(l=c.parent)===null||l===void 0?void 0:l.lastChild)===null||o===void 0?void 0:o.name)!="CloseTag"&&(h=C(i.doc,c.parent,f))&&!SO.has(h)){let u=O.state.doc.sliceString(f,f+1)===">",p=`${u?"":">"}`;return{range:N.cursor(f+1),changes:{from:f+(u?1:0),insert:p}}}}else if(t=="/"&&c.name=="OpenTag"){let u=c.parent,p=u==null?void 0:u.parent;if(u.from==f-1&&((Q=p.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(h=C(i.doc,p,f))&&!SO.has(h)){let g=O.state.doc.sliceString(f,f+1)===">",$=`/${h}${g?"":">"}`,k=f+$.length+(g?1:0);return{range:N.cursor(k),changes:{from:f,insert:$}}}}return{range:r}});return s.changes.empty?!1:(O.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)}),rr=36,$O=1,sr=2,I=3,Ze=4,lr=5,nr=6,or=7,cr=8,Qr=9,ur=10,fr=11,hr=12,dr=13,pr=14,Sr=15,$r=16,gr=17,gO=18,mr=19,ot=20,ct=21,mO=22,Xr=23,Pr=24;function we(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function Zr(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function v(O,e,a){for(let t=!1;;){if(O.next<0)return;if(O.next==e&&!t){O.advance();return}t=a&&!t&&O.next==92,O.advance()}}function br(O){for(;;){if(O.next<0||O.peek(1)<0)return;if(O.next==36&&O.peek(1)==36){O.advance(2);return}O.advance()}}function kr(O,e){let a="[{<(".indexOf(String.fromCharCode(e)),t=a<0?e:"]}>)".charCodeAt(a);for(;;){if(O.next<0)return;if(O.next==t&&O.peek(1)==39){O.advance(2);return}O.advance()}}function Qt(O,e){for(;!(O.next!=95&&!we(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function xr(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),v(O,e,!1)}else Qt(O)}function XO(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function PO(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function ZO(O){for(;!(O.next<0||O.next==10);)O.advance()}function T(O,e){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ut(yr,wr)};function Yr(O,e,a,t){let i={};for(let s in ye)i[s]=(O.hasOwnProperty(s)?O:ye)[s];return e&&(i.words=ut(e,a||"",t)),i}function ft(O){return new b(e=>{var a;let{next:t}=e;if(e.advance(),T(t,be)){for(;T(e.next,be);)e.advance();e.acceptToken(rr)}else if(t==36&&e.next==36&&O.doubleDollarQuotedStrings)br(e),e.acceptToken(I);else if(t==39||t==34&&O.doubleQuotedStrings)v(e,t,O.backslashEscapes),e.acceptToken(I);else if(t==35&&O.hashComments||t==47&&e.next==47&&O.slashComments)ZO(e),e.acceptToken($O);else if(t==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))ZO(e),e.acceptToken($O);else if(t==47&&e.next==42){e.advance();for(let i=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(i--,e.advance(),!i)break}else s==47&&e.next==42&&(i++,e.advance())}e.acceptToken(sr)}else if((t==101||t==69)&&e.next==39)e.advance(),v(e,39,!0);else if((t==110||t==78)&&e.next==39&&O.charSetCasts)e.advance(),v(e,39,O.backslashEscapes),e.acceptToken(I);else if(t==95&&O.charSetCasts)for(let i=0;;i++){if(e.next==39&&i>1){e.advance(),v(e,39,O.backslashEscapes),e.acceptToken(I);break}if(!we(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(t==113||t==81)&&e.next==39&&e.peek(1)>0&&!T(e.peek(1),be)){let i=e.peek(1);e.advance(2),kr(e,i),e.acceptToken(I)}else if(t==40)e.acceptToken(or);else if(t==41)e.acceptToken(cr);else if(t==123)e.acceptToken(Qr);else if(t==125)e.acceptToken(ur);else if(t==91)e.acceptToken(fr);else if(t==93)e.acceptToken(hr);else if(t==59)e.acceptToken(dr);else if(O.unquotedBitLiterals&&t==48&&e.next==98)e.advance(),XO(e),e.acceptToken(mO);else if((t==98||t==66)&&(e.next==39||e.next==34)){const i=e.next;e.advance(),O.treatBitsAsBytes?(v(e,i,O.backslashEscapes),e.acceptToken(Xr)):(XO(e,i),e.acceptToken(mO))}else if(t==48&&(e.next==120||e.next==88)||(t==120||t==88)&&e.next==39){let i=e.next==39;for(e.advance();Zr(e.next);)e.advance();i&&e.next==39&&e.advance(),e.acceptToken(Ze)}else if(t==46&&e.next>=48&&e.next<=57)PO(e,!0),e.acceptToken(Ze);else if(t==46)e.acceptToken(pr);else if(t>=48&&t<=57)PO(e,!1),e.acceptToken(Ze);else if(T(t,O.operatorChars)){for(;T(e.next,O.operatorChars);)e.advance();e.acceptToken(Sr)}else if(T(t,O.specialVar))e.next==t&&e.advance(),xr(e),e.acceptToken(gr);else if(T(t,O.identifierQuotes))v(e,t,!1),e.acceptToken(mr);else if(t==58||t==44)e.acceptToken($r);else if(we(t)){let i=Qt(e,String.fromCharCode(t));e.acceptToken(e.next==46?gO:(a=O.words[i.toLowerCase()])!==null&&a!==void 0?a:gO)}})}const ht=ft(ye),Tr=V.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ht],topRules:{Script:[0,25]},tokenPrec:0});function Ye(O){let e=O.cursor().moveTo(O.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function B(O,e){let a=O.sliceString(e.from,e.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function ne(O){return O&&(O.name=="Identifier"||O.name=="QuotedIdentifier")}function vr(O,e){if(e.name=="CompositeIdentifier"){let a=[];for(let t=e.firstChild;t;t=t.nextSibling)ne(t)&&a.push(B(O,t));return a}return[B(O,e)]}function bO(O,e){for(let a=[];;){if(!e||e.name!=".")return a;let t=Ye(e);if(!ne(t))return a;a.unshift(B(O,t)),e=Ye(t)}}function Ur(O,e){let a=q(O).resolveInner(e,-1),t=Rr(O.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?O.doc.sliceString(a.from,a.from+1):null,parents:bO(O.doc,Ye(a)),aliases:t}:a.name=="."?{from:e,quoted:null,parents:bO(O.doc,a),aliases:t}:{from:e,quoted:null,parents:[],empty:!0,aliases:t}}const Vr=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Rr(O,e){let a;for(let i=e;!a;i=i.parent){if(!i)return null;i.name=="Statement"&&(a=i)}let t=null;for(let i=a.firstChild,s=!1,r=null;i;i=i.nextSibling){let l=i.name=="Keyword"?O.sliceString(i.from,i.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&r&&ne(i.nextSibling))o=B(O,i.nextSibling);else{if(l&&Vr.has(l))break;r&&ne(i)&&(o=B(O,i))}o&&(t||(t=Object.create(null)),t[o]=vr(O,r)),r=/Identifier$/.test(i.name)?i:null}return t}function _r(O,e){return O?e.map(a=>Object.assign(Object.assign({},a),{label:O+a.label+O,apply:void 0})):e}const Cr=/^\w*$/,Wr=/^[`'"]?\w*[`'"]?$/;class _e{constructor(){this.list=[],this.children=void 0}child(e,a){let t=this.children||(this.children=Object.create(null)),i=t[e];return i||(e&&this.list.push(dt(e,"type",a)),t[e]=new _e)}addCompletions(e){for(let a of e){let t=this.list.findIndex(i=>i.label==a.label);t>-1?this.list[t]=a:this.list.push(a)}}}function dt(O,e,a){return/[^\w\xb5-\uffff]/.test(O)?{label:O,type:e,apply:a+O+a}:{label:O,type:e}}function qr(O,e,a,t,i,s){var r;let l=new _e,o=((r=s==null?void 0:s.spec.identifierQuotes)===null||r===void 0?void 0:r[0])||'"',Q=l.child(i||"",o);for(let f in O){let c=f.replace(/\\?\./g,u=>u=="."?"\0":u).split("\0"),h=c.length==1?Q:l;for(let u of c)h=h.child(u.replace(/\\\./g,"."),o);for(let u of O[f])u&&h.list.push(typeof u=="string"?dt(u,"property",o):u)}return e&&Q.addCompletions(e),a&&l.addCompletions(a),l.addCompletions(Q.list),t&&l.addCompletions(Q.child(t,o).list),f=>{let{parents:c,from:h,quoted:u,empty:p,aliases:g}=Ur(f.state,f.pos);if(p&&!f.explicit)return null;g&&c.length==1&&(c=g[c[0]]||c);let $=l;for(let y of c){for(;!$.children||!$.children[y];)if($==l)$=Q;else if($==Q&&t)$=$.child(t,o);else return null;$=$.child(y,o)}let k=u&&f.state.sliceDoc(f.pos,f.pos+1)==u,R=$.list;return $==l&&g&&(R=R.concat(Object.keys(g).map(y=>({label:y,type:"constant"})))),{from:h,to:k?f.pos+1:void 0,options:_r(u,R),validFor:u?Wr:Cr}}}function jr(O,e){let a=Object.keys(O).map(t=>({label:e?t.toUpperCase():t,type:O[t]==ct?"type":O[t]==ot?"keyword":"variable",boost:-1}));return yO(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],YO(a))}let zr=Tr.configure({props:[Qe.add({Statement:E()}),ue.add({Statement(O){return{from:O.firstChild.to,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}}),oe({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class D{constructor(e,a,t){this.dialect=e,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(e){let a=Yr(e,e.keywords,e.types,e.builtin),t=ce.define({name:"sql",parser:zr.configure({tokenizers:[{from:ht,to:ft(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new D(a,t,e)}}function Gr(O,e=!1){return jr(O.dialect.words,e)}function Ir(O,e=!1){return O.language.data.of({autocomplete:Gr(O,e)})}function Ar(O){return O.schema?qr(O.schema,O.tables,O.schemas,O.defaultTable,O.defaultSchema,O.dialect||Ce):()=>null}function Er(O){return O.schema?(O.dialect||Ce).language.data.of({autocomplete:Ar(O)}):[]}function kO(O={}){let e=O.dialect||Ce;return new fe(e.language,[Er(O),Ir(e,!!O.upperCaseKeywords)])}const Ce=D.define({});function Nr(O){let e;return{c(){e=Xt("div"),Pt(e,"class","code-editor"),J(e,"min-height",O[0]?O[0]+"px":null),J(e,"max-height",O[1]?O[1]+"px":"auto")},m(a,t){Zt(a,e,t),O[11](e)},p(a,[t]){t&1&&J(e,"min-height",a[0]?a[0]+"px":null),t&2&&J(e,"max-height",a[1]?a[1]+"px":"auto")},i:ze,o:ze,d(a){a&&bt(e),O[11](null)}}}function Br(O,e,a){let t;kt(O,xt,S=>a(12,t=S));const i=wt();let{id:s=""}=e,{value:r=""}=e,{minHeight:l=null}=e,{maxHeight:o=null}=e,{disabled:Q=!1}=e,{placeholder:f=""}=e,{language:c="javascript"}=e,{singleLine:h=!1}=e,u,p,g=new M,$=new M,k=new M,R=new M;function y(){u==null||u.focus()}function pt(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r},bubbles:!0})),i("change",r)}function We(){if(!s)return;const S=document.querySelectorAll('[for="'+s+'"]');for(let m of S)m.removeEventListener("click",y)}function qe(){if(!s)return;We();const S=document.querySelectorAll('[for="'+s+'"]');for(let m of S)m.addEventListener("click",y)}function je(){switch(c){case"html":return ar();case"sql-create-index":return kO({dialect:D.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let S={};for(let m of t)S[m.name]=Yt.getAllCollectionIdentifiers(m);return kO({dialect:D.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:S,upperCaseKeywords:!0});default:return Ot()}}yt(()=>{const S={key:"Enter",run:m=>{h&&i("submit",r)}};return qe(),a(10,u=new U({parent:p,state:j.create({doc:r,extensions:[zt(),Gt(),It(),At(),Et(),j.allowMultipleSelections.of(!0),Nt(Bt,{fallback:!0}),Dt(),Jt(),Mt(),Lt(),Ft.of([S,...Kt,...Ht,ea.find(m=>m.key==="Mod-d"),...Oa,...ta]),U.lineWrapping,aa({icons:!1}),g.of(je()),R.of(Ge(f)),$.of(U.editable.of(!0)),k.of(j.readOnly.of(!1)),j.transactionFilter.of(m=>h&&m.newDoc.lines>1?[]:m),U.updateListener.of(m=>{!m.docChanged||Q||(a(3,r=m.state.doc.toString()),pt())})]})})),()=>{We(),u==null||u.destroy()}});function St(S){Tt[S?"unshift":"push"](()=>{p=S,a(2,p)})}return O.$$set=S=>{"id"in S&&a(4,s=S.id),"value"in S&&a(3,r=S.value),"minHeight"in S&&a(0,l=S.minHeight),"maxHeight"in S&&a(1,o=S.maxHeight),"disabled"in S&&a(5,Q=S.disabled),"placeholder"in S&&a(6,f=S.placeholder),"language"in S&&a(7,c=S.language),"singleLine"in S&&a(8,h=S.singleLine)},O.$$.update=()=>{O.$$.dirty&16&&s&&qe(),O.$$.dirty&1152&&u&&c&&u.dispatch({effects:[g.reconfigure(je())]}),O.$$.dirty&1056&&u&&typeof Q<"u"&&u.dispatch({effects:[$.reconfigure(U.editable.of(!Q)),k.reconfigure(j.readOnly.of(Q))]}),O.$$.dirty&1032&&u&&r!=u.state.doc.toString()&&u.dispatch({changes:{from:0,to:u.state.doc.length,insert:r}}),O.$$.dirty&1088&&u&&typeof f<"u"&&u.dispatch({effects:[R.reconfigure(Ge(f))]})},[l,o,p,r,s,Q,f,c,h,y,u,St]}class Mr extends $t{constructor(e){super(),gt(this,e,Br,Nr,mt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Mr as default}; diff --git a/ui/dist/assets/CodeEditor-8fadd9a5.js b/ui/dist/assets/CodeEditor-8fadd9a5.js deleted file mode 100644 index 9a86ab56..00000000 --- a/ui/dist/assets/CodeEditor-8fadd9a5.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as $t,i as gt,s as mt,e as Xt,f as Pt,T as D,g as Zt,y as je,o as bt,I as kt,J as xt,K as wt,H as yt,C as Yt,L as Tt}from"./index-3379c20e.js";import{P as vt,N as Ut,u as Vt,D as Rt,v as Ye,T as L,I as Te,w as oe,x as n,y as _t,L as ce,z as Qe,A,B as ue,F as xO,G as fe,H as q,J as wO,K as yO,M as YO,E as v,O as E,Q as Ct,R as Wt,U as TO,V as P,W as qt,X as jt,a as j,h as zt,b as Gt,c as It,d as At,e as Et,s as Nt,t as Bt,f as Dt,g as Jt,r as Mt,i as Lt,k as Ft,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as ze,C as J}from"./index-fd4289fb.js";class ee{constructor(e,a,t,i,s,r,l,o,Q,u=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=i,this.pos=s,this.score=r,this.buffer=l,this.bufferBase=o,this.curContext=Q,this.lookAhead=u,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 i=e.parser.context;return new ee(e,[],a,t,t,0,[],0,i?new Ge(i,i.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,i=e&65535,{parser:s}=this.p,r=s.dynamicPrecedence(i);if(r&&(this.score+=r),t==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((a=this.p.parser.nodeSet.types[i])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,a,t,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&r.buffer[l-4]==0&&r.buffer[l-1]>-1){if(a==t)return;if(r.buffer[l-2]>=a){r.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,i);else{let r=this.buffer.length;if(r>0&&this.buffer[r-4]!=0)for(;r>0&&this.buffer[r-2]>t;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4);this.buffer[r]=e,this.buffer[r+1]=a,this.buffer[r+2]=t,this.buffer[r+3]=i}}shift(e,a,t){let i=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=t,this.shiftContext(a,i),a<=this.p.parser.maxNode&&this.buffer.push(a,i,t,4);else{let s=e,{parser:r}=this.p;(t>this.pos||a<=r.maxNode)&&(this.pos=t,r.stateFlag(s,1)||(this.reducePos=t)),this.pushState(s,i),this.shiftContext(a,i),a<=r.maxNode&&this.buffer.push(a,i,t,4)}}apply(e,a,t){e&65536?this.reduce(e):this.shift(e,a,t)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(a,i),this.buffer.push(t,i,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),i=e.bufferBase+a;for(;e&&i==e.bufferBase;)e=e.parent;return new ee(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,i,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 ia(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 i=[];for(let s=0,r;so&1&&l==r)||i.push(a[s],r)}a=i}let t=[];for(let i=0;i>19,i=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;a=r}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=(i,s)=>{if(!a.includes(i))return a.push(i),e.allActions(i,r=>{if(!(r&393216))if(r&65536){let l=(r>>19)-s;if(l>1){let o=r&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}else{let l=t(r,s+1);if(l!=null)return l}})};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.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 Ge{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}var Ie;(function(O){O[O.Insert=200]="Insert",O[O.Delete=190]="Delete",O[O.Reduce=100]="Reduce",O[O.MaxNext=4]="MaxNext",O[O.MaxInsertStackDepth=300]="MaxInsertStackDepth",O[O.DampenInsertStackDepth=120]="DampenInsertStackDepth",O[O.MinBigReduction=2e3]="MinBigReduction"})(Ie||(Ie={}));class ia{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 i=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=i}}class Oe{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 Oe(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 Oe(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,i=0;t=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}a?a[i++]=s:a=new e(s)}return a}class F{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ae=new F;class ra{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ae,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,i=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];s+=r.from-t.to,t=r}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,i;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}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=Ae,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 i of this.ranges){if(i.from>=a)break;i.to>e&&(t+=this.input.read(Math.max(i.from,e),Math.min(i.to,a)))}return t}}class _{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;vO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}_.prototype.contextual=_.prototype.fallback=_.prototype.extend=!1;class te{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,i=0;for(;;){let s=e.next<0,r=e.resolveOffset(1,1);if(vO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,r==null)break;e.reset(r,e.token)}i&&(e.reset(t,e.token),e.acceptToken(this.elseToken,i))}}te.prototype.contextual=_.prototype.fallback=_.prototype.extend=!1;class b{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function vO(O,e,a,t,i,s){let r=0,l=1<0){let p=O[f];if(o.allows(p)&&(e.token.value==-1||e.token.value==p||sa(p,e.token.value,i,s))){e.acceptToken(p);break}}let u=e.next,c=0,h=O[r+2];if(e.next<0&&h>c&&O[Q+h*3-3]==65535&&O[Q+h*3-3]==65535){r=O[Q+h*3-1];continue e}for(;c>1,p=Q+f+(f<<1),g=O[p],$=O[p+1]||65536;if(u=$)c=f+1;else{r=O[p+2],e.advance();continue e}}break}}function Ee(O,e,a){for(let t=e,i;(i=O[t])!=65535;t++)if(i==a)return t-e;return-1}function sa(O,e,a,t){let i=Ee(a,t,e);return i<0||Ee(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 la{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?Be(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Be(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=r,null;if(s instanceof L){if(r==e){if(r=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(r),this.index.push(0))}else this.index[a]++,this.nextStart=r+s.length}}}class na{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new F)}getActions(e){let a=0,t=null,{parser:i}=e.p,{tokenizers:s}=i,r=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let h=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!u.extend&&(t=c,a>h))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!t&&e.pos==this.stream.end&&(t=new F,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 F,{pos:t,p:i}=e;return a.start=t,a.end=Math.min(t+1,i.stream.end),a.value=t==i.stream.end?i.parser.eofTerm:0,a}updateCachedToken(e,a,t){let i=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(i,e),t),e.value>-1){let{parser:s}=t.p;for(let r=0;r=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,a,t,i){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[r]=e;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;ra)t.push(l);else{if(this.advanceStack(l,t,e))continue;{i||(i=[],s=[]),i.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!t.length){let r=i&&Qa(i);if(r)return this.stackToTree(r);if(this.parser.strict)throw Z&&i&&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&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,t);if(r)return this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(t.length>r)for(t.sort((l,o)=>o.score-l.score);t.length>r;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let r=0;r500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(r--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let r=1;r ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,u=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(i);c;){let h=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(h>-1&&c.length&&(!Q||(c.prop(Ye.contextHash)||0)==u))return e.useNode(c,h),Z&&console.log(r+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof L)||c.children.length==0||c.positions[0]>0)break;let f=c.children[0];if(f instanceof L&&c.positions[0]==0)c=f;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(r+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qi?a.push(p):t.push(p)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Je(e,a),!0}}runRecovery(e,a,t){let i=null,s=!1;for(let r=0;r ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),h=u;for(let f=0;c.forceReduce()&&f<10&&(Z&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));f++)Z&&(h=this.stackID(c)+" -> ");for(let f of l.recoverByInsert(o))Z&&console.log(u+this.stackID(f)+" (via recover-insert)"),this.advanceFully(f,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),Je(l,t)):(!i||i.scoreO;class UO{constructor(e){this.start=e.start,this.shift=e.shift||de,this.reduce=e.reduce||de,this.reuse=e.reuse||de,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class U extends vt{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 l=0;le.topRules[l][1]),i=[];for(let l=0;l=0)s(u,o,l[Q++]);else{let c=l[Q+-u];for(let h=-u;h>0;h--)s(l[Q++],o,c);Q++}}}this.nodeSet=new Ut(a.map((l,o)=>Vt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:i[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Rt;let r=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new _(r,l):l),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 i=new oa(this,e,a,t);for(let s of this.wrappers)i=s(i,e,a,t);return i}getGoto(e,a,t=!1){let i=this.goto;if(a>=i[0])return-1;for(let s=i[a+1];;){let r=i[s++],l=r&1,o=i[s++];if(l&&t)return o;for(let Q=s+(r>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),i=t?a(t):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=x(this.data,s+2);else break;i=a(x(this.data,s+1))}return i}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 i=this.data[t+1];a.some((s,r)=>r&1&&s==i)||a.push(this.data[t],i)}}return a}configure(e){let a=Object.assign(Object.create(U.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 i=e.tokenizers.find(s=>s.from==t);return i?i.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,i)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let r=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[i]=Me(r),r})),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 r=a.indexOf(s);r>=0&&(t[r]=!0)}let i=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 ua=54,fa=1,ha=55,da=2,pa=56,Sa=3,Le=4,$a=5,ae=6,VO=7,RO=8,_O=9,CO=10,ga=11,ma=12,Xa=13,pe=57,Pa=14,Fe=58,WO=20,Za=22,qO=23,ba=24,be=26,jO=27,ka=28,xa=31,wa=34,ya=36,Ya=37,Ta=0,va=1,Ua={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},Va={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Ke={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 Ra(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function zO(O){return O==9||O==10||O==13||O==32}let He=null,eO=null,OO=0;function ke(O,e){let a=O.pos+e;if(OO==a&&eO==O)return He;let t=O.peek(e);for(;zO(t);)t=O.peek(++e);let i="";for(;Ra(t);)i+=String.fromCharCode(t),t=O.peek(++e);return eO=O,OO=a,He=i?i.toLowerCase():t==_a||t==Ca?void 0:null}const GO=60,ie=62,ve=47,_a=63,Ca=33,Wa=45;function tO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new tO(ke(t,1)||"",O):O},reduce(O,e){return e==WO&&O?O.parent:O},reuse(O,e,a,t){let i=e.type.id;return i==ae||i==ya?new tO(ke(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new b((O,e)=>{if(O.next!=GO){O.next<0&&e.context&&O.acceptToken(pe);return}O.advance();let a=O.next==ve;a&&O.advance();let t=ke(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Pa:ae);let i=e.context?e.context.name:null;if(a){if(t==i)return O.acceptToken(ga);if(i&&Va[i])return O.acceptToken(pe,-2);if(e.dialectEnabled(Ta))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Xa)}else{if(t=="script")return O.acceptToken(VO);if(t=="style")return O.acceptToken(RO);if(t=="textarea")return O.acceptToken(_O);if(Ua.hasOwnProperty(t))return O.acceptToken(CO);i&&Ke[i]&&Ke[i][t]?O.acceptToken(pe,-1):O.acceptToken(ae)}},{contextual:!0}),Ga=new b(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Fe);break}if(O.next==Wa)e++;else if(O.next==ie&&e>=2){a>3&&O.acceptToken(Fe,-2);break}else e=0;O.advance()}});function Ia(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new b((O,e)=>{if(O.next==ve&&O.peek(1)==ie){let a=e.dialectEnabled(va)||Ia(e.context);O.acceptToken(a?$a:Le,2)}else O.next==ie&&O.acceptToken(Le,1)});function Ue(O,e,a){let t=2+O.length;return new b(i=>{for(let s=0,r=0,l=0;;l++){if(i.next<0){l&&i.acceptToken(e);break}if(s==0&&i.next==GO||s==1&&i.next==ve||s>=2&&sr?i.acceptToken(e,-r):i.acceptToken(a,-(r-2));break}else if((i.next==10||i.next==13)&&l){i.acceptToken(e,1);break}else s=r=0;i.advance()}})}const Ea=Ue("script",ua,fa),Na=Ue("style",ha,da),Ba=Ue("textarea",pa,Sa),Da=oe({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),Ja=U.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:ja,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"]],propSources:[Da],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=l.type.id;if(Q==ka)return Se(l,o,a);if(Q==xa)return Se(l,o,t);if(Q==wa)return Se(l,o,i);if(Q==WO&&s.length){let u=l.node,c=u.firstChild,h=c&&aO(c,o),f;if(h){for(let p of s)if(p.tag==h&&(!p.attrs||p.attrs(f||(f=IO(u,o))))){let g=u.lastChild;return{parser:p.parser,overlay:[{from:c.to,to:g.type.id==Ya?g.from:u.to}]}}}}if(r&&Q==qO){let u=l.node,c;if(c=u.firstChild){let h=r[o.read(c.from,c.to)];if(h)for(let f of h){if(f.tagName&&f.tagName!=aO(u.parent,o))continue;let p=u.lastChild;if(p.type.id==be){let g=p.from+1,$=p.lastChild,k=p.to-($&&$.isError?0:1);if(k>g)return{parser:f.parser,overlay:[{from:g,to:k}]}}else if(p.type.id==jO)return{parser:f.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const Ma=96,iO=1,La=97,Fa=98,rO=2,EO=[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],Ka=58,Ha=40,NO=95,ei=91,K=45,Oi=46,ti=35,ai=37;function re(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function ii(O){return O>=48&&O<=57}const ri=new b((O,e)=>{for(let a=!1,t=0,i=0;;i++){let{next:s}=O;if(re(s)||s==K||s==NO||a&&ii(s))!a&&(s!=K||i>0)&&(a=!0),t===i&&s==K&&t++,O.advance();else{a&&O.acceptToken(s==Ha?La:t==2&&e.canShift(rO)?rO:Fa);break}}}),si=new b(O=>{if(EO.includes(O.peek(-1))){let{next:e}=O;(re(e)||e==NO||e==ti||e==Oi||e==ei||e==Ka||e==K)&&O.acceptToken(Ma)}}),li=new b(O=>{if(!EO.includes(O.peek(-1))){let{next:e}=O;if(e==ai&&(O.advance(),O.acceptToken(iO)),re(e)){do O.advance();while(re(O.next));O.acceptToken(iO)}}}),ni=oe({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),oi={__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:134},ci={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qi={__proto__:null,not:128,only:128},ui=U.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[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!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[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!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[si,li,ri,1,2,3,4,new te("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>oi[O]||-1},{term:56,get:O=>ci[O]||-1},{term:98,get:O=>Qi[O]||-1}],tokenPrec:1169});let $e=null;function ge(){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,i=>"-"+i.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const sO=["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})),lO=["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}))),fi=["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})),Y=/^(\w[\w-]*|-\w[\w-]*|)$/,hi=/^-(-[\w-]*)?$/;function di(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 nO=new wO,pi=["Declaration"];function Si(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function BO(O,e,a){if(e.to-e.from>4096){let t=nO.get(e);if(t)return t;let i=[],s=new Set,r=e.cursor(Te.IncludeAnonymous);if(r.firstChild())do for(let l of BO(O,r.node,a))s.has(l.label)||(s.add(l.label),i.push(l));while(r.nextSibling());return nO.set(e,i),i}else{let t=[],i=new Set;return e.cursor().iterate(s=>{var r;if(a(s)&&s.matchContext(pi)&&((r=s.node.nextSibling)===null||r===void 0?void 0:r.name)==":"){let l=O.sliceString(s.from,s.to);i.has(l)||(i.add(l),t.push({label:l,type:"variable"}))}}),t}}const $i=O=>e=>{let{state:a,pos:t}=e,i=q(a).resolveInner(t,-1),s=i.type.isError&&i.from==i.to-1&&a.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:ge(),validFor:Y};if(i.name=="ValueName")return{from:i.from,options:lO,validFor:Y};if(i.name=="PseudoClassName")return{from:i.from,options:sO,validFor:Y};if(O(i)||(e.explicit||s)&&di(i,a.doc))return{from:O(i)||s?i.from:t,options:BO(a.doc,Si(i),O),validFor:hi};if(i.name=="TagName"){for(let{parent:o}=i;o;o=o.parent)if(o.name=="Block")return{from:i.from,options:ge(),validFor:Y};return{from:i.from,options:fi,validFor:Y}}if(!e.explicit)return null;let r=i.resolve(t),l=r.childBefore(t);return l&&l.name==":"&&r.name=="PseudoClassSelector"?{from:t,options:sO,validFor:Y}:l&&l.name==":"&&r.name=="Declaration"||r.name=="ArgList"?{from:t,options:lO,validFor:Y}:r.name=="Block"||r.name=="Styles"?{from:t,options:ge(),validFor:Y}:null},gi=$i(O=>O.name=="VariableName"),se=ce.define({name:"css",parser:ui.configure({props:[Qe.add({Declaration:A()}),ue.add({Block:xO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mi(){return new fe(se,se.data.of({autocomplete:gi}))}const Xi=303,oO=1,Pi=2,Zi=304,bi=306,ki=307,xi=3,wi=4,yi=[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],DO=125,Yi=59,cO=47,Ti=42,vi=43,Ui=45,Vi=new UO({start:!1,shift(O,e){return e==xi||e==wi||e==bi?O:e==ki},strict:!1}),Ri=new b((O,e)=>{let{next:a}=O;(a==DO||a==-1||e.context)&&O.acceptToken(Zi)},{contextual:!0,fallback:!0}),_i=new b((O,e)=>{let{next:a}=O,t;yi.indexOf(a)>-1||a==cO&&((t=O.peek(1))==cO||t==Ti)||a!=DO&&a!=Yi&&a!=-1&&!e.context&&O.acceptToken(Xi)},{contextual:!0}),Ci=new b((O,e)=>{let{next:a}=O;if((a==vi||a==Ui)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(oO);O.acceptToken(t?oO:Pi)}},{contextual:!0}),Wi=oe({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,LineComment:n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),qi={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,using:413,interface:419,enum:423,namespace:429,module:431,declare:435,global:439,for:458,of:467,while:470,with:474,do:478,if:482,else:484,switch:488,case:494,try:500,catch:504,finally:508,return:512,throw:516,break:520,continue:524,debugger:528},ji={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},zi={__proto__:null,"<":137},Gi=U.deserialize({version:14,states:"$6tO`QUOOO%TQUOOO'WQWOOP(eOSOOO*sQ(CjO'#CfO*zOpO'#CgO+YO!bO'#CgO+hO07`O'#DZO-yQUO'#DaO.ZQUO'#DlO%TQUO'#DvO0_QUO'#EOOOQ(CY'#EW'#EWO0xQSO'#ETOOQO'#Ei'#EiOOQO'#Ic'#IcO1QQSO'#GkO1]QSO'#EhO1bQSO'#EhO3dQ(CjO'#JdO6TQ(CjO'#JeO6qQSO'#FWO6vQ#tO'#FoOOQ(CY'#F`'#F`O7RO&jO'#F`O7aQ,UO'#FvO8wQSO'#FuOOQ(CY'#Je'#JeOOQ(CW'#Jd'#JdO8|QSO'#GoOOQQ'#KP'#KPO9XQSO'#IPO9^Q(C[O'#IQOOQQ'#JQ'#JQOOQQ'#IU'#IUQ`QUOOO%TQUO'#DnO9fQUO'#DzO9mQUO'#D|O9SQSO'#GkO9tQ,UO'#ClO:SQSO'#EgO:_QSO'#ErO:dQ,UO'#F_O;RQSO'#GkOOQO'#KQ'#KQO;WQSO'#KQO;fQSO'#GsO;fQSO'#GtO;fQSO'#GvO9SQSO'#GyO<]QSO'#G|O=tQSO'#CbO>UQSO'#HYO>^QSO'#H`O>^QSO'#HbO`QUO'#HdO>^QSO'#HfO>^QSO'#HiO>cQSO'#HoO>hQ(C]O'#HuO%TQUO'#HwO>sQ(C]O'#HyO?OQ(C]O'#H{O9^Q(C[O'#H}O?ZQ(CjO'#CfO@]QWO'#DfQOQSOOO%TQUO'#D|O@sQSO'#EPO9tQ,UO'#EgOAOQSO'#EgOAZQ`O'#F_OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jh'#JhO%TQUO'#JhOOQO'#Jl'#JlOOQO'#I`'#I`OBZQWO'#E`OOQ(CW'#E_'#E_OCVQ(C`O'#E`OCaQWO'#ESOOQO'#Jk'#JkOCuQWO'#JlOESQWO'#ESOCaQWO'#E`PEaO?MpO'#C`POOO)CDo)CDoOOOO'#IV'#IVOElOpO,59ROOQ(CY,59R,59ROOOO'#IW'#IWOEzO!bO,59RO%TQUO'#D]OOOO'#IY'#IYOFYO07`O,59uOOQ(CY,59u,59uOFhQUO'#IZOF{QSO'#JfOH}QbO'#JfO+vQUO'#JfOIUQSO,59{OIlQSO'#EiOIyQSO'#JtOJUQSO'#JsOJUQSO'#JsOJ^QSO,5;VOJcQSO'#JrOOQ(CY,5:W,5:WOJjQUO,5:WOLkQ(CjO,5:bOM[QSO,5:jOMuQ(C[O'#JqOM|QSO'#JpO8|QSO'#JpONbQSO'#JpONjQSO,5;UONoQSO'#JpO!!wQbO'#JeOOQ(CY'#Cf'#CfO%TQUO'#EOO!#gQ`O,5:oOOQO'#Jm'#JmOOQO-EkOOQQ'#JY'#JYOOQQ,5>l,5>lOOQQ-EqQ(CjO,5:hOOQO,5@l,5@lO!?bQ,UO,5=VO!?pQ(C[O'#JZO8wQSO'#JZO!@RQ(C[O,59WO!@^QWO,59WO!@fQ,UO,59WO9tQ,UO,59WO!@qQSO,5;SO!@yQSO'#HXO!A[QSO'#KUO%TQUO,5;wO!7[QWO,5;yO!AdQSO,5=rO!AiQSO,5=rO!AnQSO,5=rO9^Q(C[O,5=rO;fQSO,5=bOOQO'#Cr'#CrO!A|QWO,5=_O!BUQ,UO,5=`O!BaQSO,5=bO!BfQ`O,5=eO!BnQSO'#KQO>cQSO'#HOO9SQSO'#HQO!BsQSO'#HQO9tQ,UO'#HSO!BxQSO'#HSOOQQ,5=h,5=hO!B}QSO'#HTO!CVQSO'#ClO!C[QSO,58|O!CfQSO,58|O!EkQUO,58|OOQQ,58|,58|O!E{Q(C[O,58|O%TQUO,58|O!HWQUO'#H[OOQQ'#H]'#H]OOQQ'#H^'#H^O`QUO,5=tO!HnQSO,5=tO`QUO,5=zO`QUO,5=|O!HsQSO,5>OO`QUO,5>QO!HxQSO,5>TO!H}QUO,5>ZOOQQ,5>a,5>aO%TQUO,5>aO9^Q(C[O,5>cOOQQ,5>e,5>eO!MXQSO,5>eOOQQ,5>g,5>gO!MXQSO,5>gOOQQ,5>i,5>iO!M^QWO'#DXO%TQUO'#JhO!M{QWO'#JhO!NjQWO'#DgO!N{QWO'#DgO##^QUO'#DgO##eQSO'#JgO##mQSO,5:QO##rQSO'#EmO#$QQSO'#JuO#$YQSO,5;WO#$_QWO'#DgO#$lQWO'#EROOQ(CY,5:k,5:kO%TQUO,5:kO#$sQSO,5:kO>cQSO,5;RO!@^QWO,5;RO!@fQ,UO,5;RO9tQ,UO,5;RO#${QSO,5@SO#%QQ!LQO,5:oOOQO-E<^-E<^O#&WQ(C`O,5:zOCaQWO,5:nO#&bQWO,5:nOCaQWO,5:zO!@RQ(C[O,5:nOOQ(CW'#Ec'#EcOOQO,5:z,5:zO%TQUO,5:zO#&oQ(C[O,5:zO#&zQ(C[O,5:zO!@^QWO,5:nOOQO,5;Q,5;QO#'YQ(C[O,5:zPOOO'#IT'#ITP#'nO?MpO,58zPOOO,58z,58zOOOO-EuO+vQUO,5>uOOQO,5>{,5>{O#(YQUO'#IZOOQO-E^QSO1G3jO$.OQUO1G3lO$2SQUO'#HkOOQQ1G3o1G3oO$2aQSO'#HqO>cQSO'#HsOOQQ1G3u1G3uO$2iQUO1G3uO9^Q(C[O1G3{OOQQ1G3}1G3}OOQ(CW'#GW'#GWO9^Q(C[O1G4PO9^Q(C[O1G4RO$6pQSO,5@SO!){QUO,5;XO8|QSO,5;XO>cQSO,5:RO!){QUO,5:RO!@^QWO,5:RO$6uQ$IUO,5:ROOQO,5;X,5;XO$7PQWO'#I[O$7gQSO,5@ROOQ(CY1G/l1G/lO$7oQWO'#IbO$7yQSO,5@aOOQ(CW1G0r1G0rO!N{QWO,5:ROOQO'#I_'#I_O$8RQWO,5:mOOQ(CY,5:m,5:mO#$vQSO1G0VOOQ(CY1G0V1G0VO%TQUO1G0VOOQ(CY1G0m1G0mO>cQSO1G0mO!@^QWO1G0mO!@fQ,UO1G0mOOQ(CW1G5n1G5nO!@RQ(C[O1G0YOOQO1G0f1G0fO%TQUO1G0fO$8YQ(C[O1G0fO$8eQ(C[O1G0fO!@^QWO1G0YOCaQWO1G0YO$8sQ(C[O1G0fOOQO1G0Y1G0YO$9XQ(CjO1G0fPOOO-EuO$9uQSO1G5lO$9}QSO1G5yO$:VQbO1G5zO8|QSO,5>{O$:aQ(CjO1G5wO%TQUO1G5wO$:qQ(C[O1G5wO$;SQSO1G5vO$;SQSO1G5vO8|QSO1G5vO$;[QSO,5?OO8|QSO,5?OOOQO,5?O,5?OO$;pQSO,5?OO$$QQSO,5?OOOQO-EqQ(CjO,5VOOQQ,5>V,5>VO%TQUO'#HlO%(SQSO'#HnOOQQ,5>],5>]O8|QSO,5>]OOQQ,5>_,5>_OOQQ7+)a7+)aOOQQ7+)g7+)gOOQQ7+)k7+)kOOQQ7+)m7+)mO%(XQWO1G5nO%(mQ$IUO1G0sO%(wQSO1G0sOOQO1G/m1G/mO%)SQ$IUO1G/mO>cQSO1G/mO!){QUO'#DgOOQO,5>v,5>vOOQO-E|,5>|OOQO-E<`-E<`O!@^QWO1G/mOOQO-E<]-E<]OOQ(CY1G0X1G0XOOQ(CY7+%q7+%qO#$vQSO7+%qOOQ(CY7+&X7+&XO>cQSO7+&XO!@^QWO7+&XOOQO7+%t7+%tO$9XQ(CjO7+&QOOQO7+&Q7+&QO%TQUO7+&QO%)^Q(C[O7+&QO!@RQ(C[O7+%tO!@^QWO7+%tO%)iQ(C[O7+&QO%)wQ(CjO7++cO%TQUO7++cO%*XQSO7++bO%*XQSO7++bOOQO1G4j1G4jO8|QSO1G4jO%*aQSO1G4jOOQO7+%y7+%yO#$vQSO<wOOQO-ExO%TQUO,5>xOOQO-E<[-E<[O%2aQSO1G5pOOQ(CY<QQ$IUO1G0xO%>XQ$IUO1G0xO%@PQ$IUO1G0xO%@dQ(CjO<WOOQQ,5>Y,5>YO%M}QSO1G3wO8|QSO7+&_O!){QUO7+&_OOQO7+%X7+%XO%NSQ$IUO1G5zO>cQSO7+%XOOQ(CY<cQSO<cQSO7+)cO&5kQSO<zAN>zO%TQUOAN?WOOQO<TQSOANAxOOQQANAzANAzO9^Q(C[OANAzO#MsQSOANAzOOQO'#HV'#HVOOQO7+*d7+*dOOQQG22tG22tOOQQANEOANEOOOQQANEPANEPOOQQANBSANBSO&>]QSOANBSOOQQ<bQSOLD,iO&>jQ$IUO7+'sO&@`Q$IUO7+'uO&BUQ,UOG26{OOQO<ROPYXXYXkYXyYXzYX|YX!eYX!fYX!hYX!lYX#XYX#dcX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#oYX#qYX#sYX#uYX#vYX#{YX(SYX(cYX(jYX(kYX!VYX!WYX~O#yYX~P#@lOP$[OX:XOk9{Oy#xOz#yO|#zO!e9}O!f#vO!h#wO!l$[O#g9yO#h9zO#i9zO#j9zO#k9|O#l9}O#m9}O#n:WO#o9}O#q:OO#s:QO#u:SO#v:TO(SVO(c$YO(j#{O(k#|O~O#y.hO~P#ByO#X:YO#{:YO#y(XX!W(XX~PN}O^'Za!V'Za'l'Za'j'Za!g'Za!S'Zao'Za!X'Za%a'Za!a'Za~P!7sOP#fiX#fi^#fik#fiz#fi!V#fi!e#fi!f#fi!h#fi!l#fi#g#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi'l#fi(S#fi(c#fi'j#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~P#,`O^#zi!V#zi'l#zi'j#zi!S#zi!g#zio#zi!X#zi%a#zi!a#zi~P!7sO$W.mO$Y.mO~O$W.nO$Y.nO~O!a)^O#X.oO!X$^X$T$^X$W$^X$Y$^X$a$^X~O!U.pO~O!X)aO$T.rO$W)`O$Y)`O$a.sO~O!V:UO!W(WX~P#ByO!W.tO~O!a)^O$a(lX~O$a.vO~Oq)pO(T)qO(U.yO~O!S.}O~P!&VO!VcX!acX!gcX!g$sX(ccX~P!/ZO!g/TO~P#,`O!V/UO!a#tO(c'fO!g(pX~O!g/ZO~O!U*RO'u%_O!g(pP~O#d/]O~O!S$sX!V$sX!a$zX~P!/ZO!V/^O!S(qX~P#,`O!a/`O~O!S/bO~Ok/fO!a#tO!h%]O(O%QO(c'fO~O'u/hO~O!a+XO~O^%fO!V/lO'l%fO~O!W/nO~P!3XO!]/oO!^/oO'v!kO(V!lO~O|/qO(V!lO~O#T/rO~O'u&POd'`X!V'`X~O!V*kOd(Pa~Od/wO~Oy/xOz/xO|/yOgva(jva(kva!Vva#Xva~Odva#yva~P$ aOy)uO|)vOg$la(j$la(k$la!V$la#X$la~Od$la#y$la~P$!VOy)uO|)vOg$na(j$na(k$na!V$na#X$na~Od$na#y$na~P$!xO#d/{O~Od$|a!V$|a#X$|a#y$|a~P!0dO!a#tO~O#d0OO~O!V*|O^(ua'l(ua~Oy#xOz#yO|#zO!f#vO!h#wO(SVOP!niX!nik!ni!V!ni!e!ni!l!ni#g!ni#h!ni#i!ni#j!ni#k!ni#l!ni#m!ni#n!ni#o!ni#q!ni#s!ni#u!ni#v!ni(c!ni(j!ni(k!ni~O^!ni'l!ni'j!ni!S!ni!g!nio!ni!X!ni%a!ni!a!ni~P$$gOg.TO!X'UO%a.SO~Oi0YO'u0XO~P!1UO!a+XO^'}a!X'}a'l'}a!V'}a~O#d0`O~OXYX!VcX!WcX~O!V0aO!W(yX~O!W0cO~OX0dO~O'u+aO'wTO'zUO~O!X%vO'u%_O]'hX!V'hX~O!V+fO](xa~O!g0iO~P!7sOX0lO~O]0mO~O#X0pO~Og0sO!X${O~O(V(sO!W(vP~Og0|O!X0yO%a0{O(O%QO~OX1WO!V1UO!W(wX~O!W1XO~O]1ZO^%fO'l%fO~O'u#lO'wTO'zUO~O#X$dO#{$dOP(XXX(XXk(XXy(XXz(XX|(XX!V(XX!e(XX!h(XX!l(XX#g(XX#h(XX#i(XX#j(XX#k(XX#l(XX#m(XX#n(XX#q(XX#s(XX#u(XX#v(XX(S(XX(c(XX(j(XX(k(XX~O#o1^O&R1_O^(XX!f(XX~P$+]O#X$dO#o1^O&R1_O~O^1aO~P%TO^1cO~O&[1fOP&YiQ&YiV&Yi^&Yia&Yib&Yii&Yik&Yil&Yim&Yis&Yiu&Yiw&Yi|&Yi!Q&Yi!R&Yi!X&Yi!c&Yi!h&Yi!k&Yi!l&Yi!m&Yi!o&Yi!q&Yi!t&Yi!x&Yi#p&Yi$Q&Yi$U&Yi%`&Yi%b&Yi%d&Yi%e&Yi%f&Yi%i&Yi%k&Yi%n&Yi%o&Yi%q&Yi%}&Yi&T&Yi&V&Yi&X&Yi&Z&Yi&^&Yi&d&Yi&j&Yi&l&Yi&n&Yi&p&Yi&r&Yi'j&Yi'u&Yi'w&Yi'z&Yi(S&Yi(b&Yi(o&Yi!W&Yi_&Yi&a&Yi~O_1lO!W1jO&a1kO~P`O!XXO!h1nO~O&h,iOP&ciQ&ciV&ci^&cia&cib&cii&cik&cil&cim&cis&ciu&ciw&ci|&ci!Q&ci!R&ci!X&ci!c&ci!h&ci!k&ci!l&ci!m&ci!o&ci!q&ci!t&ci!x&ci#p&ci$Q&ci$U&ci%`&ci%b&ci%d&ci%e&ci%f&ci%i&ci%k&ci%n&ci%o&ci%q&ci%}&ci&T&ci&V&ci&X&ci&Z&ci&^&ci&d&ci&j&ci&l&ci&n&ci&p&ci&r&ci'j&ci'u&ci'w&ci'z&ci(S&ci(b&ci(o&ci!W&ci&[&ci_&ci&a&ci~O!S1tO~O!V!Za!W!Za~P#ByOl!mO|!nO!U1zO(V!lO!V'OX!W'OX~P?wO!V,yO!W(Za~O!V'UX!W'UX~P!6{O!V,|O!W(ia~O!W2RO~P'WO^%fO#X2[O'l%fO~O^%fO!a#tO#X2[O'l%fO~O^%fO!a#tO!l2`O#X2[O'l%fO(c'fO~O^%fO'l%fO~P!7sO!V$`Oo$ka~O!S&}i!V&}i~P!7sO!V'zO!S(Yi~O!V(RO!S(gi~O!S(hi!V(hi~P!7sO!V(ei!g(ei^(ei'l(ei~P!7sO#X2bO!V(ei!g(ei^(ei'l(ei~O!V(_O!g(di~O|%`O!X%aO!x]O#b2gO#c2fO'u%_O~O|%`O!X%aO#c2fO'u%_O~Og2nO!X'UO%a2mO~Og2nO!X'UO%a2mO(O%QO~O#dvaPvaXva^vakva!eva!fva!hva!lva#gva#hva#iva#jva#kva#lva#mva#nva#ova#qva#sva#uva#vva'lva(Sva(cva!gva!Sva'jvaova!Xva%ava!ava~P$ aO#d$laP$laX$la^$lak$laz$la!e$la!f$la!h$la!l$la#g$la#h$la#i$la#j$la#k$la#l$la#m$la#n$la#o$la#q$la#s$la#u$la#v$la'l$la(S$la(c$la!g$la!S$la'j$lao$la!X$la%a$la!a$la~P$!VO#d$naP$naX$na^$nak$naz$na!e$na!f$na!h$na!l$na#g$na#h$na#i$na#j$na#k$na#l$na#m$na#n$na#o$na#q$na#s$na#u$na#v$na'l$na(S$na(c$na!g$na!S$na'j$nao$na!X$na%a$na!a$na~P$!xO#d$|aP$|aX$|a^$|ak$|az$|a!V$|a!e$|a!f$|a!h$|a!l$|a#g$|a#h$|a#i$|a#j$|a#k$|a#l$|a#m$|a#n$|a#o$|a#q$|a#s$|a#u$|a#v$|a'l$|a(S$|a(c$|a!g$|a!S$|a'j$|a#X$|ao$|a!X$|a%a$|a!a$|a~P#,`O^#[q!V#[q'l#[q'j#[q!S#[q!g#[qo#[q!X#[q%a#[q!a#[q~P!7sOd'PX!V'PX~P!'oO!V.^Od(]a~O!U2vO!V'QX!g'QX~P%TO!V.aO!g(^a~O!V.aO!g(^a~P!7sO!S2yO~O#y!ja!W!ja~PJqO#y!ba!V!ba!W!ba~P#ByO#y!na!W!na~P!:^O#y!pa!W!pa~P!`O^#wy!V#wy'l#wy'j#wy!S#wy!g#wyo#wy!X#wy%a#wy!a#wy~P!7sOg;lOy)uO|)vO(j)xO(k)zO~OP#fiX#fik#fiz#fi!e#fi!f#fi!h#fi!l#fi#g#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi#y#fi(S#fi(c#fi!V#fi!W#fi~P%AWO!f#vOP(RXX(RXg(RXk(RXy(RXz(RX|(RX!e(RX!h(RX!l(RX#g(RX#h(RX#i(RX#j(RX#k(RX#l(RX#m(RX#n(RX#o(RX#q(RX#s(RX#u(RX#v(RX#y(RX(S(RX(c(RX(j(RX(k(RX!V(RX!W(RX~O#y#zi!V#zi!W#zi~P#ByO#y!ni!W!ni~P$$gO!W6_O~O!V'Za!W'Za~P#ByO!a#tO(c'fO!V'[a!g'[a~O!V/UO!g(pi~O!V/UO!a#tO!g(pi~Od$uq!V$uq#X$uq#y$uq~P!0dO!S'^a!V'^a~P#,`O!a6fO~O!V/^O!S(qi~P#,`O!V/^O!S(qi~O!S6jO~O!a#tO#o6oO~Ok6pO!a#tO(c'fO~O!S6rO~Od$wq!V$wq#X$wq#y$wq~P!0dO^$iy!V$iy'l$iy'j$iy!S$iy!g$iyo$iy!X$iy%a$iy!a$iy~P!7sO!a5jO~O!V4VO!X(ra~O^#[y!V#[y'l#[y'j#[y!S#[y!g#[yo#[y!X#[y%a#[y!a#[y~P!7sOX6wO~O!V0aO!W(yi~O]6}O~O(V(sO!V'cX!W'cX~O!V4mO!W(va~OikO'u7UO~P.bO!W7XO~P%$gOl!mO|7YO'wTO'zUO(V!lO(b!rO~O!X0yO~O!X0yO%a7[O~Og7_O!X0yO%a7[O~OX7dO!V'fa!W'fa~O!V1UO!W(wi~O!g7hO~O!g7iO~O!g7lO~O!g7lO~P%TO^7nO~O!a7oO~O!g7pO~O!V(hi!W(hi~P#ByO^%fO#X7xO'l%fO~O!V(ey!g(ey^(ey'l(ey~P!7sO!V(_O!g(dy~O!X'UO%a7{O~O#d$uqP$uqX$uq^$uqk$uqz$uq!V$uq!e$uq!f$uq!h$uq!l$uq#g$uq#h$uq#i$uq#j$uq#k$uq#l$uq#m$uq#n$uq#o$uq#q$uq#s$uq#u$uq#v$uq'l$uq(S$uq(c$uq!g$uq!S$uq'j$uq#X$uqo$uq!X$uq%a$uq!a$uq~P#,`O#d$wqP$wqX$wq^$wqk$wqz$wq!V$wq!e$wq!f$wq!h$wq!l$wq#g$wq#h$wq#i$wq#j$wq#k$wq#l$wq#m$wq#n$wq#o$wq#q$wq#s$wq#u$wq#v$wq'l$wq(S$wq(c$wq!g$wq!S$wq'j$wq#X$wqo$wq!X$wq%a$wq!a$wq~P#,`O!V'Qi!g'Qi~P!7sO#y#[q!V#[q!W#[q~P#ByOy/xOz/xO|/yOPvaXvagvakva!eva!fva!hva!lva#gva#hva#iva#jva#kva#lva#mva#nva#ova#qva#sva#uva#vva#yva(Sva(cva(jva(kva!Vva!Wva~Oy)uO|)vOP$laX$lag$lak$laz$la!e$la!f$la!h$la!l$la#g$la#h$la#i$la#j$la#k$la#l$la#m$la#n$la#o$la#q$la#s$la#u$la#v$la#y$la(S$la(c$la(j$la(k$la!V$la!W$la~Oy)uO|)vOP$naX$nag$nak$naz$na!e$na!f$na!h$na!l$na#g$na#h$na#i$na#j$na#k$na#l$na#m$na#n$na#o$na#q$na#s$na#u$na#v$na#y$na(S$na(c$na(j$na(k$na!V$na!W$na~OP$|aX$|ak$|az$|a!e$|a!f$|a!h$|a!l$|a#g$|a#h$|a#i$|a#j$|a#k$|a#l$|a#m$|a#n$|a#o$|a#q$|a#s$|a#u$|a#v$|a#y$|a(S$|a(c$|a!V$|a!W$|a~P%AWO#y$hq!V$hq!W$hq~P#ByO#y$iq!V$iq!W$iq~P#ByO!W8VO~O#y8WO~P!0dO!a#tO!V'[i!g'[i~O!a#tO(c'fO!V'[i!g'[i~O!V/UO!g(pq~O!S'^i!V'^i~P#,`O!V/^O!S(qq~O!S8^O~P#,`O!S8^O~Od(Qy!V(Qy~P!0dO!V'aa!X'aa~P#,`O^%Tq!X%Tq'l%Tq!V%Tq~P#,`OX8cO~O!V0aO!W(yq~O#X8gO!V'ca!W'ca~O!V4mO!W(vi~P#ByOPYXXYXkYXyYXzYX|YX!SYX!VYX!eYX!fYX!hYX!lYX#XYX#dcX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#oYX#qYX#sYX#uYX#vYX#{YX(SYX(cYX(jYX(kYX~O!a%RX#o%RX~P&2WO!X0yO%a8kO~O'wTO'zUO(V8pO~O!V1UO!W(wq~O!g8sO~O!g8tO~O!g8uO~O!g8uO~P%TO#X8xO!V#ay!W#ay~O!V#ay!W#ay~P#ByO!X'UO%a8}O~O#y#wy!V#wy!W#wy~P#ByOP$uiX$uik$uiz$ui!e$ui!f$ui!h$ui!l$ui#g$ui#h$ui#i$ui#j$ui#k$ui#l$ui#m$ui#n$ui#o$ui#q$ui#s$ui#u$ui#v$ui#y$ui(S$ui(c$ui!V$ui!W$ui~P%AWOy)uO|)vO(k)zOP%XiX%Xig%Xik%Xiz%Xi!e%Xi!f%Xi!h%Xi!l%Xi#g%Xi#h%Xi#i%Xi#j%Xi#k%Xi#l%Xi#m%Xi#n%Xi#o%Xi#q%Xi#s%Xi#u%Xi#v%Xi#y%Xi(S%Xi(c%Xi(j%Xi!V%Xi!W%Xi~Oy)uO|)vOP%ZiX%Zig%Zik%Ziz%Zi!e%Zi!f%Zi!h%Zi!l%Zi#g%Zi#h%Zi#i%Zi#j%Zi#k%Zi#l%Zi#m%Zi#n%Zi#o%Zi#q%Zi#s%Zi#u%Zi#v%Zi#y%Zi(S%Zi(c%Zi(j%Zi(k%Zi!V%Zi!W%Zi~O#y$iy!V$iy!W$iy~P#ByO#y#[y!V#[y!W#[y~P#ByO!a#tO!V'[q!g'[q~O!V/UO!g(py~O!S'^q!V'^q~P#,`O!S9UO~P#,`O!V0aO!W(yy~O!V4mO!W(vq~O!X0yO%a9]O~O!g9`O~O!X'UO%a9eO~OP$uqX$uqk$uqz$uq!e$uq!f$uq!h$uq!l$uq#g$uq#h$uq#i$uq#j$uq#k$uq#l$uq#m$uq#n$uq#o$uq#q$uq#s$uq#u$uq#v$uq#y$uq(S$uq(c$uq!V$uq!W$uq~P%AWOP$wqX$wqk$wqz$wq!e$wq!f$wq!h$wq!l$wq#g$wq#h$wq#i$wq#j$wq#k$wq#l$wq#m$wq#n$wq#o$wq#q$wq#s$wq#u$wq#v$wq#y$wq(S$wq(c$wq!V$wq!W$wq~P%AWOd%]!Z!V%]!Z#X%]!Z#y%]!Z~P!0dO!V'cq!W'cq~P#ByO!V#a!Z!W#a!Z~P#ByO#d%]!ZP%]!ZX%]!Z^%]!Zk%]!Zz%]!Z!V%]!Z!e%]!Z!f%]!Z!h%]!Z!l%]!Z#g%]!Z#h%]!Z#i%]!Z#j%]!Z#k%]!Z#l%]!Z#m%]!Z#n%]!Z#o%]!Z#q%]!Z#s%]!Z#u%]!Z#v%]!Z'l%]!Z(S%]!Z(c%]!Z!g%]!Z!S%]!Z'j%]!Z#X%]!Zo%]!Z!X%]!Z%a%]!Z!a%]!Z~P#,`OP%]!ZX%]!Zk%]!Zz%]!Z!e%]!Z!f%]!Z!h%]!Z!l%]!Z#g%]!Z#h%]!Z#i%]!Z#j%]!Z#k%]!Z#l%]!Z#m%]!Z#n%]!Z#o%]!Z#q%]!Z#s%]!Z#u%]!Z#v%]!Z#y%]!Z(S%]!Z(c%]!Z!V%]!Z!W%]!Z~P%AWOo(WX~P1jO'v!kO~P!){O!ScX!VcX#XcX~P&2WOPYXXYXkYXyYXzYX|YX!VYX!VcX!eYX!fYX!hYX!lYX#XYX#XcX#dcX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#oYX#qYX#sYX#uYX#vYX#{YX(SYX(cYX(jYX(kYX~O!acX!gYX!gcX(ccX~P&GnOP9pOQ9pOa;aOb!hOikOk9pOlkOmkOskOu9pOw9pO|WO!QkO!RkO!XXO!c9sO!hZO!k9pO!l9pO!m9pO!o9tO!q9wO!t!gO$Q!jO$UfO'u)TO'wTO'zUO(SVO(b[O(o;_O~O!V:UO!W$ka~Oi%ROk$sOl$rOm$rOs%SOu%TOw:[O|$zO!X${O!c;fO!h$wO#c:bO$Q%XO$m:^O$o:`O$r%YO'u(kO'wTO'zUO(O%QO(S$tO~O#p)[O~P&LdO!WYX!WcX~P&GnO#d9xO~O!a#tO#d9xO~O#X:YO~O#o9}O~O#X:dO!V(hX!W(hX~O#X:YO!V(fX!W(fX~O#d:eO~Od:gO~P!0dO#d:lO~O#d:mO~O!a#tO#d:nO~O!a#tO#d:eO~O#y:oO~P#ByO#d:pO~O#d:qO~O#d:rO~O#d:sO~O#d:tO~O#d:uO~O#y:vO~P!0dO#y:wO~P!0dO$U~!f!|!}#P#Q#T#b#c#n(o$m$o$r%U%`%a%b%i%k%n%o%q%s~'pR$U(o#h!R'n'v#il#g#jky'o(V'o'u$W$Y$W~",goto:"$&a(}PPPP)OP)RP)cP*r.uPPPP5UPP5kP;f>mP?QP?QPPP?QP@rP?QP?QP?QP@vPP@{PAfPF]PPPFaPPPPFaIaPPPIgJbPFaPLoPPPPN}FaPPPFaPFaP!#]FaP!&p!'r!'{P!(n!(r!(nPPPPP!+|!'rPP!,j!-dP!0WFaFa!0]!3f!7z!7z!;oPPP!;vFaPPPPPPPPPPP!?SP!@ePPFa!ArPFaPFaFaFaFaPFa!CUPP!F]P!I`P!Id!In!Ir!IrP!FYP!Iv!IvP!LyP!L}FaFa!MT#!V?QP?QP?Q?QP##a?Q?Q#%]?Q#'l?Q#)b?Q?Q#*O#+|#+|#,Q#,Y#+|#,bP#+|P?Q#,z?Q#.T?Q?Q5UPPP#/aPPP#/y#/yP#/yP#0`#/yPP#0fP#0]P#0]#0x#0]#1d#1j5R)R#1m)RP#1t#1t#1tP)RP)RP)RP)RPP)RP#1z#1}P#1})RP#2RP#2UP)RP)RP)RP)RP)RP)R)RPP#2[#2b#2l#2r#2x#3O#3U#3d#3j#3p#3z#4Q#4[#4k#4q#5b#5t#5z#6Q#6`#6u#8W#8f#8l#8r#8x#9O#9Y#9`#9f#9p#:S#:YPPPPPPPPPP#:`PPPPPPP#;S#>ZP#?j#?q#?yPPPP#DX#F}#Me#Mh#Mk#Nd#Ng#Nj#Nq#NyPP$ P$ T$ {$!z$#O$#dPP$#h$#n$#rP$#u$#y$#|$$r$%Y$%p$%t$%w$%z$&Q$&T$&X$&]R!zRmqOXs!Y#b%e&h&j&k&m,a,f1f1iY!tQ'U-R0y4tQ%kuQ%sxQ%z{Q&`!US&|!d,yQ'[!hS'b!q!wS*^${*cQ+_%tQ+l%|Q,Q&YQ-P'TQ-Z']Q-c'cQ/o*eQ1T,RR:c9t$|dOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{,^,a,f-V-_-m-s.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2v4q4{5]5^5a5t7Y7_7n7xS#o]9q!r)V$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ*n%UQ+d%vQ,S&]Q,Z&eQ.W:ZQ0V+VQ0Z+XQ0f+eQ1],XQ2j.TQ4_0aQ5S1UQ6Q2nQ6W:[Q6y4`R8O6R&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bt!mQ!q!t!w!x&|'T'U'b'c'd,y-P-R-c0y4t4v$^$ri#t#v$b$c$w$z%V%W%[)p)v)y){)|*T*Z*i*j+U+X+p+s.S.^/O/]/^/`/{0p0s0{2m3e3o3w3}4V4X4z6O6f6o7[7{8W8k8}9]9e:W:X:]:^:_:`:a:b:h:i:j:k:l:m:p:q:r:s:v:w;_;g;h;k;lQ%}{Q&z!dS'Q%a,|Q+d%vQ/z*rQ0f+eQ0k+kQ1[,WQ1],XQ4_0aQ4h0mQ5V1WQ5W1ZQ6y4`Q6|4eQ7g5YQ8f6}R8q7dpnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iR,U&a&t^OPXYstuvy!Y!_!f!i!n#Q#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y'W'h'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;a;b[#ZWZ#U#X&}'x!S%bm#f#g#j%]%`(R(](^(_*y*z*|,],s-q-w-x-y-{1n2f2g5j5{Q%nwQ%rxS%w{%|Q&T!SQ'X!gQ'Z!hQ(f#qS*Q$w*US+^%s%tQ+b%vQ+{&WQ,P&YS-Y'[']Q.V(gQ/Y*RQ0_+_Q0e+eQ0g+fQ0j+jQ1O+|S1S,Q,RQ2W-ZQ3f/UQ4^0aQ4b0dQ4g0lQ5R1TQ6c3gQ6x4`Q6{4dQ8b6wR9W8cv$yi#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;h!S%px!h!s%r%s%t&{'Z'[']'a'k*]+^+_,v-Y-Z-b/g0_2P2W2_3yQ+W%nQ+q&QQ+t&RQ,O&YQ.U(fQ0}+{U1R,P,Q,RQ2o.VQ4|1OS5Q1S1TQ7c5R#O;c#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lg;d:W:X:^:`:b:i:k:m:q:s:wW%Oi%Q*k;_S&Q!P&_Q&R!QQ&S!RR+o&O$_$}i#t#v$b$c$w$z%V%W%[)p)v)y){)|*T*Z*i*j+U+X+p+s.S.^/O/]/^/`/{0p0s0{2m3e3o3w3}4V4X4z6O6f6o7[7{8W8k8}9]9e:W:X:]:^:_:`:a:b:h:i:j:k:l:m:p:q:r:s:v:w;_;g;h;k;lT)q$t)rV*o%U:Z:[U'Q!d%a,|S(t#x#yQ+i%yS.O(b(cQ0t+uQ4O/xR7R4m&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;b$i$_c#W#c%i%j%l'w'}(i(p(x(y(z({(|(})O)P)Q)R)S)U)X)])g+S+h,w-f-k-p-r.].c.g.i.j.k.z/|1u1x2Y2a2u2z2{2|2}3O3P3Q3R3S3T3U3V3W3Z3[3a4S4[5m5s5x6U6V6[6]7T7r7v8P8T8U8z9Y9a9r;UT#RV#S&{kOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ'O!dR1{,yv!mQ!d!q!t!w!x&|'T'U'b'c'd,y-P-R-c0y4t4vS*]${*cS/g*^*eQ/p*fQ0v+wQ3y/oR3|/rlqOXs!Y#b%e&h&j&k&m,a,f1f1iQ&o!]Q'l!vS(h#s9xQ+[%qQ+y&TQ+z&VQ-W'YQ-e'eS.[(m:eS/}*w:nQ0]+]Q0x+xQ1m,hQ1o,iQ1w,tQ2U-XQ2X-]S4T0O:tQ4Y0^S4]0`:uQ5l1yQ5p2VQ5u2^Q6v4ZQ7s5nQ7t5qQ7w5vR8w7p$d$^c#W#c%j%l'w'}(i(p(x(y(z({(|(})O)P)Q)R)S)U)X)])g+S+h,w-f-k-p-r.].c.g.j.k.z/|1u1x2Y2a2u2z2{2|2}3O3P3Q3R3S3T3U3V3W3Z3[3a4S4[5m5s5x6U6V6[6]7T7r7v8P8T8U8z9Y9a9r;US(e#n'_U*h$|(l3YS+R%i.iQ2k0VQ5}2jQ7}6QR9O8O$d$]c#W#c%j%l'w'}(i(p(x(y(z({(|(})O)P)Q)R)S)U)X)])g+S+h,w-f-k-p-r.].c.g.j.k.z/|1u1x2Y2a2u2z2{2|2}3O3P3Q3R3S3T3U3V3W3Z3[3a4S4[5m5s5x6U6V6[6]7T7r7v8P8T8U8z9Y9a9r;US(d#n'_S(v#y$^S+Q%i.iS.P(c(eQ.l)WQ0S+RR2h.Q&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bS#o]9qQ&j!WQ&k!XQ&m!ZQ&n![R1e,dQ'V!gQ+T%nQ-U'XS.R(f+WQ2S-TW2l.U.V0U0WQ5o2TU5|2i2k2oS7z5}6PS8|7|7}S9c8{9OQ9k9dR9n9lU!uQ'U-RT4r0y4t!O_OXZ`s!U!Y#b#f%]%e&_&a&h&j&k&m(_,a,f-x1f1i]!oQ!q'U-R0y4tT#o]9q%WzOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xS(t#x#yS.O(b(c!s:{$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bY!sQ'U-R0y4tQ'a!qS'k!t!wS'm!x4vS-b'b'cQ-d'dR2_-cQ'j!sS(Z#e1`S-a'a'mQ/X*QQ/e*]Q2`-dQ3k/YS3t/f/pQ6b3fS6m3z3|Q8Y6cR8a6pQ#ubQ'i!sS(Y#e1`S([#k*vQ*x%^Q+Y%oQ+`%uU-`'a'j'mQ-t(ZQ/W*QQ/d*]Q/j*`Q0[+ZQ1P+}S2]-a-dQ2e-|S3j/X/YS3s/e/pQ3v/iQ3x/kQ5O1QQ5w2`Q6a3fQ6e3kS6i3t3|Q6n3{Q7a5PS8X6b6cQ8]6jQ8_6mQ8n7bQ9S8YQ9T8^Q9V8aQ9_8oQ9g9UQ;O:yQ;Z;SR;[;TV!uQ'U-R%WaOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xS#uy!i!r:x$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bR;O;a%WbOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xQ%^j!S%ox!h!s%r%s%t&{'Z'[']'a'k*]+^+_,v-Y-Z-b/g0_2P2W2_3yS%uy!iQ+Z%pQ+}&YW1Q,O,P,Q,RU5P1R1S1TS7b5Q5RQ8o7c!r:y$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ;S;`R;T;a$zeOPXYstuv!Y!_!f!n#Q#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&h&j&k&m&q&y'W'h'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7xY#`WZ#U#X'x!S%bm#f#g#j%]%`(R(](^(_*y*z*|,],s-q-w-x-y-{1n2f2g5j5{Q,[&e!p:z$Z$l)i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bR:}&}S'R!d%aR1},|$|dOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{,^,a,f-V-_-m-s.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2v4q4{5]5^5a5t7Y7_7n7x!r)V$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bQ,Z&eQ0V+VQ2j.TQ6Q2nR8O6R!f$Tc#W%i'w'}(i(p)P)Q)R)S)X)]+h-f-k-p-r.].c.z/|2Y2a2u3W4S4[5s5x6U7v8z9r!T:P)U)g,w.i1u1x2z3S3T3U3V3Z3a5m6V6[6]7T7r8P8T8U9Y9a;U!b$Vc#W%i'w'}(i(p)R)S)X)]+h-f-k-p-r.].c.z/|2Y2a2u3W4S4[5s5x6U7v8z9r!P:R)U)g,w.i1u1x2z3U3V3Z3a5m6V6[6]7T7r8P8T8U9Y9a;U!^$Zc#W%i'w'}(i(p)X)]+h-f-k-p-r.].c.z/|2Y2a2u3W4S4[5s5x6U7v8z9rQ3e/Sz;b)U)g,w.i1u1x2z3Z3a5m6V6[6]7T7r8P8T8U9Y9a;UQ;g;iR;h;j&zkOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bS$mh$nR3^.o'RgOPWXYZhstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l$n%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.o.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bT$if$oQ$gfS)`$j)dR)l$oT$hf$oT)b$j)d'RhOPWXYZhstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$Z$`$d$l$n%e%k%x&a&d&e&h&j&k&m&q&y&}'W'h'x'z(Q(X(m(q(u)i)t*w*{+V,^,a,f,r,u-V-_-m-s.T.a.h.o.p/y0O0`0|1^1_1a1c1f1i1k1z2[2b2n2v3]4o4q4{5]5^5a5k5t6R7Y7_7n7x8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;bT$mh$nQ$phR)k$n%WjOPWXYZstuv!Y!_!f!n#Q#U#X#b#m#s#w#z#}$O$P$Q$R$S$T$U$V$W$X$`$d%e%k%x&a&d&e&h&j&k&m&q&y'W'h'x'z(Q(X(m(q(u)t*w*{+V,^,a,f-V-_-m-s.T.a.h/y0O0`0|1^1_1a1c1f1i1k2[2b2n2v4q4{5]5^5a5t6R7Y7_7n7x!s;`$Z$l&})i,r,u.p1z3]4o5k8g8x9p9s9t9w9x9y9z9{9|9}:O:P:Q:R:S:T:U:Y:c:d:e:g:n:o:t:u;b#alOPXZs!Y!_!n#Q#b#m#z$l%e&a&d&e&h&j&k&m&q&y'W(u)i*{+V,^,a,f-V.T.p/y0|1^1_1a1c1f1i1k2n3]4q4{5]5^5a6R7Y7_7nv$|i#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;h#O(l#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lQ*s%YQ.{)ug3Y:W:X:^:`:b:i:k:m:q:s:wv$xi#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;hQ*V$yS*`${*cQ*t%ZQ/k*a#O;Q#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lf;R:W:X:^:`:b:i:k:m:q:s:wQ;V;cQ;W;dQ;X;eR;Y;fv$|i#v%V%W%[)y){*T*i*j.^/]/{3e3}8W;_;g;h#O(l#t$b$c$w$z)p)v)|*Z+U+X+p+s.S/O/^/`0p0s0{2m3o3w4V4X4z6O6f6o7[7{8k8}9]9e:]:_:a:h:j:l:p:r:v;k;lg3Y:W:X:^:`:b:i:k:m:q:s:wloOXs!Y#b%e&h&j&k&m,a,f1f1iQ*Y$zQ,o&tQ,p&vR3n/^$^$}i#t#v$b$c$w$z%V%W%[)p)v)y){)|*T*Z*i*j+U+X+p+s.S.^/O/]/^/`/{0p0s0{2m3e3o3w3}4V4X4z6O6f6o7[7{8W8k8}9]9e:W:X:]:^:_:`:a:b:h:i:j:k:l:m:p:q:r:s:v:w;_;g;h;k;lQ+r&RQ0r+tQ4k0qR7Q4lT*b${*cS*b${*cT4s0y4tS/i*_4qT3{/q7YQ+Y%oQ/j*`Q0[+ZQ1P+}Q5O1QQ7a5PQ8n7bR9_8on)y$u(n*u/[/s/t2s3l4R6`6q9R;P;];^!Y:h(j)Z*P*X.Z.w.|/S/a0T0o0q2r3m3q4j4l6S6T6g6k6s6u8[8`9f;i;j]:i3X6Z8Q9P9Q9op){$u(n*u/Q/[/s/t2s3l4R6`6q9R;P;];^![:j(j)Z*P*X.Z.w.|/S/a0T0o0q2p2r3m3q4j4l6S6T6g6k6s6u8[8`9f;i;j_:k3X6Z8Q8R9P9Q9opnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iQ&[!TR,^&epnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iR&[!TQ+v&SR0n+oqnOXs!U!Y#b%e&_&h&j&k&m,a,f1f1iQ0z+{S4y0}1OU7Z4w4x4|S8j7]7^S9Z8i8lQ9h9[R9m9iQ&c!UR,V&_R5V1WS%w{%|R0g+fQ&h!VR,a&iR,g&nT1g,f1iR,k&oQ,j&oR1p,kQ'o!yR-g'oQsOQ#bXT%hs#bQ!|TR'q!|Q#PUR's#PQ)r$tR.x)rQ#SVR'u#SQ#VWU'{#V'|-nQ'|#WR-n'}Q,z'OR1|,zQ._(nR2t._Q.b(pS2w.b2xR2x.cQ-R'UR2Q-RY!qQ'U-R0y4tR'`!qS#]W%`U(S#](T-oQ(T#^R-o(OQ,}'RR2O,}r`OXs!U!Y#b%e&_&a&h&j&k&m,a,f1f1iS#fZ%]U#p`#f-xR-x(_Q(`#hQ-u([W-}(`-u2c5yQ2c-vR5y2dQ)d$jR.q)dQ$nhR)j$nQ$acU)Y$a-j:VQ-j9rR:V)gQ/V*QW3h/V3i6d8ZU3i/W/X/YS6d3j3kR8Z6e#o)w$u(j(n)Z*P*X*p*q*u.X.Y.Z.w.|/Q/R/S/[/a/s/t0T0o0q2p2q2r2s3X3l3m3q4R4j4l6S6T6X6Y6Z6`6g6k6q6s6u8Q8R8S8[8`9P9Q9R9f9o;P;];^;i;jQ/_*XU3p/_3r6hQ3r/aR6h3qQ*c${R/m*cQ*l%PR/v*lQ4W0TR6t4WQ*}%cR0R*}Q4n0tS7S4n8hR8h7TQ+x&TR0w+xQ4t0yR7W4tQ1V,SS5T1V7eR7e5VQ0b+bW4a0b4c6z8dQ4c0eQ6z4bR8d6{Q+g%wR0h+gQ1i,fR5e1iWrOXs#bQ&l!YQ+P%eQ,`&hQ,b&jQ,c&kQ,e&mQ1d,aS1g,f1iR5d1fQ%gpQ&p!^Q&s!`Q&u!aQ&w!bQ'g!sQ+O%dQ+[%qQ+n%}Q,U&cQ,m&rW-^'a'i'j'mQ-e'eQ/l*bQ0]+]S1Y,V,YQ1q,lQ1r,oQ1s,pQ2X-]W2Z-`-a-d-fQ4Y0^Q4f0kQ4i0oQ4}1PQ5X1[Q5c1eU5r2Y2]2`Q5u2^Q6v4ZQ7O4hQ7P4jQ7V4sQ7`5OQ7f5WS7u5s5wQ7w5vQ8e6|Q8m7aQ8r7gQ8y7vQ9X8fQ9^8nQ9b8zR9j9_Q%qxQ'Y!hQ'e!sU+]%r%s%tQ,t&{U-X'Z'[']S-]'a'kQ/c*]S0^+^+_Q1y,vS2V-Y-ZQ2^-bQ3u/gQ4Z0_Q5n2PQ5q2WQ5v2_R6l3yS$vi;_R*m%QU%Pi%Q;_R/u*kQ$uiS(j#t+XQ(n#vS)Z$b$cQ*P$wQ*X$zQ*p%VQ*q%WQ*u%[Q.X:]Q.Y:_Q.Z:aQ.w)pS.|)v/OQ/Q)yQ/R){Q/S)|Q/[*TQ/a*ZQ/s*iQ/t*jh0T+U.S0{2m4z6O7[7{8k8}9]9eQ0o+pQ0q+sQ2p:hQ2q:jQ2r:lQ2s.^S3X:W:XQ3l/]Q3m/^Q3q/`Q4R/{Q4j0pQ4l0sQ6S:pQ6T:rQ6X:^Q6Y:`Q6Z:bQ6`3eQ6g3oQ6k3wQ6q3}Q6s4VQ6u4XQ8Q:mQ8R:iQ8S:kQ8[6fQ8`6oQ9P:qQ9Q:sQ9R8WQ9f:vQ9o:wQ;P;_Q;];gQ;^;hQ;i;kR;j;llpOXs!Y#b%e&h&j&k&m,a,f1f1iQ!ePS#dZ#mQ&r!_U'^!n4q7YQ't#QQ(w#zQ)h$lS,Y&a&dQ,_&eQ,l&qQ,q&yQ-T'WQ.e(uQ.u)iQ0P*{Q0W+VQ1b,^Q2T-VQ2k.TQ3`.pQ4P/yQ4x0|Q5Z1^Q5[1_Q5`1aQ5b1cQ5g1kQ5}2nQ6^3]Q7^4{Q7j5]Q7k5^Q7m5aQ7}6RQ8l7_R8v7n#UcOPXZs!Y!_!n#b#m#z%e&a&d&e&h&j&k&m&q&y'W(u*{+V,^,a,f-V.T/y0|1^1_1a1c1f1i1k2n4q4{5]5^5a6R7Y7_7nQ#WWQ#cYQ%itQ%juS%lv!fS'w#U'zQ'}#XQ(i#sQ(p#wQ(x#}Q(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)U$ZQ)X$`Q)]$dW)g$l)i.p3]Q+S%kQ+h%xS,w&}1zQ-f'hS-k'x-mQ-p(QQ-r(XQ.](mQ.c(qQ.g9pQ.i9sQ.j9tQ.k9wQ.z)tQ/|*wQ1u,rQ1x,uQ2Y-_Q2a-sQ2u.aQ2z9xQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W.hQ3Z:YQ3[:cQ3a:UQ4S0OQ4[0`Q5m:dQ5s2[Q5x2bQ6U2vQ6V:eQ6[:gQ6]:nQ7T4oQ7r5kQ7v5tQ8P:oQ8T:tQ8U:uQ8z7xQ9Y8gQ9a8xQ9r#QR;U;bR#YWR'P!dY!sQ'U-R0y4tS&{!d,yQ'a!qS'k!t!wS'm!x4vS,v&|'TS-b'b'cQ-d'dQ2P-PR2_-cR(o#vR(r#wQ!eQT-Q'U-R]!pQ!q'U-R0y4tQ#n]R'_9qT#iZ%]S#hZ%]S%cm,]U([#f#g#jS-v(](^Q-z(_Q0Q*|Q2d-wU2e-x-y-{S5z2f2gR7y5{`#[W#U#X%`'x(R*y-qr#eZm#f#g#j%](](^(_*|-w-x-y-{2f2g5{Q1`,]Q1v,sQ5i1nQ7q5jT:|&}*zT#_W%`S#^W%`S'y#U(RS(O#X*yS,x&}*zT-l'x-qT'S!d%aQ$jfR)n$oT)c$j)dR3_.oT*S$w*UR*[$zQ0U+UQ2i.SQ4w0{Q6P2mQ7]4zQ7|6OQ8i7[Q8{7{Q9[8kQ9d8}Q9i9]R9l9elqOXs!Y#b%e&h&j&k&m,a,f1f1iQ&b!UR,U&_rmOXs!T!U!Y#b%e&_&h&j&k&m,a,f1f1iR,]&eT%dm,]R0u+uR,T&]Q%{{R+m%|R+c%vT&f!V&iT&g!V&iT1h,f1i",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > 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 JSXStartTag 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:366,context:Vi,nodeProps:[["group",-26,6,14,16,62,199,203,207,208,210,213,216,226,228,234,236,238,240,243,249,255,257,259,261,263,265,266,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[Wi],skippedNodes:[0,3,4,269],repeatNodeCount:33,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$d&j'xp'{!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$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$d&j'{!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'{!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$d&j'xpOY(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'xpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'xp'{!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$d&j'xp'{!b'n(;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'y#S$d&j'o(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$d&j'xp'{!b'o(;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`$d&j!l$Ip'xp'{!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`#q$Id$d&j'xp'{!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_#q$Id$d&j'xp'{!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$2b3l_'w$(n$d&j'{!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$d&j'{!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$d&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$_#t$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$_#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$_#t$d&j'{!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'{!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$_#t'{!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$d&j'xp'{!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$d&j'xp'{!b(V!LY'u&;d$W#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P+d@`k$d&j'xp'{!b$W#tOY%ZYZ&cZr%Zrs&}st%Ztu@Tuw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![@T![!^%Z!^!_*g!_!c%Z!c!}@T!}#O%Z#O#P&c#P#R%Z#R#S@T#S#T%Z#T#o@T#o#p*g#p$g%Z$g;'S@T;'S;=`BT<%lO@T+dBWP;=`<%l@T(CSB^P;=`<%l>P%#SBl`$d&j'xp'{!b#i$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Cn!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SCy_$d&j#{$Id'xp'{!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%DfETa(k%Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>fi$d&j'xp'{!bl$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#>Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#b%Z#b#c#5T#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#@b_!a$b$d&j#y%Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$JT>P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(CS$=Uk$d&j'xp'{!b'o(;d(V!LY'u&;d$W#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P",tokenizers:[_i,Ci,2,3,4,5,6,7,8,9,10,11,12,13,Ri,new te("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOq~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!O~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(U~~",141,327),new te("j~RQYZXz{^~^O'r~~aP!P!Qd~iO's~~",25,309)],topRules:{Script:[0,5],SingleExpression:[1,267],SingleClassItem:[2,268]},dialects:{jsx:12794,ts:12796},dynamicPrecedences:{76:1,78:1,163:1,191:1},specialized:[{term:313,get:O=>qi[O]||-1},{term:329,get:O=>ji[O]||-1},{term:67,get:O=>zi[O]||-1}],tokenPrec:12820}),Ii=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),P("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),P(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),P(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),P('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),P('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],QO=new wO,JO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function z(O){return(e,a)=>{let t=e.node.getChild("VariableDefinition");return t&&a(t,O),!0}}const Ai=["FunctionDeclaration"],Ei={FunctionDeclaration:z("function"),ClassDeclaration:z("class"),ClassExpression:()=>!0,EnumDeclaration:z("constant"),TypeAliasDeclaration:z("type"),NamespaceDeclaration:z("namespace"),VariableDefinition(O,e){O.matchContext(Ai)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function MO(O,e){let a=QO.get(e);if(a)return a;let t=[],i=!0;function s(r,l){let o=O.sliceString(r.from,r.to);t.push({label:o,type:l})}return e.cursor(Te.IncludeAnonymous).iterate(r=>{if(i)i=!1;else if(r.name){let l=Ei[r.name];if(l&&l(r,s)||JO.has(r.name))return!1}else if(r.to-r.from>8192){for(let l of MO(O,r.node))t.push(l);return!1}}),QO.set(e,t),t}const uO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,LO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Ni(O){let e=q(O.state).resolveInner(O.pos,-1);if(LO.indexOf(e.name)>-1)return null;let a=e.name=="VariableName"||e.to-e.from<20&&uO.test(O.state.sliceDoc(e.from,e.to));if(!a&&!O.explicit)return null;let t=[];for(let i=e;i;i=i.parent)JO.has(i.name)&&(t=t.concat(MO(O.state.doc,i)));return{options:t,from:a?e.from:O.pos,validFor:uO}}const w=ce.define({name:"javascript",parser:Gi.configure({props:[Qe.add({IfStatement:A({except:/^\s*({|else\b)/}),TryStatement:A({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Ct,SwitchBody:O=>{let e=O.textAfter,a=/^\s*\}/.test(e),t=/^\s*(case|default)\b/.test(e);return O.baseIndent+(a?0:t?1:2)*O.unit},Block:Wt({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":A({except:/^{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),ue.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":xO,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),FO={test:O=>/^JSX/.test(O.name),facet:qt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},KO=w.configure({dialect:"ts"},"typescript"),HO=w.configure({dialect:"jsx",props:[TO.add(O=>O.isTop?[FO]:void 0)]}),et=w.configure({dialect:"jsx ts",props:[TO.add(O=>O.isTop?[FO]:void 0)]},"typescript"),Bi="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(O=>({label:O,type:"keyword"}));function Ot(O={}){let e=O.jsx?O.typescript?et:HO:O.typescript?KO:w;return new fe(e,[w.data.of({autocomplete:yO(LO,YO(Ii.concat(Bi)))}),w.data.of({autocomplete:Ni}),O.jsx?Li:[]])}function Di(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function fO(O,e,a=O.length){for(let t=e==null?void 0:e.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return O.sliceString(t.from,Math.min(t.to,a));return""}function Ji(O){return O&&(O.name=="JSXEndTag"||O.name=="JSXSelfCloseEndTag")}const Mi=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Li=v.inputHandler.of((O,e,a,t)=>{if((Mi?O.composing:O.compositionStarted)||O.state.readOnly||e!=a||t!=">"&&t!="/"||!w.isActiveAt(O.state,e,-1))return!1;let{state:i}=O,s=i.changeByRange(r=>{var l;let{head:o}=r,Q=q(i).resolveInner(o,-1),u;if(Q.name=="JSXStartTag"&&(Q=Q.parent),!(Q.name=="JSXAttributeValue"&&Q.to>o)){if(t==">"&&Q.name=="JSXFragmentTag")return{range:E.cursor(o+1),changes:{from:o,insert:">"}};if(t=="/"&&Q.name=="JSXFragmentTag"){let c=Q.parent,h=c==null?void 0:c.parent;if(c.from==o-1&&((l=h.lastChild)===null||l===void 0?void 0:l.name)!="JSXEndTag"&&(u=fO(i.doc,h==null?void 0:h.firstChild,o))){let f=`/${u}>`;return{range:E.cursor(o+f.length),changes:{from:o,insert:f}}}}else if(t==">"){let c=Di(Q);if(c&&!Ji(c.lastChild)&&i.sliceDoc(o,o+2)!="`}}}}return{range:r}});return s.changes.empty?!1:(O.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)}),G=["_blank","_self","_top","_parent"],me=["ascii","utf-8","utf-16","latin1","latin1"],Xe=["get","post","put","delete"],Pe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],X=["true","false"],d={},Fi={a:{attrs:{href:null,ping:null,type:null,media:null,target:G,hreflang:null}},abbr:d,address:d,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:d,aside:d,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:d,base:{attrs:{href:null,target:G}},bdi:d,bdo:d,blockquote:{attrs:{cite:null}},body:d,br:d,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Pe,formmethod:Xe,formnovalidate:["novalidate"],formtarget:G,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:d,center:d,cite:d,code:d,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:d,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:d,div:d,dl:d,dt:d,em:d,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:d,figure:d,footer:d,form:{attrs:{action:null,name:null,"accept-charset":me,autocomplete:["on","off"],enctype:Pe,method:Xe,novalidate:["novalidate"],target:G}},h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:d,hgroup:d,hr:d,html:{attrs:{manifest:null}},i:d,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Pe,formmethod:Xe,formnovalidate:["novalidate"],formtarget:G,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:d,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:d,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:d,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:me,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:d,noscript:d,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:d,param:{attrs:{name:null,value:null}},pre:d,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:d,rt:d,ruby:d,samp:d,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:me}},section:d,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:d,source:{attrs:{src:null,type:null,media:null}},span:d,strong:d,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:d,summary:d,sup:d,table:d,tbody:d,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:d,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:d,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:d,time:{attrs:{datetime:null}},title:d,tr:d,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:d,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:d},tt={accesskey:null,class:null,contenteditable:X,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:X,autocorrect:X,autocapitalize:X,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":X,"aria-autocomplete":["inline","list","both","none"],"aria-busy":X,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":X,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":X,"aria-hidden":X,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":X,"aria-multiselectable":X,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":X,"aria-relevant":null,"aria-required":X,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},at="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(O=>"on"+O);for(let O of at)tt[O]=null;class le{constructor(e,a){this.tags=Object.assign(Object.assign({},Fi),e),this.globalAttrs=Object.assign(Object.assign({},tt),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}le.default=new le;function C(O,e,a=O.length){if(!e)return"";let t=e.firstChild,i=t&&t.getChild("TagName");return i?O.sliceString(i.from,Math.min(i.to,a)):""}function W(O,e=!1){for(;O;O=O.parent)if(O.name=="Element")if(e)e=!1;else return O;return null}function it(O,e,a){let t=a.tags[C(O,W(e))];return(t==null?void 0:t.children)||a.allTags}function Ve(O,e){let a=[];for(let t=W(e);t&&!t.type.isTop;t=W(t.parent)){let i=C(O,t);if(i&&t.lastChild.name=="CloseTag")break;i&&a.indexOf(i)<0&&(e.name=="EndTag"||e.from>=t.firstChild.to)&&a.push(i)}return a}const rt=/^[:\-\.\w\u00b7-\uffff]*$/;function hO(O,e,a,t,i){let s=/\s*>/.test(O.sliceDoc(i,i+5))?"":">",r=W(a,!0);return{from:t,to:i,options:it(O.doc,r,e).map(l=>({label:l,type:"type"})).concat(Ve(O.doc,a).map((l,o)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-o}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function dO(O,e,a,t){let i=/\s*>/.test(O.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:Ve(O.doc,e).map((s,r)=>({label:s,apply:s+i,type:"type",boost:99-r})),validFor:rt}}function Ki(O,e,a,t){let i=[],s=0;for(let r of it(O.doc,a,e))i.push({label:"<"+r,type:"type"});for(let r of Ve(O.doc,a))i.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Hi(O,e,a,t,i){let s=W(a),r=s?e.tags[C(O.doc,s)]:null,l=r&&r.attrs?Object.keys(r.attrs):[],o=r&&r.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:t,to:i,options:o.map(Q=>({label:Q,type:"property"})),validFor:rt}}function er(O,e,a,t,i){var s;let r=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],o;if(r){let Q=O.sliceDoc(r.from,r.to),u=e.globalAttrs[Q];if(!u){let c=W(a),h=c?e.tags[C(O.doc,c)]:null;u=(h==null?void 0:h.attrs)&&h.attrs[Q]}if(u){let c=O.sliceDoc(t,i).toLowerCase(),h='"',f='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",f=O.sliceDoc(i,i+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let p of u)l.push({label:p,apply:h+p+f,type:"constant"})}}return{from:t,to:i,options:l,validFor:o}}function Or(O,e){let{state:a,pos:t}=e,i=q(a).resolveInner(t,-1),s=i.resolve(t);for(let r=t,l;s==i&&(l=i.childBefore(r));){let o=l.lastChild;if(!o||!o.type.isError||o.fromOr(t,i)}const st=[{tag:"script",attrs:O=>O.type=="text/typescript"||O.lang=="ts",parser:KO.parser},{tag:"script",attrs:O=>O.type=="text/babel"||O.type=="text/jsx",parser:HO.parser},{tag:"script",attrs:O=>O.type=="text/typescript-jsx",parser:et.parser},{tag:"script",attrs(O){return!O.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(O.type)},parser:w.parser},{tag:"style",attrs(O){return(!O.lang||O.lang=="css")&&(!O.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(O.type))},parser:se.parser}],lt=[{name:"style",parser:se.parser.configure({top:"Styles"})}].concat(at.map(O=>({name:O,parser:w.parser}))),nt=ce.define({name:"html",parser:Ja.configure({props:[Qe.add({Element(O){let e=/^(\s*)(<\/)?/.exec(O.textAfter);return O.node.to<=O.pos+e[0].length?O.continue():O.lineIndent(O.node.from)+(e[2]?0:O.unit)},"OpenTag CloseTag SelfClosingTag"(O){return O.column(O.node.from)+O.unit},Document(O){if(O.pos+/\s*/.exec(O.textAfter)[0].lengthO.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),H=nt.configure({wrap:AO(st,lt)});function ar(O={}){let e="",a;O.matchClosingTags===!1&&(e="noMatch"),O.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(a=AO((O.nestedLanguages||[]).concat(st),(O.nestedAttributes||[]).concat(lt)));let t=a?nt.configure({wrap:a,dialect:e}):e?H.configure({dialect:e}):H;return new fe(t,[H.data.of({autocomplete:tr(O)}),O.autoCloseTags!==!1?ir:[],Ot().support,mi().support])}const pO=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ir=v.inputHandler.of((O,e,a,t)=>{if(O.composing||O.state.readOnly||e!=a||t!=">"&&t!="/"||!H.isActiveAt(O.state,e,-1))return!1;let{state:i}=O,s=i.changeByRange(r=>{var l,o,Q;let{head:u}=r,c=q(i).resolveInner(u,-1),h;if((c.name=="TagName"||c.name=="StartTag")&&(c=c.parent),t==">"&&c.name=="OpenTag"){if(((o=(l=c.parent)===null||l===void 0?void 0:l.lastChild)===null||o===void 0?void 0:o.name)!="CloseTag"&&(h=C(i.doc,c.parent,u))&&!pO.has(h)){let f=O.state.doc.sliceString(u,u+1)===">",p=`${f?"":">"}`;return{range:E.cursor(u+1),changes:{from:u+(f?1:0),insert:p}}}}else if(t=="/"&&c.name=="OpenTag"){let f=c.parent,p=f==null?void 0:f.parent;if(f.from==u-1&&((Q=p.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(h=C(i.doc,p,u))&&!pO.has(h)){let g=O.state.doc.sliceString(u,u+1)===">",$=`/${h}${g?"":">"}`,k=u+$.length+(g?1:0);return{range:E.cursor(k),changes:{from:u,insert:$}}}}return{range:r}});return s.changes.empty?!1:(O.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)}),rr=36,SO=1,sr=2,M=3,Ze=4,lr=5,nr=6,or=7,cr=8,Qr=9,ur=10,fr=11,hr=12,dr=13,pr=14,Sr=15,$r=16,gr=17,$O=18,mr=19,ot=20,ct=21,gO=22,Xr=23,Pr=24;function xe(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function Zr(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function T(O,e,a){for(let t=!1;;){if(O.next<0)return;if(O.next==e&&!t){O.advance();return}t=a&&!t&&O.next==92,O.advance()}}function br(O){for(;;){if(O.next<0||O.peek(1)<0)return;if(O.next==36&&O.peek(1)==36){O.advance(2);return}O.advance()}}function Qt(O,e){for(;!(O.next!=95&&!xe(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function kr(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),T(O,e,!1)}else Qt(O)}function mO(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function XO(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function PO(O){for(;!(O.next<0||O.next==10);)O.advance()}function R(O,e){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ut(wr,xr)};function yr(O,e,a,t){let i={};for(let s in we)i[s]=(O.hasOwnProperty(s)?O:we)[s];return e&&(i.words=ut(e,a||"",t)),i}function ft(O){return new b(e=>{var a;let{next:t}=e;if(e.advance(),R(t,ZO)){for(;R(e.next,ZO);)e.advance();e.acceptToken(rr)}else if(t==36&&e.next==36&&O.doubleDollarQuotedStrings)br(e),e.acceptToken(M);else if(t==39||t==34&&O.doubleQuotedStrings)T(e,t,O.backslashEscapes),e.acceptToken(M);else if(t==35&&O.hashComments||t==47&&e.next==47&&O.slashComments)PO(e),e.acceptToken(SO);else if(t==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))PO(e),e.acceptToken(SO);else if(t==47&&e.next==42){e.advance();for(let i=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(i--,e.advance(),!i)break}else s==47&&e.next==42&&(i++,e.advance())}e.acceptToken(sr)}else if((t==101||t==69)&&e.next==39)e.advance(),T(e,39,!0);else if((t==110||t==78)&&e.next==39&&O.charSetCasts)e.advance(),T(e,39,O.backslashEscapes),e.acceptToken(M);else if(t==95&&O.charSetCasts)for(let i=0;;i++){if(e.next==39&&i>1){e.advance(),T(e,39,O.backslashEscapes),e.acceptToken(M);break}if(!xe(e.next))break;e.advance()}else if(t==40)e.acceptToken(or);else if(t==41)e.acceptToken(cr);else if(t==123)e.acceptToken(Qr);else if(t==125)e.acceptToken(ur);else if(t==91)e.acceptToken(fr);else if(t==93)e.acceptToken(hr);else if(t==59)e.acceptToken(dr);else if(O.unquotedBitLiterals&&t==48&&e.next==98)e.advance(),mO(e),e.acceptToken(gO);else if((t==98||t==66)&&(e.next==39||e.next==34)){const i=e.next;e.advance(),O.treatBitsAsBytes?(T(e,i,O.backslashEscapes),e.acceptToken(Xr)):(mO(e,i),e.acceptToken(gO))}else if(t==48&&(e.next==120||e.next==88)||(t==120||t==88)&&e.next==39){let i=e.next==39;for(e.advance();Zr(e.next);)e.advance();i&&e.next==39&&e.advance(),e.acceptToken(Ze)}else if(t==46&&e.next>=48&&e.next<=57)XO(e,!0),e.acceptToken(Ze);else if(t==46)e.acceptToken(pr);else if(t>=48&&t<=57)XO(e,!1),e.acceptToken(Ze);else if(R(t,O.operatorChars)){for(;R(e.next,O.operatorChars);)e.advance();e.acceptToken(Sr)}else if(R(t,O.specialVar))e.next==t&&e.advance(),kr(e),e.acceptToken(gr);else if(R(t,O.identifierQuotes))T(e,t,!1),e.acceptToken(mr);else if(t==58||t==44)e.acceptToken($r);else if(xe(t)){let i=Qt(e,String.fromCharCode(t));e.acceptToken(e.next==46?$O:(a=O.words[i.toLowerCase()])!==null&&a!==void 0?a:$O)}})}const ht=ft(we),Yr=U.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ht],topRules:{Script:[0,25]},tokenPrec:0});function ye(O){let e=O.cursor().moveTo(O.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function N(O,e){let a=O.sliceString(e.from,e.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function ne(O){return O&&(O.name=="Identifier"||O.name=="QuotedIdentifier")}function Tr(O,e){if(e.name=="CompositeIdentifier"){let a=[];for(let t=e.firstChild;t;t=t.nextSibling)ne(t)&&a.push(N(O,t));return a}return[N(O,e)]}function bO(O,e){for(let a=[];;){if(!e||e.name!=".")return a;let t=ye(e);if(!ne(t))return a;a.unshift(N(O,t)),e=ye(t)}}function vr(O,e){let a=q(O).resolveInner(e,-1),t=Vr(O.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?O.doc.sliceString(a.from,a.from+1):null,parents:bO(O.doc,ye(a)),aliases:t}:a.name=="."?{from:e,quoted:null,parents:bO(O.doc,a),aliases:t}:{from:e,quoted:null,parents:[],empty:!0,aliases:t}}const Ur=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Vr(O,e){let a;for(let i=e;!a;i=i.parent){if(!i)return null;i.name=="Statement"&&(a=i)}let t=null;for(let i=a.firstChild,s=!1,r=null;i;i=i.nextSibling){let l=i.name=="Keyword"?O.sliceString(i.from,i.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&r&&ne(i.nextSibling))o=N(O,i.nextSibling);else{if(l&&Ur.has(l))break;r&&ne(i)&&(o=N(O,i))}o&&(t||(t=Object.create(null)),t[o]=Tr(O,r)),r=/Identifier$/.test(i.name)?i:null}return t}function Rr(O,e){return O?e.map(a=>Object.assign(Object.assign({},a),{label:O+a.label+O,apply:void 0})):e}const _r=/^\w*$/,Cr=/^[`'"]?\w*[`'"]?$/;class Re{constructor(){this.list=[],this.children=void 0}child(e,a){let t=this.children||(this.children=Object.create(null)),i=t[e];return i||(e&&this.list.push(dt(e,"type",a)),t[e]=new Re)}addCompletions(e){for(let a of e){let t=this.list.findIndex(i=>i.label==a.label);t>-1?this.list[t]=a:this.list.push(a)}}}function dt(O,e,a){return/[^\w\xb5-\uffff]/.test(O)?{label:O,type:e,apply:a+O+a}:{label:O,type:e}}function Wr(O,e,a,t,i,s){var r;let l=new Re,o=((r=s==null?void 0:s.spec.identifierQuotes)===null||r===void 0?void 0:r[0])||'"',Q=l.child(i||"",o);for(let u in O){let c=u.split("."),h=c.length==1?Q:l;for(let f of c)h=h.child(f,o);for(let f of O[u])f&&h.list.push(typeof f=="string"?dt(f,"property",o):f)}return e&&Q.addCompletions(e),a&&l.addCompletions(a),l.addCompletions(Q.list),t&&l.addCompletions(Q.child(t,o).list),u=>{let{parents:c,from:h,quoted:f,empty:p,aliases:g}=vr(u.state,u.pos);if(p&&!u.explicit)return null;g&&c.length==1&&(c=g[c[0]]||c);let $=l;for(let y of c){for(;!$.children||!$.children[y];)if($==l)$=Q;else if($==Q&&t)$=$.child(t,o);else return null;$=$.child(y,o)}let k=f&&u.state.sliceDoc(u.pos,u.pos+1)==f,V=$.list;return $==l&&g&&(V=V.concat(Object.keys(g).map(y=>({label:y,type:"constant"})))),{from:h,to:k?u.pos+1:void 0,options:Rr(f,V),validFor:f?Cr:_r}}}function qr(O,e){let a=Object.keys(O).map(t=>({label:e?t.toUpperCase():t,type:O[t]==ct?"type":O[t]==ot?"keyword":"variable",boost:-1}));return yO(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],YO(a))}let jr=Yr.configure({props:[Qe.add({Statement:A()}),ue.add({Statement(O){return{from:O.firstChild.to,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}}),oe({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class B{constructor(e,a,t){this.dialect=e,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(e){let a=yr(e,e.keywords,e.types,e.builtin),t=ce.define({name:"sql",parser:jr.configure({tokenizers:[{from:ht,to:ft(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new B(a,t,e)}}function zr(O,e=!1){return qr(O.dialect.words,e)}function Gr(O,e=!1){return O.language.data.of({autocomplete:zr(O,e)})}function Ir(O){return O.schema?Wr(O.schema,O.tables,O.schemas,O.defaultTable,O.defaultSchema,O.dialect||_e):()=>null}function Ar(O){return O.schema?(O.dialect||_e).language.data.of({autocomplete:Ir(O)}):[]}function kO(O={}){let e=O.dialect||_e;return new fe(e.language,[Ar(O),Gr(e,!!O.upperCaseKeywords)])}const _e=B.define({});function Er(O){let e;return{c(){e=Xt("div"),Pt(e,"class","code-editor"),D(e,"min-height",O[0]?O[0]+"px":null),D(e,"max-height",O[1]?O[1]+"px":"auto")},m(a,t){Zt(a,e,t),O[11](e)},p(a,[t]){t&1&&D(e,"min-height",a[0]?a[0]+"px":null),t&2&&D(e,"max-height",a[1]?a[1]+"px":"auto")},i:je,o:je,d(a){a&&bt(e),O[11](null)}}}function Nr(O,e,a){let t;kt(O,xt,S=>a(12,t=S));const i=wt();let{id:s=""}=e,{value:r=""}=e,{minHeight:l=null}=e,{maxHeight:o=null}=e,{disabled:Q=!1}=e,{placeholder:u=""}=e,{language:c="javascript"}=e,{singleLine:h=!1}=e,f,p,g=new J,$=new J,k=new J,V=new J;function y(){f==null||f.focus()}function pt(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r},bubbles:!0})),i("change",r)}function Ce(){if(!s)return;const S=document.querySelectorAll('[for="'+s+'"]');for(let m of S)m.removeEventListener("click",y)}function We(){if(!s)return;Ce();const S=document.querySelectorAll('[for="'+s+'"]');for(let m of S)m.addEventListener("click",y)}function qe(){switch(c){case"html":return ar();case"sql-create-index":return kO({dialect:B.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let S={};for(let m of t)S[m.name]=Yt.getAllCollectionIdentifiers(m);return kO({dialect:B.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:S,upperCaseKeywords:!0});default:return Ot()}}yt(()=>{const S={key:"Enter",run:m=>{h&&i("submit",r)}};return We(),a(10,f=new v({parent:p,state:j.create({doc:r,extensions:[zt(),Gt(),It(),At(),Et(),j.allowMultipleSelections.of(!0),Nt(Bt,{fallback:!0}),Dt(),Jt(),Mt(),Lt(),Ft.of([S,...Kt,...Ht,ea.find(m=>m.key==="Mod-d"),...Oa,...ta]),v.lineWrapping,aa({icons:!1}),g.of(qe()),V.of(ze(u)),$.of(v.editable.of(!0)),k.of(j.readOnly.of(!1)),j.transactionFilter.of(m=>h&&m.newDoc.lines>1?[]:m),v.updateListener.of(m=>{!m.docChanged||Q||(a(3,r=m.state.doc.toString()),pt())})]})})),()=>{Ce(),f==null||f.destroy()}});function St(S){Tt[S?"unshift":"push"](()=>{p=S,a(2,p)})}return O.$$set=S=>{"id"in S&&a(4,s=S.id),"value"in S&&a(3,r=S.value),"minHeight"in S&&a(0,l=S.minHeight),"maxHeight"in S&&a(1,o=S.maxHeight),"disabled"in S&&a(5,Q=S.disabled),"placeholder"in S&&a(6,u=S.placeholder),"language"in S&&a(7,c=S.language),"singleLine"in S&&a(8,h=S.singleLine)},O.$$.update=()=>{O.$$.dirty&16&&s&&We(),O.$$.dirty&1152&&f&&c&&f.dispatch({effects:[g.reconfigure(qe())]}),O.$$.dirty&1056&&f&&typeof Q<"u"&&f.dispatch({effects:[$.reconfigure(v.editable.of(!Q)),k.reconfigure(j.readOnly.of(Q))]}),O.$$.dirty&1032&&f&&r!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:r}}),O.$$.dirty&1088&&f&&typeof u<"u"&&f.dispatch({effects:[V.reconfigure(ze(u))]})},[l,o,p,r,s,Q,u,c,h,y,f,St]}class Jr extends $t{constructor(e){super(),gt(this,e,Nr,Er,mt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Jr as default}; diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-92660280.js b/ui/dist/assets/ConfirmEmailChangeDocs-18835cec.js similarity index 86% rename from ui/dist/assets/ConfirmEmailChangeDocs-92660280.js rename to ui/dist/assets/ConfirmEmailChangeDocs-18835cec.js index 0f5aa2a4..a5771e92 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-92660280.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-18835cec.js @@ -1,4 +1,4 @@ -import{S as Ce,i as $e,s as Pe,e as r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,N as pe,P as Se,k as we,Q as Oe,n as Re,t as Z,a as x,o as m,d as ge,C as Te,p as Ee,r as j,u as ye,M as Be}from"./index-3379c20e.js";import{S as qe}from"./SdkTabs-0096fda4.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(C,s,$),n(s,_),n(s,u),i||(d=ye(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new Be({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&m(s),ge(a)}}}function Ae(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,P,I,R,L,S,M,te,N,T,le,Q,K=o[0].name+"",z,se,G,E,J,y,V,B,X,w,q,v=[],ae=new Map,oe,A,k=[],ne=new Map,O;P=new qe({props:{js:` +import{S as Ce,i as $e,s as Pe,e as r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,O as pe,P as Se,k as we,Q as Oe,n as Re,t as Z,a as x,o as m,d as ge,C as Te,p as Ee,r as j,u as ye,N as Be}from"./index-352a0704.js";import{S as qe}from"./SdkTabs-17fc08c7.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(C,s,$),n(s,_),n(s,u),i||(d=ye(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new Be({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&m(s),ge(a)}}}function Ae(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,P,I,R,L,S,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,w,q,v=[],ae=new Map,oe,A,k=[],ne=new Map,O;P=new qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -20,7 +20,7 @@ import{S as Ce,i as $e,s as Pe,e as r,w as g,b as h,c as he,f as b,g as f,h as n 'TOKEN', 'YOUR_PASSWORD', ); - `}});let W=o[2];const ie=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam + `}});let W=o[2];const ie=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required @@ -30,7 +30,7 @@ import{S as Ce,i as $e,s as Pe,e as r,w as g,b as h,c as he,f as b,g as f,h as n
Required password
String - The account password to confirm the email change.`,V=h(),B=r("div"),B.textContent="Responses",X=h(),w=r("div"),q=r("div");for(let e=0;eThe account password to confirm the email change.`,V=h(),B=r("div"),B.textContent="Responses",X=h(),w=r("div"),q=r("div");for(let e=0;es(1,u=p.code);return o.$$set=p=>{"collection"in p&&s(0,_=p.collection)},s(3,a=Te.getApiExampleUrl(Ee.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),P.$set(c),(!O||t&1)&&M!==(M=e[0].name+"")&&Y(z,M),t&6&&(W=e[2],v=pe(v,t,ie,1,e,W,ae,q,Se,_e,null,be)),t&6&&(U=e[2],we(),k=pe(k,t,ce,1,e,U,ne,A,Oe,ke,null,ue),Re())},i(e){if(!O){Z(P.$$.fragment,e);for(let t=0;ts(1,u=p.code);return o.$$set=p=>{"collection"in p&&s(0,_=p.collection)},s(3,a=Te.getApiExampleUrl(Ee.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -63,4 +63,4 @@ import{S as Ce,i as $e,s as Pe,e as r,w as g,b as h,c as he,f as b,g as f,h as n } } } - `}]),[_,u,i,a,d]}class Ne extends Ce{constructor(l){super(),$e(this,l,Ue,Ae,Pe,{collection:0})}}export{Ne as default}; + `}]),[_,u,i,a,d]}class Ke extends Ce{constructor(l){super(),$e(this,l,Ue,Ae,Pe,{collection:0})}}export{Ke as default}; diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-8f0f20ec.js b/ui/dist/assets/ConfirmPasswordResetDocs-9860c6ec.js similarity index 77% rename from ui/dist/assets/ConfirmPasswordResetDocs-8f0f20ec.js rename to ui/dist/assets/ConfirmPasswordResetDocs-9860c6ec.js index 6ebc6e03..4a00e03c 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-8f0f20ec.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-9860c6ec.js @@ -1,4 +1,4 @@ -import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,N as me,P as Ne,k as Oe,Q as Ce,n as We,t as Z,a as x,o as f,d as Pe,C as $e,p as Ee,r as U,u as Te,M as ge}from"./index-3379c20e.js";import{S as Ae}from"./SdkTabs-0096fda4.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(S,l,h),n(l,_),n(l,u),i||(p=Te(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&f(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new ge({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(l),Pe(a)}}}function De(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,M=o[0].name+"",j,ee,H,R,L,W,Q,N,q,te,B,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,O,A,w=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new Ae({props:{js:` +import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as f,d as Pe,C as $e,p as Ee,r as U,u as Te,N as ge}from"./index-352a0704.js";import{S as Ae}from"./SdkTabs-17fc08c7.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(S,l,h),n(l,_),n(l,u),i||(p=Te(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&f(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new ge({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(l),Pe(a)}}}function De(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,w=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -22,7 +22,7 @@ import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n 'NEW_PASSWORD', 'NEW_PASSWORD_CONFIRM', ); - `}});let I=o[2];const ie=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam + `}});let I=o[2];const ie=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
Required @@ -36,7 +36,7 @@ import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n
Required passwordConfirm
String - The new password confirmation.`,X=v(),g=r("div"),g.textContent="Responses",Y=v(),O=r("div"),A=r("div");for(let e=0;eThe new password confirmation.`,X=v(),g=r("div"),g.textContent="Responses",Y=v(),N=r("div"),A=r("div");for(let e=0;el(1,u=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=$e.getApiExampleUrl(Ee.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` + `),R.$set(c),(!C||t&1)&&F!==(F=e[0].name+"")&&K(G,F),t&6&&(I=e[2],w=me(w,t,ie,1,e,I,ae,A,Oe,_e,null,be)),t&6&&(y=e[2],Ne(),k=me(k,t,ce,1,e,y,ne,D,Ce,ke,null,ue),We())},i(e){if(!C){Z(R.$$.fragment,e);for(let t=0;tl(1,u=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=$e.getApiExampleUrl(Ee.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -71,4 +71,4 @@ import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n } } } - `}]),[_,u,i,a,p]}class Be extends Se{constructor(s){super(),he(this,s,ye,De,Re,{collection:0})}}export{Be as default}; + `}]),[_,u,i,a,p]}class Me extends Se{constructor(s){super(),he(this,s,ye,De,Re,{collection:0})}}export{Me as default}; diff --git a/ui/dist/assets/ConfirmVerificationDocs-c9a2216e.js b/ui/dist/assets/ConfirmVerificationDocs-4dc49abd.js similarity index 71% rename from ui/dist/assets/ConfirmVerificationDocs-c9a2216e.js rename to ui/dist/assets/ConfirmVerificationDocs-4dc49abd.js index 4010c9eb..16acc441 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-c9a2216e.js +++ b/ui/dist/assets/ConfirmVerificationDocs-4dc49abd.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Te,e as r,w,b as k,c as ge,f as b,g as f,h as i,m as ye,x as D,N as _e,P as Be,k as qe,Q as Re,n as Ee,t as Z,a as x,o as p,d as Ce,C as Me,p as Ne,r as H,u as Oe,M as Ve}from"./index-3379c20e.js";import{S as Ke}from"./SdkTabs-0096fda4.js";function ke(a,l,s){const o=a.slice();return o[5]=l[s],o}function ve(a,l,s){const o=a.slice();return o[5]=l[s],o}function we(a,l){let s,o=l[5].code+"",h,d,n,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),h=w(o),d=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m($,g){f($,s,g),i(s,h),i(s,d),n||(u=Oe(s,"click",m),n=!0)},p($,g){l=$,g&4&&o!==(o=l[5].code+"")&&D(h,o),g&6&&H(s,"active",l[1]===l[5].code)},d($){$&&p(s),n=!1,u()}}}function $e(a,l){let s,o,h,d;return o=new Ve({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ge(o.$$.fragment),h=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(n,s,u),ye(o,s,null),i(s,h),d=!0},p(n,u){l=n;const m={};u&4&&(m.content=l[5].body),o.$set(m),(!d||u&6)&&H(s,"active",l[1]===l[5].code)},i(n){d||(Z(o.$$.fragment,n),d=!0)},o(n){x(o.$$.fragment,n),d=!1},d(n){n&&p(s),Ce(o)}}}function Ae(a){var re,fe,pe,ue;let l,s,o=a[0].name+"",h,d,n,u,m,$,g,V=a[0].name+"",F,ee,I,y,L,T,Q,C,K,te,A,B,le,z,U=a[0].name+"",G,se,J,q,W,R,X,E,Y,P,M,v=[],oe=new Map,ae,N,_=[],ie=new Map,S;y=new Ke({props:{js:` +import{S as Pe,i as Se,s as Te,e as r,w,b as k,c as ge,f as b,g as f,h as i,m as ye,x as D,O as _e,P as Be,k as qe,Q as Oe,n as Re,t as Z,a as x,o as p,d as Ce,C as Ee,p as Ne,r as H,u as Ve,N as Ke}from"./index-352a0704.js";import{S as Me}from"./SdkTabs-17fc08c7.js";function ke(a,l,s){const o=a.slice();return o[5]=l[s],o}function ve(a,l,s){const o=a.slice();return o[5]=l[s],o}function we(a,l){let s,o=l[5].code+"",h,d,n,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),h=w(o),d=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m($,g){f($,s,g),i(s,h),i(s,d),n||(u=Ve(s,"click",m),n=!0)},p($,g){l=$,g&4&&o!==(o=l[5].code+"")&&D(h,o),g&6&&H(s,"active",l[1]===l[5].code)},d($){$&&p(s),n=!1,u()}}}function $e(a,l){let s,o,h,d;return o=new Ke({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ge(o.$$.fragment),h=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(n,s,u),ye(o,s,null),i(s,h),d=!0},p(n,u){l=n;const m={};u&4&&(m.content=l[5].body),o.$set(m),(!d||u&6)&&H(s,"active",l[1]===l[5].code)},i(n){d||(Z(o.$$.fragment,n),d=!0)},o(n){x(o.$$.fragment,n),d=!1},d(n){n&&p(s),Ce(o)}}}function Ae(a){var re,fe,pe,ue;let l,s,o=a[0].name+"",h,d,n,u,m,$,g,K=a[0].name+"",F,ee,I,y,L,T,Q,C,M,te,A,B,le,z,U=a[0].name+"",G,se,J,q,W,O,X,R,Y,P,E,v=[],oe=new Map,ae,N,_=[],ie=new Map,S;y=new Me({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -20,13 +20,13 @@ import{S as Pe,i as Se,s as Te,e as r,w,b as k,c as ge,f as b,g as f,h as i,m as // optionally refresh the previous authStore state with the latest record changes await pb.collection('${(ue=a[0])==null?void 0:ue.name}').authRefresh(); - `}});let j=a[2];const ne=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam + `}});let j=a[2];const ne=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.`,X=k(),E=r("div"),E.textContent="Responses",Y=k(),P=r("div"),M=r("div");for(let e=0;eThe token from the verification request email.`,X=k(),R=r("div"),R.textContent="Responses",Y=k(),P=r("div"),E=r("div");for(let e=0;es(1,d=m.code);return a.$$set=m=>{"collection"in m&&s(0,h=m.collection)},s(3,o=Me.getApiExampleUrl(Ne.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:` + `),y.$set(c),(!S||t&1)&&U!==(U=e[0].name+"")&&D(G,U),t&6&&(j=e[2],v=_e(v,t,ne,1,e,j,oe,E,Be,we,null,ve)),t&6&&(V=e[2],qe(),_=_e(_,t,ce,1,e,V,ie,N,Oe,$e,null,ke),Re())},i(e){if(!S){Z(y.$$.fragment,e);for(let t=0;ts(1,d=m.code);return a.$$set=m=>{"collection"in m&&s(0,h=m.collection)},s(3,o=Ee.getApiExampleUrl(Ne.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/CreateApiDocs-4f05d49f.js b/ui/dist/assets/CreateApiDocs-26ff026a.js similarity index 87% rename from ui/dist/assets/CreateApiDocs-4f05d49f.js rename to ui/dist/assets/CreateApiDocs-26ff026a.js index 4ff839ff..59471228 100644 --- a/ui/dist/assets/CreateApiDocs-4f05d49f.js +++ b/ui/dist/assets/CreateApiDocs-26ff026a.js @@ -1,4 +1,4 @@ -import{S as qt,i as Mt,s as Ot,C as Q,M as Tt,e as a,w as k,b as u,c as be,f as h,g as d,h as n,m as _e,x,N as Be,P as _t,k as Ht,Q as Lt,n as Pt,t as fe,a as pe,o as c,d as ke,p as gt,r as ye,u as Ft,y as ne}from"./index-3379c20e.js";import{S as At}from"./SdkTabs-0096fda4.js";import{F as Bt}from"./FieldsQueryParam-aebe0d79.js";function kt(o,e,l){const s=o.slice();return s[8]=e[l],s}function yt(o,e,l){const s=o.slice();return s[8]=e[l],s}function vt(o,e,l){const s=o.slice();return s[13]=e[l],s}function ht(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin Authorization:TOKEN header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function wt(o){let e,l,s,m,b,r,f,v,T,q,$,L,D,E,g,I,j,R,C,N,M,w,_;function O(p,S){var ee,K;return(K=(ee=p[0])==null?void 0:ee.options)!=null&&K.requireEmail?jt:Rt}let z=O(o),F=z(o);return{c(){e=a("tr"),e.innerHTML='Auth fields',l=u(),s=a("tr"),s.innerHTML=`
Optional +import{S as qt,i as Ot,s as Mt,C as Q,N as Tt,e as a,w as k,b as u,c as be,f as h,g as d,h as n,m as _e,x,O as Be,P as _t,k as Ht,Q as Lt,n as Pt,t as fe,a as pe,o as c,d as ke,p as gt,r as ye,u as Ft,y as ne}from"./index-352a0704.js";import{S as At}from"./SdkTabs-17fc08c7.js";import{F as Bt}from"./FieldsQueryParam-d00fc8d6.js";function kt(o,e,l){const s=o.slice();return s[8]=e[l],s}function yt(o,e,l){const s=o.slice();return s[8]=e[l],s}function vt(o,e,l){const s=o.slice();return s[13]=e[l],s}function ht(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin Authorization:TOKEN header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function wt(o){let e,l,s,m,b,r,f,v,T,q,$,L,D,E,g,I,j,R,C,N,O,w,_;function M(p,S){var ee,K;return(K=(ee=p[0])==null?void 0:ee.options)!=null&&K.requireEmail?jt:Rt}let z=M(o),F=z(o);return{c(){e=a("tr"),e.innerHTML='Auth fields',l=u(),s=a("tr"),s.innerHTML=`
Optional username
String The username of the auth record. @@ -12,13 +12,13 @@ import{S as qt,i as Mt,s as Ot,C as Q,M as Tt,e as a,w as k,b as u,c as be,f as Auth record password.`,R=u(),C=a("tr"),C.innerHTML=`
Required passwordConfirm
String - Auth record password confirmation.`,N=u(),M=a("tr"),M.innerHTML=`
Optional + Auth record password confirmation.`,N=u(),O=a("tr"),O.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.`,w=u(),_=a("tr"),_.innerHTML='Schema fields',h(f,"class","inline-flex")},m(p,S){d(p,e,S),d(p,l,S),d(p,s,S),d(p,m,S),d(p,b,S),n(b,r),n(r,f),F.m(f,null),n(f,v),n(f,T),n(b,q),n(b,$),n(b,L),n(b,D),d(p,E,S),d(p,g,S),d(p,I,S),d(p,j,S),d(p,R,S),d(p,C,S),d(p,N,S),d(p,M,S),d(p,w,S),d(p,_,S)},p(p,S){z!==(z=O(p))&&(F.d(1),F=z(p),F&&(F.c(),F.m(f,v)))},d(p){p&&c(e),p&&c(l),p&&c(s),p&&c(m),p&&c(b),F.d(),p&&c(E),p&&c(g),p&&c(I),p&&c(j),p&&c(R),p&&c(C),p&&c(N),p&&c(M),p&&c(w),p&&c(_)}}}function Rt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function jt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function Dt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function Nt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function Vt(o){var b;let e,l=((b=o[13].options)==null?void 0:b.maxSelect)===1?"id":"ids",s,m;return{c(){e=k("Relation record "),s=k(l),m=k(".")},m(r,f){d(r,e,f),d(r,s,f),d(r,m,f)},p(r,f){var v;f&1&&l!==(l=((v=r[13].options)==null?void 0:v.maxSelect)===1?"id":"ids")&&x(s,l)},d(r){r&&c(e),r&&c(s),r&&c(m)}}}function Jt(o){let e,l,s,m,b;return{c(){e=k("File object."),l=a("br"),s=k(` - Set to `),m=a("code"),m.textContent="null",b=k(" to delete already uploaded file(s).")},m(r,f){d(r,e,f),d(r,l,f),d(r,s,f),d(r,m,f),d(r,b,f)},p:ne,d(r){r&&c(e),r&&c(l),r&&c(s),r&&c(m),r&&c(b)}}}function Et(o){let e;return{c(){e=k("URL address.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function It(o){let e;return{c(){e=k("Email address.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function Ut(o){let e;return{c(){e=k("JSON array or object.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function Qt(o){let e;return{c(){e=k("Number value.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function zt(o){let e;return{c(){e=k("Plain text value.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function $t(o,e){let l,s,m,b,r,f=e[13].name+"",v,T,q,$,L=Q.getFieldValueType(e[13])+"",D,E,g,I;function j(_,O){return _[13].required?Nt:Dt}let R=j(e),C=R(e);function N(_,O){if(_[13].type==="text")return zt;if(_[13].type==="number")return Qt;if(_[13].type==="json")return Ut;if(_[13].type==="email")return It;if(_[13].type==="url")return Et;if(_[13].type==="file")return Jt;if(_[13].type==="relation")return Vt}let M=N(e),w=M&&M(e);return{key:o,first:null,c(){l=a("tr"),s=a("td"),m=a("div"),C.c(),b=u(),r=a("span"),v=k(f),T=u(),q=a("td"),$=a("span"),D=k(L),E=u(),g=a("td"),w&&w.c(),I=u(),h(m,"class","inline-flex"),h($,"class","label"),this.first=l},m(_,O){d(_,l,O),n(l,s),n(s,m),C.m(m,null),n(m,b),n(m,r),n(r,v),n(l,T),n(l,q),n(q,$),n($,D),n(l,E),n(l,g),w&&w.m(g,null),n(l,I)},p(_,O){e=_,R!==(R=j(e))&&(C.d(1),C=R(e),C&&(C.c(),C.m(m,b))),O&1&&f!==(f=e[13].name+"")&&x(v,f),O&1&&L!==(L=Q.getFieldValueType(e[13])+"")&&x(D,L),M===(M=N(e))&&w?w.p(e,O):(w&&w.d(1),w=M&&M(e),w&&(w.c(),w.m(g,null)))},d(_){_&&c(l),C.d(),w&&w.d()}}}function Ct(o,e){let l,s=e[8].code+"",m,b,r,f;function v(){return e[7](e[8])}return{key:o,first:null,c(){l=a("button"),m=k(s),b=u(),h(l,"class","tab-item"),ye(l,"active",e[2]===e[8].code),this.first=l},m(T,q){d(T,l,q),n(l,m),n(l,b),r||(f=Ft(l,"click",v),r=!0)},p(T,q){e=T,q&8&&s!==(s=e[8].code+"")&&x(m,s),q&12&&ye(l,"active",e[2]===e[8].code)},d(T){T&&c(l),r=!1,f()}}}function St(o,e){let l,s,m,b;return s=new Tt({props:{content:e[8].body}}),{key:o,first:null,c(){l=a("div"),be(s.$$.fragment),m=u(),h(l,"class","tab-item"),ye(l,"active",e[2]===e[8].code),this.first=l},m(r,f){d(r,l,f),_e(s,l,null),n(l,m),b=!0},p(r,f){e=r;const v={};f&8&&(v.content=e[8].body),s.$set(v),(!b||f&12)&&ye(l,"active",e[2]===e[8].code)},i(r){b||(fe(s.$$.fragment,r),b=!0)},o(r){pe(s.$$.fragment,r),b=!1},d(r){r&&c(l),ke(s)}}}function Kt(o){var at,ot,rt,dt,ct;let e,l,s=o[0].name+"",m,b,r,f,v,T,q,$=o[0].name+"",L,D,E,g,I,j,R,C,N,M,w,_,O,z,F,p,S,ee,K=o[0].name+"",ve,Re,je,he,se,we,W,$e,De,U,Ce,Ne,Se,V=[],Ve=new Map,Te,ie,qe,Y,Me,Je,ae,G,Oe,Ee,He,Ie,H,Ue,te,Qe,ze,Ke,Le,We,Pe,Ye,Ge,Xe,ge,Ze,xe,le,Fe,oe,Ae,X,re,J=[],et=new Map,tt,de,A=[],lt=new Map,Z;C=new At({props:{js:` + This field can be set only by admins or auth records with "Manage" access.`,w=u(),_=a("tr"),_.innerHTML='Schema fields',h(f,"class","inline-flex")},m(p,S){d(p,e,S),d(p,l,S),d(p,s,S),d(p,m,S),d(p,b,S),n(b,r),n(r,f),F.m(f,null),n(f,v),n(f,T),n(b,q),n(b,$),n(b,L),n(b,D),d(p,E,S),d(p,g,S),d(p,I,S),d(p,j,S),d(p,R,S),d(p,C,S),d(p,N,S),d(p,O,S),d(p,w,S),d(p,_,S)},p(p,S){z!==(z=M(p))&&(F.d(1),F=z(p),F&&(F.c(),F.m(f,v)))},d(p){p&&c(e),p&&c(l),p&&c(s),p&&c(m),p&&c(b),F.d(),p&&c(E),p&&c(g),p&&c(I),p&&c(j),p&&c(R),p&&c(C),p&&c(N),p&&c(O),p&&c(w),p&&c(_)}}}function Rt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function jt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function Dt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function Nt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){d(l,e,s)},d(l){l&&c(e)}}}function Vt(o){var b;let e,l=((b=o[13].options)==null?void 0:b.maxSelect)===1?"id":"ids",s,m;return{c(){e=k("Relation record "),s=k(l),m=k(".")},m(r,f){d(r,e,f),d(r,s,f),d(r,m,f)},p(r,f){var v;f&1&&l!==(l=((v=r[13].options)==null?void 0:v.maxSelect)===1?"id":"ids")&&x(s,l)},d(r){r&&c(e),r&&c(s),r&&c(m)}}}function Jt(o){let e,l,s,m,b;return{c(){e=k("File object."),l=a("br"),s=k(` + Set to `),m=a("code"),m.textContent="null",b=k(" to delete already uploaded file(s).")},m(r,f){d(r,e,f),d(r,l,f),d(r,s,f),d(r,m,f),d(r,b,f)},p:ne,d(r){r&&c(e),r&&c(l),r&&c(s),r&&c(m),r&&c(b)}}}function Et(o){let e;return{c(){e=k("URL address.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function It(o){let e;return{c(){e=k("Email address.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function Ut(o){let e;return{c(){e=k("JSON array or object.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function Qt(o){let e;return{c(){e=k("Number value.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function zt(o){let e;return{c(){e=k("Plain text value.")},m(l,s){d(l,e,s)},p:ne,d(l){l&&c(e)}}}function $t(o,e){let l,s,m,b,r,f=e[13].name+"",v,T,q,$,L=Q.getFieldValueType(e[13])+"",D,E,g,I;function j(_,M){return _[13].required?Nt:Dt}let R=j(e),C=R(e);function N(_,M){if(_[13].type==="text")return zt;if(_[13].type==="number")return Qt;if(_[13].type==="json")return Ut;if(_[13].type==="email")return It;if(_[13].type==="url")return Et;if(_[13].type==="file")return Jt;if(_[13].type==="relation")return Vt}let O=N(e),w=O&&O(e);return{key:o,first:null,c(){l=a("tr"),s=a("td"),m=a("div"),C.c(),b=u(),r=a("span"),v=k(f),T=u(),q=a("td"),$=a("span"),D=k(L),E=u(),g=a("td"),w&&w.c(),I=u(),h(m,"class","inline-flex"),h($,"class","label"),this.first=l},m(_,M){d(_,l,M),n(l,s),n(s,m),C.m(m,null),n(m,b),n(m,r),n(r,v),n(l,T),n(l,q),n(q,$),n($,D),n(l,E),n(l,g),w&&w.m(g,null),n(l,I)},p(_,M){e=_,R!==(R=j(e))&&(C.d(1),C=R(e),C&&(C.c(),C.m(m,b))),M&1&&f!==(f=e[13].name+"")&&x(v,f),M&1&&L!==(L=Q.getFieldValueType(e[13])+"")&&x(D,L),O===(O=N(e))&&w?w.p(e,M):(w&&w.d(1),w=O&&O(e),w&&(w.c(),w.m(g,null)))},d(_){_&&c(l),C.d(),w&&w.d()}}}function Ct(o,e){let l,s=e[8].code+"",m,b,r,f;function v(){return e[7](e[8])}return{key:o,first:null,c(){l=a("button"),m=k(s),b=u(),h(l,"class","tab-item"),ye(l,"active",e[2]===e[8].code),this.first=l},m(T,q){d(T,l,q),n(l,m),n(l,b),r||(f=Ft(l,"click",v),r=!0)},p(T,q){e=T,q&8&&s!==(s=e[8].code+"")&&x(m,s),q&12&&ye(l,"active",e[2]===e[8].code)},d(T){T&&c(l),r=!1,f()}}}function St(o,e){let l,s,m,b;return s=new Tt({props:{content:e[8].body}}),{key:o,first:null,c(){l=a("div"),be(s.$$.fragment),m=u(),h(l,"class","tab-item"),ye(l,"active",e[2]===e[8].code),this.first=l},m(r,f){d(r,l,f),_e(s,l,null),n(l,m),b=!0},p(r,f){e=r;const v={};f&8&&(v.content=e[8].body),s.$set(v),(!b||f&12)&&ye(l,"active",e[2]===e[8].code)},i(r){b||(fe(s.$$.fragment,r),b=!0)},o(r){pe(s.$$.fragment,r),b=!1},d(r){r&&c(l),ke(s)}}}function Kt(o){var at,ot,rt,dt,ct;let e,l,s=o[0].name+"",m,b,r,f,v,T,q,$=o[0].name+"",L,D,E,g,I,j,R,C,N,O,w,_,M,z,F,p,S,ee,K=o[0].name+"",ve,Re,je,he,se,we,W,$e,De,U,Ce,Ne,Se,V=[],Ve=new Map,Te,ie,qe,Y,Oe,Je,ae,G,Me,Ee,He,Ie,H,Ue,te,Qe,ze,Ke,Le,We,Pe,Ye,Ge,Xe,ge,Ze,xe,le,Fe,oe,Ae,X,re,J=[],et=new Map,tt,de,A=[],lt=new Map,Z;C=new At({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[5]}'); @@ -51,22 +51,22 @@ await pb.collection('${(dt=o[0])==null?void 0:dt.name}').requestVerification('te
For more info and examples you could check the detailed Files upload and handling docs - .`,R=u(),be(C.$$.fragment),N=u(),M=a("h6"),M.textContent="API details",w=u(),_=a("div"),O=a("strong"),O.textContent="POST",z=u(),F=a("div"),p=a("p"),S=k("/api/collections/"),ee=a("strong"),ve=k(K),Re=k("/records"),je=u(),B&&B.c(),he=u(),se=a("div"),se.textContent="Body Parameters",we=u(),W=a("table"),$e=a("thead"),$e.innerHTML=`Param + .`,R=u(),be(C.$$.fragment),N=u(),O=a("h6"),O.textContent="API details",w=u(),_=a("div"),M=a("strong"),M.textContent="POST",z=u(),F=a("div"),p=a("p"),S=k("/api/collections/"),ee=a("strong"),ve=k(K),Re=k("/records"),je=u(),B&&B.c(),he=u(),se=a("div"),se.textContent="Body Parameters",we=u(),W=a("table"),$e=a("thead"),$e.innerHTML=`Param Type Description`,De=u(),U=a("tbody"),Ce=a("tr"),Ce.innerHTML=`
Optional id
String 15 characters string to store as record ID.
- If not set, it will be auto generated.`,Ne=u(),P&&P.c(),Se=u();for(let t=0;tParam + If not set, it will be auto generated.`,Ne=u(),P&&P.c(),Se=u();for(let t=0;tParam Type - Description`,Je=u(),ae=a("tbody"),G=a("tr"),Oe=a("td"),Oe.textContent="expand",Ee=u(),He=a("td"),He.innerHTML='String',Ie=u(),H=a("td"),Ue=k(`Auto expand relations when returning the created record. Ex.: + Description`,Je=u(),ae=a("tbody"),G=a("tr"),Me=a("td"),Me.textContent="expand",Ee=u(),He=a("td"),He.innerHTML='String',Ie=u(),H=a("td"),Ue=k(`Auto expand relations when returning the created record. Ex.: `),be(te.$$.fragment),Qe=k(` Supports up to 6-levels depth nested relations expansion. `),ze=a("br"),Ke=k(` The expanded relations will be appended to the record under the `),Le=a("code"),Le.textContent="expand",We=k(" property (eg. "),Pe=a("code"),Pe.textContent='"expand": {"relField1": {...}, ...}',Ye=k(`). `),Ge=a("br"),Xe=k(` - Only the relations to which the request user has permissions to `),ge=a("strong"),ge.textContent="view",Ze=k(" will be expanded."),xe=u(),be(le.$$.fragment),Fe=u(),oe=a("div"),oe.textContent="Responses",Ae=u(),X=a("div"),re=a("div");for(let t=0;tl(2,f=$.code);return o.$$set=$=>{"collection"in $&&l(0,r=$.collection)},o.$$.update=()=>{var $,L;o.$$.dirty&1&&l(1,s=r.type==="auth"),o.$$.dirty&1&&l(6,m=(r==null?void 0:r.createRule)===null),o.$$.dirty&1&&l(3,v=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(r),null,2)},{code:400,body:` +`:"")),C.$set(y),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(ve,K),t[6]?B||(B=ht(),B.c(),B.m(_,null)):B&&(B.d(1),B=null),t[1]?P?P.p(t,i):(P=wt(t),P.c(),P.m(U,Se)):P&&(P.d(1),P=null),i&1&&(ue=(bt=t[0])==null?void 0:bt.schema,V=Be(V,i,nt,1,t,ue,Ve,U,_t,$t,null,vt)),i&12&&(me=t[3],J=Be(J,i,st,1,t,me,et,re,_t,Ct,null,yt)),i&12&&(ce=t[3],Ht(),A=Be(A,i,it,1,t,ce,lt,de,Lt,St,null,kt),Pt())},i(t){if(!Z){fe(C.$$.fragment,t),fe(te.$$.fragment,t),fe(le.$$.fragment,t);for(let i=0;il(2,f=$.code);return o.$$set=$=>{"collection"in $&&l(0,r=$.collection)},o.$$.update=()=>{var $,L;o.$$.dirty&1&&l(1,s=r.type==="auth"),o.$$.dirty&1&&l(6,m=(r==null?void 0:r.createRule)===null),o.$$.dirty&1&&l(3,v=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(r),null,2)},{code:400,body:` { "code": 400, "message": "Failed to create record.", @@ -111,4 +111,4 @@ await pb.collection('${(mt=t[0])==null?void 0:mt.name}').requestVerification('te "message": "You are not allowed to perform this request.", "data": {} } - `}]),o.$$.dirty&2&&(s?l(4,T={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):l(4,T={}))},l(5,b=Q.getApiExampleUrl(gt.baseUrl)),[r,s,f,v,T,b,m,q]}class Zt extends qt{constructor(e){super(),Mt(this,e,Wt,Kt,Ot,{collection:0})}}export{Zt as default}; + `}]),o.$$.dirty&2&&(s?l(4,T={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):l(4,T={}))},l(5,b=Q.getApiExampleUrl(gt.baseUrl)),[r,s,f,v,T,b,m,q]}class Zt extends qt{constructor(e){super(),Ot(this,e,Wt,Kt,Mt,{collection:0})}}export{Zt as default}; diff --git a/ui/dist/assets/DeleteApiDocs-85dc6d56.js b/ui/dist/assets/DeleteApiDocs-339172a8.js similarity index 74% rename from ui/dist/assets/DeleteApiDocs-85dc6d56.js rename to ui/dist/assets/DeleteApiDocs-339172a8.js index 51a75aef..abbc2113 100644 --- a/ui/dist/assets/DeleteApiDocs-85dc6d56.js +++ b/ui/dist/assets/DeleteApiDocs-339172a8.js @@ -1,4 +1,4 @@ -import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as ge,x,N as _e,P as Ee,k as Te,Q as Be,n as Oe,t as ee,a as te,o as p,d as we,C as Ie,p as Me,r as N,u as Ae,M as Se}from"./index-3379c20e.js";import{S as qe}from"./SdkTabs-0096fda4.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){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,a){f(s,l,a)},d(s){s&&p(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,u;function g(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,w){f(b,s,w),n(s,v),n(s,i),r||(u=Ae(s,"click",g),r=!0)},p(b,w){l=b,w&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&p(s),r=!1,u()}}}function De(o,l){let s,a,v,i;return a=new Se({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){f(r,s,u),ge(a,s,null),n(s,v),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&p(s),we(a)}}}function He(o){var pe,ue;let l,s,a=o[0].name+"",v,i,r,u,g,b,w,q=o[0].name+"",z,le,F,C,K,T,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,B,X,O,Y,I,Z,R,M,D=[],ie=new Map,re,A,_=[],ce=new Map,P;C=new qe({props:{js:` +import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as ge,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as p,d as we,C as Ie,p as Ae,r as N,u as Me,N as Se}from"./index-352a0704.js";import{S as qe}from"./SdkTabs-17fc08c7.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){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,a){f(s,l,a)},d(s){s&&p(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,u;function g(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,w){f(b,s,w),n(s,v),n(s,i),r||(u=Me(s,"click",g),r=!0)},p(b,w){l=b,w&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&p(s),r=!1,u()}}}function De(o,l){let s,a,v,i;return a=new Se({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){f(r,s,u),ge(a,s,null),n(s,v),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&p(s),we(a)}}}function He(o){var pe,ue;let l,s,a=o[0].name+"",v,i,r,u,g,b,w,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,D=[],ie=new Map,re,M,_=[],ce=new Map,P;C=new qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -14,12 +14,12 @@ import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n ... await pb.collection('${(ue=o[0])==null?void 0:ue.name}').delete('RECORD_ID'); - `}});let k=o[1]&&ve(),j=o[4];const de=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam + `}});let k=o[1]&&ve(),j=o[4];const de=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.`,Y=h(),I=c("div"),I.textContent="Responses",Z=h(),R=c("div"),M=c("div");for(let e=0;eID of the record to delete.`,Y=h(),I=c("div"),I.textContent="Responses",Z=h(),R=c("div"),A=c("div");for(let e=0;es(2,r=b.code);return o.$$set=b=>{"collection"in b&&s(0,i=b.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(1,a=(i==null?void 0:i.deleteRule)===null),o.$$.dirty&3&&i!=null&&i.id&&(u.push({code:204,body:` + `),C.$set(d),(!P||t&1)&&U!==(U=e[0].name+"")&&x(J,U),e[1]?k||(k=ve(),k.c(),k.m(y,null)):k&&(k.d(1),k=null),t&20&&(j=e[4],D=_e(D,t,de,1,e,j,ie,A,Ee,ye,null,he)),t&20&&(S=e[4],Oe(),_=_e(_,t,fe,1,e,S,ce,M,Te,De,null,ke),Be())},i(e){if(!P){ee(C.$$.fragment,e);for(let t=0;ts(2,r=b.code);return o.$$set=b=>{"collection"in b&&s(0,i=b.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(1,a=(i==null?void 0:i.deleteRule)===null),o.$$.dirty&3&&i!=null&&i.id&&(u.push({code:204,body:` null `}),u.push({code:400,body:` { @@ -55,4 +55,4 @@ import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n "message": "The requested resource wasn't found.", "data": {} } - `}))},s(3,v=Ie.getApiExampleUrl(Me.baseUrl)),[i,a,r,v,u,g]}class Ne extends Ce{constructor(l){super(),Re(this,l,Le,He,Pe,{collection:0})}}export{Ne as default}; + `}))},s(3,v=Ie.getApiExampleUrl(Ae.baseUrl)),[i,a,r,v,u,g]}class Ne extends Ce{constructor(l){super(),Re(this,l,Le,He,Pe,{collection:0})}}export{Ne as default}; diff --git a/ui/dist/assets/FieldsQueryParam-aebe0d79.js b/ui/dist/assets/FieldsQueryParam-d00fc8d6.js similarity index 88% rename from ui/dist/assets/FieldsQueryParam-aebe0d79.js rename to ui/dist/assets/FieldsQueryParam-d00fc8d6.js index b9542a4e..f3e05c0c 100644 --- a/ui/dist/assets/FieldsQueryParam-aebe0d79.js +++ b/ui/dist/assets/FieldsQueryParam-d00fc8d6.js @@ -1,4 +1,4 @@ -import{S as d,i as n,s as i,e as l,g as o,y as s,o as p}from"./index-3379c20e.js";function c(a){let e;return{c(){e=l("tr"),e.innerHTML=`fields +import{S as d,i as n,s as i,e as l,g as o,y as s,o as p}from"./index-352a0704.js";function c(a){let e;return{c(){e=l("tr"),e.innerHTML=`fields String Comma separated string of the fields to return in the JSON response (by default returns all fields). For example: diff --git a/ui/dist/assets/FilterAutocompleteInput-0c84d8aa.js b/ui/dist/assets/FilterAutocompleteInput-0a758632.js similarity index 92% rename from ui/dist/assets/FilterAutocompleteInput-0c84d8aa.js rename to ui/dist/assets/FilterAutocompleteInput-0a758632.js index 6fd0474c..d21248de 100644 --- a/ui/dist/assets/FilterAutocompleteInput-0c84d8aa.js +++ b/ui/dist/assets/FilterAutocompleteInput-0a758632.js @@ -1 +1 @@ -import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as H,o as de,I as he,J as ge,K as pe,H as ye,C as q,L as me}from"./index-3379c20e.js";import{E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,g as we,r as Le,i as Ie,k as Ee,j as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as E,S as He,t as De}from"./index-fd4289fb.js";function Me(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;on(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,M=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&q.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=q.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(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 r=L.filter(h=>h.type==="auth");for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)q.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indexOf(":")===-1&&!c.includes(m[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const r of L){const c="@collection."+r.name+".",h=C(r.name,c);for(const u of h)t.push(u)}return t}function ie(t=!0,r=!0){let c=[].concat(R);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),r&&(c=c.concat(W||[])),c.sort(function(h,u){return u.length-h.length}),c}function se(t){let r=t.matchBefore(/[\'\"\@\w\.]*/);if(r&&r.from==r.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"}];K||c.push({label:"@collection.*",apply:"@collection."});const h=ie(!x,!x&&r.text.startsWith("@c"));for(const u of h)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:r.from,options:c}}function G(){return He.define(Me({start:[{regex:/true|false|null/,token:"atom"},{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:q.escapeRegExp("@now"),token:"keyword"},{regex:q.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:r=>{b&&p("submit",o)}};return V(),n(11,f=new S({parent:k,state:w.create({doc:o,extensions:[be(),ke(),xe(),Ke(),Ce(),w.allowMultipleSelections.of(!0),qe(De,{fallback:!0}),Se(),we(),Le(),Ie(),Ee.of([t,...Re,...Ae,Be.find(r=>r.key==="Mod-d"),...Oe,..._e]),S.lineWrapping,ve({override:[se],icons:!1}),T.of(Y(l)),M.of(S.editable.of(!s)),F.of(w.readOnly.of(s)),D.of(G()),w.transactionFilter.of(r=>b&&r.newDoc.lines>1?[]:r),S.updateListener.of(r=>{!r.docChanged||s||(n(1,o=r.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),f==null||f.destroy()}});function re(t){me[t?"unshift":"push"](()=>{k=t,n(0,k)})}return e.$$set=t=>{"id"in t&&n(2,d=t.id),"value"in t&&n(1,o=t.value),"disabled"in t&&n(3,s=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,R=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,x=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,K=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,I=Pe(a)),e.$$.dirty[0]&25352&&!s&&(B!=I||x!==-1||K!==-1)&&(n(14,B=I),j()),e.$$.dirty[0]&4&&d&&V(),e.$$.dirty[0]&2080&&f&&a!=null&&a.schema&&f.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&f&&A!=s&&(f.dispatch({effects:[M.reconfigure(S.editable.of(!s)),F.reconfigure(w.readOnly.of(s))]}),n(12,A=s),J()),e.$$.dirty[0]&2050&&f&&o!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:o}}),e.$$.dirty[0]&2064&&f&&typeof l<"u"&&f.dispatch({effects:[T.reconfigure(Y(l))]})},[k,o,d,s,l,a,b,R,x,K,O,f,A,I,B,re]}class Qe extends oe{constructor(i){super(),ae(this,i,Ve,Je,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{Qe as default}; +import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,J as he,K as ge,L as pe,I as ye,C as q,M as me}from"./index-352a0704.js";import{E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,g as we,r as Le,i as Ie,k as Ee,j as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as E,S as Me,t as De}from"./index-eb24c20e.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;on(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&q.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=q.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(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 r=L.filter(h=>h.type==="auth");for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)q.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indexOf(":")===-1&&!c.includes(m[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const r of L){const c="@collection."+r.name+".",h=C(r.name,c);for(const u of h)t.push(u)}return t}function ie(t=!0,r=!0){let c=[].concat(R);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),r&&(c=c.concat(W||[])),c.sort(function(h,u){return u.length-h.length}),c}function se(t){let r=t.matchBefore(/[\'\"\@\w\.]*/);if(r&&r.from==r.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"}];K||c.push({label:"@collection.*",apply:"@collection."});const h=ie(!x,!x&&r.text.startsWith("@c"));for(const u of h)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:r.from,options:c}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{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:q.escapeRegExp("@now"),token:"keyword"},{regex:q.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:r=>{b&&p("submit",o)}};return V(),n(11,f=new S({parent:k,state:w.create({doc:o,extensions:[be(),ke(),xe(),Ke(),Ce(),w.allowMultipleSelections.of(!0),qe(De,{fallback:!0}),Se(),we(),Le(),Ie(),Ee.of([t,...Re,...Ae,Be.find(r=>r.key==="Mod-d"),...Oe,..._e]),S.lineWrapping,ve({override:[se],icons:!1}),T.of(Y(l)),H.of(S.editable.of(!s)),F.of(w.readOnly.of(s)),D.of(G()),w.transactionFilter.of(r=>b&&r.newDoc.lines>1?[]:r),S.updateListener.of(r=>{!r.docChanged||s||(n(1,o=r.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),f==null||f.destroy()}});function re(t){me[t?"unshift":"push"](()=>{k=t,n(0,k)})}return e.$$set=t=>{"id"in t&&n(2,d=t.id),"value"in t&&n(1,o=t.value),"disabled"in t&&n(3,s=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,R=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,x=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,K=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,I=Pe(a)),e.$$.dirty[0]&25352&&!s&&(B!=I||x!==-1||K!==-1)&&(n(14,B=I),j()),e.$$.dirty[0]&4&&d&&V(),e.$$.dirty[0]&2080&&f&&a!=null&&a.schema&&f.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&f&&A!=s&&(f.dispatch({effects:[H.reconfigure(S.editable.of(!s)),F.reconfigure(w.readOnly.of(s))]}),n(12,A=s),J()),e.$$.dirty[0]&2050&&f&&o!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:o}}),e.$$.dirty[0]&2064&&f&&typeof l<"u"&&f.dispatch({effects:[T.reconfigure(Y(l))]})},[k,o,d,s,l,a,b,R,x,K,O,f,A,I,B,re]}class Qe extends oe{constructor(i){super(),ae(this,i,Ve,Je,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{Qe as default}; diff --git a/ui/dist/assets/ListApiDocs-63cb84c3.js b/ui/dist/assets/ListApiDocs-ff0e14ff.js similarity index 82% rename from ui/dist/assets/ListApiDocs-63cb84c3.js rename to ui/dist/assets/ListApiDocs-ff0e14ff.js index 2ad4437f..3519c2c7 100644 --- a/ui/dist/assets/ListApiDocs-63cb84c3.js +++ b/ui/dist/assets/ListApiDocs-ff0e14ff.js @@ -1,14 +1,14 @@ -import{S as Ye,i as Ze,s as tl,e,b as s,E as ll,f as i,g as u,u as el,y as Ge,o as m,w as x,h as t,M as ve,c as te,m as ee,x as $e,N as Ue,P as sl,k as nl,Q as ol,n as il,t as Bt,a as Gt,d as le,R as al,C as ye,p as rl,r as Fe}from"./index-3379c20e.js";import{S as cl}from"./SdkTabs-0096fda4.js";function dl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Show details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-down-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function fl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Hide details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-up-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function je(c){let n,o,a,p,b,d,h,g,w,_,f,Z,Ct,Ut,E,jt,H,at,S,tt,se,G,U,ne,rt,$t,et,kt,oe,ct,dt,lt,N,zt,yt,v,st,vt,Jt,Ft,j,nt,Lt,Kt,At,L,ft,Tt,ie,pt,ae,D,Pt,ot,St,R,ut,re,z,Rt,Qt,Ot,ce,q,Vt,J,mt,de,I,fe,B,pe,P,Et,K,bt,ue,ht,me,$,Nt,it,qt,be,Mt,Wt,Q,_t,he,Ht,_e,wt,we,V,xt,xe,gt,Xt,W,Yt,A,X,O,Dt,ge,Y,F,It;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ye,i as Ze,s as tl,e,b as s,E as ll,f as i,g as u,u as el,y as Ge,o as m,w as x,h as t,N as ve,c as te,m as ee,x as $e,O as Ue,P as sl,k as nl,Q as ol,n as il,t as Bt,a as Gt,d as le,R as al,C as ye,p as rl,r as Fe}from"./index-352a0704.js";import{S as cl}from"./SdkTabs-17fc08c7.js";function dl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Show details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-down-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function fl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Hide details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-up-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function je(c){let n,o,a,p,b,d,h,g,w,_,f,Z,Ct,Ut,E,jt,M,at,S,tt,se,G,U,ne,rt,$t,et,kt,oe,ct,dt,lt,N,zt,yt,v,st,vt,Jt,Ft,j,nt,Lt,Kt,At,L,ft,Tt,ie,pt,ae,D,Pt,ot,St,O,ut,re,z,Ot,Qt,Rt,ce,q,Vt,J,mt,de,I,fe,B,pe,P,Et,K,bt,ue,ht,me,$,Nt,it,qt,be,Ht,Wt,Q,_t,he,Mt,_e,wt,we,V,xt,xe,gt,Xt,W,Yt,A,X,R,Dt,ge,Y,F,It;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),a=e("ul"),p=e("li"),p.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,b=s(),d=e("li"),h=e("code"),h.textContent="OPERATOR",g=x(` - is one of: - `),w=e("br"),_=s(),f=e("ul"),Z=e("li"),Ct=e("code"),Ct.textContent="=",Ut=s(),E=e("span"),E.textContent="Equal",jt=s(),H=e("li"),at=e("code"),at.textContent="!=",S=s(),tt=e("span"),tt.textContent="NOT equal",se=s(),G=e("li"),U=e("code"),U.textContent=">",ne=s(),rt=e("span"),rt.textContent="Greater than",$t=s(),et=e("li"),kt=e("code"),kt.textContent=">=",oe=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),lt=e("li"),N=e("code"),N.textContent="<",zt=s(),yt=e("span"),yt.textContent="Less than",v=s(),st=e("li"),vt=e("code"),vt.textContent="<=",Jt=s(),Ft=e("span"),Ft.textContent="Less than or equal",j=s(),nt=e("li"),Lt=e("code"),Lt.textContent="~",Kt=s(),At=e("span"),At.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for + `),w=e("br"),_=s(),f=e("ul"),Z=e("li"),Ct=e("code"),Ct.textContent="=",Ut=s(),E=e("span"),E.textContent="Equal",jt=s(),M=e("li"),at=e("code"),at.textContent="!=",S=s(),tt=e("span"),tt.textContent="NOT equal",se=s(),G=e("li"),U=e("code"),U.textContent=">",ne=s(),rt=e("span"),rt.textContent="Greater than",$t=s(),et=e("li"),kt=e("code"),kt.textContent=">=",oe=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),lt=e("li"),N=e("code"),N.textContent="<",zt=s(),yt=e("span"),yt.textContent="Less than",v=s(),st=e("li"),vt=e("code"),vt.textContent="<=",Jt=s(),Ft=e("span"),Ft.textContent="Less than or equal",j=s(),nt=e("li"),Lt=e("code"),Lt.textContent="~",Kt=s(),At=e("span"),At.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard match)`,L=s(),ft=e("li"),Tt=e("code"),Tt.textContent="!~",ie=s(),pt=e("span"),pt.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for - wildcard match)`,ae=s(),D=e("li"),Pt=e("code"),Pt.textContent="?=",ot=s(),St=e("em"),St.textContent="Any/At least one of",R=s(),ut=e("span"),ut.textContent="Equal",re=s(),z=e("li"),Rt=e("code"),Rt.textContent="?!=",Qt=s(),Ot=e("em"),Ot.textContent="Any/At least one of",ce=s(),q=e("span"),q.textContent="NOT equal",Vt=s(),J=e("li"),mt=e("code"),mt.textContent="?>",de=s(),I=e("em"),I.textContent="Any/At least one of",fe=s(),B=e("span"),B.textContent="Greater than",pe=s(),P=e("li"),Et=e("code"),Et.textContent="?>=",K=s(),bt=e("em"),bt.textContent="Any/At least one of",ue=s(),ht=e("span"),ht.textContent="Greater than or equal",me=s(),$=e("li"),Nt=e("code"),Nt.textContent="?<",it=s(),qt=e("em"),qt.textContent="Any/At least one of",be=s(),Mt=e("span"),Mt.textContent="Less than",Wt=s(),Q=e("li"),_t=e("code"),_t.textContent="?<=",he=s(),Ht=e("em"),Ht.textContent="Any/At least one of",_e=s(),wt=e("span"),wt.textContent="Less than or equal",we=s(),V=e("li"),xt=e("code"),xt.textContent="?~",xe=s(),gt=e("em"),gt.textContent="Any/At least one of",Xt=s(),W=e("span"),W.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for - wildcard match)`,Yt=s(),A=e("li"),X=e("code"),X.textContent="?!~",O=s(),Dt=e("em"),Dt.textContent="Any/At least one of",ge=s(),Y=e("span"),Y.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for + wildcard match)`,ae=s(),D=e("li"),Pt=e("code"),Pt.textContent="?=",ot=s(),St=e("em"),St.textContent="Any/At least one of",O=s(),ut=e("span"),ut.textContent="Equal",re=s(),z=e("li"),Ot=e("code"),Ot.textContent="?!=",Qt=s(),Rt=e("em"),Rt.textContent="Any/At least one of",ce=s(),q=e("span"),q.textContent="NOT equal",Vt=s(),J=e("li"),mt=e("code"),mt.textContent="?>",de=s(),I=e("em"),I.textContent="Any/At least one of",fe=s(),B=e("span"),B.textContent="Greater than",pe=s(),P=e("li"),Et=e("code"),Et.textContent="?>=",K=s(),bt=e("em"),bt.textContent="Any/At least one of",ue=s(),ht=e("span"),ht.textContent="Greater than or equal",me=s(),$=e("li"),Nt=e("code"),Nt.textContent="?<",it=s(),qt=e("em"),qt.textContent="Any/At least one of",be=s(),Ht=e("span"),Ht.textContent="Less than",Wt=s(),Q=e("li"),_t=e("code"),_t.textContent="?<=",he=s(),Mt=e("em"),Mt.textContent="Any/At least one of",_e=s(),wt=e("span"),wt.textContent="Less than or equal",we=s(),V=e("li"),xt=e("code"),xt.textContent="?~",xe=s(),gt=e("em"),gt.textContent="Any/At least one of",Xt=s(),W=e("span"),W.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for + wildcard match)`,Yt=s(),A=e("li"),X=e("code"),X.textContent="?!~",R=s(),Dt=e("em"),Dt.textContent="Any/At least one of",ge=s(),Y=e("span"),Y.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard match)`,F=s(),It=e("p"),It.innerHTML=`To group and combine several expressions you could use brackets - (...), && (AND) and || (OR) tokens.`,i(h,"class","txt-danger"),i(Ct,"class","filter-op svelte-1w7s5nw"),i(E,"class","txt"),i(at,"class","filter-op svelte-1w7s5nw"),i(tt,"class","txt"),i(U,"class","filter-op svelte-1w7s5nw"),i(rt,"class","txt"),i(kt,"class","filter-op svelte-1w7s5nw"),i(ct,"class","txt"),i(N,"class","filter-op svelte-1w7s5nw"),i(yt,"class","txt"),i(vt,"class","filter-op svelte-1w7s5nw"),i(Ft,"class","txt"),i(Lt,"class","filter-op svelte-1w7s5nw"),i(At,"class","txt"),i(Tt,"class","filter-op svelte-1w7s5nw"),i(pt,"class","txt"),i(Pt,"class","filter-op svelte-1w7s5nw"),i(St,"class","txt-hint"),i(ut,"class","txt"),i(Rt,"class","filter-op svelte-1w7s5nw"),i(Ot,"class","txt-hint"),i(q,"class","txt"),i(mt,"class","filter-op svelte-1w7s5nw"),i(I,"class","txt-hint"),i(B,"class","txt"),i(Et,"class","filter-op svelte-1w7s5nw"),i(bt,"class","txt-hint"),i(ht,"class","txt"),i(Nt,"class","filter-op svelte-1w7s5nw"),i(qt,"class","txt-hint"),i(Mt,"class","txt"),i(_t,"class","filter-op svelte-1w7s5nw"),i(Ht,"class","txt-hint"),i(wt,"class","txt"),i(xt,"class","filter-op svelte-1w7s5nw"),i(gt,"class","txt-hint"),i(W,"class","txt"),i(X,"class","filter-op svelte-1w7s5nw"),i(Dt,"class","txt-hint"),i(Y,"class","txt")},m(k,y){u(k,n,y),u(k,o,y),u(k,a,y),t(a,p),t(a,b),t(a,d),t(d,h),t(d,g),t(d,w),t(d,_),t(d,f),t(f,Z),t(Z,Ct),t(Z,Ut),t(Z,E),t(f,jt),t(f,H),t(H,at),t(H,S),t(H,tt),t(f,se),t(f,G),t(G,U),t(G,ne),t(G,rt),t(f,$t),t(f,et),t(et,kt),t(et,oe),t(et,ct),t(f,dt),t(f,lt),t(lt,N),t(lt,zt),t(lt,yt),t(f,v),t(f,st),t(st,vt),t(st,Jt),t(st,Ft),t(f,j),t(f,nt),t(nt,Lt),t(nt,Kt),t(nt,At),t(f,L),t(f,ft),t(ft,Tt),t(ft,ie),t(ft,pt),t(f,ae),t(f,D),t(D,Pt),t(D,ot),t(D,St),t(D,R),t(D,ut),t(f,re),t(f,z),t(z,Rt),t(z,Qt),t(z,Ot),t(z,ce),t(z,q),t(f,Vt),t(f,J),t(J,mt),t(J,de),t(J,I),t(J,fe),t(J,B),t(f,pe),t(f,P),t(P,Et),t(P,K),t(P,bt),t(P,ue),t(P,ht),t(f,me),t(f,$),t($,Nt),t($,it),t($,qt),t($,be),t($,Mt),t(f,Wt),t(f,Q),t(Q,_t),t(Q,he),t(Q,Ht),t(Q,_e),t(Q,wt),t(f,we),t(f,V),t(V,xt),t(V,xe),t(V,gt),t(V,Xt),t(V,W),t(f,Yt),t(f,A),t(A,X),t(A,O),t(A,Dt),t(A,ge),t(A,Y),u(k,F,y),u(k,It,y)},d(k){k&&m(n),k&&m(o),k&&m(a),k&&m(F),k&&m(It)}}}function pl(c){let n,o,a,p,b;function d(_,f){return _[0]?fl:dl}let h=d(c),g=h(c),w=c[0]&&je();return{c(){n=e("button"),g.c(),o=s(),w&&w.c(),a=ll(),i(n,"class","btn btn-sm btn-secondary m-t-10")},m(_,f){u(_,n,f),g.m(n,null),u(_,o,f),w&&w.m(_,f),u(_,a,f),p||(b=el(n,"click",c[1]),p=!0)},p(_,[f]){h!==(h=d(_))&&(g.d(1),g=h(_),g&&(g.c(),g.m(n,null))),_[0]?w||(w=je(),w.c(),w.m(a.parentNode,a)):w&&(w.d(1),w=null)},i:Ge,o:Ge,d(_){_&&m(n),g.d(),_&&m(o),w&&w.d(_),_&&m(a),p=!1,b()}}}function ul(c,n,o){let a=!1;function p(){o(0,a=!a)}return[a,p]}class ml extends Ye{constructor(n){super(),Ze(this,n,ul,pl,tl,{})}}function ze(c,n,o){const a=c.slice();return a[7]=n[o],a}function Je(c,n,o){const a=c.slice();return a[7]=n[o],a}function Ke(c,n,o){const a=c.slice();return a[12]=n[o],a[14]=o,a}function Qe(c){let n;return{c(){n=e("p"),n.innerHTML="Requires admin Authorization:TOKEN header",i(n,"class","txt-hint txt-sm txt-right")},m(o,a){u(o,n,a)},d(o){o&&m(n)}}}function Ve(c){let n,o=c[12]+"",a,p=c[14](...), && (AND) and || (OR) tokens.`,i(h,"class","txt-danger"),i(Ct,"class","filter-op svelte-1w7s5nw"),i(E,"class","txt"),i(at,"class","filter-op svelte-1w7s5nw"),i(tt,"class","txt"),i(U,"class","filter-op svelte-1w7s5nw"),i(rt,"class","txt"),i(kt,"class","filter-op svelte-1w7s5nw"),i(ct,"class","txt"),i(N,"class","filter-op svelte-1w7s5nw"),i(yt,"class","txt"),i(vt,"class","filter-op svelte-1w7s5nw"),i(Ft,"class","txt"),i(Lt,"class","filter-op svelte-1w7s5nw"),i(At,"class","txt"),i(Tt,"class","filter-op svelte-1w7s5nw"),i(pt,"class","txt"),i(Pt,"class","filter-op svelte-1w7s5nw"),i(St,"class","txt-hint"),i(ut,"class","txt"),i(Ot,"class","filter-op svelte-1w7s5nw"),i(Rt,"class","txt-hint"),i(q,"class","txt"),i(mt,"class","filter-op svelte-1w7s5nw"),i(I,"class","txt-hint"),i(B,"class","txt"),i(Et,"class","filter-op svelte-1w7s5nw"),i(bt,"class","txt-hint"),i(ht,"class","txt"),i(Nt,"class","filter-op svelte-1w7s5nw"),i(qt,"class","txt-hint"),i(Ht,"class","txt"),i(_t,"class","filter-op svelte-1w7s5nw"),i(Mt,"class","txt-hint"),i(wt,"class","txt"),i(xt,"class","filter-op svelte-1w7s5nw"),i(gt,"class","txt-hint"),i(W,"class","txt"),i(X,"class","filter-op svelte-1w7s5nw"),i(Dt,"class","txt-hint"),i(Y,"class","txt")},m(k,y){u(k,n,y),u(k,o,y),u(k,a,y),t(a,p),t(a,b),t(a,d),t(d,h),t(d,g),t(d,w),t(d,_),t(d,f),t(f,Z),t(Z,Ct),t(Z,Ut),t(Z,E),t(f,jt),t(f,M),t(M,at),t(M,S),t(M,tt),t(f,se),t(f,G),t(G,U),t(G,ne),t(G,rt),t(f,$t),t(f,et),t(et,kt),t(et,oe),t(et,ct),t(f,dt),t(f,lt),t(lt,N),t(lt,zt),t(lt,yt),t(f,v),t(f,st),t(st,vt),t(st,Jt),t(st,Ft),t(f,j),t(f,nt),t(nt,Lt),t(nt,Kt),t(nt,At),t(f,L),t(f,ft),t(ft,Tt),t(ft,ie),t(ft,pt),t(f,ae),t(f,D),t(D,Pt),t(D,ot),t(D,St),t(D,O),t(D,ut),t(f,re),t(f,z),t(z,Ot),t(z,Qt),t(z,Rt),t(z,ce),t(z,q),t(f,Vt),t(f,J),t(J,mt),t(J,de),t(J,I),t(J,fe),t(J,B),t(f,pe),t(f,P),t(P,Et),t(P,K),t(P,bt),t(P,ue),t(P,ht),t(f,me),t(f,$),t($,Nt),t($,it),t($,qt),t($,be),t($,Ht),t(f,Wt),t(f,Q),t(Q,_t),t(Q,he),t(Q,Mt),t(Q,_e),t(Q,wt),t(f,we),t(f,V),t(V,xt),t(V,xe),t(V,gt),t(V,Xt),t(V,W),t(f,Yt),t(f,A),t(A,X),t(A,R),t(A,Dt),t(A,ge),t(A,Y),u(k,F,y),u(k,It,y)},d(k){k&&m(n),k&&m(o),k&&m(a),k&&m(F),k&&m(It)}}}function pl(c){let n,o,a,p,b;function d(_,f){return _[0]?fl:dl}let h=d(c),g=h(c),w=c[0]&&je();return{c(){n=e("button"),g.c(),o=s(),w&&w.c(),a=ll(),i(n,"class","btn btn-sm btn-secondary m-t-10")},m(_,f){u(_,n,f),g.m(n,null),u(_,o,f),w&&w.m(_,f),u(_,a,f),p||(b=el(n,"click",c[1]),p=!0)},p(_,[f]){h!==(h=d(_))&&(g.d(1),g=h(_),g&&(g.c(),g.m(n,null))),_[0]?w||(w=je(),w.c(),w.m(a.parentNode,a)):w&&(w.d(1),w=null)},i:Ge,o:Ge,d(_){_&&m(n),g.d(),_&&m(o),w&&w.d(_),_&&m(a),p=!1,b()}}}function ul(c,n,o){let a=!1;function p(){o(0,a=!a)}return[a,p]}class ml extends Ye{constructor(n){super(),Ze(this,n,ul,pl,tl,{})}}function ze(c,n,o){const a=c.slice();return a[7]=n[o],a}function Je(c,n,o){const a=c.slice();return a[7]=n[o],a}function Ke(c,n,o){const a=c.slice();return a[12]=n[o],a[14]=o,a}function Qe(c){let n;return{c(){n=e("p"),n.innerHTML="Requires admin Authorization:TOKEN header",i(n,"class","txt-hint txt-sm txt-right")},m(o,a){u(o,n,a)},d(o){o&&m(n)}}}function Ve(c){let n,o=c[12]+"",a,p=c[14]= "2022-01-01 00:00:00" && someField1 != someField2', ); // you can also fetch all records at once via getFullList - final records = await pb.collection('${(Oe=c[0])==null?void 0:Oe.name}').getFullList( + final records = await pb.collection('${(Re=c[0])==null?void 0:Re.name}').getFullList( sort: '-created', ); @@ -58,7 +58,7 @@ import{S as Ye,i as Ze,s as tl,e,b as s,E as ll,f as i,g as u,u as el,y as Ge,o ?sort=-created,id `}});let Zt=c[4],T=[];for(let l=0;l'2022-01-01') - `}}),P=new ml({}),it=new ve({props:{content:"?expand=relField1,relField2.subRelField"}});let ke=c[5];const Le=l=>l[7].code;for(let l=0;ll[7].code;for(let l=0;lParam + `}}),P=new ml({}),it=new ve({props:{content:"?expand=relField1,relField2.subRelField"}});let ke=c[5];const Le=l=>l[7].code;for(let l=0;ll[7].code;for(let l=0;lParam Type Description`,yt=s(),v=e("tbody"),st=e("tr"),st.innerHTML=`page Number @@ -67,14 +67,14 @@ import{S as Ye,i as Ze,s as tl,e,b as s,E as ll,f as i,g as u,u as el,y as Ge,o Specify the max returned records per page (default to 30).`,Ft=s(),j=e("tr"),nt=e("td"),nt.textContent="sort",Lt=s(),Kt=e("td"),Kt.innerHTML='String',At=s(),L=e("td"),ft=x("Specify the records order attribute(s). "),Tt=e("br"),ie=x(` Add `),pt=e("code"),pt.textContent="-",ae=x(" / "),D=e("code"),D.textContent="+",Pt=x(` (default) in front of the attribute for DESC / ASC order. Ex.: - `),te(ot.$$.fragment),St=s(),R=e("p"),ut=e("strong"),ut.textContent="Supported record sort fields:",re=s(),z=e("br"),Rt=s(),Qt=e("code"),Qt.textContent="@random",Ot=x(`, + `),te(ot.$$.fragment),St=s(),O=e("p"),ut=e("strong"),ut.textContent="Supported record sort fields:",re=s(),z=e("br"),Ot=s(),Qt=e("code"),Qt.textContent="@random",Rt=x(`, `);for(let l=0;lString',de=s(),I=e("td"),fe=x(`Filter the returned records. Ex.: `),te(B.$$.fragment),pe=s(),te(P.$$.fragment),Et=s(),K=e("tr"),bt=e("td"),bt.textContent="expand",ue=s(),ht=e("td"),ht.innerHTML='String',me=s(),$=e("td"),Nt=x(`Auto expand record relations. Ex.: `),te(it.$$.fragment),qt=x(` - Supports up to 6-levels depth nested relations expansion. `),be=e("br"),Mt=x(` + Supports up to 6-levels depth nested relations expansion. `),be=e("br"),Ht=x(` The expanded relations will be appended to each individual record under the `),Wt=e("code"),Wt.textContent="expand",Q=x(" property (eg. "),_t=e("code"),_t.textContent='"expand": {"relField1": {...}, ...}',he=x(`). - `),Ht=e("br"),_e=x(` + `),Mt=e("br"),_e=x(` Only the relations to which the request user has permissions to `),wt=e("strong"),wt.textContent="view",we=x(" will be expanded."),V=s(),xt=e("tr"),xt.innerHTML=`fields String Comma separated string of the fields to return in the JSON response @@ -89,7 +89,7 @@ import{S as Ye,i as Ze,s as tl,e,b as s,E as ll,f as i,g as u,u as el,y as Ge,o For optimization purposes, it is set by default for the getFirstListItem() and - getFullList() SDKs methods.`,Xt=s(),W=e("div"),W.textContent="Responses",Yt=s(),A=e("div"),X=e("div");for(let l=0;lgetFullList() SDKs methods.`,Xt=s(),W=e("div"),W.textContent="Responses",Yt=s(),A=e("div"),X=e("div");for(let l=0;l= "2022-01-01 00:00:00" && someField1 != someField2', @@ -134,7 +134,7 @@ import{S as Ye,i as Ze,s as tl,e,b as s,E as ll,f as i,g as u,u as el,y as Ge,o 'someField="test"', expand: 'relField1,relField2.subRelField', ); - `),E.$set(C),(!k||r&1)&&$t!==($t=l[0].name+"")&&$e(et,$t),l[1]?y||(y=Qe(),y.c(),y.m(S,null)):y&&(y.d(1),y=null),r&16){Zt=l[4];let M;for(M=0;Mo(2,h=_.code);return c.$$set=_=>{"collection"in _&&o(0,d=_.collection)},c.$$.update=()=>{c.$$.dirty&1&&o(4,a=ye.getAllCollectionIdentifiers(d)),c.$$.dirty&1&&o(1,p=(d==null?void 0:d.listRule)===null),c.$$.dirty&3&&d!=null&&d.id&&(g.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[ye.dummyCollectionRecord(d),ye.dummyCollectionRecord(d)]},null,2)}),g.push({code:400,body:` + `),E.$set(C),(!k||r&1)&&$t!==($t=l[0].name+"")&&$e(et,$t),l[1]?y||(y=Qe(),y.c(),y.m(S,null)):y&&(y.d(1),y=null),r&16){Zt=l[4];let H;for(H=0;Ho(2,h=_.code);return c.$$set=_=>{"collection"in _&&o(0,d=_.collection)},c.$$.update=()=>{c.$$.dirty&1&&o(4,a=ye.getAllCollectionIdentifiers(d)),c.$$.dirty&1&&o(1,p=(d==null?void 0:d.listRule)===null),c.$$.dirty&3&&d!=null&&d.id&&(g.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[ye.dummyCollectionRecord(d),ye.dummyCollectionRecord(d)]},null,2)}),g.push({code:400,body:` { "code": 400, "message": "Something went wrong while processing your request. Invalid filter.", diff --git a/ui/dist/assets/ListExternalAuthsDocs-4a5594ac.js b/ui/dist/assets/ListExternalAuthsDocs-e75a87f6.js similarity index 77% rename from ui/dist/assets/ListExternalAuthsDocs-4a5594ac.js rename to ui/dist/assets/ListExternalAuthsDocs-e75a87f6.js index ccc63e78..85b165fd 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-4a5594ac.js +++ b/ui/dist/assets/ListExternalAuthsDocs-e75a87f6.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Re,e as n,w as v,b as f,c as de,f as m,g as r,h as o,m as pe,x as F,N as Le,P as Ue,k as je,Q as Fe,n as Ne,t as N,a as G,o as c,d as ue,C as Ge,p as Ke,r as K,u as Je,M as Ve}from"./index-3379c20e.js";import{S as Xe}from"./SdkTabs-0096fda4.js";import{F as Ye}from"./FieldsQueryParam-aebe0d79.js";function De(a,l,s){const i=a.slice();return i[5]=l[s],i}function He(a,l,s){const i=a.slice();return i[5]=l[s],i}function Oe(a,l){let s,i=l[5].code+"",b,_,d,u;function h(){return l[4](l[5])}return{key:a,first:null,c(){s=n("button"),b=v(i),_=f(),m(s,"class","tab-item"),K(s,"active",l[1]===l[5].code),this.first=s},m(y,P){r(y,s,P),o(s,b),o(s,_),d||(u=Je(s,"click",h),d=!0)},p(y,P){l=y,P&4&&i!==(i=l[5].code+"")&&F(b,i),P&6&&K(s,"active",l[1]===l[5].code)},d(y){y&&c(s),d=!1,u()}}}function We(a,l){let s,i,b,_;return i=new Ve({props:{content:l[5].body}}),{key:a,first:null,c(){s=n("div"),de(i.$$.fragment),b=f(),m(s,"class","tab-item"),K(s,"active",l[1]===l[5].code),this.first=s},m(d,u){r(d,s,u),pe(i,s,null),o(s,b),_=!0},p(d,u){l=d;const h={};u&4&&(h.content=l[5].body),i.$set(h),(!_||u&6)&&K(s,"active",l[1]===l[5].code)},i(d){_||(N(i.$$.fragment,d),_=!0)},o(d){G(i.$$.fragment,d),_=!1},d(d){d&&c(s),ue(i)}}}function Ze(a){var Ce,ge,Se,Ee;let l,s,i=a[0].name+"",b,_,d,u,h,y,P,W=a[0].name+"",J,fe,me,V,X,T,Y,I,Z,w,z,be,Q,A,he,x,R=a[0].name+"",ee,_e,te,ke,ve,U,le,B,se,q,oe,M,ae,C,ie,$e,ne,E,re,L,ce,g,D,$=[],we=new Map,ye,H,k=[],Pe=new Map,S;T=new Xe({props:{js:` +import{S as ze,i as Qe,s as Re,e as n,w as v,b as f,c as de,f as m,g as r,h as o,m as pe,x as F,O as Me,P as Ue,k as je,Q as Fe,n as Ne,t as N,a as G,o as c,d as ue,C as Ge,p as Ke,r as K,u as Je,N as Ve}from"./index-352a0704.js";import{S as Xe}from"./SdkTabs-17fc08c7.js";import{F as Ye}from"./FieldsQueryParam-d00fc8d6.js";function Oe(a,l,s){const i=a.slice();return i[5]=l[s],i}function De(a,l,s){const i=a.slice();return i[5]=l[s],i}function He(a,l){let s,i=l[5].code+"",b,_,d,u;function h(){return l[4](l[5])}return{key:a,first:null,c(){s=n("button"),b=v(i),_=f(),m(s,"class","tab-item"),K(s,"active",l[1]===l[5].code),this.first=s},m(y,P){r(y,s,P),o(s,b),o(s,_),d||(u=Je(s,"click",h),d=!0)},p(y,P){l=y,P&4&&i!==(i=l[5].code+"")&&F(b,i),P&6&&K(s,"active",l[1]===l[5].code)},d(y){y&&c(s),d=!1,u()}}}function We(a,l){let s,i,b,_;return i=new Ve({props:{content:l[5].body}}),{key:a,first:null,c(){s=n("div"),de(i.$$.fragment),b=f(),m(s,"class","tab-item"),K(s,"active",l[1]===l[5].code),this.first=s},m(d,u){r(d,s,u),pe(i,s,null),o(s,b),_=!0},p(d,u){l=d;const h={};u&4&&(h.content=l[5].body),i.$set(h),(!_||u&6)&&K(s,"active",l[1]===l[5].code)},i(d){_||(N(i.$$.fragment,d),_=!0)},o(d){G(i.$$.fragment,d),_=!1},d(d){d&&c(s),ue(i)}}}function Ze(a){var Ce,ge,Se,Ee;let l,s,i=a[0].name+"",b,_,d,u,h,y,P,W=a[0].name+"",J,fe,me,V,X,T,Y,I,Z,w,z,be,Q,A,he,x,R=a[0].name+"",ee,_e,te,ke,ve,U,le,B,se,q,oe,L,ae,C,ie,$e,ne,E,re,M,ce,g,O,$=[],we=new Map,ye,D,k=[],Pe=new Map,S;T=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -22,14 +22,14 @@ import{S as ze,i as Qe,s as Re,e as n,w as v,b as f,c as de,f as m,g as r,h as o final result = await pb.collection('${(Ee=a[0])==null?void 0:Ee.name}').listExternalAuths( pb.authStore.model.id, ); - `}}),E=new Ye({});let j=a[2];const Te=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",le=f(),B=n("div"),B.textContent="Path Parameters",se=f(),q=n("table"),q.innerHTML=`Param + `}}),E=new Ye({});let j=a[2];const Te=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",le=f(),B=n("div"),B.textContent="Path Parameters",se=f(),q=n("table"),q.innerHTML=`Param Type Description id String - ID of the auth record.`,oe=f(),M=n("div"),M.textContent="Query parameters",ae=f(),C=n("table"),ie=n("thead"),ie.innerHTML=`Param + ID of the auth record.`,oe=f(),L=n("div"),L.textContent="Query parameters",ae=f(),C=n("table"),ie=n("thead"),ie.innerHTML=`Param Type - Description`,$e=f(),ne=n("tbody"),de(E.$$.fragment),re=f(),L=n("div"),L.textContent="Responses",ce=f(),g=n("div"),D=n("div");for(let e=0;e<$.length;e+=1)$[e].c();ye=f(),H=n("div");for(let e=0;eDescription`,$e=f(),ne=n("tbody"),de(E.$$.fragment),re=f(),M=n("div"),M.textContent="Responses",ce=f(),g=n("div"),O=n("div");for(let e=0;e<$.length;e+=1)$[e].c();ye=f(),D=n("div");for(let e=0;es(1,_=h.code);return a.$$set=h=>{"collection"in h&&s(0,b=h.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(2,d=[{code:200,body:` + `),T.$set(p),(!S||t&1)&&R!==(R=e[0].name+"")&&F(ee,R),t&6&&(j=e[2],$=Me($,t,Te,1,e,j,we,O,Ue,He,null,De)),t&6&&(H=e[2],je(),k=Me(k,t,Ae,1,e,H,Pe,D,Fe,We,null,Oe),Ne())},i(e){if(!S){N(T.$$.fragment,e),N(E.$$.fragment,e);for(let t=0;ts(1,_=h.code);return a.$$set=h=>{"collection"in h&&s(0,b=h.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(2,d=[{code:200,body:` [ { "id": "8171022dc95a4e8", diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-2ba29ad7.js b/ui/dist/assets/PageAdminConfirmPasswordReset-3e640056.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-2ba29ad7.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-3e640056.js index b7252574..8dfda317 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-2ba29ad7.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-3e640056.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as A,m as B,t as N,a as T,d as h,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,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 S}from"./index-3379c20e.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=j(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=j(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,F,P,v,k,R,z,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as A,m as B,t as N,a as T,d as h,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,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 S}from"./index-352a0704.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=j(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=j(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,F,P,v,k,R,z,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password `),m&&m.c(),t=C(),A(r.$$.fragment),p=C(),A(d.$$.fragment),n=C(),i=c("button"),g=c("span"),g.textContent="Set new password",F=C(),P=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(P,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,F,$),b(a,P,$),_(P,v),k=!0,R||(z=[j(e,"submit",O(f[4])),Q(U.call(null,v))],R=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:a}),r.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:a}),d.$set(H),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(N(r.$$.fragment,a),N(d.$$.fragment,a),k=!0)},o(a){T(r.$$.fragment,a),T(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),h(r),h(d),a&&w(F),a&&w(P),R=!1,V(z)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(N(e.$$.fragment,s),o=!0)},o(s){T(e.$$.fragment,s),o=!1},d(s){h(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}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-4a4bbc63.js b/ui/dist/assets/PageAdminRequestPasswordReset-147aa187.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-4a4bbc63.js rename to ui/dist/assets/PageAdminRequestPasswordReset-147aa187.js index 9b07ffc1..c6b8d749 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-4a4bbc63.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-147aa187.js @@ -1,2 +1,2 @@ -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 g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,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-3379c20e.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

+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 g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,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-352a0704.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{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=g(),R(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=H(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),(!a||$&2)&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),E(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),L(t,c[0]),t.focus(),f||(m=H(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&L(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),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(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{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(c,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 f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageOAuth2Redirect-a1b27cdd.js b/ui/dist/assets/PageOAuth2Redirect-b0382fc8.js similarity index 74% rename from ui/dist/assets/PageOAuth2Redirect-a1b27cdd.js rename to ui/dist/assets/PageOAuth2Redirect-b0382fc8.js index 19a6d679..63f3d40a 100644 --- a/ui/dist/assets/PageOAuth2Redirect-a1b27cdd.js +++ b/ui/dist/assets/PageOAuth2Redirect-b0382fc8.js @@ -1,2 +1,2 @@ -import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,H as h}from"./index-3379c20e.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML=`

Auth completed.

+import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-352a0704.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML=`

Auth completed.

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

Successfully changed the user email address.

-

You can now sign in with your new email address.

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

You can now sign in with your new email address.

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

Invalid or expired verification token.

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

Successfully verified email address.

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

Successfully verified email address.

`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[3]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function I(o){let t;return{c(){t=u("div"),t.innerHTML='
Please wait...
',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function V(o){let t;function s(l,i){return l[1]?I:l[0]?F:S}let e=s(o),n=e(o);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){n.d(l),l&&a(t)}}}function q(o){let t,s;return t=new C({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){g(t.$$.fragment)},m(e,n){x(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 E(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new P("../");try{const m=T(e==null?void 0:e.token);await d.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const c=()=>window.close(),k=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,l,e,c,k]}class N extends v{constructor(t){super(),y(this,t,E,q,w,{params:2})}}export{N as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-cf5b9787.js b/ui/dist/assets/RealtimeApiDocs-688ce291.js similarity index 94% rename from ui/dist/assets/RealtimeApiDocs-cf5b9787.js rename to ui/dist/assets/RealtimeApiDocs-688ce291.js index 3039d969..6d14d1b1 100644 --- a/ui/dist/assets/RealtimeApiDocs-cf5b9787.js +++ b/ui/dist/assets/RealtimeApiDocs-688ce291.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,M as pe,C as P,e as p,w as y,b as a,c as te,f as u,g as t,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-3379c20e.js";import{S as de}from"./SdkTabs-0096fda4.js";function fe(s){var B,U,W,A,H,L,M,T,q,j,J,N;let i,m,c=s[0].name+"",b,d,h,f,_,$,k,l,S,v,C,R,w,g,E,r,D;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,w as y,b as a,c as te,f as u,g as t,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-352a0704.js";import{S as de}from"./SdkTabs-17fc08c7.js";function fe(s){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=s[0].name+"",b,d,h,f,_,$,k,l,S,v,C,R,w,g,E,r,D;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[1]}'); @@ -34,22 +34,22 @@ import{S as re,i as ae,s as be,M as pe,C as P,e as p,w as y,b as a,c as te,f as // (Optionally) authenticate await pb.collection('users').authWithPassword('test@example.com', '123456'); - // Subscribe to changes in any ${(M=s[0])==null?void 0:M.name} record - pb.collection('${(T=s[0])==null?void 0:T.name}').subscribe('*', (e) { + // Subscribe to changes in any ${(T=s[0])==null?void 0:T.name} record + pb.collection('${(q=s[0])==null?void 0:q.name}').subscribe('*', (e) { print(e.action); print(e.record); }); // Subscribe to changes only in the specified record - pb.collection('${(q=s[0])==null?void 0:q.name}').subscribe('RECORD_ID', (e) { + pb.collection('${(M=s[0])==null?void 0:M.name}').subscribe('RECORD_ID', (e) { print(e.action); print(e.record); }); // Unsubscribe - pb.collection('${(j=s[0])==null?void 0:j.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions - pb.collection('${(J=s[0])==null?void 0:J.name}').unsubscribe('*'); // remove all '*' topic subscriptions - pb.collection('${(N=s[0])==null?void 0:N.name}').unsubscribe(); // remove all subscriptions in the collection + pb.collection('${(N=s[0])==null?void 0:N.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions + pb.collection('${(j=s[0])==null?void 0:j.name}').unsubscribe('*'); // remove all '*' topic subscriptions + pb.collection('${(J=s[0])==null?void 0:J.name}').unsubscribe(); // remove all subscriptions in the collection `}}),r=new pe({props:{content:JSON.stringify({action:"create",record:P.dummyCollectionRecord(s[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){i=p("h3"),m=y("Realtime ("),b=y(c),d=y(")"),h=a(),f=p("div"),f.innerHTML=`

Subscribe to realtime changes via Server-Sent Events (SSE).

Events are sent for create, update and delete record operations (see "Event data format" section below).

`,_=a(),$=p("div"),$.innerHTML=`
diff --git a/ui/dist/assets/RequestEmailChangeDocs-2c584fa4.js b/ui/dist/assets/RequestEmailChangeDocs-9dfe810b.js similarity index 75% rename from ui/dist/assets/RequestEmailChangeDocs-2c584fa4.js rename to ui/dist/assets/RequestEmailChangeDocs-9dfe810b.js index 1f68e97e..96602d64 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-2c584fa4.js +++ b/ui/dist/assets/RequestEmailChangeDocs-9dfe810b.js @@ -1,4 +1,4 @@ -import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as N,N as ve,P as Se,k as Me,Q as Re,n as Ae,t as x,a as ee,o as d,d as ye,C as We,p as ze,r as O,u as He,M as Ue}from"./index-3379c20e.js";import{S as je}from"./SdkTabs-0096fda4.js";function we(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 $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),O(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,s,q),n(s,_),n(s,b),i||(p=He(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&N(_,a),q&6&&O(s,"active",l[1]===l[5].code)},d($){$&&d(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),O(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&O(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&d(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,g,H,le,U,E,se,G,j=o[0].name+"",J,ae,oe,D,V,B,X,S,Y,M,Z,C,R,v=[],ne=new Map,ie,A,h=[],ce=new Map,y;P=new je({props:{js:` +import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as L,O as ve,P as Se,k as Me,Q as Re,n as Ae,t as x,a as ee,o as d,d as ye,C as We,p as ze,r as N,u as He,N as Oe}from"./index-352a0704.js";import{S as Ue}from"./SdkTabs-17fc08c7.js";function we(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 $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,s,q),n(s,_),n(s,b),i||(p=He(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&d(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Oe({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&d(s),ye(a)}}}function je(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,g,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,M,Z,C,R,v=[],ne=new Map,ie,A,h=[],ce=new Map,y;P=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -18,13 +18,13 @@ import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x await pb.collection('${(ue=o[0])==null?void 0:ue.name}').authWithPassword('test@example.com', '1234567890'); await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestEmailChange('new@example.com'); - `}});let L=o[2];const re=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",V=k(),B=r("div"),B.textContent="Body Parameters",X=k(),S=r("table"),S.innerHTML=`Param + `}});let D=o[2];const re=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",V=k(),B=r("div"),B.textContent="Body Parameters",X=k(),S=r("table"),S.innerHTML=`Param Type Description
Required newEmail
String - The new email address to send the change email request.`,Y=k(),M=r("div"),M.textContent="Responses",Z=k(),C=r("div"),R=r("div");for(let e=0;eThe new email address to send the change email request.`,Y=k(),M=r("div"),M.textContent="Responses",Z=k(),C=r("div"),R=r("div");for(let e=0;es(1,b=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=We.getApiExampleUrl(ze.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),P.$set(c),(!y||t&1)&&U!==(U=e[0].name+"")&&L(J,U),t&6&&(D=e[2],v=ve(v,t,re,1,e,D,ne,R,Se,$e,null,ge)),t&6&&(W=e[2],Me(),h=ve(h,t,me,1,e,W,ce,A,Re,qe,null,we),Ae())},i(e){if(!y){x(P.$$.fragment,e);for(let t=0;ts(1,b=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=We.getApiExampleUrl(ze.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -67,4 +67,4 @@ import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x "message": "The authorized record model is not allowed to perform this action.", "data": {} } - `}]),[_,b,i,a,p]}class Fe extends Te{constructor(l){super(),Ee(this,l,Le,De,Be,{collection:0})}}export{Fe as default}; + `}]),[_,b,i,a,p]}class Fe extends Te{constructor(l){super(),Ee(this,l,De,je,Be,{collection:0})}}export{Fe as default}; diff --git a/ui/dist/assets/RequestPasswordResetDocs-1b1b244e.js b/ui/dist/assets/RequestPasswordResetDocs-e1a9e426.js similarity index 74% rename from ui/dist/assets/RequestPasswordResetDocs-1b1b244e.js rename to ui/dist/assets/RequestPasswordResetDocs-e1a9e426.js index d8a32de1..23d7b8bc 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-1b1b244e.js +++ b/ui/dist/assets/RequestPasswordResetDocs-e1a9e426.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,e as r,w,b as v,c as ve,f as b,g as d,h as n,m as he,x as L,N as ue,P as ge,k as ye,Q as Re,n as Be,t as Z,a as x,o as f,d as we,C as Ce,p as Se,r as N,u as Te,M as Me}from"./index-3379c20e.js";import{S as Ae}from"./SdkTabs-0096fda4.js";function me(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,m,i,p;function u(){return s[4](s[5])}return{key:a,first:null,c(){l=r("button"),_=w(o),m=v(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(P,l,$),n(l,_),n(l,m),i||(p=Te(l,"click",u),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&L(_,o),$&6&&N(l,"active",s[1]===s[5].code)},d(P){P&&f(l),i=!1,p()}}}function ke(a,s){let l,o,_,m;return o=new Me({props:{content:s[5].body}}),{key:a,first:null,c(){l=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),he(o,l,null),n(l,_),m=!0},p(i,p){s=i;const u={};p&4&&(u.content=s[5].body),o.$set(u),(!m||p&6)&&N(l,"active",s[1]===s[5].code)},i(i){m||(Z(o.$$.fragment,i),m=!0)},o(i){x(o.$$.fragment,i),m=!1},d(i){i&&f(l),we(o)}}}function Ue(a){var re,de;let s,l,o=a[0].name+"",_,m,i,p,u,P,$,D=a[0].name+"",O,ee,Q,q,z,B,G,g,H,te,E,C,se,J,F=a[0].name+"",K,le,V,S,W,T,X,M,Y,y,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,R;q=new Ae({props:{js:` +import{S as Pe,i as $e,s as qe,e as r,w,b as v,c as ve,f as b,g as d,h as n,m as he,x as I,O as ue,P as ge,k as ye,Q as Re,n as Be,t as Z,a as x,o as f,d as we,C as Ce,p as Se,r as L,u as Te,N as Me}from"./index-352a0704.js";import{S as Ae}from"./SdkTabs-17fc08c7.js";function me(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,m,i,p;function u(){return s[4](s[5])}return{key:a,first:null,c(){l=r("button"),_=w(o),m=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(P,l,$),n(l,_),n(l,m),i||(p=Te(l,"click",u),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&f(l),i=!1,p()}}}function ke(a,s){let l,o,_,m;return o=new Me({props:{content:s[5].body}}),{key:a,first:null,c(){l=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),he(o,l,null),n(l,_),m=!0},p(i,p){s=i;const u={};p&4&&(u.content=s[5].body),o.$set(u),(!m||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){m||(Z(o.$$.fragment,i),m=!0)},o(i){x(o.$$.fragment,i),m=!1},d(i){i&&f(l),we(o)}}}function Ue(a){var re,de;let s,l,o=a[0].name+"",_,m,i,p,u,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,g,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,y,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,R;q=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -14,13 +14,13 @@ import{S as Pe,i as $e,s as qe,e as r,w,b as v,c as ve,f as b,g as d,h as n,m as ... await pb.collection('${(de=a[0])==null?void 0:de.name}').requestPasswordReset('test@example.com'); - `}});let I=a[2];const ie=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam + `}});let F=a[2];const ie=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).`,X=v(),M=r("div"),M.textContent="Responses",Y=v(),y=r("div"),A=r("div");for(let e=0;eThe auth record email address to send the password reset request (if exists).`,X=v(),M=r("div"),M.textContent="Responses",Y=v(),y=r("div"),A=r("div");for(let e=0;el(1,m=u.code);return a.$$set=u=>{"collection"in u&&l(0,_=u.collection)},l(3,o=Ce.getApiExampleUrl(Se.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` + `),q.$set(c),(!R||t&1)&&E!==(E=e[0].name+"")&&I(K,E),t&6&&(F=e[2],h=ue(h,t,ie,1,e,F,oe,A,ge,_e,null,be)),t&6&&(j=e[2],ye(),k=ue(k,t,ce,1,e,j,ne,U,Re,ke,null,me),Be())},i(e){if(!R){Z(q.$$.fragment,e);for(let t=0;tl(1,m=u.code);return a.$$set=u=>{"collection"in u&&l(0,_=u.collection)},l(3,o=Ce.getApiExampleUrl(Se.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -47,4 +47,4 @@ import{S as Pe,i as $e,s as qe,e as r,w,b as v,c as ve,f as b,g as d,h as n,m as } } } - `}]),[_,m,i,o,p]}class Ee extends Pe{constructor(s){super(),$e(this,s,je,Ue,qe,{collection:0})}}export{Ee as default}; + `}]),[_,m,i,o,p]}class Oe extends Pe{constructor(s){super(),$e(this,s,je,Ue,qe,{collection:0})}}export{Oe as default}; diff --git a/ui/dist/assets/RequestVerificationDocs-1d25bdc1.js b/ui/dist/assets/RequestVerificationDocs-dd991b38.js similarity index 66% rename from ui/dist/assets/RequestVerificationDocs-1d25bdc1.js rename to ui/dist/assets/RequestVerificationDocs-dd991b38.js index 2a6b80e2..18d0f8bd 100644 --- a/ui/dist/assets/RequestVerificationDocs-1d25bdc1.js +++ b/ui/dist/assets/RequestVerificationDocs-dd991b38.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as I,N as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as p,d as $e,C as Se,p as Te,r as L,u as Me,M as Ve}from"./index-3379c20e.js";import{S as Re}from"./SdkTabs-0096fda4.js";function me(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,m,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),_=$(o),m=v(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,m),n||(u=Me(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&I(_,o),w&6&&L(s,"active",l[1]===l[5].code)},d(q){q&&p(s),n=!1,u()}}}function ke(a,l){let s,o,_,m;return o=new Ve({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(n,s,u),he(o,s,null),i(s,_),m=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!m||u&6)&&L(s,"active",l[1]===l[5].code)},i(n){m||(Z(o.$$.fragment,n),m=!0)},o(n){x(o.$$.fragment,n),m=!1},d(n){n&&p(s),$e(o)}}}function Ae(a){var re,fe;let l,s,o=a[0].name+"",_,m,n,u,d,q,w,j=a[0].name+"",N,ee,O,P,Q,C,z,g,D,te,H,S,le,G,E=a[0].name+"",J,se,K,T,W,M,X,V,Y,y,R,h=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Re({props:{js:` +import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as p,d as $e,C as Se,p as Te,r as I,u as Ve,N as Me}from"./index-352a0704.js";import{S as Re}from"./SdkTabs-17fc08c7.js";function me(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,m,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),_=$(o),m=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,m),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&p(s),n=!1,u()}}}function ke(a,l){let s,o,_,m;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(n,s,u),he(o,s,null),i(s,_),m=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!m||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){m||(Z(o.$$.fragment,n),m=!0)},o(n){x(o.$$.fragment,n),m=!1},d(n){n&&p(s),$e(o)}}}function Ae(a){var re,fe;let l,s,o=a[0].name+"",_,m,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,V,X,M,Y,y,R,h=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Re({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -14,13 +14,13 @@ import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i ... await pb.collection('${(fe=a[0])==null?void 0:fe.name}').requestVerification('test@example.com'); - `}});let F=a[2];const ne=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam + `}});let E=a[2];const ne=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).`,X=v(),V=r("div"),V.textContent="Responses",Y=v(),y=r("div"),R=r("div");for(let e=0;eThe auth record email address to send the verification request (if exists).`,X=v(),M=r("div"),M.textContent="Responses",Y=v(),y=r("div"),R=r("div");for(let e=0;es(1,m=d.code);return a.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Se.getApiExampleUrl(Te.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:` + `),P.$set(c),(!B||t&1)&&O!==(O=e[0].name+"")&&F(J,O),t&6&&(E=e[2],h=de(h,t,ne,1,e,E,oe,R,ge,_e,null,be)),t&6&&(U=e[2],ye(),k=de(k,t,ce,1,e,U,ie,A,Be,ke,null,me),Ce())},i(e){if(!B){Z(P.$$.fragment,e);for(let t=0;ts(1,m=d.code);return a.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Se.getApiExampleUrl(Te.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/SdkTabs-0096fda4.js b/ui/dist/assets/SdkTabs-0096fda4.js deleted file mode 100644 index 953263e3..00000000 --- a/ui/dist/assets/SdkTabs-0096fda4.js +++ /dev/null @@ -1 +0,0 @@ -import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,N as C,P as J,k as Q,Q as Y,n as z,t as N,a as P,o as w,w as E,r as S,u as A,x as R,M as G,c as H,m as L,d as O}from"./index-3379c20e.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function M(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=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(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+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(l),n=!1,k()}}}function T(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=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),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"),S(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+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(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&&w(l),O(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=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(I,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 X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S}; diff --git a/ui/dist/assets/SdkTabs-17fc08c7.js b/ui/dist/assets/SdkTabs-17fc08c7.js new file mode 100644 index 00000000..c39d8c9b --- /dev/null +++ b/ui/dist/assets/SdkTabs-17fc08c7.js @@ -0,0 +1 @@ +import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-352a0704.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(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=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(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=z(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(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 A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),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"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(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+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(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&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=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 X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-12d77ab0.js b/ui/dist/assets/UnlinkExternalAuthDocs-b79405e3.js similarity index 87% rename from ui/dist/assets/UnlinkExternalAuthDocs-12d77ab0.js rename to ui/dist/assets/UnlinkExternalAuthDocs-b79405e3.js index a5b7d3ec..6cf7d7cc 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-12d77ab0.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-b79405e3.js @@ -1,4 +1,4 @@ -import{S as qe,i as Me,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s,m as Be,x as I,N as ye,P as Oe,k as We,Q as ze,n as He,t as le,a as oe,o as u,d as Ue,C as Le,p as je,r as N,u as Ie,M as Ne}from"./index-3379c20e.js";import{S as Re}from"./SdkTabs-0096fda4.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),s(o,_),s(o,b),c||(p=Ie(o,"click",f),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&I(_,a),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(a)}}}function Ke(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,f,$,P,O=n[0].name+"",R,se,ae,K,Q,A,F,E,G,w,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,g=[],ue=new Map,pe,M,k=[],fe=new Map,T;A=new Re({props:{js:` +import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s,m as Be,x as I,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as u,d as Ue,C as Le,p as je,r as N,u as Ie,N as Ne}from"./index-352a0704.js";import{S as Re}from"./SdkTabs-17fc08c7.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),s(o,_),s(o,b),c||(p=Ie(o,"click",f),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&I(_,a),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(a)}}}function Ke(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,f,$,P,M=n[0].name+"",R,se,ae,K,Q,A,F,E,G,w,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,g=[],ue=new Map,pe,O,k=[],fe=new Map,T;A=new Re({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); @@ -24,7 +24,7 @@ import{S as qe,i as Me,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s pb.authStore.model.id, 'google', ); - `}});let j=n[2];const me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",Z=h(),S=i("div"),S.textContent="Path Parameters",x=h(),B=i("table"),B.innerHTML=`Param + `}});let j=n[2];const me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",Z=h(),S=i("div"),S.textContent="Path Parameters",x=h(),B=i("table"),B.innerHTML=`Param Type Description id @@ -33,7 +33,7 @@ import{S as qe,i as Me,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s provider String The name of the auth provider to unlink, eg. google, twitter, - github, etc.`,ee=h(),U=i("div"),U.textContent="Responses",te=h(),C=i("div"),q=i("div");for(let e=0;egithub, etc.`,ee=h(),U=i("div"),U.textContent="Responses",te=h(),C=i("div"),q=i("div");for(let e=0;eo(1,b=f.code);return n.$$set=f=>{"collection"in f&&o(0,_=f.collection)},o(3,a=Le.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:` + `),A.$set(r),(!T||t&1)&&H!==(H=e[0].name+"")&&I(V,H),t&6&&(j=e[2],g=ye(g,t,me,1,e,j,ue,q,Me,Te,null,Ce)),t&6&&(D=e[2],We(),k=ye(k,t,be,1,e,D,fe,O,ze,Ee,null,Ae),He())},i(e){if(!T){le(A.$$.fragment,e);for(let t=0;to(1,b=f.code);return n.$$set=f=>{"collection"in f&&o(0,_=f.collection)},o(3,a=Le.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.", @@ -77,4 +77,4 @@ import{S as qe,i as Me,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s "message": "The requested resource wasn't found.", "data": {} } - `}]),[_,b,c,a,p]}class Je extends qe{constructor(l){super(),Me(this,l,Qe,Ke,De,{collection:0})}}export{Je as default}; + `}]),[_,b,c,a,p]}class Je extends qe{constructor(l){super(),Oe(this,l,Qe,Ke,De,{collection:0})}}export{Je as default}; diff --git a/ui/dist/assets/UpdateApiDocs-470faa57.js b/ui/dist/assets/UpdateApiDocs-84870d7b.js similarity index 85% rename from ui/dist/assets/UpdateApiDocs-470faa57.js rename to ui/dist/assets/UpdateApiDocs-84870d7b.js index 0ca2390d..b4dddf05 100644 --- a/ui/dist/assets/UpdateApiDocs-470faa57.js +++ b/ui/dist/assets/UpdateApiDocs-84870d7b.js @@ -1,4 +1,4 @@ -import{S as Ct,i as St,s as $t,C as E,M as Tt,e as r,w as y,b,c as be,f as w,g as o,h as a,m as me,x as U,N as je,P as ut,k as Ot,Q as Mt,n as qt,t as de,a as re,o as d,d as _e,p as Dt,r as ye,u as Ht,y as X}from"./index-3379c20e.js";import{S as Pt}from"./SdkTabs-0096fda4.js";import{F as Rt}from"./FieldsQueryParam-aebe0d79.js";function bt(f,t,l){const n=f.slice();return n[8]=t[l],n}function mt(f,t,l){const n=f.slice();return n[8]=t[l],n}function _t(f,t,l){const n=f.slice();return n[13]=t[l],n}function yt(f){let t;return{c(){t=r("p"),t.innerHTML="Requires admin Authorization:TOKEN header",w(t,"class","txt-hint txt-sm txt-right")},m(l,n){o(l,t,n)},d(l){l&&d(t)}}}function kt(f){let t,l,n,u,_,s,p,k,C,S,T,O,F,A,M,g,B;return{c(){t=r("tr"),t.innerHTML='Auth fields',l=b(),n=r("tr"),n.innerHTML=`
Optional +import{S as Ct,i as St,s as Ot,C as E,N as Tt,e as r,w as y,b,c as be,f as w,g as o,h as a,m as me,x as U,O as je,P as ut,k as $t,Q as Mt,n as qt,t as de,a as re,o as d,d as _e,p as Dt,r as ye,u as Ht,y as X}from"./index-352a0704.js";import{S as Pt}from"./SdkTabs-17fc08c7.js";import{F as Rt}from"./FieldsQueryParam-d00fc8d6.js";function bt(f,t,l){const n=f.slice();return n[8]=t[l],n}function mt(f,t,l){const n=f.slice();return n[8]=t[l],n}function _t(f,t,l){const n=f.slice();return n[13]=t[l],n}function yt(f){let t;return{c(){t=r("p"),t.innerHTML="Requires admin Authorization:TOKEN header",w(t,"class","txt-hint txt-sm txt-right")},m(l,n){o(l,t,n)},d(l){l&&d(t)}}}function kt(f){let t,l,n,u,_,s,p,k,C,S,T,$,F,A,M,g,B;return{c(){t=r("tr"),t.innerHTML='Auth fields',l=b(),n=r("tr"),n.innerHTML=`
Optional username
String The username of the auth record.`,u=b(),_=r("tr"),_.innerHTML=`
Optional @@ -20,7 +20,7 @@ import{S as Ct,i as St,s as $t,C as E,M as Tt,e as r,w as y,b,c as be,f as w,g a "Manage" access can skip this field.`,S=b(),T=r("tr"),T.innerHTML=`
Optional password
String - New auth record password.`,O=b(),F=r("tr"),F.innerHTML=`
Optional + New auth record password.`,$=b(),F=r("tr"),F.innerHTML=`
Optional passwordConfirm
String New auth record password confirmation.`,A=b(),M=r("tr"),M.innerHTML=`
Optional @@ -28,8 +28,8 @@ import{S as Ct,i as St,s as $t,C as E,M as Tt,e as r,w as y,b,c as be,f as w,g a 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=b(),B=r("tr"),B.innerHTML='Schema fields'},m(c,m){o(c,t,m),o(c,l,m),o(c,n,m),o(c,u,m),o(c,_,m),o(c,s,m),o(c,p,m),o(c,k,m),o(c,C,m),o(c,S,m),o(c,T,m),o(c,O,m),o(c,F,m),o(c,A,m),o(c,M,m),o(c,g,m),o(c,B,m)},d(c){c&&d(t),c&&d(l),c&&d(n),c&&d(u),c&&d(_),c&&d(s),c&&d(p),c&&d(k),c&&d(C),c&&d(S),c&&d(T),c&&d(O),c&&d(F),c&&d(A),c&&d(M),c&&d(g),c&&d(B)}}}function Lt(f){let t;return{c(){t=r("span"),t.textContent="Optional",w(t,"class","label label-warning")},m(l,n){o(l,t,n)},d(l){l&&d(t)}}}function Ft(f){let t;return{c(){t=r("span"),t.textContent="Required",w(t,"class","label label-success")},m(l,n){o(l,t,n)},d(l){l&&d(t)}}}function Bt(f){var _;let t,l=((_=f[13].options)==null?void 0:_.maxSelect)>1?"ids":"id",n,u;return{c(){t=y("User "),n=y(l),u=y(".")},m(s,p){o(s,t,p),o(s,n,p),o(s,u,p)},p(s,p){var k;p&1&&l!==(l=((k=s[13].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&U(n,l)},d(s){s&&d(t),s&&d(n),s&&d(u)}}}function Nt(f){var _;let t,l=((_=f[13].options)==null?void 0:_.maxSelect)>1?"ids":"id",n,u;return{c(){t=y("Relation record "),n=y(l),u=y(".")},m(s,p){o(s,t,p),o(s,n,p),o(s,u,p)},p(s,p){var k;p&1&&l!==(l=((k=s[13].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&U(n,l)},d(s){s&&d(t),s&&d(n),s&&d(u)}}}function jt(f){let t,l,n,u,_;return{c(){t=y("File object."),l=r("br"),n=y(` - Set to `),u=r("code"),u.textContent="null",_=y(" to delete already uploaded file(s).")},m(s,p){o(s,t,p),o(s,l,p),o(s,n,p),o(s,u,p),o(s,_,p)},p:X,d(s){s&&d(t),s&&d(l),s&&d(n),s&&d(u),s&&d(_)}}}function At(f){let t;return{c(){t=y("URL address.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function gt(f){let t;return{c(){t=y("Email address.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function Et(f){let t;return{c(){t=y("JSON array or object.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function Ut(f){let t;return{c(){t=y("Number value.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function It(f){let t;return{c(){t=y("Plain text value.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function ht(f,t){let l,n,u,_,s,p=t[13].name+"",k,C,S,T,O=E.getFieldValueType(t[13])+"",F,A,M,g;function B(h,L){return h[13].required?Ft:Lt}let c=B(t),m=c(t);function K(h,L){if(h[13].type==="text")return It;if(h[13].type==="number")return Ut;if(h[13].type==="json")return Et;if(h[13].type==="email")return gt;if(h[13].type==="url")return At;if(h[13].type==="file")return jt;if(h[13].type==="relation")return Nt;if(h[13].type==="user")return Bt}let R=K(t),$=R&&R(t);return{key:f,first:null,c(){l=r("tr"),n=r("td"),u=r("div"),m.c(),_=b(),s=r("span"),k=y(p),C=b(),S=r("td"),T=r("span"),F=y(O),A=b(),M=r("td"),$&&$.c(),g=b(),w(u,"class","inline-flex"),w(T,"class","label"),this.first=l},m(h,L){o(h,l,L),a(l,n),a(n,u),m.m(u,null),a(u,_),a(u,s),a(s,k),a(l,C),a(l,S),a(S,T),a(T,F),a(l,A),a(l,M),$&&$.m(M,null),a(l,g)},p(h,L){t=h,c!==(c=B(t))&&(m.d(1),m=c(t),m&&(m.c(),m.m(u,_))),L&1&&p!==(p=t[13].name+"")&&U(k,p),L&1&&O!==(O=E.getFieldValueType(t[13])+"")&&U(F,O),R===(R=K(t))&&$?$.p(t,L):($&&$.d(1),$=R&&R(t),$&&($.c(),$.m(M,null)))},d(h){h&&d(l),m.d(),$&&$.d()}}}function vt(f,t){let l,n=t[8].code+"",u,_,s,p;function k(){return t[7](t[8])}return{key:f,first:null,c(){l=r("button"),u=y(n),_=b(),w(l,"class","tab-item"),ye(l,"active",t[1]===t[8].code),this.first=l},m(C,S){o(C,l,S),a(l,u),a(l,_),s||(p=Ht(l,"click",k),s=!0)},p(C,S){t=C,S&4&&n!==(n=t[8].code+"")&&U(u,n),S&6&&ye(l,"active",t[1]===t[8].code)},d(C){C&&d(l),s=!1,p()}}}function wt(f,t){let l,n,u,_;return n=new Tt({props:{content:t[8].body}}),{key:f,first:null,c(){l=r("div"),be(n.$$.fragment),u=b(),w(l,"class","tab-item"),ye(l,"active",t[1]===t[8].code),this.first=l},m(s,p){o(s,l,p),me(n,l,null),a(l,u),_=!0},p(s,p){t=s;const k={};p&4&&(k.content=t[8].body),n.$set(k),(!_||p&6)&&ye(l,"active",t[1]===t[8].code)},i(s){_||(de(n.$$.fragment,s),_=!0)},o(s){re(n.$$.fragment,s),_=!1},d(s){s&&d(l),_e(n)}}}function Jt(f){var ot,dt,rt;let t,l,n=f[0].name+"",u,_,s,p,k,C,S,T=f[0].name+"",O,F,A,M,g,B,c,m,K,R,$,h,L,Ae,fe,W,ge,ke,pe=f[0].name+"",he,Ee,ve,Ue,we,Z,Te,ee,Ce,te,Se,I,$e,Ie,J,Oe,N=[],Je=new Map,Me,le,qe,V,De,Ve,se,x,He,xe,Pe,Qe,q,ze,Y,Ke,We,Ye,Re,Ge,Le,Xe,Fe,Ze,et,G,Be,ne,Ne,Q,ie,j=[],tt=new Map,lt,ae,D=[],st=new Map,z;m=new Pt({props:{js:` + This field can be set only by admins or auth records with "Manage" access.`,g=b(),B=r("tr"),B.innerHTML='Schema fields'},m(c,m){o(c,t,m),o(c,l,m),o(c,n,m),o(c,u,m),o(c,_,m),o(c,s,m),o(c,p,m),o(c,k,m),o(c,C,m),o(c,S,m),o(c,T,m),o(c,$,m),o(c,F,m),o(c,A,m),o(c,M,m),o(c,g,m),o(c,B,m)},d(c){c&&d(t),c&&d(l),c&&d(n),c&&d(u),c&&d(_),c&&d(s),c&&d(p),c&&d(k),c&&d(C),c&&d(S),c&&d(T),c&&d($),c&&d(F),c&&d(A),c&&d(M),c&&d(g),c&&d(B)}}}function Lt(f){let t;return{c(){t=r("span"),t.textContent="Optional",w(t,"class","label label-warning")},m(l,n){o(l,t,n)},d(l){l&&d(t)}}}function Ft(f){let t;return{c(){t=r("span"),t.textContent="Required",w(t,"class","label label-success")},m(l,n){o(l,t,n)},d(l){l&&d(t)}}}function Bt(f){var _;let t,l=((_=f[13].options)==null?void 0:_.maxSelect)>1?"ids":"id",n,u;return{c(){t=y("User "),n=y(l),u=y(".")},m(s,p){o(s,t,p),o(s,n,p),o(s,u,p)},p(s,p){var k;p&1&&l!==(l=((k=s[13].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&U(n,l)},d(s){s&&d(t),s&&d(n),s&&d(u)}}}function Nt(f){var _;let t,l=((_=f[13].options)==null?void 0:_.maxSelect)>1?"ids":"id",n,u;return{c(){t=y("Relation record "),n=y(l),u=y(".")},m(s,p){o(s,t,p),o(s,n,p),o(s,u,p)},p(s,p){var k;p&1&&l!==(l=((k=s[13].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&U(n,l)},d(s){s&&d(t),s&&d(n),s&&d(u)}}}function jt(f){let t,l,n,u,_;return{c(){t=y("File object."),l=r("br"),n=y(` + Set to `),u=r("code"),u.textContent="null",_=y(" to delete already uploaded file(s).")},m(s,p){o(s,t,p),o(s,l,p),o(s,n,p),o(s,u,p),o(s,_,p)},p:X,d(s){s&&d(t),s&&d(l),s&&d(n),s&&d(u),s&&d(_)}}}function At(f){let t;return{c(){t=y("URL address.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function gt(f){let t;return{c(){t=y("Email address.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function Et(f){let t;return{c(){t=y("JSON array or object.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function Ut(f){let t;return{c(){t=y("Number value.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function It(f){let t;return{c(){t=y("Plain text value.")},m(l,n){o(l,t,n)},p:X,d(l){l&&d(t)}}}function ht(f,t){let l,n,u,_,s,p=t[13].name+"",k,C,S,T,$=E.getFieldValueType(t[13])+"",F,A,M,g;function B(h,L){return h[13].required?Ft:Lt}let c=B(t),m=c(t);function K(h,L){if(h[13].type==="text")return It;if(h[13].type==="number")return Ut;if(h[13].type==="json")return Et;if(h[13].type==="email")return gt;if(h[13].type==="url")return At;if(h[13].type==="file")return jt;if(h[13].type==="relation")return Nt;if(h[13].type==="user")return Bt}let R=K(t),O=R&&R(t);return{key:f,first:null,c(){l=r("tr"),n=r("td"),u=r("div"),m.c(),_=b(),s=r("span"),k=y(p),C=b(),S=r("td"),T=r("span"),F=y($),A=b(),M=r("td"),O&&O.c(),g=b(),w(u,"class","inline-flex"),w(T,"class","label"),this.first=l},m(h,L){o(h,l,L),a(l,n),a(n,u),m.m(u,null),a(u,_),a(u,s),a(s,k),a(l,C),a(l,S),a(S,T),a(T,F),a(l,A),a(l,M),O&&O.m(M,null),a(l,g)},p(h,L){t=h,c!==(c=B(t))&&(m.d(1),m=c(t),m&&(m.c(),m.m(u,_))),L&1&&p!==(p=t[13].name+"")&&U(k,p),L&1&&$!==($=E.getFieldValueType(t[13])+"")&&U(F,$),R===(R=K(t))&&O?O.p(t,L):(O&&O.d(1),O=R&&R(t),O&&(O.c(),O.m(M,null)))},d(h){h&&d(l),m.d(),O&&O.d()}}}function vt(f,t){let l,n=t[8].code+"",u,_,s,p;function k(){return t[7](t[8])}return{key:f,first:null,c(){l=r("button"),u=y(n),_=b(),w(l,"class","tab-item"),ye(l,"active",t[1]===t[8].code),this.first=l},m(C,S){o(C,l,S),a(l,u),a(l,_),s||(p=Ht(l,"click",k),s=!0)},p(C,S){t=C,S&4&&n!==(n=t[8].code+"")&&U(u,n),S&6&&ye(l,"active",t[1]===t[8].code)},d(C){C&&d(l),s=!1,p()}}}function wt(f,t){let l,n,u,_;return n=new Tt({props:{content:t[8].body}}),{key:f,first:null,c(){l=r("div"),be(n.$$.fragment),u=b(),w(l,"class","tab-item"),ye(l,"active",t[1]===t[8].code),this.first=l},m(s,p){o(s,l,p),me(n,l,null),a(l,u),_=!0},p(s,p){t=s;const k={};p&4&&(k.content=t[8].body),n.$set(k),(!_||p&6)&&ye(l,"active",t[1]===t[8].code)},i(s){_||(de(n.$$.fragment,s),_=!0)},o(s){re(n.$$.fragment,s),_=!1},d(s){s&&d(l),_e(n)}}}function Jt(f){var ot,dt,rt;let t,l,n=f[0].name+"",u,_,s,p,k,C,S,T=f[0].name+"",$,F,A,M,g,B,c,m,K,R,O,h,L,Ae,fe,W,ge,ke,pe=f[0].name+"",he,Ee,ve,Ue,we,Z,Te,ee,Ce,te,Se,I,Oe,Ie,J,$e,N=[],Je=new Map,Me,le,qe,V,De,Ve,se,x,He,xe,Pe,Qe,q,ze,Y,Ke,We,Ye,Re,Ge,Le,Xe,Fe,Ze,et,G,Be,ne,Ne,Q,ie,j=[],tt=new Map,lt,ae,D=[],st=new Map,z;m=new Pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${f[4]}'); @@ -51,26 +51,26 @@ final pb = PocketBase('${f[4]}'); final body = ${JSON.stringify(Object.assign({},f[3],E.dummyCollectionSchemaData(f[0])),null,2)}; final record = await pb.collection('${(dt=f[0])==null?void 0:dt.name}').update('RECORD_ID', body: body); - `}});let H=f[5]&&yt(),P=f[6]&&kt(),ce=(rt=f[0])==null?void 0:rt.schema;const nt=e=>e[13].name;for(let e=0;ee[8].code;for(let e=0;ee[8].code;for(let e=0;eapplication/json or + `}});let H=f[5]&&yt(),P=f[6]&&kt(),ce=(rt=f[0])==null?void 0:rt.schema;const nt=e=>e[13].name;for(let e=0;ee[8].code;for(let e=0;ee[8].code;for(let e=0;eapplication/json or multipart/form-data.`,g=b(),B=r("p"),B.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 - .`,c=b(),be(m.$$.fragment),K=b(),R=r("h6"),R.textContent="API details",$=b(),h=r("div"),L=r("strong"),L.textContent="PATCH",Ae=b(),fe=r("div"),W=r("p"),ge=y("/api/collections/"),ke=r("strong"),he=y(pe),Ee=y("/records/"),ve=r("strong"),ve.textContent=":id",Ue=b(),H&&H.c(),we=b(),Z=r("div"),Z.textContent="Path parameters",Te=b(),ee=r("table"),ee.innerHTML=`Param + .`,c=b(),be(m.$$.fragment),K=b(),R=r("h6"),R.textContent="API details",O=b(),h=r("div"),L=r("strong"),L.textContent="PATCH",Ae=b(),fe=r("div"),W=r("p"),ge=y("/api/collections/"),ke=r("strong"),he=y(pe),Ee=y("/records/"),ve=r("strong"),ve.textContent=":id",Ue=b(),H&&H.c(),we=b(),Z=r("div"),Z.textContent="Path parameters",Te=b(),ee=r("table"),ee.innerHTML=`Param Type Description id String - ID of the record to update.`,Ce=b(),te=r("div"),te.textContent="Body Parameters",Se=b(),I=r("table"),$e=r("thead"),$e.innerHTML=`Param + ID of the record to update.`,Ce=b(),te=r("div"),te.textContent="Body Parameters",Se=b(),I=r("table"),Oe=r("thead"),Oe.innerHTML=`Param Type - Description`,Ie=b(),J=r("tbody"),P&&P.c(),Oe=b();for(let e=0;eParam + Description`,Ie=b(),J=r("tbody"),P&&P.c(),$e=b();for(let e=0;eParam Type Description`,Ve=b(),se=r("tbody"),x=r("tr"),He=r("td"),He.textContent="expand",xe=b(),Pe=r("td"),Pe.innerHTML='String',Qe=b(),q=r("td"),ze=y(`Auto expand relations when returning the updated record. Ex.: `),be(Y.$$.fragment),Ke=y(` Supports up to 6-levels depth nested relations expansion. `),We=r("br"),Ye=y(` The expanded relations will be appended to the record under the `),Re=r("code"),Re.textContent="expand",Ge=y(" property (eg. "),Le=r("code"),Le.textContent='"expand": {"relField1": {...}, ...}',Xe=y(`). Only - the relations that the user has permissions to `),Fe=r("strong"),Fe.textContent="view",Ze=y(" will be expanded."),et=b(),be(G.$$.fragment),Be=b(),ne=r("div"),ne.textContent="Responses",Ne=b(),Q=r("div"),ie=r("div");for(let e=0;e${JSON.stringify(Object.assign({},e[3],E.dummyCollectionSchemaData(e[0])),null,2)}; final record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update('RECORD_ID', body: body); - `),m.$set(v),(!z||i&1)&&pe!==(pe=e[0].name+"")&&U(he,pe),e[5]?H||(H=yt(),H.c(),H.m(h,null)):H&&(H.d(1),H=null),e[6]?P||(P=kt(),P.c(),P.m(J,Oe)):P&&(P.d(1),P=null),i&1&&(ce=(ct=e[0])==null?void 0:ct.schema,N=je(N,i,nt,1,e,ce,Je,J,ut,ht,null,_t)),i&6&&(ue=e[2],j=je(j,i,it,1,e,ue,tt,ie,ut,vt,null,mt)),i&6&&(oe=e[2],Ot(),D=je(D,i,at,1,e,oe,st,ae,Mt,wt,null,bt),qt())},i(e){if(!z){de(m.$$.fragment,e),de(Y.$$.fragment,e),de(G.$$.fragment,e);for(let i=0;il(1,p=T.code);return f.$$set=T=>{"collection"in T&&l(0,s=T.collection)},f.$$.update=()=>{var T,O;f.$$.dirty&1&&l(6,n=(s==null?void 0:s.type)==="auth"),f.$$.dirty&1&&l(5,u=(s==null?void 0:s.updateRule)===null),f.$$.dirty&1&&l(2,k=[{code:200,body:JSON.stringify(E.dummyCollectionRecord(s),null,2)},{code:400,body:` + `),m.$set(v),(!z||i&1)&&pe!==(pe=e[0].name+"")&&U(he,pe),e[5]?H||(H=yt(),H.c(),H.m(h,null)):H&&(H.d(1),H=null),e[6]?P||(P=kt(),P.c(),P.m(J,$e)):P&&(P.d(1),P=null),i&1&&(ce=(ct=e[0])==null?void 0:ct.schema,N=je(N,i,nt,1,e,ce,Je,J,ut,ht,null,_t)),i&6&&(ue=e[2],j=je(j,i,it,1,e,ue,tt,ie,ut,vt,null,mt)),i&6&&(oe=e[2],$t(),D=je(D,i,at,1,e,oe,st,ae,Mt,wt,null,bt),qt())},i(e){if(!z){de(m.$$.fragment,e),de(Y.$$.fragment,e),de(G.$$.fragment,e);for(let i=0;il(1,p=T.code);return f.$$set=T=>{"collection"in T&&l(0,s=T.collection)},f.$$.update=()=>{var T,$;f.$$.dirty&1&&l(6,n=(s==null?void 0:s.type)==="auth"),f.$$.dirty&1&&l(5,u=(s==null?void 0:s.updateRule)===null),f.$$.dirty&1&&l(2,k=[{code:200,body:JSON.stringify(E.dummyCollectionRecord(s),null,2)},{code:400,body:` { "code": 400, "message": "Failed to update record.", "data": { - "${(O=(T=s==null?void 0:s.schema)==null?void 0:T[0])==null?void 0:O.name}": { + "${($=(T=s==null?void 0:s.schema)==null?void 0:T[0])==null?void 0:$.name}": { "code": "validation_required", "message": "Missing required value." } @@ -115,4 +115,4 @@ final record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update(' "message": "The requested resource wasn't found.", "data": {} } - `}]),f.$$.dirty&1&&(s.type==="auth"?l(3,C={username:"test_username_update",emailVisibility:!1,password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):l(3,C={}))},l(4,_=E.getApiExampleUrl(Dt.baseUrl)),[s,p,k,C,_,u,n,S]}class Kt extends Ct{constructor(t){super(),St(this,t,Vt,Jt,$t,{collection:0})}}export{Kt as default}; + `}]),f.$$.dirty&1&&(s.type==="auth"?l(3,C={username:"test_username_update",emailVisibility:!1,password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):l(3,C={}))},l(4,_=E.getApiExampleUrl(Dt.baseUrl)),[s,p,k,C,_,u,n,S]}class Kt extends Ct{constructor(t){super(),St(this,t,Vt,Jt,Ot,{collection:0})}}export{Kt as default}; diff --git a/ui/dist/assets/ViewApiDocs-bddeeafe.js b/ui/dist/assets/ViewApiDocs-a8491c7b.js similarity index 79% rename from ui/dist/assets/ViewApiDocs-bddeeafe.js rename to ui/dist/assets/ViewApiDocs-a8491c7b.js index 903a29ba..bc134d6a 100644 --- a/ui/dist/assets/ViewApiDocs-bddeeafe.js +++ b/ui/dist/assets/ViewApiDocs-a8491c7b.js @@ -1,4 +1,4 @@ -import{S as tt,i as lt,s as st,M as et,e as o,w as b,b as u,c as W,f as _,g as r,h as l,m as X,x as ve,N as Ge,P as nt,k as ot,Q as it,n as at,t as U,a as j,o as d,d as Y,C as Je,p as rt,r as Z,u as dt}from"./index-3379c20e.js";import{S as ct}from"./SdkTabs-0096fda4.js";import{F as ft}from"./FieldsQueryParam-aebe0d79.js";function Ke(i,s,n){const a=i.slice();return a[6]=s[n],a}function We(i,s,n){const a=i.slice();return a[6]=s[n],a}function Xe(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin Authorization:TOKEN header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function Ye(i,s){let n,a=s[6].code+"",w,c,f,m;function F(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=b(a),c=u(),_(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(h,g){r(h,n,g),l(n,w),l(n,c),f||(m=dt(n,"click",F),f=!0)},p(h,g){s=h,g&20&&Z(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,m()}}}function Ze(i,s){let n,a,w,c;return a=new et({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),W(a.$$.fragment),w=u(),_(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(f,m){r(f,n,m),X(a,n,null),l(n,w),c=!0},p(f,m){s=f,(!c||m&20)&&Z(n,"active",s[2]===s[6].code)},i(f){c||(U(a.$$.fragment,f),c=!0)},o(f){j(a.$$.fragment,f),c=!1},d(f){f&&d(n),Y(a)}}}function pt(i){var Ue,je;let s,n,a=i[0].name+"",w,c,f,m,F,h,g,V=i[0].name+"",ee,$e,te,R,le,M,se,y,z,we,G,E,ye,ne,J=i[0].name+"",oe,Ce,ie,Fe,ae,x,re,A,de,I,ce,O,fe,ge,q,P,pe,Re,ue,Oe,k,Pe,S,De,Te,Ee,me,Se,be,Be,Me,xe,_e,Ae,Ie,B,ke,H,he,D,L,C=[],qe=new Map,He,N,v=[],Le=new Map,T;R=new ct({props:{js:` +import{S as tt,i as lt,s as st,N as et,e as o,w as b,b as u,c as W,f as _,g as r,h as l,m as X,x as ve,O as Ge,P as nt,k as ot,Q as it,n as at,t as U,a as j,o as d,d as Y,C as Je,p as rt,r as Z,u as dt}from"./index-352a0704.js";import{S as ct}from"./SdkTabs-17fc08c7.js";import{F as ft}from"./FieldsQueryParam-d00fc8d6.js";function Ke(i,s,n){const a=i.slice();return a[6]=s[n],a}function We(i,s,n){const a=i.slice();return a[6]=s[n],a}function Xe(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin Authorization:TOKEN header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function Ye(i,s){let n,a=s[6].code+"",w,c,f,m;function F(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=b(a),c=u(),_(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(h,g){r(h,n,g),l(n,w),l(n,c),f||(m=dt(n,"click",F),f=!0)},p(h,g){s=h,g&20&&Z(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,m()}}}function Ze(i,s){let n,a,w,c;return a=new et({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),W(a.$$.fragment),w=u(),_(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(f,m){r(f,n,m),X(a,n,null),l(n,w),c=!0},p(f,m){s=f,(!c||m&20)&&Z(n,"active",s[2]===s[6].code)},i(f){c||(U(a.$$.fragment,f),c=!0)},o(f){j(a.$$.fragment,f),c=!1},d(f){f&&d(n),Y(a)}}}function pt(i){var Ue,je;let s,n,a=i[0].name+"",w,c,f,m,F,h,g,V=i[0].name+"",ee,$e,te,R,le,x,se,y,z,we,G,E,ye,ne,J=i[0].name+"",oe,Ce,ie,Fe,ae,A,re,I,de,M,ce,O,fe,ge,q,P,pe,Re,ue,Oe,k,Pe,S,De,Te,Ee,me,Se,be,Be,xe,Ae,_e,Ie,Me,B,ke,H,he,D,L,C=[],qe=new Map,He,N,v=[],Le=new Map,T;R=new ct({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); @@ -18,20 +18,20 @@ import{S as tt,i as lt,s as st,M as et,e as o,w as b,b as u,c as W,f as _,g as r final record = await pb.collection('${(je=i[0])==null?void 0:je.name}').getOne('RECORD_ID', expand: 'relField1,relField2.subRelField', ); - `}});let $=i[1]&&Xe();S=new et({props:{content:"?expand=relField1,relField2.subRelField"}}),B=new ft({});let K=i[4];const Ne=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam + `}});let $=i[1]&&Xe();S=new et({props:{content:"?expand=relField1,relField2.subRelField"}}),B=new ft({});let K=i[4];const Ne=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.`,de=u(),I=o("div"),I.textContent="Query parameters",ce=u(),O=o("table"),fe=o("thead"),fe.innerHTML=`Param + ID of the record to view.`,de=u(),M=o("div"),M.textContent="Query parameters",ce=u(),O=o("table"),fe=o("thead"),fe.innerHTML=`Param Type Description`,ge=u(),q=o("tbody"),P=o("tr"),pe=o("td"),pe.textContent="expand",Re=u(),ue=o("td"),ue.innerHTML='String',Oe=u(),k=o("td"),Pe=b(`Auto expand record relations. Ex.: `),W(S.$$.fragment),De=b(` Supports up to 6-levels depth nested relations expansion. `),Te=o("br"),Ee=b(` The expanded relations will be appended to the record under the `),me=o("code"),me.textContent="expand",Se=b(" property (eg. "),be=o("code"),be.textContent='"expand": {"relField1": {...}, ...}',Be=b(`). - `),Me=o("br"),xe=b(` - Only the relations to which the request user has permissions to `),_e=o("strong"),_e.textContent="view",Ae=b(" will be expanded."),Ie=u(),W(B.$$.fragment),ke=u(),H=o("div"),H.textContent="Responses",he=u(),D=o("div"),L=o("div");for(let e=0;en(2,f=h.code);return i.$$set=h=>{"collection"in h&&n(0,c=h.collection)},i.$$.update=()=>{i.$$.dirty&1&&n(1,a=(c==null?void 0:c.viewRule)===null),i.$$.dirty&3&&c!=null&&c.id&&(m.push({code:200,body:JSON.stringify(Je.dummyCollectionRecord(c),null,2)}),a&&m.push({code:403,body:` + `),R.$set(p),(!T||t&1)&&J!==(J=e[0].name+"")&&ve(oe,J),e[1]?$||($=Xe(),$.c(),$.m(y,null)):$&&($.d(1),$=null),t&20&&(K=e[4],C=Ge(C,t,Ne,1,e,K,qe,L,nt,Ye,null,We)),t&20&&(Q=e[4],ot(),v=Ge(v,t,Qe,1,e,Q,Le,N,it,Ze,null,Ke),at())},i(e){if(!T){U(R.$$.fragment,e),U(S.$$.fragment,e),U(B.$$.fragment,e);for(let t=0;tn(2,f=h.code);return i.$$set=h=>{"collection"in h&&n(0,c=h.collection)},i.$$.update=()=>{i.$$.dirty&1&&n(1,a=(c==null?void 0:c.viewRule)===null),i.$$.dirty&3&&c!=null&&c.id&&(m.push({code:200,body:JSON.stringify(Je.dummyCollectionRecord(c),null,2)}),a&&m.push({code:403,body:` { "code": 403, "message": "Only admins can access this action.", diff --git a/ui/dist/assets/index-3379c20e.js b/ui/dist/assets/index-3379c20e.js deleted file mode 100644 index fdc5c706..00000000 --- a/ui/dist/assets/index-3379c20e.js +++ /dev/null @@ -1,231 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const vl=n=>n;function Re(n,e){for(const t in e)n[t]=e[t];return n}function q1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Q_(n){return n()}function du(){return Object.create(null)}function Oe(n){n.forEach(Q_)}function jt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Pl;function gn(n,e){return Pl||(Pl=document.createElement("a")),Pl.href=e,n===Pl.href}function j1(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null)return x;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function z1(n){let e;return ha(n,t=>e=t)(),e}function Ke(n,e,t){n.$$.on_destroy.push(ha(e,t))}function wt(n,e,t,i){if(n){const s=x_(n,e,t,i);return n[0](s)}}function x_(n,e,t,i){return n[1]&&i?Re(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),_a=eg?n=>requestAnimationFrame(n):x;const bs=new Set;function tg(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&_a(tg)}function No(n){let e;return bs.size===0&&_a(tg),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function b(n,e){n.appendChild(e)}function ng(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function V1(n){const e=v("style");return H1(ng(n),e),e.sheet}function H1(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Qe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Dn(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 B1=["width","height"];function ri(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&&B1.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function U1(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 pt(n){return n===""?null:+n}function W1(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function qr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function ig(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Rt(n,e){return new n(e)}const co=new Map;let po=0;function Y1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function K1(n,e){const t={stylesheet:V1(e),rules:{}};return co.set(n,t),t}function al(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ -`;for(let g=0;g<=1;g+=a){const y=e+(t-e)*l(g);u+=g*100+`%{${o(y,1-y)}} -`}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${Y1(f)}_${r}`,d=ng(n),{stylesheet:m,rules:_}=co.get(d)||K1(d,n);_[c]||(_[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${s}ms 1 both`,po+=1,c}function ul(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),po-=s,po||J1())}function J1(){_a(()=>{po||(co.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),co.clear())})}function Z1(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=vl,start:a=Fo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,_;function h(){c&&(_=al(n,0,1,o,l,r,c)),l||(m=!0)}function g(){c&&ul(n,_),d=!1}return No(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),g()),!d)return!1;if(m){const S=y-a,$=0+1*r(S/o);f($,1-$)}return!0}),h(),f(0,1),g}function G1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,sg(n,s)}}function sg(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fl;function gi(n){fl=n}function yl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Xt(n){yl().$$.on_mount.push(n)}function X1(n){yl().$$.after_update.push(n)}function Ro(n){yl().$$.on_destroy.push(n)}function Tt(){const n=yl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ig(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gs=[],te=[];let vs=[];const jr=[],lg=Promise.resolve();let zr=!1;function og(){zr||(zr=!0,lg.then(ga))}function cn(){return og(),lg}function Ge(n){vs.push(n)}function he(n){jr.push(n)}const nr=new Set;let cs=0;function ga(){if(cs!==0)return;const n=fl;do{try{for(;csn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vs=e}let qs;function ba(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function xi(n,e,t){n.dispatchEvent(ig(`${e?"intro":"outro"}${t}`))}const io=new Set;let si;function ae(){si={r:0,c:[],p:si}}function ue(){si.r||Oe(si.c),si=si.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),si.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function rg(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ul(n,o)}function f(){const{delay:d=0,duration:m=300,easing:_=vl,tick:h=x,css:g}=s||va;g&&(o=al(n,0,1,m,d,_,g,a++)),h(0,1);const y=Fo()+d,S=y+m;r&&r.abort(),l=!0,Ge(()=>xi(n,!0,"start")),r=No($=>{if(l){if($>=S)return h(1,0),xi(n,!0,"end"),u(),l=!1;if($>=y){const C=_(($-y)/m);h(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,ul(n),jt(s)?(s=s(i),ba().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function ya(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=si;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=vl,tick:d=x,css:m}=s||va;m&&(o=al(n,1,0,f,u,c,m));const _=Fo()+u,h=_+f;Ge(()=>xi(n,!1,"start")),No(g=>{if(l){if(g>=h)return d(0,1),xi(n,!1,"end"),--r.r||Oe(r.c),!1;if(g>=_){const y=c((g-_)/f);d(1-y,y)}}return l})}return jt(s)?ba().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&ul(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&ul(n,u)}function c(m,_){const h=m.b-o;return _*=Math.abs(h),{a:o,b:m.b,d:h,duration:_,start:m.start,end:m.start+_,group:m.group}}function d(m){const{delay:_=0,duration:h=300,easing:g=vl,tick:y=x,css:S}=l||va,$={start:Fo()+_,b:m};m||($.group=si,si.r+=1),r||a?a=$:(S&&(f(),u=al(n,o,m,h,_,g,S)),m&&y(0,1),r=c($,h),Ge(()=>xi(n,m,"start")),No(C=>{if(a&&C>a.start&&(r=c(a,h),a=null,xi(n,r.b,"start"),S&&(f(),u=al(n,o,r.b,r.duration,0,g,l.css))),r){if(C>=r.end)y(o=r.b,1-o),xi(n,r.b,"end"),a||(r.b?f():--r.group.r||Oe(r.group.c)),r=null;else if(C>=r.start){const T=C-r.start;o=r.a+r.d*g(T/r.duration),y(o,1-o)}}return!!(r||a)}))}return{run(m){jt(l)?ba().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function mu(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(ae(),L(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ue())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ga()}if(q1(n)){const s=yl();if(n.then(l=>{gi(s),i(e.then,1,e.value,l),gi(null)},l=>{if(gi(s),i(e.catch,2,e.error,l),gi(null),!e.hasCatch)throw l}),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 e0(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ls(n,e){n.d(1),e.delete(n.key)}function Ut(n,e){L(n,1,1,()=>{e.delete(n.key)})}function t0(n,e){n.f(),Ut(n,e)}function bt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,_=d;const h={};for(;_--;)h[n[_].key]=_;const g=[],y=new Map,S=new Map,$=[];for(_=m;_--;){const O=c(s,l,_),D=t(O);let I=o.get(D);I?i&&$.push(()=>I.p(O,e)):(I=u(D,O),I.c()),y.set(D,g[_]=I),D in h&&S.set(D,Math.abs(_-h[D]))}const C=new Set,T=new Set;function M(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,m--}for(;d&&m;){const O=g[m-1],D=n[d-1],I=O.key,P=D.key;O===D?(f=O.first,d--,m--):y.has(P)?!o.has(I)||C.has(I)?M(O):T.has(P)?d--:S.get(I)>S.get(P)?(T.add(I),M(O)):(C.add(P),d--):(a(D,o),d--)}for(;d--;){const O=n[d];y.has(O.key)||a(O,o)}for(;m;)M(g[m-1]);return Oe($),g}function At(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Qt(n){return typeof n=="object"&&n!==null?n:{}}function ce(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function V(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||Ge(()=>{const o=n.$$.on_mount.map(Q_).filter(jt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Oe(o),n.$$.on_mount=[]}),l.forEach(Ge)}function H(n,e){const t=n.$$;t.fragment!==null&&(x1(t.after_update),Oe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function n0(n,e){n.$$.dirty[0]===-1&&(gs.push(n),og(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const _=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=_)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](_),f&&n0(n,c)),d}):[],u.update(),f=!0,Oe(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=W1(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),V(n,e.target,e.anchor,e.customElement),ga()}gi(a)}class ve{$destroy(){H(this,1),this.$destroy=x}$on(e,t){if(!jt(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!j1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Lt(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;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function ug(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return ag(t,o=>{let r=!1;const a=[];let u=0,f=x;const c=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=jt(m)?m:x},d=s.map((m,_)=>ha(m,h=>{a[_]=h,u&=~(1<<_),r&&c()},()=>{u|=1<<_}));return r=!0,c(),function(){Oe(d),f(),r=!1}})}function fg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function i0(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{H(f,1)}),ue()}l?(e=Rt(l,o()),e.$on("routeEvent",r[7]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function s0(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{H(f,1)}),ue()}l?(e=Rt(l,o()),e.$on("routeEvent",r[6]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function l0(n){let e,t,i,s;const l=[s0,i0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),L(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function hu(){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=ag(null,function(e){e(hu());const t=()=>{e(hu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ug(qo,n=>n.location);const ka=ug(qo,n=>n.querystring),_u=An(void 0);async function qi(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await cn();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 rn(n,e){if(e=bu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return gu(n,e),{update(t){t=bu(t),gu(n,t)}}}function o0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function gu(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||r0(i.currentTarget.getAttribute("href"))})}function bu(n){return n&&typeof n=="string"?{href:n}:n||{}}function r0(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:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(T,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!T||typeof T=="string"&&(T.length<1||T.charAt(0)!="/"&&T.charAt(0)!="*")||typeof T=="object"&&!(T instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:D}=fg(T);this.path=T,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=O,this._keys=D}match(T){if(s){if(typeof s=="string")if(T.startsWith(s))T=T.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=T.match(s);if(I&&I[0])T=T.substr(I[0].length)||"/";else return null}}const M=this._pattern.exec(T);if(M===null)return null;if(this._keys===!1)return M;const O={};let D=0;for(;D{r.push(new o(T,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const c=Tt();async function d(C,T){await cn(),c(C,T)}let m=null,_=null;l&&(_=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",_),X1(()=>{o0(m)}));let h=null,g=null;const y=qo.subscribe(async C=>{h=C;let T=0;for(;T{_u.set(u)});return}t(0,a=null),g=null,_u.set(void 0)});Ro(()=>{y(),_&&window.removeEventListener("popstate",_)});function S(C){Fe.call(this,n,C)}function $(C){Fe.call(this,n,C)}return n.$$set=C=>{"routes"in C&&t(3,i=C.routes),"prefix"in C&&t(4,s=C.prefix),"restoreScrollState"in C&&t(5,l=C.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,$]}class u0 extends ve{constructor(e){super(),be(this,e,a0,l0,me,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let cg;function dg(n){const e=n.pattern.test(cg);vu(n,n.className,e),vu(n,n.inactiveClassName,!e)}function vu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{cg=n.location+(n.querystring?"?"+n.querystring:""),so.map(dg)});function jn(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 so.push(i),dg(i),{destroy(){so.splice(so.indexOf(i),1)}}}const f0="modulepreload",c0=function(n,e){return new URL(n,e).href},yu={},at=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=c0(l,i),l in yu)return;yu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":f0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};var Vr=function(n,e){return Vr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Vr(n,e)};function nn(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Vr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Hr=function(){return Hr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i0&&s[s.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]0&&(!t.exp||t.exp-e>Date.now()/1e3))}pg=typeof atob=="function"?atob:function(n){var 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,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var kl=function(){function n(e){e===void 0&&(e={}),this.$load(e||{})}return n.prototype.load=function(e){return this.$load(e)},n.prototype.$load=function(e){for(var t=0,i=Object.entries(e);t4096&&(a.model={id:(s=a==null?void 0:a.model)===null||s===void 0?void 0:s.id,email:(l=a==null?void 0:a.model)===null||l===void 0?void 0:l.email},this.model instanceof mo&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=ku(t,JSON.stringify(a),e)),u},n.prototype.onChange=function(e,t){var i=this;return t===void 0&&(t=!1),this._onChangeCallbacks.push(e),t&&e(this.token,this.model),function(){for(var s=i._onChangeCallbacks.length-1;s>=0;s--)if(i._onChangeCallbacks[s]==e)return delete i._onChangeCallbacks[s],void i._onChangeCallbacks.splice(s,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e0?e:1,this.perPage=t>=0?t:0,this.totalItems=i>=0?i:0,this.totalPages=s>=0?s:0,this.items=l||[]},Sa=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.getFullList=function(t,i){if(typeof t=="number")return this._getFullList(this.baseCrudPath,t,i);var s=Object.assign({},t,i),l=500;return s.batch&&(l=s.batch,delete s.batch),this._getFullList(this.baseCrudPath,l,s)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),this._getList(this.baseCrudPath,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),this._getFirstListItem(this.baseCrudPath,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),this._getOne(this.baseCrudPath,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this._create(this.baseCrudPath,t,i)},e.prototype.update=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._update(this.baseCrudPath,t,i,s)},e.prototype.delete=function(t,i){return i===void 0&&(i={}),this._delete(this.baseCrudPath,t,i)},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=500),s===void 0&&(s={}),s=Object.assign({skipTotal:1},s);var o=[],r=function(a){return xt(l,void 0,void 0,function(){return en(this,function(u){return[2,this._getList(t,a,i||500,s).then(function(f){var c=f.items;return o=o.concat(c),c.length==f.perPage?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u1||typeof(t==null?void 0:t[0])=="string"?(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."),[2,this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{})]):(s=(t==null?void 0:t[0])||{},[4,this.listAuthMethods()]);case 1:if(l=u.sent(),!(o=l.authProviders.find(function(f){return f.name===s.provider})))throw new Di(new Error('Missing or invalid provider "'.concat(s.provider,'".')));return r=this.client.buildUrl("/api/oauth2-redirect"),[2,new Promise(function(f,c){return xt(a,void 0,void 0,function(){var d,m,_,h,g,y=this;return en(this,function(S){switch(S.label){case 0:return S.trys.push([0,3,,4]),[4,this.client.realtime.subscribe("@oauth2",function($){return xt(y,void 0,void 0,function(){var C,T,M;return en(this,function(O){switch(O.label){case 0:C=this.client.realtime.clientId,O.label=1;case 1:if(O.trys.push([1,3,,4]),d(),!$.state||C!==$.state)throw new Error("State parameters don't match.");return[4,this.authWithOAuth2Code(o.name,$.code,o.codeVerifier,r,s.createData,s.body,s.query)];case 2:return T=O.sent(),f(T),[3,4];case 3:return M=O.sent(),c(new Di(M)),[3,4];case 4:return[2]}})})})];case 1:return d=S.sent(),m={state:this.client.realtime.clientId},!((g=s.scopes)===null||g===void 0)&&g.length&&(m.scope=s.scopes.join(" ")),_=this._replaceQueryParams(o.authUrl+r,m),[4,s.urlCallback?s.urlCallback(_):this._defaultUrlCallback(_)];case 2:return S.sent(),[3,4];case 3:return h=S.sent(),c(new Di(h)),[3,4];case 4:return[2]}})})})]}})})},e.prototype.authRefresh=function(t,i){var s=this;return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCollectionPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(function(l){return s.authResponse(l)})},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e.prototype.requestVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({token:t},i),this.client.send(this.baseCollectionPath+"/confirm-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.requestEmailChange=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({newEmail:t},i),this.client.send(this.baseCollectionPath+"/request-email-change",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({token:t,password:i},s),this.client.send(this.baseCollectionPath+"/confirm-email-change",{method:"POST",params:l,body:s}).then(function(){return!0})},e.prototype.listExternalAuths=function(t,i){return i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:i}).then(function(s){var l=[];if(Array.isArray(s))for(var o=0,r=s;o=0&&(s=t.substring(0,t.indexOf("?")),l=t.substring(t.indexOf("?")+1));for(var o={},r=0,a=l.split("&");r"u"||!(window!=null&&window.open))throw new Di(new Error("Not in a browser context - please pass a custom urlCallback function."));var i=1024,s=768,l=window.innerWidth,o=window.innerHeight,r=l/2-(i=i>l?l:i)/2,a=o/2-(s=s>o?o:s)/2;window.open(t,"oauth2-popup","width="+i+",height="+s+",top="+a+",left="+r+",resizable,menubar=no")},e}(Sa),v0=function(e){e===void 0&&(e={}),this.id=e.id!==void 0?e.id:"",this.name=e.name!==void 0?e.name:"",this.type=e.type!==void 0?e.type:"text",this.system=!!e.system,this.required=!!e.required,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},y0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.$load=function(t){n.prototype.$load.call(this,t),this.system=!!t.system,this.name=typeof t.name=="string"?t.name:"",this.type=typeof t.type=="string"?t.type:"base",this.options=t.options!==void 0&&t.options!==null?t.options:{},this.indexes=Array.isArray(t.indexes)?t.indexes:[],this.listRule=typeof t.listRule=="string"?t.listRule:null,this.viewRule=typeof t.viewRule=="string"?t.viewRule:null,this.createRule=typeof t.createRule=="string"?t.createRule:null,this.updateRule=typeof t.updateRule=="string"?t.updateRule:null,this.deleteRule=typeof t.deleteRule=="string"?t.deleteRule:null,t.schema=Array.isArray(t.schema)?t.schema:[],this.schema=[];for(var i=0,s=t.schema;i=0;o--)this.subscriptions[t][o]===i&&(l=!0,delete this.subscriptions[t][o],this.subscriptions[t].splice(o,1),(s=this.eventSource)===null||s===void 0||s.removeEventListener(t,i));return l?(this.subscriptions[t].length||delete this.subscriptions[t],this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3])):[2];case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.hasSubscriptionListeners=function(t){var i,s;if(this.subscriptions=this.subscriptions||{},t)return!!(!((i=this.subscriptions[t])===null||i===void 0)&&i.length);for(var l in this.subscriptions)if(!((s=this.subscriptions[l])===null||s===void 0)&&s.length)return!0;return!1},e.prototype.submitSubscriptions=function(){return xt(this,void 0,void 0,function(){return en(this,function(t){return this.clientId?(this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},params:{$cancelKey:this.getSubscriptionsCancelKey()}}).catch(function(i){if(!(i!=null&&i.isAbort))throw i})]):[2]})})},e.prototype.getSubscriptionsCancelKey=function(){return"realtime_"+this.clientId},e.prototype.getNonEmptySubscriptionTopics=function(){var t=[];for(var i in this.subscriptions)this.subscriptions[i].length&&t.push(i);return t},e.prototype.addAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeAllSubscriptionListeners(),this.subscriptions)for(var i=0,s=this.subscriptions[t];i0?[2]:[2,new Promise(function(s,l){t.pendingConnects.push({resolve:s,reject:l}),t.pendingConnects.length>1||t.initConnect()})]})})},e.prototype.initConnect=function(){var t=this;this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(function(){t.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=function(i){t.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",function(i){var s=i;t.clientId=s==null?void 0:s.lastEventId,t.submitSubscriptions().then(function(){return xt(t,void 0,void 0,function(){var l;return en(this,function(o){switch(o.label){case 0:l=3,o.label=1;case 1:return this.hasUnsentSubscriptions()&&l>0?(l--,[4,this.submitSubscriptions()]):[3,3];case 2:return o.sent(),[3,1];case 3:return[2]}})})}).then(function(){for(var l=0,o=t.pendingConnects;lthis.maxReconnectAttempts){for(var s=0,l=this.pendingConnects;s=400)throw new Di({url:M.url,status:M.status,data:O});return[2,O]}})})}).catch(function(M){throw new Di(M)})]}})})},n.prototype.getFileUrl=function(e,t,i){return i===void 0&&(i={}),this.files.getUrl(e,t,i)},n.prototype.buildUrl=function(e){var t,i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i},n.prototype.isFormData=function(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o"u"}function es(n){return typeof n=="number"}function zo(n){return typeof n=="number"&&n%1===0}function I0(n){return typeof n=="string"}function L0(n){return Object.prototype.toString.call(n)==="[object Date]"}function qg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function P0(n){return Array.isArray(n)?n:[n]}function Cu(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function F0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function $s(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function bi(n,e,t){return zo(n)&&n>=e&&n<=t}function N0(n,e){return n-e*Math.floor(n/e)}function Yt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Oi(n){if(!(tt(n)||n===null||n===""))return parseInt(n,10)}function Hi(n){if(!(tt(n)||n===null||n===""))return parseFloat(n)}function Ca(n){if(!(tt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function $a(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function wl(n){return n%4===0&&(n%100!==0||n%400===0)}function el(n){return wl(n)?366:365}function ho(n,e){const t=N0(e-1,12)+1,i=n+(e-t)/12;return t===2?wl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ta(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(e.getUTCFullYear()-1900)),+e}function _o(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Ur(n){return n>99?n:n>60?1900+n:2e3+n}function jg(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).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,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function zg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Vn(`Invalid unit value ${n}`);return e}function go(n,e){const t={};for(const i in n)if($s(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=zg(s)}return t}function tl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Yt(t,2)}:${Yt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Yt(t,2)}${Yt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ho(n){return F0(n,["hour","minute","second","millisecond"])}const Vg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,R0=["January","February","March","April","May","June","July","August","September","October","November","December"],Hg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],q0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Bg(n){switch(n){case"narrow":return[...q0];case"short":return[...Hg];case"long":return[...R0];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 Ug=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Wg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],j0=["M","T","W","T","F","S","S"];function Yg(n){switch(n){case"narrow":return[...j0];case"short":return[...Wg];case"long":return[...Ug];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Kg=["AM","PM"],z0=["Before Christ","Anno Domini"],V0=["BC","AD"],H0=["B","A"];function Jg(n){switch(n){case"narrow":return[...H0];case"short":return[...V0];case"long":return[...z0];default:return null}}function B0(n){return Kg[n.hour<12?0:1]}function U0(n,e){return Yg(e)[n.weekday-1]}function W0(n,e){return Bg(e)[n.month-1]}function Y0(n,e){return Jg(e)[n.year<0?0:1]}function K0(n,e,t="always",i=!1){const s={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."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function $u(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const J0={D:Br,DD:vg,DDD:yg,DDDD:kg,t:wg,tt:Sg,ttt:Cg,tttt:$g,T:Tg,TT:Mg,TTT:Og,TTTT:Eg,f:Dg,ff:Ig,fff:Pg,ffff:Ng,F:Ag,FF:Lg,FFF:Fg,FFFF:Rg};class wn{static create(e,t={}){return new wn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return J0[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()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Yt(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",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,_)=>this.loc.extract(e,m,_),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?B0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,_)=>i?W0(e,m):l(_?{month:m}:{month:m,day:"numeric"},"month"),u=(m,_)=>i?U0(e,m):l(_?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const _=wn.macroTokenToFormatOpts(m);return _?this.formatWithSystemDefault(e,_):m},c=m=>i?Y0(e,m):l({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 s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({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 s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({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 s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({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"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 f(m)}};return $u(wn.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}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return $u(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Sl{get type(){throw new Ti}get name(){throw new Ti}get ianaName(){return this.name}get isUniversal(){throw new Ti}offsetName(e,t){throw new Ti}formatOffset(e,t){throw new Ti}offset(e){throw new Ti}equals(e){throw new Ti}get isValid(){throw new Ti}}let ir=null;class Ma extends Sl{static get instance(){return ir===null&&(ir=new Ma),ir}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return jg(e,t,i)}formatOffset(e,t){return tl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let lo={};function Z0(n){return lo[n]||(lo[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"})),lo[n]}const G0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function X0(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function Q0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?_:1e3+_,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let sr=null;class _n extends Sl{static get utcInstance(){return sr===null&&(sr=new _n(0)),sr}static instance(e){return e===0?_n.utcInstance:new _n(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new _n(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${tl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${tl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return tl(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 x0 extends Sl{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 Ei(n,e){if(tt(n)||n===null)return e;if(n instanceof Sl)return n;if(I0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?_n.utcInstance:_n.parseSpecifier(t)||vi.create(n)}else return es(n)?_n.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new x0(n)}let Tu=()=>Date.now(),Mu="system",Ou=null,Eu=null,Du=null,Au;class Zt{static get now(){return Tu}static set now(e){Tu=e}static set defaultZone(e){Mu=e}static get defaultZone(){return Ei(Mu,Ma.instance)}static get defaultLocale(){return Ou}static set defaultLocale(e){Ou=e}static get defaultNumberingSystem(){return Eu}static set defaultNumberingSystem(e){Eu=e}static get defaultOutputCalendar(){return Du}static set defaultOutputCalendar(e){Du=e}static get throwOnInvalid(){return Au}static set throwOnInvalid(e){Au=e}static resetCaches(){It.resetCache(),vi.resetCache()}}let Iu={};function ev(n,e={}){const t=JSON.stringify([n,e]);let i=Iu[t];return i||(i=new Intl.ListFormat(n,e),Iu[t]=i),i}let Wr={};function Yr(n,e={}){const t=JSON.stringify([n,e]);let i=Wr[t];return i||(i=new Intl.DateTimeFormat(n,e),Wr[t]=i),i}let Kr={};function tv(n,e={}){const t=JSON.stringify([n,e]);let i=Kr[t];return i||(i=new Intl.NumberFormat(n,e),Kr[t]=i),i}let Jr={};function nv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Jr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Jr[s]=l),l}let Xs=null;function iv(){return Xs||(Xs=new Intl.DateTimeFormat().resolvedOptions().locale,Xs)}function sv(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Yr(n).resolvedOptions()}catch{t=Yr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function lv(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function ov(n){const e=[];for(let t=1;t<=12;t++){const i=He.utc(2016,t,1);e.push(n(i))}return e}function rv(n){const e=[];for(let t=1;t<=7;t++){const i=He.utc(2016,11,13+t);e.push(n(i))}return e}function Rl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function av(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 uv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=tv(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):$a(e,3);return Yt(t,this.padTo)}}}class fv{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&vi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:He.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Yr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class cv{constructor(e,t,i){this.opts={style:"long",...i},!t&&qg()&&(this.rtf=nv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):K0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class It{static fromOpts(e){return It.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Zt.defaultLocale,o=l||(s?"en-US":iv()),r=t||Zt.defaultNumberingSystem,a=i||Zt.defaultOutputCalendar;return new It(o,r,a,l)}static resetCache(){Xs=null,Wr={},Kr={},Jr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return It.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=sv(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=lv(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=av(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:It.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Rl(this,e,i,Bg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=ov(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Rl(this,e,i,Yg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=rv(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Rl(this,void 0,e,()=>Kg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[He.utc(2016,11,13,9),He.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Rl(this,e,t,Jg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[He.utc(-40,1,1),He.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new uv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new fv(e,this.intl,t)}relFormatter(e={}){return new cv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ev(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Is(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ls(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ps(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function Zg(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(_||m&&f)?-m:m;return[{years:d(Hi(t)),months:d(Hi(i)),weeks:d(Hi(s)),days:d(Hi(l)),hours:d(Hi(o)),minutes:d(Hi(r)),seconds:d(Hi(a),a==="-0"),milliseconds:d(Ca(u),c)}]}const Cv={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 Da(n,e,t,i,s,l,o){const r={year:e.length===2?Ur(Oi(e)):Oi(e),month:Hg.indexOf(t)+1,day:Oi(i),hour:Oi(s),minute:Oi(l)};return o&&(r.second=Oi(o)),n&&(r.weekday=n.length>3?Ug.indexOf(n)+1:Wg.indexOf(n)+1),r}const $v=/^(?:(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 Tv(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Da(e,s,i,t,l,o,r);let m;return a?m=Cv[a]:u?m=0:m=Vo(f,c),[d,new _n(m)]}function Mv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ov=/^(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$/,Ev=/^(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$/,Dv=/^(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 Lu(n){const[,e,t,i,s,l,o,r]=n;return[Da(e,s,i,t,l,o,r),_n.utcInstance]}function Av(n){const[,e,t,i,s,l,o,r]=n;return[Da(e,r,t,i,s,l,o),_n.utcInstance]}const Iv=Is(pv,Ea),Lv=Is(mv,Ea),Pv=Is(hv,Ea),Fv=Is(Xg),xg=Ls(yv,Fs,Cl,$l),Nv=Ls(_v,Fs,Cl,$l),Rv=Ls(gv,Fs,Cl,$l),qv=Ls(Fs,Cl,$l);function jv(n){return Ps(n,[Iv,xg],[Lv,Nv],[Pv,Rv],[Fv,qv])}function zv(n){return Ps(Mv(n),[$v,Tv])}function Vv(n){return Ps(n,[Ov,Lu],[Ev,Lu],[Dv,Av])}function Hv(n){return Ps(n,[wv,Sv])}const Bv=Ls(Fs);function Uv(n){return Ps(n,[kv,Bv])}const Wv=Is(bv,vv),Yv=Is(Qg),Kv=Ls(Fs,Cl,$l);function Jv(n){return Ps(n,[Wv,xg],[Yv,Kv])}const Zv="Invalid Duration",eb={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}},Gv={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},...eb},Fn=146097/400,ps=146097/4800,Xv={years:{quarters:4,months:12,weeks:Fn/7,days:Fn,hours:Fn*24,minutes:Fn*24*60,seconds:Fn*24*60*60,milliseconds:Fn*24*60*60*1e3},quarters:{months:3,weeks:Fn/28,days:Fn/4,hours:Fn*24/4,minutes:Fn*24*60/4,seconds:Fn*24*60*60/4,milliseconds:Fn*24*60*60*1e3/4},months:{weeks:ps/7,days:ps,hours:ps*24,minutes:ps*24*60,seconds:ps*24*60*60,milliseconds:ps*24*60*60*1e3},...eb},Ji=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Qv=Ji.slice(0).reverse();function Bi(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};return new ot(i)}function xv(n){return n<0?Math.floor(n):Math.ceil(n)}function tb(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?xv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function ey(n,e){Qv.reduce((t,i)=>tt(e[i])?t:(t&&tb(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||It.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Xv:Gv,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 Vn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:go(e,ot.normalizeUnit),loc:It.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(es(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Vn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Hv(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]=Uv(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 Vn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new E0(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?wn.create(this.loc,i).formatDurationFromString(this,e):Zv}toHuman(e={}){const t=Ji.map(i=>{const s=this.values[i];return tt(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).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+=$a(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e),i={};for(const s of Ji)($s(t.values,s)||$s(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Bi(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]=zg(e(this.values[i],i));return Bi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...go(e,ot.normalizeUnit)};return Bi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Bi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return ey(this.matrix,e),Bi(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={},s=this.toObject();let l;for(const o of Ji)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;es(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Ji.indexOf(u)>Ji.indexOf(o)&&tb(this.matrix,s,u,t,o)}else es(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Bi(this,{values:t},!0).normalize()}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 Bi(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,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Ji)if(!t(this.values[i],e.values[i]))return!1;return!0}}const js="Invalid Interval";function ty(n,e){return!n||!n.isValid?Pt.invalid("missing or invalid start"):!e||!e.isValid?Pt.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?Pt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Pt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Pt.fromDateTimes(i,l)),i=l,s+=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:Pt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Pt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Pt.fromDateTimes(t,a.time)),t=null);return Pt.merge(s)}difference(...e){return Pt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:js}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:js}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:js}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:js}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:js}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Pt.fromDateTimes(e(this.s),e(this.e))}}class ql{static hasDST(e=Zt.defaultZone){const t=He.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return vi.isValidZone(e)}static normalizeZone(e){return Ei(e,Zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||It.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||It.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||It.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||It.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return It.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return It.create(t,null,"gregory").eras(e)}static features(){return{relative:qg()}}}function Pu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function ny(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Pu(r,a);return(u-u%7)/7}],["days",Pu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function iy(n,e,t,i){let[s,l,o,r]=ny(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Aa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Fu={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]},sy=Aa.hanidec.replace(/[\[|\]]/g,"").split("");function ly(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Zn({numberingSystem:n},e=""){return new RegExp(`${Aa[n||"latn"]}${e}`)}const oy="missing Intl.DateTimeFormat.formatToParts support";function ut(n,e=t=>t){return{regex:n,deser:([t])=>e(ly(t))}}const ry=String.fromCharCode(160),nb=`[ ${ry}]`,ib=new RegExp(nb,"g");function ay(n){return n.replace(/\./g,"\\.?").replace(ib,nb)}function Nu(n){return n.replace(/\./g,"").replace(ib," ").toLowerCase()}function Gn(n,e){return n===null?null:{regex:RegExp(n.map(ay).join("|")),deser:([t])=>n.findIndex(i=>Nu(t)===Nu(i))+e}}function Ru(n,e){return{regex:n,deser:([,t,i])=>Vo(t,i),groups:e}}function lr(n){return{regex:n,deser:([e])=>e}}function uy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function fy(n,e){const t=Zn(e),i=Zn(e,"{2}"),s=Zn(e,"{3}"),l=Zn(e,"{4}"),o=Zn(e,"{6}"),r=Zn(e,"{1,2}"),a=Zn(e,"{1,3}"),u=Zn(e,"{1,6}"),f=Zn(e,"{1,9}"),c=Zn(e,"{2,4}"),d=Zn(e,"{4,6}"),m=g=>({regex:RegExp(uy(g.val)),deser:([y])=>y,literal:!0}),h=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Gn(e.eras("short",!1),0);case"GG":return Gn(e.eras("long",!1),0);case"y":return ut(u);case"yy":return ut(c,Ur);case"yyyy":return ut(l);case"yyyyy":return ut(d);case"yyyyyy":return ut(o);case"M":return ut(r);case"MM":return ut(i);case"MMM":return Gn(e.months("short",!0,!1),1);case"MMMM":return Gn(e.months("long",!0,!1),1);case"L":return ut(r);case"LL":return ut(i);case"LLL":return Gn(e.months("short",!1,!1),1);case"LLLL":return Gn(e.months("long",!1,!1),1);case"d":return ut(r);case"dd":return ut(i);case"o":return ut(a);case"ooo":return ut(s);case"HH":return ut(i);case"H":return ut(r);case"hh":return ut(i);case"h":return ut(r);case"mm":return ut(i);case"m":return ut(r);case"q":return ut(r);case"qq":return ut(i);case"s":return ut(r);case"ss":return ut(i);case"S":return ut(a);case"SSS":return ut(s);case"u":return lr(f);case"uu":return lr(r);case"uuu":return ut(t);case"a":return Gn(e.meridiems(),0);case"kkkk":return ut(l);case"kk":return ut(c,Ur);case"W":return ut(r);case"WW":return ut(i);case"E":case"c":return ut(t);case"EEE":return Gn(e.weekdays("short",!1,!1),1);case"EEEE":return Gn(e.weekdays("long",!1,!1),1);case"ccc":return Gn(e.weekdays("short",!0,!1),1);case"cccc":return Gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ru(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ru(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return lr(/[a-z_+-/]{1,256}?/i);default:return m(g)}})(n)||{invalidReason:oy};return h.token=n,h}const cy={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function dy(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=cy[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function py(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function my(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if($s(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function hy(n){const e=l=>{switch(l){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 tt(n.z)||(t=vi.create(n.z)),tt(n.Z)||(t||(t=new _n(n.Z)),i=n.Z),tt(n.q)||(n.M=(n.q-1)*3+1),tt(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),tt(n.u)||(n.S=Ca(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let or=null;function _y(){return or||(or=He.fromMillis(1555555555555)),or}function gy(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(_y()).map(o=>dy(o,e,t));return l.includes(void 0)?n:l}function by(n,e){return Array.prototype.concat(...n.map(t=>gy(t,e)))}function sb(n,e,t){const i=by(wn.parseFormat(t),n),s=i.map(o=>fy(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=py(s),a=RegExp(o,"i"),[u,f]=my(e,a,r),[c,d,m]=f?hy(f):[null,null,void 0];if($s(f,"a")&&$s(f,"H"))throw new Gs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:m}}}function vy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=sb(n,e,t);return[i,s,l,o]}const lb=[0,31,59,90,120,151,181,212,243,273,304,334],ob=[0,31,60,91,121,152,182,213,244,274,305,335];function Bn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function rb(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function ab(n,e,t){return t+(wl(n)?ob:lb)[e-1]}function ub(n,e){const t=wl(n)?ob:lb,i=t.findIndex(l=>l_o(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Ho(n)}}function qu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=rb(e,1,4),l=el(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=el(r)):o>l?(r=e+1,o-=el(e)):r=e;const{month:a,day:u}=ub(r,o);return{year:r,month:a,day:u,...Ho(n)}}function rr(n){const{year:e,month:t,day:i}=n,s=ab(e,t,i);return{year:e,ordinal:s,...Ho(n)}}function ju(n){const{year:e,ordinal:t}=n,{month:i,day:s}=ub(e,t);return{year:e,month:i,day:s,...Ho(n)}}function yy(n){const e=zo(n.weekYear),t=bi(n.weekNumber,1,_o(n.weekYear)),i=bi(n.weekday,1,7);return e?t?i?!1:Bn("weekday",n.weekday):Bn("week",n.week):Bn("weekYear",n.weekYear)}function ky(n){const e=zo(n.year),t=bi(n.ordinal,1,el(n.year));return e?t?!1:Bn("ordinal",n.ordinal):Bn("year",n.year)}function fb(n){const e=zo(n.year),t=bi(n.month,1,12),i=bi(n.day,1,ho(n.year,n.month));return e?t?i?!1:Bn("day",n.day):Bn("month",n.month):Bn("year",n.year)}function cb(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=bi(e,0,23)||e===24&&t===0&&i===0&&s===0,o=bi(t,0,59),r=bi(i,0,59),a=bi(s,0,999);return l?o?r?a?!1:Bn("millisecond",s):Bn("second",i):Bn("minute",t):Bn("hour",e)}const ar="Invalid DateTime",zu=864e13;function jl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function ur(n){return n.weekData===null&&(n.weekData=Zr(n.c)),n.weekData}function zs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new He({...t,...e,old:t})}function db(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Vu(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 db(Ta(n),e,t)}function Hu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,ho(i,s))+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=Ta(l);let[a,u]=db(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=He.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return He.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function zl(n,e,t=!0){return n.isValid?wn.create(It.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function fr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Yt(n.c.year,t?6:4),e?(i+="-",i+=Yt(n.c.month),i+="-",i+=Yt(n.c.day)):(i+=Yt(n.c.month),i+=Yt(n.c.day)),i}function Bu(n,e,t,i,s,l){let o=Yt(n.c.hour);return e?(o+=":",o+=Yt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Yt(n.c.minute),(n.c.second!==0||!t)&&(o+=Yt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Yt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Yt(Math.trunc(-n.o/60)),o+=":",o+=Yt(Math.trunc(-n.o%60))):(o+="+",o+=Yt(Math.trunc(n.o/60)),o+=":",o+=Yt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const pb={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},wy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Sy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},mb=["year","month","day","hour","minute","second","millisecond"],Cy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],$y=["year","ordinal","hour","minute","second","millisecond"];function Uu(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 Wu(n,e){const t=Ei(e.zone,Zt.defaultZone),i=It.fromObject(e),s=Zt.now();let l,o;if(tt(n.year))l=s;else{for(const u of mb)tt(n[u])&&(n[u]=pb[u]);const r=fb(n)||cb(n);if(r)return He.invalid(r);const a=t.offset(s);[l,o]=oo(n,a,t)}return new He({ts:l,zone:t,loc:i,o})}function Yu(n,e,t){const i=tt(t.round)?!0:t.round,s=(o,r)=>(o=$a(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=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 s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Ku(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 He{constructor(e){const t=e.zone||Zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:jl(t));this.ts=tt(e.ts)?Zt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Vu(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||It.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new He({})}static local(){const[e,t]=Ku(arguments),[i,s,l,o,r,a,u]=t;return Wu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Ku(arguments),[i,s,l,o,r,a,u]=t;return e.zone=_n.utcInstance,Wu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=L0(e)?e.valueOf():NaN;if(Number.isNaN(i))return He.invalid("invalid input");const s=Ei(t.zone,Zt.defaultZone);return s.isValid?new He({ts:i,zone:s,loc:It.fromObject(t)}):He.invalid(jl(s))}static fromMillis(e,t={}){if(es(e))return e<-zu||e>zu?He.invalid("Timestamp out of range"):new He({ts:e,zone:Ei(t.zone,Zt.defaultZone),loc:It.fromObject(t)});throw new Vn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(es(e))return new He({ts:e*1e3,zone:Ei(t.zone,Zt.defaultZone),loc:It.fromObject(t)});throw new Vn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ei(t.zone,Zt.defaultZone);if(!i.isValid)return He.invalid(jl(i));const s=Zt.now(),l=tt(t.specificOffset)?i.offset(s):t.specificOffset,o=go(e,Uu),r=!tt(o.ordinal),a=!tt(o.year),u=!tt(o.month)||!tt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=It.fromObject(t);if((f||r)&&c)throw new Gs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Gs("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let _,h,g=Vu(s,l);m?(_=Cy,h=wy,g=Zr(g)):r?(_=$y,h=Sy,g=rr(g)):(_=mb,h=pb);let y=!1;for(const D of _){const I=o[D];tt(I)?y?o[D]=h[D]:o[D]=g[D]:y=!0}const S=m?yy(o):r?ky(o):fb(o),$=S||cb(o);if($)return He.invalid($);const C=m?qu(o):r?ju(o):o,[T,M]=oo(C,l,i),O=new He({ts:T,zone:i,o:M,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?He.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=jv(e);return Vs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=zv(e);return Vs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Vv(e);return Vs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(tt(e)||tt(t))throw new Vn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=It.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=vy(o,e,t);return f?He.invalid(f):Vs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return He.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Jv(e);return Vs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new M0(i);return new He({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}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?ur(this).weekYear:NaN}get weekNumber(){return this.isValid?ur(this).weekNumber:NaN}get weekday(){return this.isValid?ur(this).weekday:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?ql.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ql.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ql.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ql.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}get isInLeapYear(){return wl(this.year)}get daysInMonth(){return ho(this.year,this.month)}get daysInYear(){return this.isValid?el(this.year):NaN}get weeksInWeekYear(){return this.isValid?_o(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(_n.instance(e),t)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ei(e,Zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=oo(o,l,e)}return zs(this,{ts:s,zone:e})}else return He.invalid(jl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=go(e,Uu),i=!tt(t.weekYear)||!tt(t.weekNumber)||!tt(t.weekday),s=!tt(t.ordinal),l=!tt(t.year),o=!tt(t.month)||!tt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Gs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Gs("Can't mix ordinal dates with month/day");let u;i?u=qu({...Zr(this.c),...t}):tt(t.ordinal)?(u={...this.toObject(),...t},tt(t.day)&&(u.day=Math.min(ho(u.year,u.month),u.day))):u=ju({...rr(this.c),...t});const[f,c]=oo(u,this.o,this.zone);return zs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return zs(this,Hu(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return zs(this,Hu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ar}toLocaleString(e=Br,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):ar}toLocaleParts(e={}){return this.isValid?wn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=fr(this,o);return r+="T",r+=Bu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?fr(this,e==="extended"):null}toISOWeekDate(){return zl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Bu(this,o==="extended",t,e,i,l):null}toRFC2822(){return zl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?fr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),zl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ar}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ot.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=P0(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=iy(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(He.now(),e,t)}until(e){return this.isValid?Pt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}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||He.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(He.isDateTime))throw new Vn("max requires all arguments be DateTimes");return Cu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=It.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return sb(o,e,t)}static fromStringExplain(e,t,i={}){return He.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Br}static get DATE_MED(){return vg}static get DATE_MED_WITH_WEEKDAY(){return D0}static get DATE_FULL(){return yg}static get DATE_HUGE(){return kg}static get TIME_SIMPLE(){return wg}static get TIME_WITH_SECONDS(){return Sg}static get TIME_WITH_SHORT_OFFSET(){return Cg}static get TIME_WITH_LONG_OFFSET(){return $g}static get TIME_24_SIMPLE(){return Tg}static get TIME_24_WITH_SECONDS(){return Mg}static get TIME_24_WITH_SHORT_OFFSET(){return Og}static get TIME_24_WITH_LONG_OFFSET(){return Eg}static get DATETIME_SHORT(){return Dg}static get DATETIME_SHORT_WITH_SECONDS(){return Ag}static get DATETIME_MED(){return Ig}static get DATETIME_MED_WITH_SECONDS(){return Lg}static get DATETIME_MED_WITH_WEEKDAY(){return A0}static get DATETIME_FULL(){return Pg}static get DATETIME_FULL_WITH_SECONDS(){return Fg}static get DATETIME_HUGE(){return Ng}static get DATETIME_HUGE_WITH_SECONDS(){return Rg}}function Hs(n){if(He.isDateTime(n))return n;if(n&&n.valueOf&&es(n.valueOf()))return He.fromJSDate(n);if(n&&typeof n=="object")return He.fromObject(n);throw new Vn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Ty=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],My=[".mp4",".avi",".mov",".3gp",".wmv"],Oy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Ey=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class z{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||z.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.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return z.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!z.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!z.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){z.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=z.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!z.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!z.isObject(l)&&!Array.isArray(l)||!z.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!z.isObject(s)&&!Array.isArray(s)||!z.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):z.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||z.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||z.isObject(e)&&Object.keys(e).length>0)&&z.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s=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 He.fromFormat(e,i,{zone:"UTC"})}return He.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.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.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",z.download(i,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!!Ty.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!My.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Oy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Ey.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return z.hasImageExtension(e)?"image":z.hasDocumentExtension(e)?"document":z.hasVideoExtension(e)?"video":z.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(z.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)z.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):z.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,m,_;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||z.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||z.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const h of t){let g=null;h.type==="number"?g=123:h.type==="date"?g="2022-01-01 10:00:00.123Z":h.type==="bool"?g=!0:h.type==="email"?g="test@example.com":h.type==="url"?g="https://example.com":h.type==="json"?g="JSON":h.type==="file"?(g="filename.jpg",((f=h.options)==null?void 0:f.maxSelect)!==1&&(g=[g])):h.type==="select"?(g=(d=(c=h.options)==null?void 0:c.values)==null?void 0:d[0],((m=h.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):h.type==="relation"?(g="RELATION_RECORD_ID",((_=h.options)==null?void 0:_.maxSelect)!==1&&(g=[g])):g="test",l[h.name]=g}return l}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}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 u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=z.isObject(u)&&z.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(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(){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"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample direction | code fullscreen",file_picker_types:"image",file_picker_callback:(e,t,i)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",l=>{const o=l.target.files[0],r=new FileReader;r.addEventListener("load",()=>{if(!tinymce)return;const a="blobid"+new Date().getTime(),u=tinymce.activeEditor.editorUpload.blobCache,f=r.result.split(",")[1],c=u.create(a,o,f);u.add(c),e(c.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()},setup:e=>{e.on("keydown",i=>{(i.ctrlKey||i.metaKey)&&i.code=="KeyS"&&e.formElement&&(i.preventDefault(),i.stopPropagation(),e.formElement.dispatchEvent(new KeyboardEvent("keydown",i)))});const t="tinymce_last_direction";e.on("init",()=>{var s;const i=(s=window==null?void 0:window.localStorage)==null?void 0:s.getItem(t);!e.isDirty()&&e.getContent()==""&&i=="rtl"&&e.execCommand("mceDirectionRTL")}),e.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:i=>{i([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var l;(l=window==null?void 0:window.localStorage)==null||l.setItem(t,"ltr"),tinymce.activeEditor.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var l;(l=window==null?void 0:window.localStorage)==null||l.setItem(t,"rtl"),tinymce.activeEditor.execCommand("mceDirectionRTL")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=z.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","label","heading","message","key","id"];for(const o of l){let r=z.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(z.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?z.plainText(e):e,z.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return z.truncate(JSON.stringify(e))||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/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of z.extractColumnsFromQuery(e.options.query))z.pushUnique(i,t+l);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 s=e.schema||[];for(const l of s)z.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/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((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!z.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const h=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((h==null?void 0:h.length)!=4)continue;const g=(c=(f=h[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");g&&t.columns.push({name:g,collate:h[2]||"",sort:((d=h[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[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_"+z.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` - `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, - `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=z.parseIndex(e);return i.tableName=t,z.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=z.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?z.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}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)}}const Bo=An([]);function bo(n,e=4e3){return Uo(n,"info",e)}function Ht(n,e=3e3){return Uo(n,"success",e)}function Ts(n,e=4500){return Uo(n,"error",e)}function Dy(n,e=4500){return Uo(n,"warning",e)}function Uo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{hb(i)},t)};Bo.update(s=>(La(s,i.message),z.pushOrReplaceByKey(s,i,"message"),s))}function hb(n){Bo.update(e=>(La(e,n),e))}function Ia(){Bo.update(n=>{for(let e of n)La(n,e);return[]})}function La(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}const wi=An({});function tn(n){wi.set(n||{})}function ai(n){wi.update(e=>(z.deleteByPath(e,n),e))}const Pa=An({});function Gr(n){Pa.set(n||{})}const fi=An([]),yi=An({}),vo=An(!1),_b=An({});function Ay(n){fi.update(e=>{const t=z.findByKey(e,"id",n);return t?yi.set(t):e.length&&yi.set(e[0]),e})}function Iy(n){yi.update(e=>z.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),fi.update(e=>(z.pushOrReplaceByKey(e,n,"id"),Fa(),z.sortCollections(e)))}function Ly(n){fi.update(e=>(z.removeByKey(e,"id",n.id),yi.update(t=>t.id===n.id?e[0]:t),Fa(),e))}async function Py(n=null){vo.set(!0);try{let e=await fe.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),fi.set(e);const t=n&&z.findByKey(e,"id",n);t?yi.set(t):e.length&&yi.set(e[0]),Fa()}catch(e){fe.error(e)}vo.set(!1)}function Fa(){_b.update(n=>(fi.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const cr="pb_admin_file_token";jo.prototype.logout=function(n=!0){this.authStore.clear(),n&&qi("/login")};jo.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,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Ts(l),z.isEmpty(s.data)||tn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),qi("/")};jo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=z1(_b);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||hg(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 Fy extends _g{save(e,t){super.save(e,t),t&&!t.collectionId&&Gr(t)}clear(){super.clear(),Gr(null)}}const fe=new jo("../",new Fy("pb_admin_auth"));fe.authStore.model&&!fe.authStore.model.collectionId&&Gr(fe.authStore.model);function Ny(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=n[3].default,_=wt(m,n,n[2],null);return{c(){e=v("div"),t=v("main"),_&&_.c(),i=E(),s=v("footer"),l=v("a"),l.innerHTML=` - Docs`,o=E(),r=v("span"),r.textContent="|",a=E(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.17.5",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"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(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(h,g){w(h,e,g),b(e,t),_&&_.m(t,null),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(u,f),d=!0},p(h,[g]){_&&_.p&&(!d||g&4)&&Ct(_,m,h,h[2],d?St(m,h[2],g,null):$t(h[2]),null),(!d||g&2&&c!==(c="page-wrapper "+h[1]))&&p(e,"class",c),(!d||g&3)&&Q(e,"center-content",h[0])},i(h){d||(A(_,h),d=!0)},o(h){L(_,h),d=!1},d(h){h&&k(e),_&&_.d(h)}}}function Ry(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Sn extends ve{constructor(e){super(),be(this,e,Ry,Ny,me,{center:0,class:1})}}function Ju(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=``,t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function qy(n){let e,t,i,s=!n[0]&&Ju();const l=n[1].default,o=wt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Ju(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Ct(o,l,r,r[2],i?St(l,r[2],a,null):$t(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function jy(n){let e,t;return e=new Sn({props:{class:"full-page",center:!0,$$slots:{default:[qy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function zy(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class gb extends ve{constructor(e){super(),be(this,e,zy,jy,me,{nobranding:0})}}function Wo(n){const e=n-1;return e*e*e+1}function Xr(n,{delay:e=0,duration:t=400,easing:i=vl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ui(n,{delay:e=0,duration:t=400,easing:i=Wo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pu(s),[m,_]=pu(l);return{delay:e,duration:t,easing:i,css:(h,g)=>` - transform: ${u} translate(${(1-h)*c}${d}, ${(1-h)*m}${_}); - opacity: ${a-f*g}`}}function st(n,{delay:e=0,duration:t=400,easing:i=Wo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),h=parseFloat(l[`border${f[0]}Width`]),g=parseFloat(l[`border${f[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-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*m}px;margin-${u[1]}: ${y*_}px;border-${u[0]}-width: ${y*h}px;border-${u[1]}-width: ${y*g}px;`}}function Jt(n,{delay:e=0,duration:t=400,easing:i=Wo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` - transform: ${a} scale(${1-u*d}); - opacity: ${r-f*d} - `}}let Qr,Ui;const xr="app-tooltip";function Zu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Pi(){return Ui=Ui||document.querySelector("."+xr),Ui||(Ui=document.createElement("div"),Ui.classList.add(xr),document.body.appendChild(Ui)),Ui}function bb(n,e){let t=Pi();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" 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,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),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 ea(){clearTimeout(Qr),Pi().classList.remove("active"),Pi().activeNode=void 0}function Vy(n,e){Pi().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Pi().classList.add("active"),bb(n,e)},isNaN(e.delay)?0:e.delay)}function ze(n,e){let t=Zu(e);function i(){Vy(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&z.isFocusable(n))&&n.addEventListener("click",s),Pi(),{update(l){var o,r;t=Zu(l),(r=(o=Pi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&bb(n,t)},destroy(){var l,o;(o=(l=Pi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Gu(n,e,t){const i=n.slice();return i[12]=e[t],i}const Hy=n=>({}),Xu=n=>({uniqueId:n[4]});function By(n){let e,t,i=n[3],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=qe(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Qu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=yo(a[12])+"")&&se(s,i)},i(a){r||(a&&Ge(()=>{r&&(o||(o=qe(e,st,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,st,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Wy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=wt(a,n,n[8],Xu),f=[Uy,By],c=[];function d(m,_){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(m,_){w(m,e,_),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Ct(u,a,m,m[8],l?St(a,m[8],_,Hy):$t(m[8]),Xu);let h=i;i=d(m),i===h?c[i].p(m,_):(ae(),L(c[h],1,1,()=>{c[h]=null}),ue(),s=c[i],s?s.p(m,_):(s=c[i]=f[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&p(e,"class",m[1]),(!l||_&10)&&Q(e,"error",m[3].length)},i(m){l||(A(u,m),A(s),l=!0)},o(m){L(u,m),L(s),l=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const xu="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||xu:n||xu}function Yy(n,e,t){let i;Ke(n,wi,h=>t(7,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ai(r)}Xt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Fe.call(this,n,h)}function _(h){te[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=z.toArray(z.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,Yy,Wy,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Ky(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Jy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[1]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function Zy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Gy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[Ky,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[Jy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Zy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),B(s.$$.fragment),l=E(),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),f=v("button"),f.innerHTML=`Create and login - `,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(_,h){w(_,e,h),b(e,t),b(e,i),V(s,e,null),b(e,l),V(o,e,null),b(e,r),V(a,e,null),b(e,u),b(e,f),c=!0,d||(m=Y(e,"submit",Qe(n[4])),d=!0)},p(_,[h]){const g={};h&1537&&(g.$$scope={dirty:h,ctx:_}),s.$set(g);const y={};h&1538&&(y.$$scope={dirty:h,ctx:_}),o.$set(y);const S={};h&1540&&(S.$$scope={dirty:h,ctx:_}),a.$set(S),(!c||h&8)&&Q(f,"btn-disabled",_[3]),(!c||h&8)&&Q(f,"btn-loading",_[3])},i(_){c||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),c=!0)},o(_){L(s.$$.fragment,_),L(o.$$.fragment,_),L(a.$$.fragment,_),c=!1},d(_){_&&k(e),H(s),H(o),H(a),d=!1,m()}}}function Xy(n,e,t){const i=Tt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await fe.admins.create({email:s,password:l,passwordConfirm:o}),await fe.admins.authWithPassword(s,l),i("submit")}catch(d){fe.error(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class Qy extends ve{constructor(e){super(),be(this,e,Xy,Gy,me,{})}}function ef(n){let e,t;return e=new gb({props:{$$slots:{default:[xy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xy(n){let e,t;return e=new Qy({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ek(n){let e,t,i=n[0]&&ef(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=ef(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),L(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function tk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){fe.logout(!1),t(0,i=!0);return}fe.authStore.isValid?qi("/collections"):fe.logout()}return[i,async()=>{t(0,i=!1),await cn(),window.location.search=""}]}class nk extends ve{constructor(e){super(),be(this,e,tk,ek,me,{})}}const Dt=An(""),ko=An(""),Ms=An(!1);function ik(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function sk(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){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=Rt(o,r(n)),te.push(()=>ce(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],he(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function tf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,ui,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,ui,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function nf(n){let e,t,i,s,l;return{c(){e=v("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,s||(l=Y(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,ui,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,ui,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function lk(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[sk,ik],m=[];function _(y,S){return y[4]&&!y[5]?0:1}l=_(n),o=m[l]=d[l](n);let h=(n[0].length||n[7].length)&&n[7]!=n[0]&&tf(),g=(n[0].length||n[7].length)&&nf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=E(),o.c(),r=E(),h&&h.c(),a=E(),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),b(e,t),b(t,i),b(e,s),m[l].m(e,null),b(e,r),h&&h.m(e,null),b(e,a),g&&g.m(e,null),u=!0,f||(c=[Y(e,"click",Dn(n[11])),Y(e,"submit",Qe(n[10]))],f=!0)},p(y,[S]){let $=l;l=_(y),l===$?m[l].p(y,S):(ae(),L(m[$],1,1,()=>{m[$]=null}),ue(),o=m[l],o?o.p(y,S):(o=m[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?h?S&129&&A(h,1):(h=tf(),h.c(),A(h,1),h.m(e,a)):h&&(ae(),L(h,1,1,()=>{h=null}),ue()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&A(g,1)):(g=nf(y),g.c(),A(g,1),g.m(e,null)):g&&(ae(),L(g,1,1,()=>{g=null}),ue())},i(y){u||(A(o),A(h),A(g),u=!0)},o(y){L(o),L(h),L(g),u=!1},d(y){y&&k(e),m[l].d(),h&&h.d(),g&&g.d(),f=!1,Oe(c)}}}function ok(n,e,t){const i=Tt(),s="search_"+z.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=z.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(T=!0){t(7,d=""),T&&(c==null||c.focus()),i("clear")}function _(){t(0,l=d),i("submit",l)}async function h(){u||f||(t(5,f=!0),t(4,u=(await at(()=>import("./FilterAutocompleteInput-0c84d8aa.js"),["./FilterAutocompleteInput-0c84d8aa.js","./index-fd4289fb.js"],import.meta.url)).default),t(5,f=!1))}Xt(()=>{h()});function g(T){Fe.call(this,n,T)}function y(T){d=T,t(7,d),t(0,l)}function S(T){te[T?"unshift":"push"](()=>{c=T,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const C=()=>{m(!1),_()};return n.$$set=T=>{"value"in T&&t(0,l=T.value),"placeholder"in T&&t(1,o=T.placeholder),"autocompleteCollection"in T&&t(2,r=T.autocompleteCollection),"extraAutocompleteKeys"in T&&t(3,a=T.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,_,g,y,S,$,C]}class Yo extends ve{constructor(e){super(),be(this,e,ok,lk,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function rk(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("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"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),b(e,t),l||(o=[$e(s=ze.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&jt(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,Oe(o)}}}function ak(n,e,t){const i=Tt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Xt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Ko extends ve{constructor(e){super(),be(this,e,ak,rk,me,{tooltip:0,class:1})}}function uk(n){let e,t,i,s,l;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Ct(r,o,a,a[5],i?St(o,a[5],u,null):$t(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Oe(l)}}}function fk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=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,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class un extends ve{constructor(e){super(),be(this,e,fk,uk,me,{class:1,name:2,sort:0,disable:3})}}function ck(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function dk(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("div"),i=U(n[2]),s=E(),l=v("div"),o=U(n[1]),r=U(" UTC"),p(t,"class","date"),p(l,"class","time svelte-zdiknu"),p(e,"class","datetime svelte-zdiknu")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r)},p(a,u){u&4&&se(i,a[2]),u&2&&se(o,a[1])},d(a){a&&k(e)}}}function pk(n){let e;function t(l,o){return l[0]?dk:ck}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function mk(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class ki extends ve{constructor(e){super(),be(this,e,mk,pk,me,{date:0})}}const hk=n=>({}),sf=n=>({}),_k=n=>({}),lf=n=>({});function gk(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=wt(u,n,n[4],lf),c=n[5].default,d=wt(c,n,n[4],null),m=n[5].after,_=wt(m,n,n[4],sf);return{c(){e=v("div"),f&&f.c(),t=E(),i=v("div"),d&&d.c(),l=E(),_&&_.c(),p(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),p(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(h,g){w(h,e,g),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[6](i),b(e,l),_&&_.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(h,[g]){f&&f.p&&(!o||g&16)&&Ct(f,u,h,h[4],o?St(u,h[4],g,_k):$t(h[4]),lf),d&&d.p&&(!o||g&16)&&Ct(d,c,h,h[4],o?St(c,h[4],g,null):$t(h[4]),null),(!o||g&9&&s!==(s="horizontal-scroller "+h[0]+" "+h[3]+" svelte-wc2j9h"))&&p(i,"class",s),_&&_.p&&(!o||g&16)&&Ct(_,m,h,h[4],o?St(m,h[4],g,hk):$t(h[4]),sf)},i(h){o||(A(f,h),A(d,h),A(_,h),o=!0)},o(h){L(f,h),L(d,h),L(_,h),o=!1},d(h){h&&k(e),f&&f.d(h),d&&d.d(h),n[6](null),_&&_.d(h),r=!1,Oe(a)}}}function bk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const d=o.offsetWidth,m=o.scrollWidth;m-d?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+d==m&&t(3,r+=" scroll-end")):t(3,r="")},100))}Xt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function c(d){te[d?"unshift":"push"](()=>{o=d,t(2,o)})}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"$$scope"in d&&t(4,s=d.$$scope)},[l,f,o,r,s,i,c]}class Na extends ve{constructor(e){super(),be(this,e,bk,gk,me,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function of(n,e,t){const i=n.slice();return i[23]=e[t],i}function vk(n){let e;return{c(){e=v("div"),e.innerHTML=` - Method`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="URL",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function kk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Referer",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function wk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="User IP",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Sk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Status",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Ck(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function rf(n){let e;function t(l,o){return l[6]?Tk:$k}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function $k(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&af(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=af(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Tk(n){let e;return{c(){e=v("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function af(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function uf(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ff(n,e){var Ce,Je,_t;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,_,h,g,y,S=(e[23].referer||"N/A")+"",$,C,T,M,O,D=(e[23].userIp||"N/A")+"",I,P,F,R,N,q=e[23].status+"",j,Z,X,K,J,le,ie,ee,Te,Pe,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&uf();K=new ki({props:{date:e[23].created}});function Ve(){return e[17](e[23])}function ke(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=E(),u=v("td"),f=v("span"),d=U(c),_=E(),je&&je.c(),h=E(),g=v("td"),y=v("span"),$=U(S),T=E(),M=v("td"),O=v("span"),I=U(D),F=E(),R=v("td"),N=v("span"),j=U(q),Z=E(),X=v("td"),B(K.$$.fragment),J=E(),le=v("td"),le.innerHTML='',ie=E(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(g,"class","col-type-text col-field-referer"),p(O,"class","txt txt-ellipsis"),p(O,"title",P=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),p(M,"class","col-type-number col-field-userIp"),p(N,"class","label"),Q(N,"label-danger",e[23].status>=400),p(R,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(le,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Ze,We){w(Ze,t,We),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,_),je&&je.m(u,null),b(t,h),b(t,g),b(g,y),b(y,$),b(t,T),b(t,M),b(M,O),b(O,I),b(t,F),b(t,R),b(R,N),b(N,j),b(t,Z),b(t,X),V(K,X,null),b(t,J),b(t,le),b(t,ie),ee=!0,Te||(Pe=[Y(t,"click",Ve),Y(t,"keydown",ke)],Te=!0)},p(Ze,We){var pe,_e,Ye;e=Ze,(!ee||We&8)&&l!==(l=((pe=e[23].method)==null?void 0:pe.toUpperCase())+"")&&se(o,l),(!ee||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ee||We&8)&&c!==(c=e[23].url+"")&&se(d,c),(!ee||We&8&&m!==(m=e[23].url))&&p(f,"title",m),(_e=e[23].meta)!=null&&_e.errorMessage||(Ye=e[23].meta)!=null&&Ye.errorData?je||(je=uf(),je.c(),je.m(u,null)):je&&(je.d(1),je=null),(!ee||We&8)&&S!==(S=(e[23].referer||"N/A")+"")&&se($,S),(!ee||We&8&&C!==(C=e[23].referer))&&p(y,"title",C),(!ee||We&8)&&Q(y,"txt-hint",!e[23].referer),(!ee||We&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&se(I,D),(!ee||We&8&&P!==(P=e[23].userIp))&&p(O,"title",P),(!ee||We&8)&&Q(O,"txt-hint",!e[23].userIp),(!ee||We&8)&&q!==(q=e[23].status+"")&&se(j,q),(!ee||We&8)&&Q(N,"label-danger",e[23].status>=400);const yt={};We&8&&(yt.date=e[23].created),K.$set(yt)},i(Ze){ee||(A(K.$$.fragment,Ze),ee=!0)},o(Ze){L(K.$$.fragment,Ze),ee=!1},d(Ze){Ze&&k(t),je&&je.d(),H(K),Te=!1,Oe(Pe)}}}function Mk(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I=[],P=new Map,F;function R(ke){n[11](ke)}let N={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[vk]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),s=new un({props:N}),te.push(()=>ce(s,"sort",R));function q(ke){n[12](ke)}let j={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[yk]},$$scope:{ctx:n}};n[1]!==void 0&&(j.sort=n[1]),r=new un({props:j}),te.push(()=>ce(r,"sort",q));function Z(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[kk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new un({props:X}),te.push(()=>ce(f,"sort",Z));function K(ke){n[14](ke)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[wk]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),m=new un({props:J}),te.push(()=>ce(m,"sort",K));function le(ke){n[15](ke)}let ie={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Sk]},$$scope:{ctx:n}};n[1]!==void 0&&(ie.sort=n[1]),g=new un({props:ie}),te.push(()=>ce(g,"sort",le));function ee(ke){n[16](ke)}let Te={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Ck]},$$scope:{ctx:n}};n[1]!==void 0&&(Te.sort=n[1]),$=new un({props:Te}),te.push(()=>ce($,"sort",ee));let Pe=n[3];const je=ke=>ke[23].id;for(let ke=0;kel=!1)),s.$set(Je);const _t={};Ce&67108864&&(_t.$$scope={dirty:Ce,ctx:ke}),!a&&Ce&2&&(a=!0,_t.sort=ke[1],he(()=>a=!1)),r.$set(_t);const Ze={};Ce&67108864&&(Ze.$$scope={dirty:Ce,ctx:ke}),!c&&Ce&2&&(c=!0,Ze.sort=ke[1],he(()=>c=!1)),f.$set(Ze);const We={};Ce&67108864&&(We.$$scope={dirty:Ce,ctx:ke}),!_&&Ce&2&&(_=!0,We.sort=ke[1],he(()=>_=!1)),m.$set(We);const yt={};Ce&67108864&&(yt.$$scope={dirty:Ce,ctx:ke}),!y&&Ce&2&&(y=!0,yt.sort=ke[1],he(()=>y=!1)),g.$set(yt);const pe={};Ce&67108864&&(pe.$$scope={dirty:Ce,ctx:ke}),!C&&Ce&2&&(C=!0,pe.sort=ke[1],he(()=>C=!1)),$.$set(pe),Ce&841&&(Pe=ke[3],ae(),I=bt(I,Ce,je,1,ke,Pe,P,D,Ut,ff,null,of),ue(),!Pe.length&&Ve?Ve.p(ke,Ce):Pe.length?Ve&&(Ve.d(1),Ve=null):(Ve=rf(ke),Ve.c(),Ve.m(D,null))),(!F||Ce&64)&&Q(e,"table-loading",ke[6])},i(ke){if(!F){A(s.$$.fragment,ke),A(r.$$.fragment,ke),A(f.$$.fragment,ke),A(m.$$.fragment,ke),A(g.$$.fragment,ke),A($.$$.fragment,ke);for(let Ce=0;Ce{if(P<=1&&h(),t(6,d=!1),t(5,f=R.page),t(4,c=R.totalItems),s("load",u.concat(R.items)),F){const N=++m;for(;R.items.length&&m==N;)t(3,u=u.concat(R.items.splice(0,10))),await z.yieldToMain()}else t(3,u=u.concat(R.items))}).catch(R=>{R!=null&&R.isAbort||(t(6,d=!1),console.warn(R),h(),fe.error(R,!1))})}function h(){t(3,u=[]),t(5,f=1),t(4,c=0)}function g(P){a=P,t(1,a)}function y(P){a=P,t(1,a)}function S(P){a=P,t(1,a)}function $(P){a=P,t(1,a)}function C(P){a=P,t(1,a)}function T(P){a=P,t(1,a)}const M=P=>s("select",P),O=(P,F)=>{F.code==="Enter"&&(F.preventDefault(),s("select",P))},D=()=>t(0,o=""),I=()=>_(f+1);return n.$$set=P=>{"filter"in P&&t(0,o=P.filter),"presets"in P&&t(10,r=P.presets),"sort"in P&&t(1,a=P.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(h(),_(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,_,u,c,f,d,i,s,l,r,g,y,S,$,C,T,M,O,D,I]}class Dk extends ve{constructor(e){super(),be(this,e,Ek,Ok,me,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! - * Chart.js v3.9.1 - * https://www.chartjs.org - * (c) 2022 Chart.js Contributors - * Released under the MIT License - */function pi(){}const Ak=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function Ot(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 et(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Bt(n)?n:e}function nt(n,e){return typeof n>"u"?e:n}const Ik=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,vb=(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 s,l,o;if(Ot(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Ni(n,e){return(pf[e]||(pf[e]=Fk(e)))(n)}function Fk(n){const e=Nk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Nk(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Un=n=>typeof n<"u",Ri=n=>typeof n=="function",mf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Rk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const qt=Math.PI,gt=2*qt,qk=gt+qt,Co=Number.POSITIVE_INFINITY,jk=qt/180,Nt=qt/2,Bs=qt/4,hf=qt*2/3,Hn=Math.log10,oi=Math.sign;function _f(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Hn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function zk(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)=n}function kb(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ja(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Qi=(n,e,t,i)=>ja(n,t,i?s=>n[s][e]<=t:s=>n[s][e]ja(n,t,i=>n[i][e]>=t);function Wk(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Ra(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function bf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Sb.forEach(l=>{delete n[l]}),delete n._chartjs)}function Cb(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Tb(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,$b.call(window,()=>{s=!1,n.apply(e,l)}))}}function Kk(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Jk=n=>n==="start"?"left":n==="end"?"right":"center",vf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Mb(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=fn(Math.min(Qi(r,o.axis,u).lo,t?i:Qi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=fn(Math.max(Qi(r,o.axis,f,!0).hi+1,t?0:Qi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Ob(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Vl=n=>n===0||n===1,yf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*gt/t)),kf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*gt/t)+1,sl={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*Nt)+1,easeOutSine:n=>Math.sin(n*Nt),easeInOutSine:n=>-.5*(Math.cos(qt*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=>Vl(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=>Vl(n)?n:yf(n,.075,.3),easeOutElastic:n=>Vl(n)?n:kf(n,.075,.3),easeInOutElastic(n){return Vl(n)?n:n<.5?.5*yf(n*2,.1125,.45):.5+.5*kf(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-sl.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?sl.easeInBounce(n*2)*.5:sl.easeOutBounce(n*2-1)*.5+.5};/*! - * @kurkle/color v0.2.1 - * https://github.com/kurkle/color#readme - * (c) 2022 Jukka Kurkela - * Released under the MIT License - */function Tl(n){return n+.5|0}const Ai=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return Ai(Tl(n*2.55),0,255)}function Fi(n){return Ai(Tl(n*255),0,255)}function _i(n){return Ai(Tl(n/2.55)/100,0,1)}function wf(n){return Ai(Tl(n*100),0,100)}const Nn={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},na=[..."0123456789ABCDEF"],Zk=n=>na[n&15],Gk=n=>na[(n&240)>>4]+na[n&15],Hl=n=>(n&240)>>4===(n&15),Xk=n=>Hl(n.r)&&Hl(n.g)&&Hl(n.b)&&Hl(n.a);function Qk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const xk=(n,e)=>n<255?e(n):"";function e2(n){var e=Xk(n)?Zk:Gk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+xk(n.a,e):void 0}const t2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Eb(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function n2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function i2(n,e,t){const i=Eb(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function s2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=s2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Va(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Ha(n,e,t){return Va(Eb,n,e,t)}function l2(n,e,t){return Va(i2,n,e,t)}function o2(n,e,t){return Va(n2,n,e,t)}function Db(n){return(n%360+360)%360}function r2(n){const e=t2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):Fi(+e[5]));const s=Db(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=l2(s,l,o):e[1]==="hsv"?i=o2(s,l,o):i=Ha(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function a2(n,e){var t=za(n);t[0]=Db(t[0]+e),t=Ha(t),n.r=t[0],n.g=t[1],n.b=t[2]}function u2(n){if(!n)return;const e=za(n),t=e[0],i=wf(e[1]),s=wf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${_i(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Sf={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"},Cf={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 f2(){const n={},e=Object.keys(Cf),t=Object.keys(Sf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Bl;function c2(n){Bl||(Bl=f2(),Bl.transparent=[0,0,0,0]);const e=Bl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const d2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function p2(n){const e=d2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Qs(o):Ai(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Qs(i):Ai(i,0,255)),s=255&(e[4]?Qs(s):Ai(s,0,255)),l=255&(e[6]?Qs(l):Ai(l,0,255)),{r:i,g:s,b:l,a:t}}}function m2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${_i(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const dr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ms=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function h2(n,e,t){const i=ms(_i(n.r)),s=ms(_i(n.g)),l=ms(_i(n.b));return{r:Fi(dr(i+t*(ms(_i(e.r))-i))),g:Fi(dr(s+t*(ms(_i(e.g))-s))),b:Fi(dr(l+t*(ms(_i(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Ul(n,e,t){if(n){let i=za(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ha(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ab(n,e){return n&&Object.assign(e||{},n)}function $f(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=Fi(n[3]))):(e=Ab(n,{r:0,g:0,b:0,a:1}),e.a=Fi(e.a)),e}function _2(n){return n.charAt(0)==="r"?p2(n):r2(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=$f(e):t==="string"&&(i=Qk(e)||c2(e)||_2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Ab(this._rgb);return e&&(e.a=_i(e.a)),e}set rgb(e){this._rgb=$f(e)}rgbString(){return this._valid?m2(this._rgb):void 0}hexString(){return this._valid?e2(this._rgb):void 0}hslString(){return this._valid?u2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=h2(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=Fi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Tl(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 Ul(this._rgb,2,e),this}darken(e){return Ul(this._rgb,2,-e),this}saturate(e){return Ul(this._rgb,1,e),this}desaturate(e){return Ul(this._rgb,1,-e),this}rotate(e){return a2(this._rgb,e),this}}function Ib(n){return new $o(n)}function Lb(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Tf(n){return Lb(n)?n:Ib(n)}function pr(n){return Lb(n)?n:Ib(n).saturate(.5).darken(.1).hexString()}const ss=Object.create(null),ia=Object.create(null);function ll(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.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=(t,i)=>pr(i.backgroundColor),this.hoverBorderColor=(t,i)=>pr(i.borderColor),this.hoverColor=(t,i)=>pr(i.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)}set(e,t){return mr(this,e,t)}get(e){return ll(this,e)}describe(e,t){return mr(ia,e,t)}override(e,t){return mr(ss,e,t)}route(e,t,i,s){const l=ll(this,e),o=ll(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return et(a)?Object.assign({},u,a):nt(a,u)},set(a){this[r]=a}}})}}var it=new g2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function b2(n){return!n||dt(n.size)||dt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function To(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function v2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function ml(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,S2(n,l),a=0;a+n||0;function Wa(n,e){const t={},i=et(e),s=i?Object.keys(e):e,l=et(n)?i?o=>nt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=O2(l(o));return t}function Pb(n){return Wa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ks(n){return Wa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Wn(n){const e=Pb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function On(n,e){n=n||{},e=e||it.font;let t=nt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=nt(n.style,e.style);i&&!(""+i).match(T2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:nt(n.family,e.family),lineHeight:M2(nt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:nt(n.weight,e.weight),string:""};return s.string=b2(s),s}function Wl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function ji(n,e){return Object.assign(Object.create(n),e)}function Ya(n,e=[""],t=n,i,s=()=>n[0]){Un(i)||(i=qb("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ya([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return Nb(o,r,()=>R2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Ef(o).includes(r)},ownKeys(o){return Ef(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Es(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Fb(n,i),setContext:l=>Es(n,l,t,i),override:l=>Es(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return Nb(l,o,()=>A2(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function Fb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Ri(t)?t:()=>t,isIndexable:Ri(i)?i:()=>i}}const D2=(n,e)=>n?n+Ra(e):e,Ka=(n,e)=>et(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Nb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function A2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Ri(r)&&o.isScriptable(e)&&(r=I2(e,r,n,t)),Ot(r)&&r.length&&(r=L2(e,r,n,o.isIndexable)),Ka(e,r)&&(r=Es(r,s,l&&l[e],o)),r}function I2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ka(n,e)&&(e=Ja(s._scopes,s,n,e)),e}function L2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Un(l.index)&&i(n))e=e[l.index%e.length];else if(et(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ja(u,s,n,f);e.push(Es(c,l,o&&o[n],r))}}return e}function Rb(n,e,t){return Ri(n)?n(e,t):n}const P2=(n,e)=>n===!0?e:typeof n=="string"?Ni(e,n):void 0;function F2(n,e,t,i,s){for(const l of e){const o=P2(t,l);if(o){n.add(o);const r=Rb(o._fallback,t,s);if(Un(r)&&r!==t&&r!==i)return r}else if(o===!1&&Un(i)&&t!==i)return null}return!1}function Ja(n,e,t,i){const s=e._rootScopes,l=Rb(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Of(r,o,t,l||t,i);return a===null||Un(l)&&l!==t&&(a=Of(r,o,l,a,i),a===null)?!1:Ya(Array.from(r),[""],s,l,()=>N2(e,t,i))}function Of(n,e,t,i,s){for(;t;)t=F2(n,e,t,i,s);return t}function N2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ot(s)&&et(t)?t:s}function R2(n,e,t,i){let s;for(const l of e)if(s=qb(D2(l,n),t),Un(s))return Ka(n,s)?Ja(t,i,n,s):s}function qb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Un(i))return i}}function Ef(n){let e=n._keys;return e||(e=n._keys=q2(n._scopes)),e}function q2(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function jb(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function z2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=ta(l,s),a=ta(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function V2(n,e,t){const i=n.length;let s,l,o,r,a,u=Ds(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")B2(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function Y2(n,e){return Jo(n).getPropertyValue(e)}const K2=["top","right","bottom","left"];function ts(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=K2[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const J2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Z2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(J2(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.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,s=Jo(t),l=s.boxSizing==="border-box",o=ts(s,"padding"),r=ts(s,"border","width"),{x:a,y:u,box:f}=Z2(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:_}=e;return l&&(m-=o.width+r.width,_-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/_*t.height/i)}}function G2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Za(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Jo(l),a=ts(r,"border","width"),u=ts(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Eo(r.maxWidth,l,"clientWidth"),s=Eo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||Co,maxHeight:s||Co}}const hr=n=>Math.round(n*10)/10;function X2(n,e,t,i){const s=Jo(n),l=ts(s,"margin"),o=Eo(s.maxWidth,n,"clientWidth")||Co,r=Eo(s.maxHeight,n,"clientHeight")||Co,a=G2(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=ts(s,"border","width"),d=ts(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=hr(Math.min(u,o,a.maxWidth)),f=hr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=hr(u/2)),{width:u,height:f}}function Df(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;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!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Q2=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Af(n,e){const t=Y2(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function x2(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 ew(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Gi(n,s,t),r=Gi(s,l,t),a=Gi(l,e,t),u=Gi(o,r,t),f=Gi(r,a,t);return Gi(u,f,t)}const If=new Map;function tw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=If.get(t);return i||(i=new Intl.NumberFormat(n,e),If.set(t,i)),i}function Ml(n,e,t){return tw(e,t).format(n)}const nw=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}}},iw=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?nw(e,t):iw()}function sw(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 lw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Hb(n){return n==="angle"?{between:dl,compare:Hk,normalize:Mn}:{between:pl,compare:(e,t)=>e-t,normalize:e=>e}}function Lf({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function ow(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Hb(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(s,$,y)&&r(s,$)!==0,T=()=>r(l,y)===0||a(l,$,y),M=()=>h||C(),O=()=>!h||T();for(let D=f,I=f;D<=c;++D)S=e[D%o],!S.skip&&(y=u(S[i]),y!==$&&(h=a(y,s,l),g===null&&M()&&(g=r(y,s)===0?D:I),g!==null&&O()&&(_.push(Lf({start:g,end:D,loop:d,count:o,style:m})),g=null),I=D,$=y));return g!==null&&_.push(Lf({start:g,end:c,loop:d,count:o,style:m})),_}function Ub(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function aw(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function uw(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=rw(t,s,l,i);if(i===!0)return Pf(n,[{start:o,end:r,loop:l}],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=$b.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.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,s)=>Math.max(i,s._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 s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var mi=new dw;const Nf="transparent",pw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Tf(n||Nf),s=i.valid&&Tf(e||Nf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class mw{constructor(e,t,i,s){const l=t[i];s=Wl([e.to,s,l,e.from]);const o=Wl([e.from,l,s]);this._active=!0,this._fn=e.fn||pw[e.type||typeof o],this._easing=sl[e.easing]||sl.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=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Wl([e.to,t,s,e.from]),this._from=Wl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,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 s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});it.set("animations",{colors:{type:"color",properties:_w},numbers:{type:"number",properties:hw}});it.describe("animations",{_fallback:"animation"});it.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:n=>n|0}}}});class Wb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!et(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!et(s))return;const l={};for(const o of gw)l[o]=s[o];(Ot(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=vw(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&bw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new mw(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return mi.add(this._chart,i),!0}}function bw(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function Vf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=Sw(l,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function Tw(n,e){return ji(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Mw(n,e,t){return ji(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Us(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const br=n=>n==="reset"||n==="none",Hf=(n,e)=>e?n:Object.assign({},n),Ow=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Yb(t,!0),values:null};class ei{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.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=jf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Us(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,m,_)=>c==="x"?d:c==="r"?_:m,l=t.xAxisID=nt(i.xAxisID,gr(e,"x")),o=t.yAxisID=nt(i.yAxisID,gr(e,"y")),r=t.rAxisID=nt(i.rAxisID,gr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}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&&bf(this._data,this),e._stacked&&Us(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(et(t))this._data=ww(t);else if(i!==t){if(i){bf(i,this);const s=this._cachedMeta;Us(s),s._parsed=[]}t&&Object.isExtensible(t)&&Yk(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 s=!1;this._dataCheck();const l=t._stacked;t._stacked=jf(t.vScale,t),t.stack!==i.stack&&(s=!0,Us(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Vf(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:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{Ot(s[e])?d=this.parseArrayData(i,s,e,t):et(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||u&&c[r]h||c=0;--d)if(!_()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),h=u.resolveNamedOptions(d,m,_,c);return h.$shared&&(h.$shared=a,l[o]=Object.freeze(Hf(h,a))),h}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new Wb(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}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),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){br(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!br(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}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,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function Dw(n){const e=n.iScale,t=Ew(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Un(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function Kb(n,e,t,i){return Ot(n)?Lw(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Bf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function Fw(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(dt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;ddl($,r,a,!0)?1:Math.max(C,C*t,T,T*t),_=($,C,T)=>dl($,r,a,!0)?-1:Math.min(C,C*t,T,T*t),h=m(0,u,c),g=m(Nt,f,d),y=_(qt,u,c),S=_(qt+Nt,f,d);i=(h-y)/2,s=(g-S)/2,l=-(h+y)/2,o=-(g+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Ol extends ei{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(et(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ni(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?gt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Ml(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Ol.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return Ot(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Zo extends ei{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Mb(t,s,o);this._drawStart=r,this._drawCount=a,Ob(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,m=r.axis,{spanGaps:_,segment:h}=this.options,g=Os(_)?_:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let $=t;$0&&Math.abs(T[d]-S[d])>g,h&&(M.parsed=T,M.raw=u.data[$]),c&&(M.options=f||this.resolveDataElementOptions($,C.active?"active":s)),y||this.updateElement(C,$,M,s),S=T}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Zo.id="line";Zo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Zo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Qa extends ei{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Ml(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return jb.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*qt;let m=d,_;const h=360/this.countVisibleElements();for(_=0;_{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}Qa.id="polarArea";Qa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Qa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Jb extends Ol{}Jb.id="pie";Jb.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class xa extends ei{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return jb.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};Si.defaults={};Si.defaultRoutes=void 0;const Zb={values(n){return Ot(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=zw(n,t)}const o=Hn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Ml(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Hn(n)));return i===1||i===2||i===5?Zb.numeric.call(this,n,e,t):""}};function zw(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 Go={formatters:Zb};it.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Go.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});it.route("scale.ticks","color","","color");it.route("scale.grid","color","","borderColor");it.route("scale.grid","borderColor","","borderColor");it.route("scale.title","color","","color");it.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});it.describe("scales",{_fallback:"scale"});it.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function Vw(n,e){const t=n.options.ticks,i=t.maxTicksLimit||Hw(n),s=t.major.enabled?Uw(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Ww(e,a,s,l/i),a;const u=Bw(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Kl(e,a,u,dt(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function Uw(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Yf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Kf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function Zw(n,e){mt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Rn(t,Rn(i,t)),max:Rn(i,Rn(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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,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=E2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=fn(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-Ws(e.grid)-t.padding-Jf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=qa(Math.min(Math.asin(fn((f.highest.height+6)/r,-1,1)),Math.asin(fn(a/u,-1,1))-Math.asin(fn(d/u,-1,1)))),o=Math.max(s,Math.min(l,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:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Jf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ws(l)+a):(e.height=this.maxHeight,e.width=Ws(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,_=Qn(this.labelRotation),h=Math.cos(_),g=Math.sin(_);if(r){const y=i.mirror?0:g*c.width+h*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:h*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(u,f,g,h)}}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,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+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:l[O]||0,height:o[O]||0});return{first:M(0),last:M(t-1),widest:M(C),highest:M(T),widths:l,heights:o}}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 Bk(this._alignToPixels?Wi(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*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Ws(l),d=[],m=l.setContext(this.getContext()),_=m.drawBorder?m.borderWidth:0,h=_/2,g=function(j){return Wi(i,j,_)};let y,S,$,C,T,M,O,D,I,P,F,R;if(o==="top")y=g(this.bottom),M=this.bottom-c,D=y-h,P=g(e.top)+h,R=e.bottom;else if(o==="bottom")y=g(this.top),P=e.top,R=g(e.bottom)-h,M=y+h,D=this.top+c;else if(o==="left")y=g(this.right),T=this.right-c,O=y-h,I=g(e.left)+h,F=e.right;else if(o==="right")y=g(this.left),I=e.left,F=g(e.right)-h,T=y+h,O=this.left+c;else if(t==="x"){if(o==="center")y=g((e.top+e.bottom)/2+.5);else if(et(o)){const j=Object.keys(o)[0],Z=o[j];y=g(this.chart.scales[j].getPixelForValue(Z))}P=e.top,R=e.bottom,M=y+h,D=M+c}else if(t==="y"){if(o==="center")y=g((e.left+e.right)/2);else if(et(o)){const j=Object.keys(o)[0],Z=o[j];y=g(this.chart.scales[j].getPixelForValue(Z))}T=y-h,O=T-c,I=e.left,F=e.right}const N=nt(s.ticks.maxTicksLimit,f),q=Math.max(1,Math.ceil(f/N));for(S=0;Sl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");it.route(l,s,a,r)})}function n3(n){return"id"in n&&"defaults"in n}class i3{constructor(){this.controllers=new Jl(ei,"datasets",!0),this.elements=new Jl(Si,"elements"),this.plugins=new Jl(Object,"plugins"),this.scales=new Jl(as,"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(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):mt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Ra(e);Ft(i["before"+s],[],i),t[e](i),Ft(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs(M[m]-$[m])>y,g&&(O.parsed=M,O.raw=u.data[C]),d&&(O.options=c||this.resolveDataElementOptions(C,T.active?"active":s)),S||this.updateElement(T,C,O,s),$=M}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}eu.id="scatter";eu.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};eu.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Yi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class la{constructor(e){this.options=e||{}}init(e){}formats(){return Yi()}parse(e,t){return Yi()}format(e,t){return Yi()}add(e,t,i){return Yi()}diff(e,t,i){return Yi()}startOf(e,t,i){return Yi()}endOf(e,t){return Yi()}}la.override=function(n){Object.assign(la.prototype,n)};var Gb={_date:la};function s3(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?Uk:Qi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function El(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var a3={evaluateInteractionItems:El,modes:{index(n,e,t,i){const s=Zi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?yr(n,s,l,i,o):kr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Zi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?yr(n,s,l,i,o):kr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Gf(n,e){return n.filter(t=>Xb.indexOf(t.pos)===-1&&t.box.axis===e)}function Ks(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function u3(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Ks(Ys(e,"left"),!0),s=Ks(Ys(e,"right")),l=Ks(Ys(e,"top"),!0),o=Ks(Ys(e,"bottom")),r=Gf(e,"x"),a=Gf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ys(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Xf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Qb(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 p3(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!et(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&Qb(o,l.getPadding());const r=Math.max(0,e.outerWidth-Xf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Xf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function m3(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function h3(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function xs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof h.beforeLayout=="function"&&h.beforeLayout()});const f=a.reduce((h,g)=>g.box.options&&g.box.options.display===!1?h:h+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);Qb(d,Wn(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),_=c3(a.concat(u),c);xs(r.fullSize,m,c,_),xs(a,m,c,_),xs(u,m,c,_)&&xs(a,m,c,_),m3(m),Qf(r.leftAndTop,m,c,_),m.x+=m.w,m.y+=m.h,Qf(r.rightAndBottom,m,c,_),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,h=>{const g=h.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class xb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class _3 extends xb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ro="$chartjs",g3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xf=n=>n===null||n==="";function b3(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ro]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",xf(s)){const l=Af(n,"width");l!==void 0&&(n.width=l)}if(xf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Af(n,"height");l!==void 0&&(n.height=l)}return n}const e1=Q2?{passive:!0}:!1;function v3(n,e,t){n.addEventListener(e,t,e1)}function y3(n,e,t){n.canvas.removeEventListener(e,t,e1)}function k3(n,e){const t=g3[n.type]||n.type,{x:i,y:s}=Zi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Do(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function w3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.addedNodes,i),o=o&&!Do(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function S3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.removedNodes,i),o=o&&!Do(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const hl=new Map;let ec=0;function t1(){const n=window.devicePixelRatio;n!==ec&&(ec=n,hl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function C3(n,e){hl.size||window.addEventListener("resize",t1),hl.set(n,e)}function $3(n){hl.delete(n),hl.size||window.removeEventListener("resize",t1)}function T3(n,e,t){const i=n.canvas,s=i&&Za(i);if(!s)return;const l=Tb((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),C3(n,l),o}function wr(n,e,t){t&&t.disconnect(),e==="resize"&&$3(n)}function M3(n,e,t){const i=n.canvas,s=Tb(l=>{n.ctx!==null&&t(k3(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return v3(i,e,s),s}class O3 extends xb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(b3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ro])return!1;const i=t[ro].initial;["height","width"].forEach(l=>{const o=i[l];dt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[ro],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:w3,detach:S3,resize:T3}[t]||M3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:wr,detach:wr,resize:wr}[t]||y3)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return X2(e,t,i,s)}isAttached(e){const t=Za(e);return!!(t&&t.isConnected)}}function E3(n){return!Vb()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?_3:O3}class D3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(Ft(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){dt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=nt(i.options&&i.options.plugins,{}),l=A3(i);return s===!1&&!t?[]:L3(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function A3(n){const e={},t=[],i=Object.keys(li.plugins.items);for(let l=0;l{const a=i[r];if(!et(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ra(r,a),f=N3(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=nl(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||oa(a,e),c=(ss[a]||{}).scales||{};Object.keys(c).forEach(d=>{const m=F3(d,u),_=r[m+"AxisID"]||l[m]||m;o[_]=o[_]||Object.create(null),nl(o[_],[{axis:m},i[_],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];nl(a,[it.scales[a.type],it.scale])}),o}function n1(n){const e=n.options||(n.options={});e.plugins=nt(e.plugins,{}),e.scales=q3(n,e)}function i1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function j3(n){return n=n||{},n.data=i1(n.data),n1(n),n}const tc=new Map,s1=new Set;function Xl(n,e){let t=tc.get(n);return t||(t=e(),tc.set(n,t),s1.add(t)),t}const Js=(n,e,t)=>{const i=Ni(e,t);i!==void 0&&n.add(i)};class z3{constructor(e){this._config=j3(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=i1(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(),n1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Xl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Xl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Xl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Xl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Js(a,e,c))),f.forEach(c=>Js(a,s,c)),f.forEach(c=>Js(a,ss[l]||{},c)),f.forEach(c=>Js(a,it,c)),f.forEach(c=>Js(a,ia,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),s1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,ss[t]||{},it.datasets[t]||{},{type:t},it,ia]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=nc(this._resolverCache,e,s);let a=o;if(H3(o,t)){l.$shared=!1,i=Ri(i)?i():i;const u=this.createResolver(e,i,r);a=Es(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=nc(this._resolverCache,e,i);return et(t)?Es(l,t,void 0,s):l}}function nc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Ya(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const V3=n=>et(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Ri(n[t]),!1);function H3(n,e){const{isScriptable:t,isIndexable:i}=Fb(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Ri(r)||V3(r))||o&&Ot(r))return!0}return!1}var B3="3.9.1";const U3=["top","bottom","left","right","chartArea"];function ic(n,e){return n==="top"||n==="bottom"||U3.indexOf(n)===-1&&e==="x"}function sc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function lc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ft(t&&t.onComplete,[n],e)}function W3(n){const e=n.chart,t=e.options.animation;Ft(t&&t.onProgress,[n],e)}function l1(n){return Vb()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ao={},o1=n=>{const e=l1(n);return Object.values(Ao).filter(t=>t.canvas===e).pop()};function Y3(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function K3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Io{constructor(e,t){const i=this.config=new z3(t),s=l1(e),l=o1(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||E3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=Ak(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,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 D3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kk(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Ao[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}mi.listen(this,"complete",lc),mi.listen(this,"progress",W3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return dt(e)?t&&l?l:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Df(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mf(this.canvas,this.ctx),this}stop(){return mi.stop(this),this}resize(e,t){mi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Df(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,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ra(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),mt(l,o=>{const r=o.options,a=r.id,u=ra(a,r),f=nt(r.type,o.dtype);(r.position===void 0||ic(r.position,u)!==ic(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=li.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),mt(s,(o,r)=>{o||delete i[r]}),mt(i,o=>{Gl.configure(this,o,o.options),Gl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=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()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(sc("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=>{Gl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!mf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;Y3(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Gl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],mt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),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,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ba(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Ua(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ml(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=a3.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=ji(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 s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Un(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s: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(),mi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};mt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),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 s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!wo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=Rk(e),u=K3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Ft(l.onHover,[e,r,this],this),a&&Ft(l.onClick,[e,r,this],this));const f=!wo(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const oc=()=>mt(Io.instances,n=>n._plugins.invalidate()),Mi=!0;Object.defineProperties(Io,{defaults:{enumerable:Mi,value:it},instances:{enumerable:Mi,value:Ao},overrides:{enumerable:Mi,value:ss},registry:{enumerable:Mi,value:li},version:{enumerable:Mi,value:B3},getChart:{enumerable:Mi,value:o1},register:{enumerable:Mi,value:(...n)=>{li.add(...n),oc()}},unregister:{enumerable:Mi,value:(...n)=>{li.remove(...n),oc()}}});function r1(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+Nt,i-Nt),n.closePath(),n.clip()}function J3(n){return Wa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Z3(n,e,t,i){const s=J3(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return fn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:fn(s.innerStart,0,o),innerEnd:fn(s.innerEnd,0,o)}}function hs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function aa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let m=0;const _=s-a;if(i){const j=f>0?f-i:0,Z=c>0?c-i:0,X=(j+Z)/2,K=X!==0?_*X/(X+i):_;m=(_-K)/2}const h=Math.max(.001,_*c-t/qt)/c,g=(_-h)/2,y=a+g+m,S=s-g-m,{outerStart:$,outerEnd:C,innerStart:T,innerEnd:M}=Z3(e,d,c,S-y),O=c-$,D=c-C,I=y+$/O,P=S-C/D,F=d+T,R=d+M,N=y+T/F,q=S-M/R;if(n.beginPath(),l){if(n.arc(o,r,c,I,P),C>0){const X=hs(D,P,o,r);n.arc(X.x,X.y,C,P,S+Nt)}const j=hs(R,S,o,r);if(n.lineTo(j.x,j.y),M>0){const X=hs(R,q,o,r);n.arc(X.x,X.y,M,S+Nt,q+Math.PI)}if(n.arc(o,r,d,S-M/d,y+T/d,!0),T>0){const X=hs(F,N,o,r);n.arc(X.x,X.y,T,N+Math.PI,y-Nt)}const Z=hs(O,y,o,r);if(n.lineTo(Z.x,Z.y),$>0){const X=hs(O,I,o,r);n.arc(X.x,X.y,$,y-Nt,I)}}else{n.moveTo(o,r);const j=Math.cos(I)*c+o,Z=Math.sin(I)*c+r;n.lineTo(j,Z);const X=Math.cos(P)*c+o,K=Math.sin(P)*c+r;n.lineTo(X,K)}n.closePath()}function G3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){aa(n,e,t,i,o+gt,s);for(let u=0;u=gt||dl(l,r,a),h=pl(o,u+d,f+d);return _&&h}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>gt?Math.floor(i/gt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=qt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=G3(e,this,r,l,o);Q3(e,this,r,l,a,o),e.restore()}}tu.id="arc";tu.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};tu.defaultRoutes={backgroundColor:"backgroundColor"};function a1(n,e,t=e){n.lineCap=nt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(nt(t.borderDash,e.borderDash)),n.lineDashOffset=nt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=nt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=nt(t.borderWidth,e.borderWidth),n.strokeStyle=nt(t.borderColor,e.borderColor)}function x3(n,e,t){n.lineTo(t.x,t.y)}function eS(n){return n.stepped?k2:n.tension||n.cubicInterpolationMode==="monotone"?w2:x3}function u1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-C:C))%l,$=()=>{h!==g&&(n.lineTo(f,g),n.lineTo(f,h),n.lineTo(f,y))};for(a&&(m=s[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[S(d)],m.skip)continue;const C=m.x,T=m.y,M=C|0;M===_?(Tg&&(g=T),f=(c*f+C)/++c):($(),n.lineTo(C,T),_=M,c=0,h=g=T),y=T}$()}function ua(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?nS:tS}function iS(n){return n.stepped?x2:n.tension||n.cubicInterpolationMode==="monotone"?ew:Gi}function sS(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),a1(n,e.options),n.stroke(s)}function lS(n,e,t,i){const{segments:s,options:l}=e,o=ua(e);for(const r of s)a1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const oS=typeof Path2D=="function";function rS(n,e,t,i){oS&&!e.options.segment?sS(n,e,t,i):lS(n,e,t,i)}class zi extends Si{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 s=i.spanGaps?this._loop:this._fullLoop;W2(this._points,i,e,s,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=uw(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,s=e[t],l=this.points,o=Ub(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=iS(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function rc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=iu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function iu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function ac(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function c1(n,e){let t=[],i=!1;return Ot(n)?(i=!0,t=n):t=mS(n,e),t.length?new zi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function uc(n){return n&&n.fill!==!1}function hS(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Bt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function _S(n,e,t){const i=yS(n);if(et(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Bt(s)&&Math.floor(s)===s?gS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function gS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function bS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:et(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function vS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:et(n)?i=n.value:i=e.getBaseValue(),i}function yS(n){const e=n.options,t=e.fill;let i=nt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function kS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=wS(e,t);r.push(c1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&$r(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;uc(l)&&$r(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!uc(i)||t.drawTime!=="beforeDatasetDraw"||$r(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ol={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function LS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function pc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=On(e.bodyFont),u=On(e.titleFont),f=On(e.footerFont),c=l.length,d=s.length,m=i.length,_=Wn(e.padding);let h=_.height,g=0,y=i.reduce((C,T)=>C+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*C+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(C){g=Math.max(g,t.measureText(C).width+S)};return t.save(),t.font=u.string,mt(n.title,$),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,mt(i,C=>{mt(C.before,$),mt(C.lines,$),mt(C.after,$)}),S=0,t.font=f.string,mt(n.footer,$),t.restore(),g+=_.width,{width:g,height:h}}function PS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function FS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function NS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),FS(u,n,e,t)&&(u="center"),u}function mc(n,e,t){const i=t.yAlign||e.yAlign||PS(n,t);return{xAlign:t.xAlign||e.xAlign||NS(n,e,t,i),yAlign:i}}function RS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function qS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function hc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ks(o);let _=RS(e,r);const h=qS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,d)+s:r==="right"&&(_+=Math.max(c,m)+s),{x:fn(_,0,i.width-e.width),y:fn(h,0,i.height-e.height)}}function Ql(n,e,t){const i=Wn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function _c(n){return ii([],hi(n))}function jS(n,e,t){return ji(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function gc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends Si{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||e._chart,this._chart=this.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()),s=i.enabled&&t.options.animation&&i.animations,l=new Wb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=jS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ii(r,hi(s)),r=ii(r,hi(l)),r=ii(r,hi(o)),r}getBeforeBody(e,t){return _c(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=gc(i,l);ii(o.before,hi(r.beforeLabel.call(this,l))),ii(o.lines,r.label.call(this,l)),ii(o.after,hi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return _c(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ii(r,hi(s)),r=ii(r,hi(l)),r=ii(r,hi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),mt(r,f=>{const c=gc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ol[i.position].call(this,s,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=pc(this,i),u=Object.assign({},r,a),f=mc(this.chart,i,u),c=hc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={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,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ks(r),{x:d,y:m}=e,{width:_,height:h}=t;let g,y,S,$,C,T;return l==="center"?(C=m+h/2,s==="left"?(g=d,y=g-o,$=C+o,T=C-o):(g=d+_,y=g+o,$=C-o,T=C+o),S=g):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+_-Math.max(u,c)-o:y=this.caretX,l==="top"?($=m,C=$-o,g=y-o,S=y+o):($=m+h,C=$+o,g=y+o,S=y-o),T=$),{x1:g,x2:y,x3:S,y1:$,y2:C,y3:T}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=_r(i.rtl,this.x,this.width);for(e.x=Ql(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=On(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a$!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Oo(e,{x:g,y:h,w:u,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Oo(e,{x:y,y:h+1,w:u-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(g,h,u,a),e.strokeRect(g,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,h+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=On(i.bodyFont);let d=c.lineHeight,m=0;const _=_r(i.rtl,this.x,this.width),h=function(D){t.fillText(D,_.x(e.x+m),e.y+d/2),e.y+=d+l},g=_.textAlign(o);let y,S,$,C,T,M,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Ql(this,g,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,h),m=r&&g!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,M=s.length;C0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ol[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=pc(this,e),a=Object.assign({},o,this._size),u=mc(t,e,a),f=hc(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Wn(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(l,e,s,t),sw(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),lw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!wo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!wo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ol[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ca.positioners=ol;var zS={id:"tooltip",_element:ca,positioners:ol,afterInit(n,e,t){t&&(n.tooltip=new ca({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)===!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:{beforeTitle:pi,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.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const VS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function HS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return VS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const BS=(n,e)=>n===null?null:fn(Math.round(n),0,e);class da extends as{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(dt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:HS(i,e,nt(t,e),this._addedLabels),BS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}da.id="category";da.defaults={ticks:{callback:da.prototype.getLabelForValue}};function US(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=l||1,_=f-1,{min:h,max:g}=e,y=!dt(o),S=!dt(r),$=!dt(u),C=(g-h)/(c+1);let T=_f((g-h)/_/m)*m,M,O,D,I;if(T<1e-14&&!y&&!S)return[{value:h},{value:g}];I=Math.ceil(g/T)-Math.floor(h/T),I>_&&(T=_f(I*T/_/m)*m),dt(a)||(M=Math.pow(10,a),T=Math.ceil(T*M)/M),s==="ticks"?(O=Math.floor(h/T)*T,D=Math.ceil(g/T)*T):(O=h,D=g),y&&S&&l&&Vk((r-o)/l,T/1e3)?(I=Math.round(Math.min((r-o)/T,f)),T=(r-o)/I,O=o,D=r):$?(O=y?o:O,D=S?r:D,I=u-1,T=(D-O)/I):(I=(D-O)/T,il(I,Math.round(I),T/1e3)?I=Math.round(I):I=Math.ceil(I));const P=Math.max(gf(T),gf(O));M=Math.pow(10,dt(a)?P:a),O=Math.round(O*M)/M,D=Math.round(D*M)/M;let F=0;for(y&&(d&&O!==o?(t.push({value:o}),Os=t?s:a,r=a=>l=i?l:a;if(e){const a=oi(s),u=oi(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={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},l=this._range||this,o=US(s,l);return e.bounds==="ticks"&&kb(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 s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Ml(e,this.chart.options.locale,this.options.ticks.format)}}class su extends Lo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Bt(e)?e:0,this.max=Bt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}su.id="linear";su.defaults={ticks:{callback:Go.formatters.numeric}};function vc(n){return n/Math.pow(10,Math.floor(Hn(n)))===1}function WS(n,e){const t=Math.floor(Hn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Rn(n.min,Math.pow(10,Math.floor(Hn(e.min)))),o=Math.floor(Hn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:vc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Bt(e)?Math.max(0,e):null,this.max=Bt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(Hn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=WS(t,this);return e.bounds==="ticks"&&kb(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Ml(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Hn(e),this._valueRange=Hn(this.max)-Hn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Hn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}p1.id="logarithmic";p1.defaults={ticks:{callback:Go.formatters.logarithmic,major:{enabled:!0}}};function pa(n){const e=n.ticks;if(e.display&&n.display){const t=Wn(e.backdropPadding);return nt(e.font&&e.font.size,it.font.size)+t.height}return 0}function YS(n,e,t){return t=Ot(t)?t:[t],{w:v2(n,e.string,t),h:t.length*e.lineHeight}}function yc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function KS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?qt/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function ZS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=pa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?qt/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function xS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=On(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:m}=n._pointLabelItems[s],{backdropColor:_}=l;if(!dt(_)){const h=ks(l.borderRadius),g=Wn(l.backdropPadding);t.fillStyle=_;const y=f-g.left,S=c-g.top,$=d-f+g.width,C=m-c+g.height;Object.values(h).some(T=>T!==0)?(t.beginPath(),Oo(t,{x:y,y:S,w:$,h:C,radius:h}),t.fill()):t.fillRect(y,S,$,C)}Mo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function m1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,gt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Ft(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?KS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=gt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Mn(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(dt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(dt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));e4(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=On(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Wn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Mo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Qo.id="radialLinear";Qo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Go.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Qo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Qo.descriptors={angleLines:{_fallback:"grid"}};const xo={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}},kn=Object.keys(xo);function n4(n,e){return n-e}function kc(n,e){if(dt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Bt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Os(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function wc(n,e,t,i){const s=kn.length;for(let l=kn.indexOf(n);l=kn.indexOf(t);l--){const o=kn[l];if(xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return kn[t?kn.indexOf(t):0]}function s4(n){for(let e=kn.indexOf(n)+1,t=kn.length;e=e?t[i]:t[s];n[l]=!0}}function l4(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Cc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=fn(t,0,o),i=fn(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,s=this.options,l=s.time,o=l.unit||wc(l.minUnit,t,i,this._getLabelCapacity(t)),r=nt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Os(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"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 _=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;dh-g).map(h=>+h)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,m=this._adapter.format(e,s||(d?f:u)),_=l.ticks.callback;return _?Ft(_,[m,t,i],this):m}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Qi(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Qi(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class h1 extends Dl{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=xl(t,this.min),this._tableRange=xl(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{i&&(t||(t=qe(e,Jt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Jt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function r4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function a4(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function u4(n){let e,t,i,s,l,o=n[2]&&$c();function r(f,c){return f[2]?a4:r4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),qr(i,"height","250px"),qr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=$c(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),L(o,1,1,()=>{o=null}),ue()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function f4(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),fe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),fe.error(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Xt(()=>(Io.register(zi,Xo,Zo,su,Dl,IS,zS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class c4 extends ve{constructor(e){super(),be(this,e,f4,u4,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Tc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d4(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _1={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** - * Prism: Lightweight, robust, elegant syntax highlighting - * - * @license MIT - * @author Lea Verou - * @namespace - * @public - */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var C in $)if($[C].src==S)return $[C]}return null}},isActive:function(S,$,C){for(var T="no-"+$;S;){var M=S.classList;if(M.contains($))return!0;if(M.contains(T))return!1;S=S.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var C=r.util.clone(r.languages[S]);for(var T in $)C[T]=$[T];return C},insertBefore:function(S,$,C,T){T=T||r.languages;var M=T[S],O={};for(var D in M)if(M.hasOwnProperty(D)){if(D==$)for(var I in C)C.hasOwnProperty(I)&&(O[I]=C[I]);C.hasOwnProperty(D)||(O[D]=M[D])}var P=T[S];return T[S]=O,r.languages.DFS(r.languages,function(F,R){R===P&&F!=S&&(this[F]=O)}),O},DFS:function S($,C,T,M){M=M||{};var O=r.util.objId;for(var D in $)if($.hasOwnProperty(D)){C.call($,D,$[D],T||D);var I=$[D],P=r.util.type(I);P==="Object"&&!M[O(I)]?(M[O(I)]=!0,S(I,C,null,M)):P==="Array"&&!M[O(I)]&&(M[O(I)]=!0,S(I,C,D,M))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,C){var T={callback:C,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,$===!0,T.callback)},highlightElement:function(S,$,C){var T=r.util.getLanguage(S),M=r.languages[T];r.util.setLanguage(S,T);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var D=S.textContent,I={element:S,language:T,grammar:M,code:D};function P(R){I.highlightedCode=R,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){P(r.util.encode(I.code));return}if($&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(R){P(R.data)},F.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else P(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,$,C){var T={code:S,grammar:$,language:C};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function(S,$){var C=$.rest;if(C){for(var T in C)$[T]=C[T];delete $.rest}var M=new c;return d(M,M.head,S),f(S,M,$,M.head,0),_(M)},hooks:{all:{},add:function(S,$){var C=r.hooks.all;C[S]=C[S]||[],C[S].push($)},run:function(S,$){var C=r.hooks.all[S];if(!(!C||!C.length))for(var T=0,M;M=C[T++];)M($)}},Token:a};i.Prism=r;function a(S,$,C,T){this.type=S,this.content=$,this.alias=C,this.length=(T||"").length|0}a.stringify=function S($,C){if(typeof $=="string")return $;if(Array.isArray($)){var T="";return $.forEach(function(P){T+=S(P,C)}),T}var M={type:$.type,content:S($.content,C),tag:"span",classes:["token",$.type],attributes:{},language:C},O=$.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(M.classes,O):M.classes.push(O)),r.hooks.run("wrap",M);var D="";for(var I in M.attributes)D+=" "+I+'="'+(M.attributes[I]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+D+">"+M.content+""};function u(S,$,C,T){S.lastIndex=$;var M=S.exec(C);if(M&&T&&M[1]){var O=M[1].length;M.index+=O,M[0]=M[0].slice(O)}return M}function f(S,$,C,T,M,O){for(var D in C)if(!(!C.hasOwnProperty(D)||!C[D])){var I=C[D];I=Array.isArray(I)?I:[I];for(var P=0;P=O.reach);J+=K.value.length,K=K.next){var le=K.value;if($.length>S.length)return;if(!(le instanceof a)){var ie=1,ee;if(q){if(ee=u(X,J,S,N),!ee||ee.index>=S.length)break;var Ve=ee.index,Te=ee.index+ee[0].length,Pe=J;for(Pe+=K.value.length;Ve>=Pe;)K=K.next,Pe+=K.value.length;if(Pe-=K.value.length,J=Pe,K.value instanceof a)continue;for(var je=K;je!==$.tail&&(PeO.reach&&(O.reach=_t);var Ze=K.prev;Ce&&(Ze=d($,Ze,Ce),J+=Ce.length),m($,Ze,ie);var We=new a(D,R?r.tokenize(ke,R):ke,j,ke);if(K=d($,Ze,We),Je&&d($,K,Je),ie>1){var yt={cause:D+","+P,reach:_t};f(S,$,C,K.prev,J,yt),O&&yt.reach>O.reach&&(O.reach=yt.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},$={value:null,prev:S,next:null};S.next=$,this.head=S,this.tail=$,this.length=0}function d(S,$,C){var T=$.next,M={value:C,prev:$,next:T};return $.next=M,T.prev=M,S.length++,M}function m(S,$,C){for(var T=$.next,M=0;M/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(h,g){return"✖ Error "+h+" while fetching file: "+g},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(h,g,y){var S=new XMLHttpRequest;S.open("GET",h,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?g(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function m(h){var g=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(g){var y=Number(g[1]),S=g[2],$=g[3];return S?$?[y,Number($)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(h){h.selector+=", "+c}),t.hooks.add("before-sanity-check",function(h){var g=h.element;if(g.matches(c)){h.code="",g.setAttribute(r,a);var y=g.appendChild(document.createElement("CODE"));y.textContent=i;var S=g.getAttribute("data-src"),$=h.language;if($==="none"){var C=(/\.(\w+)$/.exec(S)||[,"none"])[1];$=o[C]||C}t.util.setLanguage(y,$),t.util.setLanguage(g,$);var T=t.plugins.autoloader;T&&T.loadLanguages($),d(S,function(M){g.setAttribute(r,u);var O=m(g.getAttribute("data-range"));if(O){var D=M.split(/\r\n?|\n/g),I=O[0],P=O[1]==null?D.length:O[1];I<0&&(I+=D.length),I=Math.max(0,Math.min(I-1,D.length)),P<0&&(P+=D.length),P=Math.max(0,Math.min(P,D.length)),M=D.slice(I,P).join(` -`),g.hasAttribute("data-start")||g.setAttribute("data-start",String(I+1))}y.textContent=M,t.highlightElement(y)},function(M){g.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(g){for(var y=(g||document).querySelectorAll(c),S=0,$;$=y[S++];)t.highlightElement($)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(_1);var p4=_1.exports;const Zs=d4(p4);var m4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;ar&&(f[d]=` -`+f[d],c=m)}a[u]=f.join("")}return a.join(` -`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",_="",h=!1,g=0;g>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function h4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function _4(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class g1 extends ve{constructor(e){super(),be(this,e,_4,h4,me,{class:0,content:2,language:3})}}const g4=n=>({}),Mc=n=>({}),b4=n=>({}),Oc=n=>({});function Ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$=n[4]&&!n[2]&&Dc(n);const C=n[19].header,T=wt(C,n,n[18],Oc);let M=n[4]&&n[2]&&Ac(n);const O=n[19].default,D=wt(O,n,n[18],null),I=n[19].footer,P=wt(I,n,n[18],Mc);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),$&&$.c(),r=E(),T&&T.c(),a=E(),M&&M.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(F,R){w(F,e,R),b(e,t),b(e,s),b(e,l),b(l,o),$&&$.m(o,null),b(o,r),T&&T.m(o,null),b(o,a),M&&M.m(o,null),b(l,u),b(l,f),D&&D.m(f,null),n[21](f),b(l,c),b(l,d),P&&P.m(d,null),g=!0,y||(S=[Y(t,"click",Qe(n[20])),Y(f,"scroll",n[22])],y=!0)},p(F,R){n=F,n[4]&&!n[2]?$?$.p(n,R):($=Dc(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),T&&T.p&&(!g||R[0]&262144)&&Ct(T,C,n,n[18],g?St(C,n[18],R,b4):$t(n[18]),Oc),n[4]&&n[2]?M?M.p(n,R):(M=Ac(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),D&&D.p&&(!g||R[0]&262144)&&Ct(D,O,n,n[18],g?St(O,n[18],R,null):$t(n[18]),null),P&&P.p&&(!g||R[0]&262144)&&Ct(P,I,n,n[18],g?St(I,n[18],R,g4):$t(n[18]),Mc),(!g||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!g||R[0]&262)&&Q(l,"popup",n[2]),(!g||R[0]&4)&&Q(e,"padded",n[2]),(!g||R[0]&1)&&Q(e,"active",n[0])},i(F){g||(F&&Ge(()=>{g&&(i||(i=qe(t,Xr,{duration:_s,opacity:0},!0)),i.run(1))}),A(T,F),A(D,F),A(P,F),Ge(()=>{g&&(h&&h.end(1),_=rg(l,ui,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),_.start())}),g=!0)},o(F){F&&(i||(i=qe(t,Xr,{duration:_s,opacity:0},!1)),i.run(0)),L(T,F),L(D,F),L(P,F),_&&_.invalidate(),h=ya(l,ui,n[2]?{duration:_s,y:10}:{duration:_s,x:50}),g=!1},d(F){F&&k(e),F&&i&&i.end(),$&&$.d(),T&&T.d(F),M&&M.d(),D&&D.d(F),n[21](null),P&&P.d(F),F&&h&&h.end(),y=!1,Oe(S)}}}function Dc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Qe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ac(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Qe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function v4(n){let e,t,i,s,l=n[0]&&Ec(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Ec(o),l.c(),A(l,1),l.m(e,null)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,Oe(s)}}}let Ki,Tr=[];function b1(){return Ki=Ki||document.querySelector(".overlays"),Ki||(Ki=document.createElement("div"),Ki.classList.add("overlays"),document.body.appendChild(Ki)),Ki}let _s=150;function Ic(){return 1e3+b1().querySelectorAll(".overlay-panel-container.active").length}function y4(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=Tt(),_="op_"+z.randomString(10);let h,g,y,S,$="",C=o;function T(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function D(J){t(17,C=J),J?(y=document.activeElement,m("show"),h==null||h.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await cn(),I()}function I(){h&&(o?t(6,h.style.zIndex=Ic(),h):t(6,h.style="",h))}function P(){z.pushUnique(Tr,_),document.body.classList.add("overlay-active")}function F(){z.removeByValue(Tr,_),Tr.length||document.body.classList.remove("overlay-active")}function R(J){o&&f&&J.code=="Escape"&&!z.isInput(J.target)&&h&&h.style.zIndex==Ic()&&(J.preventDefault(),M())}function N(J){o&&q(g)}function q(J,le){le&&t(8,$=""),J&&(S||(S=setTimeout(()=>{if(clearTimeout(S),S=null,!J)return;if(J.scrollHeight-J.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}J.scrollTop==0?t(8,$+=" scroll-top-reached"):J.scrollTop+J.offsetHeight==J.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100)))}Xt(()=>(b1().appendChild(h),()=>{var J;clearTimeout(S),F(),(J=h==null?void 0:h.classList)==null||J.add("hidden"),setTimeout(()=>{h==null||h.remove()},0)}));const j=()=>a?M():!0;function Z(J){te[J?"unshift":"push"](()=>{g=J,t(7,g)})}const X=J=>q(J.target);function K(J){te[J?"unshift":"push"](()=>{h=J,t(6,h)})}return n.$$set=J=>{"class"in J&&t(1,l=J.class),"active"in J&&t(0,o=J.active),"popup"in J&&t(2,r=J.popup),"overlayClose"in J&&t(3,a=J.overlayClose),"btnClose"in J&&t(4,u=J.btnClose),"escClose"in J&&t(12,f=J.escClose),"beforeOpen"in J&&t(13,c=J.beforeOpen),"beforeHide"in J&&t(14,d=J.beforeHide),"$$scope"in J&&t(18,s=J.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&C!=o&&D(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&h&&I(),n.$$.dirty[0]&1&&(o?P():F())},[o,l,r,a,u,M,h,g,$,R,N,q,f,c,d,T,O,C,s,i,j,Z,X,K]}class on extends ve{constructor(e){super(),be(this,e,y4,v4,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 k4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function w4(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=U(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&se(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function S4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function C4(n){let e,t,i;return t=new g1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function $4(n){var Ae;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,m,_,h=n[2].status+"",g,y,S,$,C,T,M=((Ae=n[2].method)==null?void 0:Ae.toUpperCase())+"",O,D,I,P,F,R,N=n[2].auth+"",q,j,Z,X,K,J,le=n[2].url+"",ie,ee,Te,Pe,je,Ve,ke,Ce,Je,_t,Ze,We=n[2].remoteIp+"",yt,pe,_e,Ye,Mt,Ie,rt=n[2].userIp+"",Ee,lt,Et,zt,In,Ln,Kn=n[2].userAgent+"",Jn,kt,dn,ti,us,di,$i,ge,we,ct,xe,Wt,bn,Pn,sn,pn;function Ll(Le,Me){return Le[2].referer?w4:k4}let W=Ll(n),G=W(n);const ne=[C4,S4],oe=[];function Se(Le,Me){return Me&4&&($i=null),$i==null&&($i=!z.isEmpty(Le[2].meta)),$i?0:1}return ge=Se(n,-1),we=oe[ge]=ne[ge](n),sn=new ki({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=E(),o=v("td"),a=U(r),u=E(),f=v("tr"),c=v("td"),c.textContent="Status",d=E(),m=v("td"),_=v("span"),g=U(h),y=E(),S=v("tr"),$=v("td"),$.textContent="Method",C=E(),T=v("td"),O=U(M),D=E(),I=v("tr"),P=v("td"),P.textContent="Auth",F=E(),R=v("td"),q=U(N),j=E(),Z=v("tr"),X=v("td"),X.textContent="URL",K=E(),J=v("td"),ie=U(le),ee=E(),Te=v("tr"),Pe=v("td"),Pe.textContent="Referer",je=E(),Ve=v("td"),G.c(),ke=E(),Ce=v("tr"),Je=v("td"),Je.textContent="Remote IP",_t=E(),Ze=v("td"),yt=U(We),pe=E(),_e=v("tr"),Ye=v("td"),Ye.textContent="User IP",Mt=E(),Ie=v("td"),Ee=U(rt),lt=E(),Et=v("tr"),zt=v("td"),zt.textContent="UserAgent",In=E(),Ln=v("td"),Jn=U(Kn),kt=E(),dn=v("tr"),ti=v("td"),ti.textContent="Meta",us=E(),di=v("td"),we.c(),ct=E(),xe=v("tr"),Wt=v("td"),Wt.textContent="Created",bn=E(),Pn=v("td"),B(sn.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(_,"class","label"),Q(_,"label-danger",n[2].status>=400),p($,"class","min-width txt-hint txt-bold"),p(P,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Pe,"class","min-width txt-hint txt-bold"),p(Je,"class","min-width txt-hint txt-bold"),p(Ye,"class","min-width txt-hint txt-bold"),p(zt,"class","min-width txt-hint txt-bold"),p(ti,"class","min-width txt-hint txt-bold"),p(Wt,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Le,Me){w(Le,e,Me),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,m),b(m,_),b(_,g),b(t,y),b(t,S),b(S,$),b(S,C),b(S,T),b(T,O),b(t,D),b(t,I),b(I,P),b(I,F),b(I,R),b(R,q),b(t,j),b(t,Z),b(Z,X),b(Z,K),b(Z,J),b(J,ie),b(t,ee),b(t,Te),b(Te,Pe),b(Te,je),b(Te,Ve),G.m(Ve,null),b(t,ke),b(t,Ce),b(Ce,Je),b(Ce,_t),b(Ce,Ze),b(Ze,yt),b(t,pe),b(t,_e),b(_e,Ye),b(_e,Mt),b(_e,Ie),b(Ie,Ee),b(t,lt),b(t,Et),b(Et,zt),b(Et,In),b(Et,Ln),b(Ln,Jn),b(t,kt),b(t,dn),b(dn,ti),b(dn,us),b(dn,di),oe[ge].m(di,null),b(t,ct),b(t,xe),b(xe,Wt),b(xe,bn),b(xe,Pn),V(sn,Pn,null),pn=!0},p(Le,Me){var Be;(!pn||Me&4)&&r!==(r=Le[2].id+"")&&se(a,r),(!pn||Me&4)&&h!==(h=Le[2].status+"")&&se(g,h),(!pn||Me&4)&&Q(_,"label-danger",Le[2].status>=400),(!pn||Me&4)&&M!==(M=((Be=Le[2].method)==null?void 0:Be.toUpperCase())+"")&&se(O,M),(!pn||Me&4)&&N!==(N=Le[2].auth+"")&&se(q,N),(!pn||Me&4)&&le!==(le=Le[2].url+"")&&se(ie,le),W===(W=Ll(Le))&&G?G.p(Le,Me):(G.d(1),G=W(Le),G&&(G.c(),G.m(Ve,null))),(!pn||Me&4)&&We!==(We=Le[2].remoteIp+"")&&se(yt,We),(!pn||Me&4)&&rt!==(rt=Le[2].userIp+"")&&se(Ee,rt),(!pn||Me&4)&&Kn!==(Kn=Le[2].userAgent+"")&&se(Jn,Kn);let Ue=ge;ge=Se(Le,Me),ge===Ue?oe[ge].p(Le,Me):(ae(),L(oe[Ue],1,1,()=>{oe[Ue]=null}),ue(),we=oe[ge],we?we.p(Le,Me):(we=oe[ge]=ne[ge](Le),we.c()),A(we,1),we.m(di,null));const Ne={};Me&4&&(Ne.date=Le[2].created),sn.$set(Ne)},i(Le){pn||(A(we),A(sn.$$.fragment,Le),pn=!0)},o(Le){L(we),L(sn.$$.fragment,Le),pn=!1},d(Le){Le&&k(e),G.d(),oe[ge].d(),H(sn)}}}function T4(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function M4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function O4(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[M4],header:[T4],default:[$4]},$$scope:{ctx:n}};return e=new on({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function E4(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Fe.call(this,n,c)}function f(c){Fe.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class D4 extends ve{constructor(e){super(),be(this,e,E4,O4,me,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function A4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Lc(n){let e,t;return e=new c4({props:{filter:n[4],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Pc(n){let e,t;return e=new Dk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function I4(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S=n[3],$,C=n[3],T,M;r=new Ko({}),r.$on("refresh",n[9]),d=new de({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[A4,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),_=new Yo({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),_.$on("submit",n[11]);let O=Lc(n),D=Pc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=U(n[6]),o=E(),B(r.$$.fragment),a=E(),u=v("div"),f=E(),c=v("div"),B(d.$$.fragment),m=E(),B(_.$$.fragment),h=E(),g=v("div"),y=E(),O.c(),$=E(),D.c(),T=ye(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(g,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,P){w(I,e,P),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),V(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),V(d,c,null),b(e,m),V(_,e,null),b(e,h),b(e,g),b(e,y),O.m(e,null),w(I,$,P),D.m(I,P),w(I,T,P),M=!0},p(I,P){(!M||P&64)&&se(l,I[6]);const F={};P&49154&&(F.$$scope={dirty:P,ctx:I}),d.$set(F);const R={};P&1&&(R.value=I[0]),_.$set(R),P&8&&me(S,S=I[3])?(ae(),L(O,1,1,x),ue(),O=Lc(I),O.c(),A(O,1),O.m(e,null)):O.p(I,P),P&8&&me(C,C=I[3])?(ae(),L(D,1,1,x),ue(),D=Pc(I),D.c(),A(D,1),D.m(T.parentNode,T)):D.p(I,P)},i(I){M||(A(r.$$.fragment,I),A(d.$$.fragment,I),A(_.$$.fragment,I),A(O),A(D),M=!0)},o(I){L(r.$$.fragment,I),L(d.$$.fragment,I),L(_.$$.fragment,I),L(O),L(D),M=!1},d(I){I&&k(e),H(r),H(d),H(_),O.d(I),I&&k($),I&&k(T),D.d(I)}}}function L4(n){let e,t,i,s;e=new Sn({props:{$$slots:{default:[I4]},$$scope:{ctx:n}}});let l={};return i=new D4({props:l}),n[13](i),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(o,r){V(e,o,r),w(o,t,r),V(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&k(t),n[13](null),H(i,o)}}}const Fc="includeAdminLogs";function P4(n,e,t){var y;let i,s,l;Ke(n,Dt,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];ln(Dt,l="Request logs",l);let r,a="",u=((y=window.localStorage)==null?void 0:y.getItem(Fc))<<0,f=1;function c(){t(3,f++,f)}const d=()=>c();function m(){u=this.checked,t(1,u)}const _=S=>t(0,a=S.detail),h=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function g(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Fc,u<<0),n.$$.dirty&1&&t(4,s=z.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,c,d,m,_,h,g]}class F4 extends ve{constructor(e){super(),be(this,e,P4,L4,me,{})}}const lu=An({});function hn(n,e,t){lu.set({text:n,yesCallback:e,noCallback:t})}function v1(){lu.set({})}function Nc(n){let e,t,i;const s=n[17].default,l=wt(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Ct(l,s,o,o[16],i?St(s,o[16],r,null):$t(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&Ge(()=>{i&&(t||(t=qe(e,ui,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,ui,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function N4(n){let e,t,i,s,l=n[0]&&Nc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[Y(window,"mousedown",n[5]),Y(window,"click",n[6]),Y(window,"keydown",n[4]),Y(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Nc(o),l.c(),A(l,1),l.m(e,null)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,Oe(s)}}}function R4(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,_,h=!1;const g=Tt();function y(){t(0,o=!1),h=!1,clearTimeout(_)}function S(){t(0,o=!0),clearTimeout(_),_=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function $(){o?y():S()}function C(j){return!c||j.classList.contains(u)||(m==null?void 0:m.contains(j))&&!c.contains(j)||c.contains(j)&&j.closest&&j.closest("."+u)}function T(j){(!o||C(j.target))&&(j.preventDefault(),j.stopPropagation(),$())}function M(j){(j.code==="Enter"||j.code==="Space")&&(!o||C(j.target))&&(j.preventDefault(),j.stopPropagation(),$())}function O(j){o&&r&&j.code==="Escape"&&(j.preventDefault(),y())}function D(j){o&&!(c!=null&&c.contains(j.target))?h=!0:h&&(h=!1)}function I(j){var Z;o&&h&&!(c!=null&&c.contains(j.target))&&!(m!=null&&m.contains(j.target))&&!((Z=j.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function P(j){D(j),I(j)}function F(j){R(),c==null||c.addEventListener("click",T),t(15,m=j||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",T),m==null||m.addEventListener("keydown",M)}function R(){clearTimeout(_),c==null||c.removeEventListener("click",T),m==null||m.removeEventListener("click",T),m==null||m.removeEventListener("keydown",M)}Xt(()=>(F(),()=>R()));function N(j){te[j?"unshift":"push"](()=>{d=j,t(3,d)})}function q(j){te[j?"unshift":"push"](()=>{c=j,t(2,c)})}return n.$$set=j=>{"trigger"in j&&t(8,l=j.trigger),"active"in j&&t(0,o=j.active),"escClose"in j&&t(9,r=j.escClose),"autoScroll"in j&&t(10,a=j.autoScroll),"closableClass"in j&&t(11,u=j.closableClass),"class"in j&&t(1,f=j.class),"$$scope"in j&&t(16,s=j.$$scope)},n.$$.update=()=>{var j,Z;n.$$.dirty&260&&c&&F(l),n.$$.dirty&32769&&(o?((j=m==null?void 0:m.classList)==null||j.add("active"),g("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),g("hide")))},[o,f,c,d,O,D,I,P,l,r,a,u,y,S,$,m,s,i,N,q]}class Yn extends ve{constructor(e){super(),be(this,e,R4,N4,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 Rc(n,e,t){const i=n.slice();return i[27]=e[t],i}function q4(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=E(),l=v("label"),o=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),b(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function j4(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a){var f;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){var c;const f={};if(u[0]&1073741824&&(f.id=a[30]),u[0]&1&&(f.placeholder=`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`),!t&&u[0]&4&&(t=!0,f.value=a[2],he(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function z4(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function V4(n){let e,t,i,s;const l=[z4,j4],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),L(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function qc(n){let e,t,i,s=n[10],l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[V4,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&qc(n);return{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),r&&r.c(),l=ye()},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=qc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),r&&r.d(a),a&&k(l)}}}function B4(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=U(t),s=U(" index")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&k(e)}}}function zc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[$e(ze.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,Oe(i)}}}function U4(n){let e,t,i,s,l,o,r=n[5]!=""&&zc(n);return{c(){r&&r.c(),e=E(),t=v("button"),t.innerHTML='Cancel',i=E(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=zc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&k(i),a&&k(s),l=!1,Oe(o)}}}function W4(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[U4],header:[B4],default:[H4]},$$scope:{ctx:n}};for(let l=0;lK.name==j);X?z.removeByValue(Z.columns,X):z.pushUnique(Z.columns,{name:j}),t(2,d=z.buildIndex(Z))}Xt(async()=>{t(8,h=!0);try{t(7,_=(await at(()=>import("./CodeEditor-8fadd9a5.js"),["./CodeEditor-8fadd9a5.js","./index-fd4289fb.js"],import.meta.url)).default)}catch(j){console.warn(j)}t(8,h=!1)});const M=()=>$(),O=()=>y(),D=()=>C(),I=j=>{t(3,s.unique=j.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=z.buildIndex(s))};function P(j){d=j,t(2,d)}const F=j=>T(j);function R(j){te[j?"unshift":"push"](()=>{f=j,t(4,f)})}function N(j){Fe.call(this,n,j)}function q(j){Fe.call(this,n,j)}return n.$$set=j=>{e=Re(Re({},e),Gt(j)),t(14,r=Xe(e,o)),"collection"in j&&t(0,u=j.collection)},n.$$.update=()=>{var j,Z,X;n.$$.dirty[0]&1&&t(10,i=(((Z=(j=u==null?void 0:u.schema)==null?void 0:j.filter(K=>!K.toDelete))==null?void 0:Z.map(K=>K.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=z.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(K=>K.name))||[])},[u,y,d,s,f,c,m,_,h,l,i,$,C,T,r,g,M,O,D,I,P,F,R,N,q]}class K4 extends ve{constructor(e){super(),be(this,e,Y4,W4,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 s=z.parseIndex(i[10]);return i[11]=s,i}function Hc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Uc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Hc();function c(){return n[4](n[10],n[13])}return{c(){var m,_;e=v("button"),f&&f.c(),t=E(),i=v("span"),l=U(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((_=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&_.message?"label-danger":"")+" svelte-167lbwu")},m(m,_){var h,g;w(m,e,_),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[$e(r=ze.call(null,e,((g=(h=n[2].indexes)==null?void 0:h[n[13]])==null?void 0:g.message)||"")),Y(e,"click",c)],a=!0)},p(m,_){var h,g,y,S,$;n=m,n[11].unique?f||(f=Hc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),_&1&&s!==(s=((h=n[11].columns)==null?void 0:h.map(Uc).join(", "))+"")&&se(l,s),_&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&&jt(r.update)&&_&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&k(e),f&&f.d(),a=!1,Oe(u)}}}function J4(n){var C,T,M;let e,t,i=(((T=(C=n[0])==null?void 0:C.indexes)==null?void 0:T.length)||0)+"",s,l,o,r,a,u,f,c,d,m,_,h,g=((M=n[0])==null?void 0:M.indexes)||[],y=[];for(let O=0;Oce(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=v("div");for(let O=0;O+ - New index`,f=E(),B(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(O,D){w(O,e,D),b(e,t),b(e,s),b(e,l),w(O,o,D),w(O,r,D);for(let I=0;Id=!1)),c.$set(I)},i(O){m||(A(c.$$.fragment,O),m=!0)},o(O){L(c.$$.fragment,O),m=!1},d(O){O&&k(e),O&&k(o),O&&k(r),ht(y,O),O&&k(f),n[6](null),H(c,O),_=!1,h()}}}const Uc=n=>n.name;function Z4(n,e,t){let i;Ke(n,wi,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let h=0;hl==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){te[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const c=m=>{for(let _=0;_{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,c,d]}class G4 extends ve{constructor(e){super(),be(this,e,Z4,J4,me,{collection:0})}}function Wc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function c(...d){return n[5](n[6],...d)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),o=U(l),r=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(d,m){w(d,e,m),b(e,t),b(e,i),b(e,s),b(s,o),b(e,r),a||(u=[Y(e,"click",Dn(f)),Y(e,"keydown",Dn(c))],a=!0)},p(d,m){n=d},d(d){d&&k(e),a=!1,Oe(u)}}}function X4(n){let e,t=n[2],i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class eC extends ve{constructor(e){super(),be(this,e,x4,Q4,me,{class:0})}}const tC=n=>({interactive:n&64,hasErrors:n&32}),Kc=n=>({interactive:n[6],hasErrors:n[5]}),nC=n=>({interactive:n&64,hasErrors:n&32}),Jc=n=>({interactive:n[6],hasErrors:n[5]}),iC=n=>({interactive:n&64,hasErrors:n&32}),Zc=n=>({interactive:n[6],hasErrors:n[5]}),sC=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]});function Xc(n){let e;return{c(){e=v("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&&k(e)}}}function Qc(n){let e,t,i,s;return{c(){e=v("span"),p(e,"class","marker marker-required")},m(l,o){w(l,e,o),i||(s=$e(t=ze.call(null,e,n[4])),i=!0)},p(l,o){t&&jt(t.update)&&o&16&&t.update.call(null,l[4])},d(l){l&&k(e),i=!1,s()}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_=n[0].required&&Qc(n);return{c(){e=v("div"),_&&_.c(),t=E(),i=v("div"),s=v("i"),o=E(),r=v("input"),p(e,"class","markers"),p(s,"class",l=z.getFieldTypeIcon(n[0].type)),p(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(i,"txt-disabled",!n[6]),p(r,"type","text"),r.required=!0,r.disabled=a=!n[6],r.readOnly=u=n[0].id&&n[0].system,p(r,"spellcheck","false"),r.autofocus=f=!n[0].id,p(r,"placeholder","Field name"),r.value=c=n[0].name},m(h,g){w(h,e,g),_&&_.m(e,null),w(h,t,g),w(h,i,g),b(i,s),w(h,o,g),w(h,r,g),n[14](r),n[0].id||r.focus(),d||(m=Y(r,"input",n[15]),d=!0)},p(h,g){h[0].required?_?_.p(h,g):(_=Qc(h),_.c(),_.m(e,null)):_&&(_.d(1),_=null),g&1&&l!==(l=z.getFieldTypeIcon(h[0].type))&&p(s,"class",l),g&64&&Q(i,"txt-disabled",!h[6]),g&64&&a!==(a=!h[6])&&(r.disabled=a),g&1&&u!==(u=h[0].id&&h[0].system)&&(r.readOnly=u),g&1&&f!==(f=!h[0].id)&&(r.autofocus=f),g&1&&c!==(c=h[0].name)&&r.value!==c&&(r.value=c)},d(h){h&&k(e),_&&_.d(),h&&k(t),h&&k(i),h&&k(o),h&&k(r),n[14](null),d=!1,m()}}}function oC(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rC(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("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")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[11]),s=!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&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function aC(n){let e,t,i;return{c(){e=v("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(s,l){w(s,e,l),t||(i=[$e(ze.call(null,e,"Restore")),Y(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,Oe(i)}}}function xc(n){let e,t,i,s,l,o,r,a,u,f,c;const d=n[13].options,m=wt(d,n,n[17],Zc),_=n[13].beforeNonempty,h=wt(_,n,n[17],Jc);r=new de({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[uC,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}});const g=n[13].afterNonempty,y=wt(g,n,n[17],Kc);let S=!n[0].toDelete&&ed(n);return{c(){e=v("div"),t=v("div"),i=v("div"),m&&m.c(),s=E(),h&&h.c(),l=E(),o=v("div"),B(r.$$.fragment),a=E(),y&&y.c(),u=E(),S&&S.c(),p(i,"class","col-sm-12 hidden-empty"),p(o,"class","col-sm-4"),p(t,"class","grid grid-sm"),p(e,"class","schema-field-options")},m($,C){w($,e,C),b(e,t),b(t,i),m&&m.m(i,null),b(t,s),h&&h.m(t,null),b(t,l),b(t,o),V(r,o,null),b(t,a),y&&y.m(t,null),b(t,u),S&&S.m(t,null),c=!0},p($,C){m&&m.p&&(!c||C&131168)&&Ct(m,d,$,$[17],c?St(d,$[17],C,iC):$t($[17]),Zc),h&&h.p&&(!c||C&131168)&&Ct(h,_,$,$[17],c?St(_,$[17],C,nC):$t($[17]),Jc);const T={};C&8519697&&(T.$$scope={dirty:C,ctx:$}),r.$set(T),y&&y.p&&(!c||C&131168)&&Ct(y,g,$,$[17],c?St(g,$[17],C,tC):$t($[17]),Kc),$[0].toDelete?S&&(ae(),L(S,1,1,()=>{S=null}),ue()):S?(S.p($,C),C&1&&A(S,1)):(S=ed($),S.c(),A(S,1),S.m(t,null))},i($){c||(A(m,$),A(h,$),A(r.$$.fragment,$),A(y,$),A(S),$&&Ge(()=>{c&&(f||(f=qe(e,st,{duration:150},!0)),f.run(1))}),c=!0)},o($){L(m,$),L(h,$),L(r.$$.fragment,$),L(y,$),L(S),$&&(f||(f=qe(e,st,{duration:150},!1)),f.run(0)),c=!1},d($){$&&k(e),m&&m.d($),h&&h.d($),H(r),y&&y.d($),S&&S.d(),$&&f&&f.end()}}}function uC(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),o=U(n[4]),r=E(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[23])},m(m,_){w(m,e,_),e.checked=n[0].required,w(m,i,_),w(m,s,_),b(s,l),b(l,o),b(s,r),b(s,a),c||(d=[Y(e,"change",n[16]),$e(u=ze.call(null,a,{text:`Requires the field value NOT to be ${z.zeroDefaultStr(n[0])}.`,position:"right"}))],c=!0)},p(m,_){_&8388608&&t!==(t=m[23])&&p(e,"id",t),_&1&&(e.checked=m[0].required),_&16&&se(o,m[4]),u&&jt(u.update)&&_&1&&u.update.call(null,{text:`Requires the field value NOT to be ${z.zeroDefaultStr(m[0])}.`,position:"right"}),_&8388608&&f!==(f=m[23])&&p(s,"for",f)},d(m){m&&k(e),m&&k(i),m&&k(s),c=!1,Oe(d)}}}function ed(n){let e,t,i,s,l,o,r,a,u;return a=new Yn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[fC]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=E(),s=v("div"),l=v("button"),o=v("i"),r=E(),B(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 m-l-auto txt-right")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),V(a,l,null),u=!0},p(f,c){const d={};c&131072&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){L(a.$$.fragment,f),u=!1},d(f){f&&k(e),H(a)}}}function fC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function cC(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Xc();s=new de({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[lC]},$$scope:{ctx:n}}});const c=n[13].default,d=wt(c,n,n[17],Gc),m=d||oC();function _(S,$){if(S[0].toDelete)return aC;if(S[6])return rC}let h=_(n),g=h&&h(n),y=n[6]&&n[3]&&xc(n);return{c(){e=v("div"),t=v("div"),f&&f.c(),i=E(),B(s.$$.fragment),l=E(),m&&m.c(),o=E(),g&&g.c(),r=E(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,$){w(S,e,$),b(e,t),f&&f.m(t,null),b(t,i),V(s,t,null),b(t,l),m&&m.m(t,null),b(t,o),g&&g.m(t,null),b(e,r),y&&y.m(e,null),u=!0},p(S,[$]){S[6]?f||(f=Xc(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const C={};$&64&&(C.class="form-field required m-0 "+(S[6]?"":"disabled")),$&2&&(C.name="schema."+S[1]+".name"),$&131157&&(C.$$scope={dirty:$,ctx:S}),s.$set(C),d&&d.p&&(!u||$&131168)&&Ct(d,c,S,S[17],u?St(c,S[17],$,sC):$t(S[17]),Gc),h===(h=_(S))&&g?g.p(S,$):(g&&g.d(1),g=h&&h(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,$),$&72&&A(y,1)):(y=xc(S),y.c(),A(y,1),y.m(e,null)):y&&(ae(),L(y,1,1,()=>{y=null}),ue()),(!u||$&1)&&Q(e,"required",S[0].required),(!u||$&72)&&Q(e,"expanded",S[6]&&S[3]),(!u||$&1)&&Q(e,"deleted",S[0].toDelete)},i(S){u||(A(s.$$.fragment,S),A(m,S),A(y),S&&Ge(()=>{u&&(a||(a=qe(e,st,{duration:150},!0)),a.run(1))}),u=!0)},o(S){L(s.$$.fragment,S),L(m,S),L(y),S&&(a||(a=qe(e,st,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),H(s),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Mr=[];function dC(n,e,t){let i,s,l,o;Ke(n,wi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+z.randomString(8),f=Tt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=z.initSchemaField()}=e,_,h=!1;function g(){m.id?t(0,m.toDelete=!0,m):f("remove")}function y(){t(0,m.toDelete=!1,m),tn({})}function S(P){return z.slugify(P)}function $(){t(3,h=!0),M()}function C(){t(3,h=!1)}function T(){h?C():$()}function M(){for(let P of Mr)P.id!=u&&P.collapse()}Xt(()=>(Mr.push({id:u,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),_==null||_.select()),()=>{z.removeByKey(Mr,"id",u)}));function O(P){te[P?"unshift":"push"](()=>{_=P,t(2,_)})}const D=P=>{const F=m.name;t(0,m.name=S(P.target.value),m),P.target.value=m.name,f("rename",{oldName:F,newName:m.name})};function I(){m.required=this.checked,t(0,m)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,m=P.field),"$$scope"in P&&t(17,a=P.$$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&4098&&t(5,s=!z.isEmpty(z.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[m==null?void 0:m.type]||"Nonempty")},[m,d,_,h,l,s,i,f,g,y,S,T,o,r,O,D,I,a]}class ci extends ve{constructor(e){super(),be(this,e,dC,cC,me,{key:1,field:0})}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.min&&re(l,u[0].options.min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),re(l,n[0].options.max),a||(u=Y(l,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].options.max&&re(l,f[0].options.max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function hC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Regex pattern"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.pattern),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0].options.pattern&&re(l,u[0].options.pattern)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function _C(n){let e,t,i,s,l,o,r,a,u,f;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[pC,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[mC,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[hC,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),a=v("div"),B(u.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),b(e,a),V(u,a,null),f=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&1537&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d&2&&(_.name="schema."+c[1]+".options.max"),d&1537&&(_.$$scope={dirty:d,ctx:c}),o.$set(_);const h={};d&2&&(h.name="schema."+c[1]+".options.pattern"),d&1537&&(h.$$scope={dirty:d,ctx:c}),u.$set(h)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(u.$$.fragment,c),f=!1},d(c){c&&k(e),H(i),H(o),H(u)}}}function gC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[_C]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function bC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=pt(this.value),t(0,l)}function a(){l.options.max=pt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(m){l=m,t(0,l)}function c(m){Fe.call(this,n,m)}function d(m){Fe.call(this,n,m)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(2,s=Xe(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class vC extends ve{constructor(e){super(),be(this,e,bC,gC,me,{field:0,key:1})}}function yC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.min&&re(l,u[0].options.min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function kC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min",r=n[0].options.min)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),re(l,n[0].options.max),a||(u=Y(l,"input",n[4]),a=!0)},p(f,c){c&256&&i!==(i=f[8])&&p(e,"for",i),c&256&&o!==(o=f[8])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].options.max&&re(l,f[0].options.max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function wC(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[yC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[kC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function SC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[wC]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function CC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=pt(this.value),t(0,l)}function a(){l.options.max=pt(this.value),t(0,l)}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(2,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class $C extends ve{constructor(e){super(),be(this,e,CC,SC,me,{field:0,key:1})}}function TC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function MC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=Re(Re({},e),Gt(f)),t(2,s=Xe(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class OC extends ve{constructor(e){super(),be(this,e,MC,TC,me,{field:0,key:1})}}function EC(n){let e,t,i,s,l=[{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=z.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Re(Re({},e),Gt(c)),t(5,l=Xe(e,s)),"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,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&1&&t(4,i=(o||[]).join(", "))},[o,r,a,u,i,l,f]}class Ns extends ve{constructor(e){super(),be(this,e,DC,EC,me,{value:0,separator:1,readonly:2,disabled:3})}}function AC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[3](g)}let h={id:n[8],disabled:!z.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(h.value=n[0].options.exceptDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(ze.call(null,s,{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&256&&l!==(l=g[8]))&&p(e,"for",l);const S={};y&256&&(S.id=g[8]),y&1&&(S.disabled=!z.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function IC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[4](g)}let h={id:n[8]+".options.onlyDomains",disabled:!z.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(ze.call(null,s,{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&256&&l!==(l=g[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=g[8]+".options.onlyDomains"),y&1&&(S.disabled=!z.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function LC(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[AC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[IC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function PC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[LC]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function FC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(2,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class y1 extends ve{constructor(e){super(),be(this,e,FC,PC,me,{field:0,key:1})}}function NC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function RC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=Re(Re({},e),Gt(f)),t(2,s=Xe(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class qC extends ve{constructor(e){super(),be(this,e,RC,NC,me,{field:0,key:1})}}function jC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=Re(Re({},e),Gt(f)),t(2,s=Xe(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class VC extends ve{constructor(e){super(),be(this,e,zC,jC,me,{field:0,key:1})}}var Or=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_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},_l={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},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},qn=function(n){return n===!0?1:0};function td(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Er=function(n){return n instanceof Array?n:[n]};function mn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ft(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 k1(n,e){if(e(n))return n;if(n.parentNode)return k1(n.parentNode,e)}function to(n,e){var t=ft("div","numInputWrapper"),i=ft("input","numInput "+n),s=ft("span","arrowUp"),l=ft("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(s),t.appendChild(l),t}function $n(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Dr=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},HC={D:Dr,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*qn(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),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},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:Dr,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:Dr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Xi={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})"},rl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[rl.w(n,e,t)]},F:function(n,e,t){return Po(rl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(rl.h(n,e,t))},H:function(n){return vn(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[qn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(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)}},w1=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?_l:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return rl[c]&&m[d-1]!=="\\"?rl[c](r,f,t):c!=="\\"?c:""}).join("")}},ma=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?_l:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ws).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var _=void 0,h=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ir(t.config);G.setHours(ne.hours,ne.minutes,ne.seconds,G.getMilliseconds()),t.selectedDates=[G],t.latestSelectedDateObj=G}W!==void 0&&W.type!=="blur"&&Ll(W);var oe=t._input.value;c(),sn(),t._input.value!==oe&&t._debouncedChange()}function u(W,G){return W%12+12*qn(G===t.l10n.amPM[1])}function f(W){switch(W%24){case 0:case 12:return 12;default:return W%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var W=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,G=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(W=u(W,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Tn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Se=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Tn(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 Ae=Ar(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Le=Ar(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Me=Ar(W,G,ne);if(Me>Le&&Me=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ne)))}function _(W){var G=$n(W),ne=parseInt(G.value)+(W.delta||0);(ne/1e3>1||W.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&ke(ne)}function h(W,G,ne,oe){if(G instanceof Array)return G.forEach(function(Se){return h(W,Se,ne,oe)});if(W instanceof Array)return W.forEach(function(Se){return h(Se,G,ne,oe)});W.addEventListener(G,ne,oe),t._handlers.push({remove:function(){return W.removeEventListener(G,ne,oe)}})}function g(){we("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(oe){return h(oe,"click",t[ne])})}),t.isMobile){$i();return}var W=td(yt,50);if(t._debouncedChange=td(g,YC),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&We($n(ne))}),h(t._input,"keydown",Ze),t.calendarContainer!==void 0&&h(t.calendarContainer,"keydown",Ze),!t.config.inline&&!t.config.static&&h(window,"resize",W),window.ontouchstart!==void 0?h(window.document,"touchstart",Ve):h(window.document,"mousedown",Ve),h(window.document,"focus",Ve,{capture:!0}),t.config.clickOpens===!0&&(h(t._input,"focus",t.open),h(t._input,"click",t.open)),t.daysContainer!==void 0&&(h(t.monthNav,"click",pn),h(t.monthNav,["keyup","increment"],_),h(t.daysContainer,"click",In)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var G=function(ne){return $n(ne).select()};h(t.timeContainer,["increment"],a),h(t.timeContainer,"blur",a,{capture:!0}),h(t.timeContainer,"click",$),h([t.hourElement,t.minuteElement],["focus","click"],G),t.secondElement!==void 0&&h(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&h(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&h(t._input,"blur",_t)}function S(W,G){var ne=W!==void 0?t.parseDate(W):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(W);var Se=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&&(!Se&&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 Ae=ft("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ae,t.element),Ae.appendChild(t.element),t.altInput&&Ae.appendChild(t.altInput),Ae.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(W,G,ne,oe){var Se=Ce(G,!0),Ae=ft("span",W,G.getDate().toString());return Ae.dateObj=G,Ae.$i=oe,Ae.setAttribute("aria-label",t.formatDate(G,t.config.ariaDateFormat)),W.indexOf("hidden")===-1&&Tn(G,t.now)===0&&(t.todayDateElem=Ae,Ae.classList.add("today"),Ae.setAttribute("aria-current","date")),Se?(Ae.tabIndex=-1,xe(G)&&(Ae.classList.add("selected"),t.selectedDateElem=Ae,t.config.mode==="range"&&(mn(Ae,"startRange",t.selectedDates[0]&&Tn(G,t.selectedDates[0],!0)===0),mn(Ae,"endRange",t.selectedDates[1]&&Tn(G,t.selectedDates[1],!0)===0),W==="nextMonthDay"&&Ae.classList.add("inRange")))):Ae.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Wt(G)&&!xe(G)&&Ae.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&W!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(G)+""),we("onDayCreate",Ae),Ae}function O(W){W.focus(),t.config.mode==="range"&&We(W)}function D(W){for(var G=W>0?0:t.config.showMonths-1,ne=W>0?t.config.showMonths:-1,oe=G;oe!=ne;oe+=W)for(var Se=t.daysContainer.children[oe],Ae=W>0?0:Se.children.length-1,Le=W>0?Se.children.length:-1,Me=Ae;Me!=Le;Me+=W){var Ue=Se.children[Me];if(Ue.className.indexOf("hidden")===-1&&Ce(Ue.dateObj))return Ue}}function I(W,G){for(var ne=W.className.indexOf("Month")===-1?W.dateObj.getMonth():t.currentMonth,oe=G>0?t.config.showMonths:-1,Se=G>0?1:-1,Ae=ne-t.currentMonth;Ae!=oe;Ae+=Se)for(var Le=t.daysContainer.children[Ae],Me=ne-t.currentMonth===Ae?W.$i+G:G<0?Le.children.length-1:0,Ue=Le.children.length,Ne=Me;Ne>=0&&Ne0?Ue:-1);Ne+=Se){var Be=Le.children[Ne];if(Be.className.indexOf("hidden")===-1&&Ce(Be.dateObj)&&Math.abs(W.$i-Ne)>=Math.abs(G))return O(Be)}t.changeMonth(Se),P(D(Se),0)}function P(W,G){var ne=l(),oe=Je(ne||document.body),Se=W!==void 0?W:oe?ne:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:D(G>0?1:-1);Se===void 0?t._input.focus():oe?I(Se,G):O(Se)}function F(W,G){for(var ne=(new Date(W,G,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((G-1+12)%12,W),Se=t.utils.getDaysInMonth(G,W),Ae=window.document.createDocumentFragment(),Le=t.config.showMonths>1,Me=Le?"prevMonthDay hidden":"prevMonthDay",Ue=Le?"nextMonthDay hidden":"nextMonthDay",Ne=oe+1-ne,Be=0;Ne<=oe;Ne++,Be++)Ae.appendChild(M("flatpickr-day "+Me,new Date(W,G-1,Ne),Ne,Be));for(Ne=1;Ne<=Se;Ne++,Be++)Ae.appendChild(M("flatpickr-day",new Date(W,G,Ne),Ne,Be));for(var vt=Se+1;vt<=42-ne&&(t.config.showMonths===1||Be%7!==0);vt++,Be++)Ae.appendChild(M("flatpickr-day "+Ue,new Date(W,G+1,vt%Se),vt,Be));var ni=ft("div","dayContainer");return ni.appendChild(Ae),ni}function R(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var W=document.createDocumentFragment(),G=0;G1||t.config.monthSelectorType!=="dropdown")){var W=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var G=0;G<12;G++)if(W(G)){var ne=ft("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,G).getMonth().toString(),ne.textContent=Po(G,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===G&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var W=ft("div","flatpickr-month"),G=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ft("span","cur-month"):(t.monthsDropdownContainer=ft("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),h(t.monthsDropdownContainer,"change",function(Le){var Me=$n(Le),Ue=parseInt(Me.value,10);t.changeMonth(Ue-t.currentMonth),we("onMonthChange")}),N(),ne=t.monthsDropdownContainer);var oe=to("cur-year",{tabindex:"-1"}),Se=oe.getElementsByTagName("input")[0];Se.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Se.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Se.setAttribute("max",t.config.maxDate.getFullYear().toString()),Se.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ae=ft("div","flatpickr-current-month");return Ae.appendChild(ne),Ae.appendChild(oe),G.appendChild(Ae),W.appendChild(G),{container:W,yearElement:Se,monthElement:ne}}function j(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var W=t.config.showMonths;W--;){var G=q();t.yearElements.push(G.yearElement),t.monthElements.push(G.monthElement),t.monthNav.appendChild(G.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ft("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ft("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ft("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,j(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(W){t.__hidePrevMonthArrow!==W&&(mn(t.prevMonthNav,"flatpickr-disabled",W),t.__hidePrevMonthArrow=W)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(W){t.__hideNextMonthArrow!==W&&(mn(t.nextMonthNav,"flatpickr-disabled",W),t.__hideNextMonthArrow=W)}}),t.currentYearElement=t.yearElements[0],bn(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var W=Ir(t.config);t.timeContainer=ft("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var G=ft("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var oe=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?W.hours:f(W.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():W.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(G),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Se=to("flatpickr-second");t.secondElement=Se.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():W.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(ft("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Se)}return t.config.time_24hr||(t.amPM=ft("span","flatpickr-am-pm",t.l10n.amPM[qn((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 K(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=ft("div","flatpickr-weekdays");for(var W=t.config.showMonths;W--;){var G=ft("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(G)}return J(),t.weekdayContainer}function J(){if(t.weekdayContainer){var W=t.l10n.firstDayOfWeek,G=nd(t.l10n.weekdays.shorthand);W>0&&W - `+G.join("")+` - - `}}function le(){t.calendarContainer.classList.add("hasWeeks");var W=ft("div","flatpickr-weekwrapper");W.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ft("div","flatpickr-weeks");return W.appendChild(G),{weekWrapper:W,weekNumbers:G}}function ie(W,G){G===void 0&&(G=!0);var ne=G?W:W-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,we("onYearChange"),N()),R(),we("onMonthChange"),bn())}function ee(W,G){if(W===void 0&&(W=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ir(t.config),oe=ne.hours,Se=ne.minutes,Ae=ne.seconds;m(oe,Se,Ae)}t.redraw(),W&&we("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),we("onClose")}function Pe(){t.config!==void 0&&we("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(W){return t.calendarContainer.contains(W)}function Ve(W){if(t.isOpen&&!t.config.inline){var G=$n(W),ne=je(G),oe=G===t.input||G===t.altInput||t.element.contains(G)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Se=!oe&&!ne&&!je(W.relatedTarget),Ae=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(G)});Se&&Ae&&(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 ke(W){if(!(!W||t.config.minDate&&Wt.config.maxDate.getFullYear())){var G=W,ne=t.currentYear!==G;t.currentYear=G||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(),we("onYearChange"),N())}}function Ce(W,G){var ne;G===void 0&&(G=!0);var oe=t.parseDate(W,void 0,G);if(t.config.minDate&&oe&&Tn(oe,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Tn(oe,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Se=!!t.config.enable,Ae=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Le=0,Me=void 0;Le=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return Se}return!Se}function Je(W){return t.daysContainer!==void 0?W.className.indexOf("hidden")===-1&&W.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(W):!1}function _t(W){var G=W.target===t._input,ne=t._input.value.trimEnd()!==Pn();G&&ne&&!(W.relatedTarget&&je(W.relatedTarget))&&t.setDate(t._input.value,!0,W.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ze(W){var G=$n(W),ne=t.config.wrap?n.contains(G):G===t._input,oe=t.config.allowInput,Se=t.isOpen&&(!oe||!ne),Ae=t.config.inline&&ne&&!oe;if(W.keyCode===13&&ne){if(oe)return t.setDate(t._input.value,!0,G===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),G.blur();t.open()}else if(je(G)||Se||Ae){var Le=!!t.timeContainer&&t.timeContainer.contains(G);switch(W.keyCode){case 13:Le?(W.preventDefault(),a(),zt()):In(W);break;case 27:W.preventDefault(),zt();break;case 8:case 46:ne&&!t.config.allowInput&&(W.preventDefault(),t.clear());break;case 37:case 39:if(!Le&&!ne){W.preventDefault();var Me=l();if(t.daysContainer!==void 0&&(oe===!1||Me&&Je(Me))){var Ue=W.keyCode===39?1:-1;W.ctrlKey?(W.stopPropagation(),ie(Ue),P(D(1),0)):P(void 0,Ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:W.preventDefault();var Ne=W.keyCode===40?1:-1;t.daysContainer&&G.$i!==void 0||G===t.input||G===t.altInput?W.ctrlKey?(W.stopPropagation(),ke(t.currentYear-Ne),P(D(1),0)):Le||P(void 0,Ne*7):G===t.currentYearElement?ke(t.currentYear-Ne):t.config.enableTime&&(!Le&&t.hourElement&&t.hourElement.focus(),a(W),t._debouncedChange());break;case 9:if(Le){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Cn){return Cn}),vt=Be.indexOf(G);if(vt!==-1){var ni=Be[vt+(W.shiftKey?-1:1)];W.preventDefault(),(ni||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(G)&&W.shiftKey&&(W.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&G===t.amPM)switch(W.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),sn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),sn();break}(ne||je(G))&&we("onKeyDown",W)}function We(W,G){if(G===void 0&&(G="flatpickr-day"),!(t.selectedDates.length!==1||W&&(!W.classList.contains(G)||W.classList.contains("flatpickr-disabled")))){for(var ne=W?W.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Se=Math.min(ne,t.selectedDates[0].getTime()),Ae=Math.max(ne,t.selectedDates[0].getTime()),Le=!1,Me=0,Ue=0,Ne=Se;NeSe&&NeMe)?Me=Ne:Ne>oe&&(!Ue||Ne ."+G));Be.forEach(function(vt){var ni=vt.dateObj,Cn=ni.getTime(),Rs=Me>0&&Cn0&&Cn>Ue;if(Rs){vt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fs){vt.classList.remove(fs)});return}else if(Le&&!Rs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fs){vt.classList.remove(fs)}),W!==void 0&&(W.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),oene&&Cn===oe&&vt.classList.add("endRange"),Cn>=Me&&(Ue===0||Cn<=Ue)&&BC(Cn,oe,ne)&&vt.classList.add("inRange"))})}}function yt(){t.isOpen&&!t.config.static&&!t.config.inline&&rt()}function pe(W,G){if(G===void 0&&(G=t._positionElement),t.isMobile===!0){if(W){W.preventDefault();var ne=$n(W);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),we("onOpen");return}else if(t._input.disabled||t.config.inline)return;var oe=t.isOpen;t.isOpen=!0,oe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),we("onOpen"),rt(G)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(W===void 0||!t.timeContainer.contains(W.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function _e(W){return function(G){var ne=t.config["_"+W+"Date"]=t.parseDate(G,t.config.dateFormat),oe=t.config["_"+(W==="min"?"max":"min")+"Date"];ne!==void 0&&(t[W==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Se){return Ce(Se)}),!t.selectedDates.length&&W==="min"&&d(ne),sn()),t.daysContainer&&(Et(),ne!==void 0?t.currentYearElement[W]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(W),t.currentYearElement.disabled=!!oe&&ne!==void 0&&oe.getFullYear()===ne.getFullYear())}}function Ye(){var W=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=an(an({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=G.parseDate,t.config.formatDate=G.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=dn(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=dn(Be)}});var oe=G.mode==="time";if(!G.dateFormat&&(G.enableTime||oe)){var Se=Kt.defaultConfig.dateFormat||ws.dateFormat;ne.dateFormat=G.noCalendar||oe?"H:i"+(G.enableSeconds?":S":""):Se+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||oe)&&!G.altFormat){var Ae=Kt.defaultConfig.altFormat||ws.altFormat;ne.altFormat=G.noCalendar||oe?"h:i"+(G.enableSeconds?":S K":" K"):Ae+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:_e("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:_e("max")});var Le=function(Be){return function(vt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(vt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Le("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Le("max")}),G.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,G);for(var Me=0;Me-1?t.config[Ne]=Er(Ue[Ne]).map(o).concat(t.config[Ne]):typeof G[Ne]>"u"&&(t.config[Ne]=Ue[Ne])}G.altInputClass||(t.config.altInputClass=Mt().className+" "+t.config.altInputClass),we("onParseConfig")}function Mt(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ie(){typeof t.config.locale!="object"&&typeof Kt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=an(an({},Kt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Kt.l10ns[t.config.locale]:void 0),Xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Xi.l="("+t.l10n.weekdays.longhand.join("|")+")",Xi.M="("+t.l10n.months.shorthand.join("|")+")",Xi.F="("+t.l10n.months.longhand.join("|")+")",Xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var W=an(an({},e),JSON.parse(JSON.stringify(n.dataset||{})));W.time_24hr===void 0&&Kt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=w1(t),t.parseDate=ma({config:t.config,l10n:t.l10n})}function rt(W){if(typeof t.config.position=="function")return void t.config.position(t,W);if(t.calendarContainer!==void 0){we("onPreCalendarPosition");var G=W||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(N1,R1){return N1+R1.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Se=t.config.position.split(" "),Ae=Se[0],Le=Se.length>1?Se[1]:null,Me=G.getBoundingClientRect(),Ue=window.innerHeight-Me.bottom,Ne=Ae==="above"||Ae!=="below"&&Uene,Be=window.pageYOffset+Me.top+(Ne?-ne-2:G.offsetHeight+2);if(mn(t.calendarContainer,"arrowTop",!Ne),mn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var vt=window.pageXOffset+Me.left,ni=!1,Cn=!1;Le==="center"?(vt-=(oe-Me.width)/2,ni=!0):Le==="right"&&(vt-=oe-Me.width,Cn=!0),mn(t.calendarContainer,"arrowLeft",!ni&&!Cn),mn(t.calendarContainer,"arrowCenter",ni),mn(t.calendarContainer,"arrowRight",Cn);var Rs=window.document.body.offsetWidth-(window.pageXOffset+Me.right),fs=vt+oe>window.document.body.offsetWidth,E1=Rs+oe>window.document.body.offsetWidth;if(mn(t.calendarContainer,"rightMost",fs),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!fs)t.calendarContainer.style.left=vt+"px",t.calendarContainer.style.right="auto";else if(!E1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Rs+"px";else{var tr=Ee();if(tr===void 0)return;var D1=window.document.body.offsetWidth,A1=Math.max(0,D1/2-oe/2),I1=".flatpickr-calendar.centerMost:before",L1=".flatpickr-calendar.centerMost:after",P1=tr.cssRules.length,F1="{left:"+Me.left+"px;right:auto;}";mn(t.calendarContainer,"rightMost",!1),mn(t.calendarContainer,"centerMost",!0),tr.insertRule(I1+","+L1+F1,P1),t.calendarContainer.style.left=A1+"px",t.calendarContainer.style.right="auto"}}}}function Ee(){for(var W=null,G=0;Gt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Se];else if(t.config.mode==="multiple"){var Le=xe(Se);Le?t.selectedDates.splice(parseInt(Le),1):t.selectedDates.push(Se)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Se,t.selectedDates.push(Se),Tn(Se,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,vt){return Be.getTime()-vt.getTime()}));if(c(),Ae){var Me=t.currentYear!==Se.getFullYear();t.currentYear=Se.getFullYear(),t.currentMonth=Se.getMonth(),Me&&(we("onYearChange"),N()),we("onMonthChange")}if(bn(),R(),sn(),!Ae&&t.config.mode!=="range"&&t.config.showMonths===1?O(oe):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 Ue=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ue||Ne)&&zt()}g()}}var Ln={locale:[Ie,J],showMonths:[j,r,K],minDate:[S],maxDate:[S],positionElement:[di],clickOpens:[function(){t.config.clickOpens===!0?(h(t._input,"focus",t.open),h(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Kn(W,G){if(W!==null&&typeof W=="object"){Object.assign(t.config,W);for(var ne in W)Ln[ne]!==void 0&&Ln[ne].forEach(function(oe){return oe()})}else t.config[W]=G,Ln[W]!==void 0?Ln[W].forEach(function(oe){return oe()}):Or.indexOf(W)>-1&&(t.config[W]=Er(G));t.redraw(),sn(!0)}function Jn(W,G){var ne=[];if(W instanceof Array)ne=W.map(function(oe){return t.parseDate(oe,G)});else if(W instanceof Date||typeof W=="number")ne=[t.parseDate(W,G)];else if(typeof W=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(W,G)];break;case"multiple":ne=W.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,G)});break;case"range":ne=W.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,G)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(W)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(oe){return oe instanceof Date&&Ce(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Se){return oe.getTime()-Se.getTime()})}function kt(W,G,ne){if(G===void 0&&(G=!1),ne===void 0&&(ne=t.config.dateFormat),W!==0&&!W||W instanceof Array&&W.length===0)return t.clear(G);Jn(W,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,G),d(),t.selectedDates.length===0&&t.clear(!1),sn(G),G&&we("onChange")}function dn(W){return W.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?t.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:t.parseDate(G.from,void 0),to:t.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function ti(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var W=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);W&&Jn(W,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 us(){if(t.input=Mt(),!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=ft(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"),di()}function di(){t._positionElement=t.config.positionElement||t._input}function $i(){var W=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ft("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=W,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=W==="datetime-local"?"Y-m-d\\TH:i:S":W==="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{}h(t.mobileInput,"change",function(G){t.setDate($n(G).value,!1,t.mobileFormatStr),we("onChange"),we("onClose")})}function ge(W){if(t.isOpen===!0)return t.close();t.open(W)}function we(W,G){if(t.config!==void 0){var ne=t.config[W];if(ne!==void 0&&ne.length>0)for(var oe=0;ne[oe]&&oe=0&&Tn(W,t.selectedDates[1])<=0}function bn(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(W,G){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+G),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[G].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),W.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 Pn(W){var G=W||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,G)}).filter(function(ne,oe,Se){return t.config.mode!=="range"||t.config.enableTime||Se.indexOf(ne)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function sn(W){W===void 0&&(W=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Pn(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Pn(t.config.altFormat)),W!==!1&&we("onValueUpdate")}function pn(W){var G=$n(W),ne=t.prevMonthNav.contains(G),oe=t.nextMonthNav.contains(G);ne||oe?ie(ne?-1:1):t.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):G.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Ll(W){W.preventDefault();var G=W.type==="keydown",ne=$n(W),oe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[qn(t.amPM.textContent===t.l10n.amPM[0])]);var Se=parseFloat(oe.getAttribute("min")),Ae=parseFloat(oe.getAttribute("max")),Le=parseFloat(oe.getAttribute("step")),Me=parseInt(oe.value,10),Ue=W.delta||(G?W.which===38?1:-1:0),Ne=Me+Le*Ue;if(typeof oe.value<"u"&&oe.value.length===2){var Be=oe===t.hourElement,vt=oe===t.minuteElement;NeAe&&(Ne=oe===t.hourElement?Ne-Ae-qn(!t.amPM):Se,vt&&C(void 0,1,t.hourElement)),t.amPM&&Be&&(Le===1?Ne+Me===23:Math.abs(Ne-Me)>Le)&&(t.amPM.textContent=t.l10n.amPM[qn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=vn(Ne)}}return s(),t}function Ss(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function XC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:_=void 0,flatpickr:h=void 0}=e;Xt(()=>{const C=f??_,T=y(d);return T.onReady.push((M,O,D)=>{a===void 0&&S(M,O,D),cn().then(()=>{t(8,m=!0)})}),t(3,h=Kt(C,Object.assign(T,f?{wrap:!0}:{}))),()=>{h.destroy()}});const g=Tt();function y(C={}){C=Object.assign({},C);for(const T of r){const M=(O,D,I)=>{g(GC(T),[O,D,I])};T in C?(Array.isArray(C[T])||(C[T]=[C[T]]),C[T].push(M)):C[T]=[M]}return C.onChange&&!C.onChange.includes(S)&&C.onChange.push(S),C}function S(C,T,M){const O=id(M,C);!sd(a,O)&&(a||O)&&t(2,a=O),t(4,u=T)}function $(C){te[C?"unshift":"push"](()=>{_=C,t(0,_)})}return n.$$set=C=>{e=Re(Re({},e),Gt(C)),t(1,s=Xe(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,u=C.formattedValue),"element"in C&&t(5,f=C.element),"dateFormat"in C&&t(6,c=C.dateFormat),"options"in C&&t(7,d=C.options),"input"in C&&t(0,_=C.input),"flatpickr"in C&&t(3,h=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&h&&m&&(sd(a,id(h,h.selectedDates))||h.setDate(a,!0,c)),n.$$.dirty&392&&h&&m)for(const[C,T]of Object.entries(y(d)))h.set(C,T)},[_,s,a,h,u,f,c,d,m,o,l,$]}class ou extends ve{constructor(e){super(),be(this,e,XC,ZC,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function QC(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:z.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new ou({props:c}),te.push(()=>ce(l,"value",u)),te.push(()=>ce(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=v("label"),t=U("Min date (UTC)"),s=E(),B(l.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),b(e,t),w(d,s,m),V(l,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const _={};m&32768&&(_.id=d[15]),!o&&m&4&&(o=!0,_.value=d[2],he(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=d[0].options.min,he(()=>r=!1)),l.$set(_)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&k(e),d&&k(s),H(l,d)}}}function xC(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:z.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new ou({props:c}),te.push(()=>ce(l,"value",u)),te.push(()=>ce(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=v("label"),t=U("Max date (UTC)"),s=E(),B(l.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),b(e,t),w(d,s,m),V(l,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const _={};m&32768&&(_.id=d[15]),!o&&m&8&&(o=!0,_.value=d[3],he(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=d[0].options.max,he(()=>r=!1)),l.$set(_)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&k(e),d&&k(s),H(l,d)}}}function e$(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[QC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[xC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function t$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[e$]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?At(s,[a&2&&{key:r[1]},a&32&&Qt(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function n$(n,e,t){var $,C;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=($=l==null?void 0:l.options)==null?void 0:$.min,a=(C=l==null?void 0:l.options)==null?void 0:C.max;function u(T,M){T.detail&&T.detail.length==3&&t(0,l.options[M]=T.detail[1],l)}function f(T){r=T,t(2,r),t(0,l)}function c(T){n.$$.not_equal(l.options.min,T)&&(l.options.min=T,t(0,l))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,l)}function _(T){n.$$.not_equal(l.options.max,T)&&(l.options.max=T,t(0,l))}const h=T=>u(T,"max");function g(T){l=T,t(0,l)}function y(T){Fe.call(this,n,T)}function S(T){Fe.call(this,n,T)}return n.$$set=T=>{e=Re(Re({},e),Gt(T)),t(5,s=Xe(e,i)),"field"in T&&t(0,l=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,M,O,D;n.$$.dirty&5&&r!=((T=l==null?void 0:l.options)==null?void 0:T.min)&&t(2,r=(M=l==null?void 0:l.options)==null?void 0:M.min),n.$$.dirty&9&&a!=((O=l==null?void 0:l.options)==null?void 0:O.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,u,s,f,c,d,m,_,h,g,y,S]}class i$ extends ve{constructor(e){super(),be(this,e,n$,t$,me,{field:0,key:1})}}const s$=n=>({}),ld=n=>({});function od(n,e,t){const i=n.slice();return i[47]=e[t],i}const l$=n=>({}),rd=n=>({});function ad(n,e,t){const i=n.slice();return i[47]=e[t],i[51]=t,i}function ud(n){let e,t,i;return{c(){e=v("div"),t=U(n[2]),i=E(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function o$(n){let e,t=n[47]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[47]+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function r$(n){let e,t,i;const s=[{item:n[47]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u{H(f,1)}),ue()}l?(e=Rt(l,o()),B(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function fd(n){let e,t,i;function s(){return n[35](n[47])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[$e(ze.call(null,e,"Clear")),Y(e,"click",Dn(Qe(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Oe(i)}}}function cd(n){let e,t,i,s,l,o;const r=[r$,o$],a=[];function u(c,d){return c[9]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[7])&&fd(n);return{c(){e=v("div"),i.c(),s=E(),f&&f.c(),l=E(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(ae(),L(a[m],1,1,()=>{a[m]=null}),ue(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[7]?f?f.p(c,d):(f=fd(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){L(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function dd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[19],$$slots:{default:[f$]},$$scope:{ctx:n}};return e=new Yn({props:i}),n[40](e),e.$on("show",n[25]),e.$on("hide",n[41]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&524288&&(o.trigger=s[19]),l[0]&3225866|l[1]&4096&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[40](null),H(e,s)}}}function pd(n){let e,t,i,s,l,o,r,a,u=n[16].length&&md(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=E(),l=v("input"),o=E(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),re(l,n[16]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[37]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&65536&&l.value!==f[16]&&re(l,f[16]),f[16].length?u?u.p(f,c):(u=md(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function md(n){let e,t,i,s;return{c(){e=v("div"),t=v("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(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",Dn(Qe(n[22]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function hd(n){let e,t=n[1]&&_d(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=_d(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function _d(n){let e,t;return{c(){e=v("div"),t=U(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&k(e)}}}function a$(n){let e=n[47]+"",t;return{c(){t=U(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&2097152&&e!==(e=i[47]+"")&&se(t,e)},i:x,o:x,d(i){i&&k(t)}}}function u$(n){let e,t,i;const s=[{item:n[47]},n[12]];var l=n[11];function o(r){let a={};for(let u=0;u{H(f,1)}),ue()}l?(e=Rt(l,o()),B(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function gd(n){let e,t,i,s,l,o,r;const a=[u$,a$],u=[];function f(m,_){return m[11]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[38](n[47],...m)}function d(...m){return n[39](n[47],...m)}return{c(){e=v("div"),i.c(),s=E(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[8]),Q(e,"selected",n[20](n[47]))},m(m,_){w(m,e,_),u[t].m(e,null),b(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,_){n=m;let h=t;t=f(n),t===h?u[t].p(n,_):(ae(),L(u[h],1,1,()=>{u[h]=null}),ue(),i=u[t],i?i.p(n,_):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||_[0]&256)&&Q(e,"closable",n[8]),(!l||_[0]&3145728)&&Q(e,"selected",n[20](n[47]))},i(m){l||(A(i),l=!0)},o(m){L(i),l=!1},d(m){m&&k(e),u[t].d(),o=!1,Oe(r)}}}function f$(n){let e,t,i,s,l,o=n[13]&&pd(n);const r=n[34].beforeOptions,a=wt(r,n,n[43],rd);let u=n[21],f=[];for(let h=0;hL(f[h],1,1,()=>{f[h]=null});let d=null;u.length||(d=hd(n));const m=n[34].afterOptions,_=wt(m,n,n[43],ld);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=v("div");for(let h=0;hL(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=ud(n));let c=!n[5]&&!n[6]&&dd(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),ue()),(!o||m[0]&16384&&l!==(l="select "+d[14]))&&p(e,"class",l),(!o||m[0]&16400)&&Q(e,"multiple",d[4]),(!o||m[0]&16416)&&Q(e,"disabled",d[5]),(!o||m[0]&16448)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mYe(Mt,_e))||[]}function ee(pe,_e){pe.preventDefault(),g&&d?j(_e):q(_e)}function Te(pe,_e){(pe.code==="Enter"||pe.code==="Space")&&(ee(pe,_e),y&&K())}function Pe(){le(),setTimeout(()=>{const pe=F==null?void 0:F.querySelector(".dropdown-item.option.selected");pe&&(pe.focus(),pe.scrollIntoView({block:"nearest"}))},0)}function je(pe){pe.stopPropagation(),!_&&!m&&(I==null||I.toggle())}Xt(()=>{const pe=document.querySelectorAll(`label[for="${r}"]`);for(const _e of pe)_e.addEventListener("click",je);return()=>{for(const _e of pe)_e.removeEventListener("click",je)}});const Ve=pe=>N(pe);function ke(pe){te[pe?"unshift":"push"](()=>{R=pe,t(19,R)})}function Ce(){P=this.value,t(16,P)}const Je=(pe,_e)=>ee(_e,pe),_t=(pe,_e)=>Te(_e,pe);function Ze(pe){te[pe?"unshift":"push"](()=>{I=pe,t(17,I)})}function We(pe){Fe.call(this,n,pe)}function yt(pe){te[pe?"unshift":"push"](()=>{F=pe,t(18,F)})}return n.$$set=pe=>{"id"in pe&&t(26,r=pe.id),"noOptionsText"in pe&&t(1,a=pe.noOptionsText),"selectPlaceholder"in pe&&t(2,u=pe.selectPlaceholder),"searchPlaceholder"in pe&&t(3,f=pe.searchPlaceholder),"items"in pe&&t(27,c=pe.items),"multiple"in pe&&t(4,d=pe.multiple),"disabled"in pe&&t(5,m=pe.disabled),"readonly"in pe&&t(6,_=pe.readonly),"selected"in pe&&t(0,h=pe.selected),"toggle"in pe&&t(7,g=pe.toggle),"closable"in pe&&t(8,y=pe.closable),"labelComponent"in pe&&t(9,S=pe.labelComponent),"labelComponentProps"in pe&&t(10,$=pe.labelComponentProps),"optionComponent"in pe&&t(11,C=pe.optionComponent),"optionComponentProps"in pe&&t(12,T=pe.optionComponentProps),"searchable"in pe&&t(13,M=pe.searchable),"searchFunc"in pe&&t(28,O=pe.searchFunc),"class"in pe&&t(14,D=pe.class),"$$scope"in pe&&t(43,o=pe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&134217728&&c&&(J(),le()),n.$$.dirty[0]&134283264&&t(21,i=ie(c,P)),n.$$.dirty[0]&1&&t(20,s=function(pe){const _e=z.toArray(h);return z.inArray(_e,pe)})},[h,a,u,f,d,m,_,g,y,S,$,C,T,M,D,N,P,I,F,R,s,i,le,ee,Te,Pe,r,c,O,q,j,Z,X,K,l,Ve,ke,Ce,Je,_t,Ze,We,yt,o]}class ru extends ve{constructor(e){super(),be(this,e,p$,c$,me,{id:26,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:27,multiple:4,disabled:5,readonly:6,selected:0,toggle:7,closable:8,labelComponent:9,labelComponentProps:10,optionComponent:11,optionComponentProps:12,searchable:13,searchFunc:28,class:14,deselectItem:15,selectItem:29,toggleItem:30,reset:31,showDropdown:32,hideDropdown:33},null,[-1,-1])}get deselectItem(){return this.$$.ctx[15]}get selectItem(){return this.$$.ctx[29]}get toggleItem(){return this.$$.ctx[30]}get reset(){return this.$$.ctx[31]}get showDropdown(){return this.$$.ctx[32]}get hideDropdown(){return this.$$.ctx[33]}}function bd(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function m$(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&bd(n);return{c(){l&&l.c(),e=E(),t=v("span"),s=U(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=bd(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:x,o:x,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function h$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class vd extends ve{constructor(e){super(),be(this,e,h$,m$,me,{item:0})}}const _$=n=>({}),yd=n=>({});function g$(n){let e;const t=n[8].afterOptions,i=wt(t,n,n[12],yd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Ct(i,t,s,s[12],e?St(t,s[12],l,_$):$t(s[12]),yd)},i(s){e||(A(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function b$(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[g$]},$$scope:{ctx:n}};for(let r=0;rce(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&62?At(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Qt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function v$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=vd}=e,{optionComponent:c=vd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function _($){$=z.toArray($,!0);let C=[];for(let T of $){const M=z.findByKey(r,d,T);M&&C.push(M)}$.length&&!C.length||t(0,u=a?C:C[0])}async function h($){let C=z.toArray($,!0).map(T=>T[d]);r.length&&t(6,m=a?C:C[0])}function g($){u=$,t(0,u)}function y($){Fe.call(this,n,$)}function S($){Fe.call(this,n,$)}return n.$$set=$=>{e=Re(Re({},e),Gt($)),t(5,s=Xe(e,i)),"items"in $&&t(1,r=$.items),"multiple"in $&&t(2,a=$.multiple),"selected"in $&&t(0,u=$.selected),"labelComponent"in $&&t(3,f=$.labelComponent),"optionComponent"in $&&t(4,c=$.optionComponent),"selectionKey"in $&&t(7,d=$.selectionKey),"keyOfSelected"in $&&t(6,m=$.keyOfSelected),"$$scope"in $&&t(12,o=$.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&_(m),n.$$.dirty&1&&h(u)},[u,r,a,f,c,s,m,d,l,g,y,S,o]}class Vi extends ve{constructor(e){super(),be(this,e,v$,b$,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function y$(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Ns({props:a}),te.push(()=>ce(t,"value",r)),{c(){e=v("div"),B(t.$$.fragment)},m(u,f){w(u,e,f),V(t,e,null),s=!0,l||(o=$e(ze.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,he(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){L(t.$$.fragment,u),s=!1},d(u){u&&k(e),H(t),l=!1,o()}}}function k$(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function w$(n){let e,t,i,s,l,o,r,a,u,f;return i=new de({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[y$,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[k$,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),B(i.$$.fragment),s=E(),l=v("div"),o=E(),B(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),V(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),V(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16384&&(m.class="form-field required "+(c[14]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&57345&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d&16384&&(_.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&k(e),c&&k(t),H(i,c),c&&k(s),c&&k(l),c&&k(o),H(r,c),c&&k(a),c&&k(u)}}}function kd(n){let e,t;return e=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[S$,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function S$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.maxSelect&&re(l,u[0].options.maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function C$(n){let e,t,i=!n[2]&&kd(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(ae(),L(i,1,1,()=>{i=null}),ue()):i?(i.p(s,l),l&4&&A(i,1)):(i=kd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function $$(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[C$],default:[w$,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&18?At(s,[a&2&&{key:r[1]},a&16&&Qt(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function T$(n,e,t){var y;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=pt(this.value),t(0,l),t(5,u),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function _(S){l=S,t(0,l),t(5,u),t(2,a)}function h(S){Fe.call(this,n,S)}function g(S){Fe.call(this,n,S)}return n.$$set=S=>{e=Re(Re({},e),Gt(S)),t(4,s=Xe(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,$;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=(($=(S=l.options)==null?void 0:S.values)==null?void 0:$.length)||2,l)),n.$$.dirty&1&&z.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,m,_,h,g]}class M$ extends ve{constructor(e){super(),be(this,e,T$,$$,me,{field:0,key:1})}}function O$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function E$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O='"{"a":1,"b":2}"',D,I,P,F,R,N,q,j,Z,X,K,J,le;return{c(){e=v("div"),t=v("div"),i=v("div"),s=U("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=U(` and - `),r=v("code"),r.textContent="multipart/form-data",a=U(` - requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field - is a - `),c=v("strong"),c.textContent="plain string",d=U(`: - `),m=v("ul"),_=v("li"),_.innerHTML=""true" is converted to the json true",h=E(),g=v("li"),g.innerHTML=""false" is converted to the json false",y=E(),S=v("li"),S.innerHTML=""null" is converted to the json null",$=E(),C=v("li"),C.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",T=E(),M=v("li"),D=U(O),I=U(" is converted to the json "),P=v("code"),P.textContent='{"a":1,"b":2}',F=E(),R=v("li"),R.textContent="numeric strings are converted to json number",N=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",j=E(),Z=v("li"),Z.textContent="any other string (empty string too) is double quoted",X=U(` - Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),K=v("code"),K.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,ee){w(ie,e,ee),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,m),b(m,_),b(m,h),b(m,g),b(m,y),b(m,S),b(m,$),b(m,C),b(m,T),b(m,M),b(M,D),b(M,I),b(M,P),b(m,F),b(m,R),b(m,N),b(m,q),b(m,j),b(m,Z),b(i,X),b(i,K),le=!0},i(ie){le||(ie&&Ge(()=>{le&&(J||(J=qe(e,st,{duration:150},!0)),J.run(1))}),le=!0)},o(ie){ie&&(J||(J=qe(e,st,{duration:150},!1)),J.run(0)),le=!1},d(ie){ie&&k(e),ie&&J&&J.end()}}}function D$(n){let e,t,i,s,l,o,r;function a(d,m){return d[2]?E$:O$}let u=a(n),f=u(n),c=n[2]&&wd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),b(e,t),b(e,i),f.m(e,null),w(d,s,m),c&&c.m(d,m),w(d,l,m),o||(r=Y(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=wd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),L(c,1,1,()=>{c=null}),ue())},d(d){d&&k(e),f.d(),d&&k(s),c&&c.d(d),d&&k(l),o=!1,r()}}}function A$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[D$]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?At(s,[a&2&&{key:r[1]},a&8&&Qt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function I$(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(3,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class L$ extends ve{constructor(e){super(),be(this,e,I$,A$,me,{field:0,key:1})}}function P$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&k(e),a&&k(s),a&&k(l)}}}function F$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Sd extends ve{constructor(e){super(),be(this,e,F$,P$,me,{item:0})}}const N$=[{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 R$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function q$(n){let e,t,i,s,l,o;return i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[R$,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),B(i.$$.fragment),s=E(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),V(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),o=!1},d(r){r&&k(e),r&&k(t),H(i,r),r&&k(s),r&&k(l)}}}function j$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=v("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(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[9]),Y(i,"click",n[10]),Y(l,"click",n[11]),Y(r,"click",n[12])],a=!0)},p:x,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,Oe(u)}}}function z$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$;function C(M){n[8](M)}let T={id:n[22],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&&(T.keyOfSelected=n[0].options.mimeTypes),r=new Vi({props:T}),te.push(()=>ce(r,"keyOfSelected",C)),g=new Yn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[j$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",m=E(),_=v("i"),h=E(),B(g.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(M,O){w(M,e,O),b(e,t),b(e,i),b(e,s),w(M,o,O),V(r,M,O),w(M,u,O),w(M,f,O),b(f,c),b(c,d),b(c,m),b(c,_),b(c,h),V(g,c,null),y=!0,S||($=$e(ze.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,O){(!y||O&4194304&&l!==(l=M[22]))&&p(e,"for",l);const D={};O&4194304&&(D.id=M[22]),O&8&&(D.items=M[3]),!a&&O&1&&(a=!0,D.keyOfSelected=M[0].options.mimeTypes,he(()=>a=!1)),r.$set(D);const I={};O&16777217&&(I.$$scope={dirty:O,ctx:M}),g.$set(I)},i(M){y||(A(r.$$.fragment,M),A(g.$$.fragment,M),y=!0)},o(M){L(r.$$.fragment,M),L(g.$$.fragment,M),y=!1},d(M){M&&k(e),M&&k(o),H(r,M),M&&k(u),M&&k(f),H(g),S=!1,$()}}}function V$(n){let e;return{c(){e=v("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:x,d(t){t&&k(e)}}}function H$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T;function M(D){n[13](D)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Ns({props:O}),te.push(()=>ce(r,"value",M)),S=new Yn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[V$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),m=v("button"),_=v("span"),_.textContent="Supported formats",h=E(),g=v("i"),y=E(),B(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(_,"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(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),V(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,m),b(m,_),b(m,h),b(m,g),b(m,y),V(S,m,null),$=!0,C||(T=$e(ze.call(null,s,{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"})),C=!0)},p(D,I){(!$||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const P={};I&4194304&&(P.id=D[22]),!a&&I&1&&(a=!0,P.value=D[0].options.thumbs,he(()=>a=!1)),r.$set(P);const F={};I&16777216&&(F.$$scope={dirty:I,ctx:D}),S.$set(F)},i(D){$||(A(r.$$.fragment,D),A(S.$$.fragment,D),$=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),$=!1},d(D){D&&k(e),D&&k(o),H(r,D),D&&k(u),D&&k(f),H(S),C=!1,T()}}}function B$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&pt(l.value)!==c[0].options.maxSize&&re(l,c[0].options.maxSize)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function Cd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[U$,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function U$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.maxSelect&&re(l,u[0].options.maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function W$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[z$,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[H$,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[B$,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let _=!n[2]&&Cd(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),a=E(),u=v("div"),B(f.$$.fragment),d=E(),_&&_.c(),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(h,g){w(h,e,g),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,a),b(e,u),V(f,u,null),b(e,d),_&&_.m(e,null),m=!0},p(h,g){const y={};g&2&&(y.name="schema."+h[1]+".options.mimeTypes"),g&20971529&&(y.$$scope={dirty:g,ctx:h}),i.$set(y);const S={};g&2&&(S.name="schema."+h[1]+".options.thumbs"),g&20971521&&(S.$$scope={dirty:g,ctx:h}),o.$set(S),(!m||g&4&&r!==(r=h[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const $={};g&2&&($.name="schema."+h[1]+".options.maxSize"),g&20971521&&($.$$scope={dirty:g,ctx:h}),f.$set($),(!m||g&4&&c!==(c=h[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),h[2]?_&&(ae(),L(_,1,1,()=>{_=null}),ue()):_?(_.p(h,g),g&4&&A(_,1)):(_=Cd(h),_.c(),A(_,1),_.m(e,null))},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),A(_),m=!0)},o(h){L(i.$$.fragment,h),L(o.$$.fragment,h),L(f.$$.fragment,h),L(_),m=!1},d(h){h&&k(e),H(i),H(o),H(f),_&&_.d()}}}function Y$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Protected",r=E(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),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,s,d),b(s,l),w(c,r,d),w(c,a,d),u||(f=Y(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&k(e),c&&k(i),c&&k(s),c&&k(r),c&&k(a),u=!1,f()}}}function K$(n){let e,t,i;return t=new de({props:{class:"form-field form-field-toggle m-0",name:"schema."+n[1]+".options.protected",$$slots:{default:[Y$,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","col-sm-4")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.protected"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function J$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{afterNonempty:[K$],options:[W$],default:[q$,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?At(s,[a&2&&{key:r[1]},a&32&&Qt(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function Z$(n,e,t){var P;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=N$.slice(),u=((P=l.options)==null?void 0:P.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(z.isEmpty(l.options.mimeTypes))return;const F=[];for(const R of l.options.mimeTypes)a.find(N=>N.mimeType===R)||F.push({mimeType:R});F.length&&t(3,a=a.concat(F))}function m(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function _(F){n.$$.not_equal(l.options.mimeTypes,F)&&(l.options.mimeTypes=F,t(0,l),t(6,f),t(2,u))}const h=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},g=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function $(F){n.$$.not_equal(l.options.thumbs,F)&&(l.options.thumbs=F,t(0,l),t(6,f),t(2,u))}function C(){l.options.maxSize=pt(this.value),t(0,l),t(6,f),t(2,u)}function T(){l.options.maxSelect=pt(this.value),t(0,l),t(6,f),t(2,u)}function M(F){u=F,t(2,u)}function O(F){l=F,t(0,l),t(6,f),t(2,u)}function D(F){Fe.call(this,n,F)}function I(F){Fe.call(this,n,F)}return n.$$set=F=>{e=Re(Re({},e),Gt(F)),t(5,s=Xe(e,i)),"field"in F&&t(0,l=F.field),"key"in F&&t(1,o=F.key)},n.$$.update=()=>{var F,R;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((R=(F=l.options)==null?void 0:F.values)==null?void 0:R.length)||99,l)),n.$$.dirty&1&&(z.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,m,_,h,g,y,S,$,C,T,M,O,D,I]}class G$ extends ve{constructor(e){super(),be(this,e,Z$,J$,me,{field:0,key:1})}}function X$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=E(),i=v("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),s||(l=Y(i,"click",n[17]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function Q$(n){let e,t,i;function s(o){n[18](o)}let l={id:n[29],searchable:n[6].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[6],readonly:!n[30]||n[0].id,$$slots:{afterOptions:[X$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&64&&(a.searchable=o[6].length>5),r[0]&64&&(a.items=o[6]),r[0]&1073741825&&(a.readonly=!o[30]||o[0].id),r[0]&8|r[1]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function x$(n){let e,t,i;function s(o){n[19](o)}let l={id:n[29],items:n[7],readonly:!n[30]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&1073741824&&(a.readonly=!o[30]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eT(n){let e,t,i,s,l,o,r,a,u,f;return i=new de({props:{class:"form-field required "+(n[30]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[Q$,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field form-field-single-multiple-select "+(n[30]?"":"readonly"),inlineError:!0,$$slots:{default:[x$,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),B(i.$$.fragment),s=E(),l=v("div"),o=E(),B(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),V(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),V(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d[0]&1073741824&&(m.class="form-field required "+(c[30]?"":"readonly")),d[0]&2&&(m.name="schema."+c[1]+".options.collectionId"),d[0]&1610612809|d[1]&1&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d[0]&1073741824&&(_.class="form-field form-field-single-multiple-select "+(c[30]?"":"readonly")),d[0]&1610612740|d[1]&1&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&k(e),c&&k(t),H(i,c),c&&k(s),c&&k(l),c&&k(o),H(r,c),c&&k(a),c&&k(u)}}}function $d(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[tT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[nT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),i=E(),s=v("div"),B(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),V(t,e,null),w(r,i,a),w(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&536870913|a[1]&1&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&536870913|a[1]&1&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(t),r&&k(i),r&&k(s),H(l)}}}function tT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=E(),l=v("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[0]&536870912&&i!==(i=u[29])&&p(e,"for",i),f[0]&536870912&&o!==(o=u[29])&&p(l,"id",o),f[0]&1&&pt(l.value)!==u[0].options.minSelect&&re(l,u[0].options.minSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),re(l,n[0].options.maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c[0]&536870912&&i!==(i=f[29])&&p(e,"for",i),c[0]&536870912&&o!==(o=f[29])&&p(l,"id",o),c[0]&1&&r!==(r=f[0].options.minSelect||2)&&p(l,"min",r),c[0]&1&&pt(l.value)!==f[0].options.maxSelect&&re(l,f[0].options.maxSelect)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function iT(n){let e,t,i,s,l,o,r,a,u,f,c;function d(_){n[15](_)}let m={multiple:!0,searchable:!0,id:n[29],selectPlaceholder:"Auto",items:n[4]};return n[0].options.displayFields!==void 0&&(m.selected=n[0].options.displayFields),r=new ru({props:m}),te.push(()=>ce(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=E(),s=v("i"),o=E(),B(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[29])},m(_,h){w(_,e,h),b(e,t),b(e,i),b(e,s),w(_,o,h),V(r,_,h),u=!0,f||(c=$e(ze.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(_,h){(!u||h[0]&536870912&&l!==(l=_[29]))&&p(e,"for",l);const g={};h[0]&536870912&&(g.id=_[29]),h[0]&16&&(g.items=_[4]),!a&&h[0]&1&&(a=!0,g.selected=_[0].options.displayFields,he(()=>a=!1)),r.$set(g)},i(_){u||(A(r.$$.fragment,_),u=!0)},o(_){L(r.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(o),H(r,_),f=!1,c()}}}function sT(n){let e,t,i,s,l,o,r,a,u,f,c,d;function m(h){n[16](h)}let _={id:n[29],items:n[8]};return n[0].options.cascadeDelete!==void 0&&(_.keyOfSelected=n[0].options.cascadeDelete),a=new Vi({props:_}),te.push(()=>ce(a,"keyOfSelected",m)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=E(),s=v("i"),r=E(),B(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[29])},m(h,g){var y,S;w(h,e,g),b(e,t),b(e,i),b(e,s),w(h,r,g),V(a,h,g),f=!0,c||(d=$e(l=ze.call(null,s,{text:[`Whether on ${((y=n[5])==null?void 0:y.name)||"relation"} record deletion to delete also the corresponding current collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[5])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` - -`),position:"top"})),c=!0)},p(h,g){var S,$;l&&jt(l.update)&&g[0]&36&&l.update.call(null,{text:[`Whether on ${((S=h[5])==null?void 0:S.name)||"relation"} record deletion to delete also the corresponding current collection record(s).`,h[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=h[5])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` - -`),position:"top"}),(!f||g[0]&536870912&&o!==(o=h[29]))&&p(e,"for",o);const y={};g[0]&536870912&&(y.id=h[29]),!u&&g[0]&1&&(u=!0,y.keyOfSelected=h[0].options.cascadeDelete,he(()=>u=!1)),a.$set(y)},i(h){f||(A(a.$$.fragment,h),f=!0)},o(h){L(a.$$.fragment,h),f=!1},d(h){h&&k(e),h&&k(r),H(a,h),c=!1,d()}}}function lT(n){let e,t,i,s,l,o,r,a,u=!n[2]&&$d(n);return s=new de({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[iT,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[sT,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),u&&u.c(),t=E(),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(f,c){w(f,e,c),u&&u.m(e,null),b(e,t),b(e,i),V(s,i,null),b(e,l),b(e,o),V(r,o,null),a=!0},p(f,c){f[2]?u&&(ae(),L(u,1,1,()=>{u=null}),ue()):u?(u.p(f,c),c[0]&4&&A(u,1)):(u=$d(f),u.c(),A(u,1),u.m(e,t));const d={};c[0]&2&&(d.name="schema."+f[1]+".options.displayFields"),c[0]&536870929|c[1]&1&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&2&&(m.name="schema."+f[1]+".options.cascadeDelete"),c[0]&536870949|c[1]&1&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){a||(A(u),A(s.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){L(u),L(s.$$.fragment,f),L(r.$$.fragment,f),a=!1},d(f){f&&k(e),u&&u.d(),H(s),H(r)}}}function oT(n){let e,t,i,s,l;const o=[{key:n[1]},n[9]];function r(f){n[20](f)}let a={$$slots:{options:[lT],default:[eT,({interactive:f})=>({30:f}),({interactive:f})=>[f?1073741824:0]]},$$scope:{ctx:n}};for(let f=0;fce(e,"field",r)),e.$on("rename",n[21]),e.$on("remove",n[22]);let u={};return s=new au({props:u}),n[23](s),s.$on("save",n[24]),{c(){B(e.$$.fragment),i=E(),B(s.$$.fragment)},m(f,c){V(e,f,c),w(f,i,c),V(s,f,c),l=!0},p(f,c){const d=c[0]&514?At(o,[c[0]&2&&{key:f[1]},c[0]&512&&Qt(f[9])]):{};c[0]&1073741951|c[1]&1&&(d.$$scope={dirty:c,ctx:f}),!t&&c[0]&1&&(t=!0,d.field=f[0],he(()=>t=!1)),e.$set(d);const m={};s.$set(m)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){H(e,f),f&&k(i),n[23](null),H(s,f)}}}function rT(n,e,t){var X;let i,s;const l=["field","key"];let o=Xe(e,l),r;Ke(n,fi,K=>t(12,r=K));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}],d=["id","created","updated"],m=["username","email","emailVisibility","verified"];let _=null,h=[],g=null,y=((X=a.options)==null?void 0:X.maxSelect)==1,S=y;function $(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},a),t(2,y=!0),t(11,S=y)}function C(){var K,J;if(t(4,h=d.slice(0)),!!s){s.type==="auth"&&t(4,h=h.concat(m));for(const le of s.schema)h.push(le.name);if(((J=(K=a.options)==null?void 0:K.displayFields)==null?void 0:J.length)>0)for(let le=a.options.displayFields.length-1;le>=0;le--)h.includes(a.options.displayFields[le])||a.options.displayFields.splice(le,1)}}function T(){a.options.minSelect=pt(this.value),t(0,a),t(11,S),t(2,y)}function M(){a.options.maxSelect=pt(this.value),t(0,a),t(11,S),t(2,y)}function O(K){n.$$.not_equal(a.options.displayFields,K)&&(a.options.displayFields=K,t(0,a),t(11,S),t(2,y))}function D(K){n.$$.not_equal(a.options.cascadeDelete,K)&&(a.options.cascadeDelete=K,t(0,a),t(11,S),t(2,y))}const I=()=>_==null?void 0:_.show();function P(K){n.$$.not_equal(a.options.collectionId,K)&&(a.options.collectionId=K,t(0,a),t(11,S),t(2,y))}function F(K){y=K,t(2,y)}function R(K){a=K,t(0,a),t(11,S),t(2,y)}function N(K){Fe.call(this,n,K)}function q(K){Fe.call(this,n,K)}function j(K){te[K?"unshift":"push"](()=>{_=K,t(3,_)})}const Z=K=>{var J,le;(le=(J=K==null?void 0:K.detail)==null?void 0:J.collection)!=null&&le.id&&K.detail.collection.type!="view"&&t(0,a.options.collectionId=K.detail.collection.id,a)};return n.$$set=K=>{e=Re(Re({},e),Gt(K)),t(9,o=Xe(e,l)),"field"in K&&t(0,a=K.field),"key"in K&&t(1,u=K.key)},n.$$.update=()=>{n.$$.dirty[0]&4096&&t(6,i=r.filter(K=>K.type!="view")),n.$$.dirty[0]&2052&&S!=y&&(t(11,S=y),y?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty[0]&1&&z.isEmpty(a.options)&&$(),n.$$.dirty[0]&4097&&t(5,s=r.find(K=>K.id==a.options.collectionId)||null),n.$$.dirty[0]&1025&&g!=a.options.collectionId&&(t(10,g=a.options.collectionId),C())},[a,u,y,_,h,s,i,f,c,o,g,S,r,T,M,O,D,I,P,F,R,N,q,j,Z]}class aT extends ve{constructor(e){super(),be(this,e,rT,oT,me,{field:0,key:1},null,[-1,-1])}}const uT=n=>({dragging:n&4,dragover:n&8}),Td=n=>({dragging:n[2],dragover:n[3]});function fT(n){let e,t,i,s,l;const o=n[10].default,r=wt(o,n,n[9],Td);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[11])),Y(e,"dragleave",Qe(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Ct(r,o,a,a[9],i?St(o,a[9],u,uT):$t(a[9]),Td),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&Q(e,"dragging",a[2]),(!i||u&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Oe(l)}}}function cT(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(C,T){if(!(!C||u)){if(f&&!C.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),C.preventDefault();return}t(2,c=!0),C.dataTransfer.effectAllowed="move",C.dataTransfer.dropEffect="move",C.dataTransfer.setData("text/plain",JSON.stringify({index:T,group:a})),l("drag",C)}}function _(C,T){if(t(3,d=!1),t(2,c=!1),!C||u)return;C.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse(C.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const O=M.index<<0;O{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=C=>m(C,o),$=C=>_(C,o);return n.$$set=C=>{"index"in C&&t(0,o=C.index),"list"in C&&t(6,r=C.list),"group"in C&&t(7,a=C.group),"disabled"in C&&t(1,u=C.disabled),"dragHandleClass"in C&&t(8,f=C.dragHandleClass),"$$scope"in C&&t(9,s=C.$$scope)},[o,u,c,d,m,_,r,a,f,s,i,h,g,y,S,$]}class Al extends ve{constructor(e){super(),be(this,e,cT,fT,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Md(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Od(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, - `),t=v("code"),t.textContent="username",i=U(` , - `),s=v("code"),s.textContent="email",l=U(` , - `),o=v("code"),o.textContent="emailVisibility",r=U(` , - `),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&k(e),u&&k(t),u&&k(i),u&&k(s),u&&k(l),u&&k(o),u&&k(r),u&&k(a)}}}function dT(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u){let f={key:u[4](u[17])};return u[17]!==void 0&&(f.field=u[17]),{props:f}}return r&&(e=Rt(r,a(n)),te.push(()=>ce(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=E()},m(u,f){e&&V(e,u,f),w(u,i,f),s=!0},p(u,f){n=u;const c={};if(f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],he(()=>t=!1)),f&1&&r!==(r=n[1][n[17].type])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),ue()}r?(e=Rt(r,a(n)),te.push(()=>ce(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else r&&e.$set(c)},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){e&&H(e,u),u&&k(i)}}}function Ed(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[dT]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Al({props:r}),te.push(()=>ce(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],_=new Map,h,g,y,S,$,C,T,M,O=n[0].type==="auth"&&Od(),D=n[0].schema;const I=R=>R[17];for(let R=0;Rce(C,"collection",P)),{c(){e=v("div"),t=v("p"),i=U(`System fields: - `),s=v("code"),s.textContent="id",l=U(` , - `),o=v("code"),o.textContent="created",r=U(` , - `),a=v("code"),a.textContent="updated",u=E(),O&&O.c(),f=U(` - .`),c=E(),d=v("div");for(let R=0;RT=!1)),C.$set(q)},i(R){if(!M){for(let N=0;NM.name===C))}function f(C){return i.findIndex(T=>T===C)}function c(C,T){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===T||!T||t(0,s.indexes=s.indexes.map(O=>z.replaceIndexColumn(O,C,T)),s)}function d(C,T,M,O){M[O]=C,t(0,s)}const m=C=>o(C),_=C=>c(C.detail.oldName,C.detail.newName);function h(C){n.$$.not_equal(s.schema,C)&&(s.schema=C,t(0,s))}const g=C=>{if(!C.detail)return;const T=C.detail.target;T.style.opacity=0,setTimeout(()=>{var M;(M=T==null?void 0:T.style)==null||M.removeProperty("opacity")},0),C.detail.dataTransfer.setDragImage(T,0,0)},y=()=>{tn({})},S=C=>r(C.detail);function $(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,c,d,m,_,h,g,y,S,$]}class hT extends ve{constructor(e){super(),be(this,e,mT,pT,me,{collection:0})}}const _T=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]}),gT=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),bT=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]});function vT(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[kT,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yT(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ld(n){let e,t,i;return{c(){e=v("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(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Pd(n){let e,t,i,s,l;return{c(){e=v("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,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function kT(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,_,h,g,y,S;const $=n[12].beforeLabel,C=wt($,n,n[15],Id),T=n[12].afterLabel,M=wt(T,n,n[15],Ad);let O=!n[9]&&Ld(n);function D(q){n[14](q)}var I=n[7];function P(q){let j={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(j.value=q[0]),{props:j}}I&&(m=Rt(I,P(n)),n[13](m),te.push(()=>ce(m,"value",D)));let F=n[9]&&Pd(n);const R=n[12].default,N=wt(R,n,n[15],Dd);return{c(){e=v("div"),t=v("label"),C&&C.c(),i=E(),s=v("span"),l=U(n[2]),o=E(),a=U(r),u=E(),M&&M.c(),f=E(),O&&O.c(),d=E(),m&&B(m.$$.fragment),h=E(),F&&F.c(),g=E(),y=v("div"),N&&N.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,j){w(q,e,j),b(e,t),C&&C.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),M&&M.m(t,null),b(t,f),O&&O.m(t,null),b(e,d),m&&V(m,e,null),b(e,h),F&&F.m(e,null),w(q,g,j),w(q,y,j),N&&N.m(y,null),S=!0},p(q,j){C&&C.p&&(!S||j&33280)&&Ct(C,$,q,q[15],S?St($,q[15],j,bT):$t(q[15]),Id),(!S||j&4)&&se(l,q[2]),(!S||j&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||j&512)&&Q(s,"txt-hint",q[9]),M&&M.p&&(!S||j&33280)&&Ct(M,T,q,q[15],S?St(T,q[15],j,gT):$t(q[15]),Ad),q[9]?O&&(O.d(1),O=null):O?O.p(q,j):(O=Ld(q),O.c(),O.m(t,null)),(!S||j&262144&&c!==(c=q[18]))&&p(t,"for",c);const Z={};if(j&262144&&(Z.id=q[18]),j&2&&(Z.baseCollection=q[1]),j&512&&(Z.disabled=q[9]),j&544&&(Z.placeholder=q[9]?"":q[5]),!_&&j&1&&(_=!0,Z.value=q[0],he(()=>_=!1)),j&128&&I!==(I=q[7])){if(m){ae();const X=m;L(X.$$.fragment,1,0,()=>{H(X,1)}),ue()}I?(m=Rt(I,P(q)),q[13](m),te.push(()=>ce(m,"value",D)),B(m.$$.fragment),A(m.$$.fragment,1),V(m,e,h)):m=null}else I&&m.$set(Z);q[9]?F?(F.p(q,j),j&512&&A(F,1)):(F=Pd(q),F.c(),A(F,1),F.m(e,null)):F&&(ae(),L(F,1,1,()=>{F=null}),ue()),N&&N.p&&(!S||j&33280)&&Ct(N,R,q,q[15],S?St(R,q[15],j,_T):$t(q[15]),Dd)},i(q){S||(A(C,q),A(M,q),m&&A(m.$$.fragment,q),A(F),A(N,q),S=!0)},o(q){L(C,q),L(M,q),m&&L(m.$$.fragment,q),L(F),L(N,q),S=!1},d(q){q&&k(e),C&&C.d(q),M&&M.d(q),O&&O.d(),n[13](null),m&&H(m),F&&F.d(),q&&k(g),q&&k(y),N&&N.d(q)}}}function wT(n){let e,t,i,s;const l=[yT,vT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),L(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}let Fd;function ST(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,_=Fd,h=!1;g();async function g(){_||h||(t(8,h=!0),t(7,_=(await at(()=>import("./FilterAutocompleteInput-0c84d8aa.js"),["./FilterAutocompleteInput-0c84d8aa.js","./index-fd4289fb.js"],import.meta.url)).default),Fd=_,t(8,h=!1))}async function y(){t(0,r=m||""),await cn(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function $(T){te[T?"unshift":"push"](()=>{d=T,t(6,d)})}function C(T){r=T,t(0,r)}return n.$$set=T=>{"collection"in T&&t(1,o=T.collection),"rule"in T&&t(0,r=T.rule),"label"in T&&t(2,a=T.label),"formKey"in T&&t(3,u=T.formKey),"required"in T&&t(4,f=T.required),"placeholder"in T&&t(5,c=T.placeholder),"$$scope"in T&&t(15,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,_,h,i,y,S,s,$,C,l]}class Cs extends ve{constructor(e){super(),be(this,e,ST,wT,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Nd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Rd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I=n[2],P=[];for(let F=0;F@request filter:",c=E(),d=v("div"),d.innerHTML=`@request.headers.* - @request.query.* - @request.data.* - @request.auth.*`,m=E(),_=v("hr"),h=E(),g=v("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=E(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=E(),C=v("hr"),T=E(),M=v("p"),M.innerHTML=`Example rule: -
    - @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(_,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,R){w(F,e,R),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let N=0;N{D&&(O||(O=qe(e,st,{duration:150},!0)),O.run(1))}),D=!0)},o(F){F&&(O||(O=qe(e,st,{duration:150},!1)),O.run(0)),D=!1},d(F){F&&k(e),ht(P,F),F&&O&&O.end()}}}function qd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function jd(n){let e,t,i,s,l,o,r,a,u;function f(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[CT,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cs({props:c}),te.push(()=>ce(e,"rule",f));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),s=new Cs({props:m}),te.push(()=>ce(s,"rule",d));function _(g){n[8](g)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new Cs({props:h}),te.push(()=>ce(r,"rule",_)),{c(){B(e.$$.fragment),i=E(),B(s.$$.fragment),o=E(),B(r.$$.fragment)},m(g,y){V(e,g,y),w(g,i,y),V(s,g,y),w(g,o,y),V(r,g,y),u=!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,he(()=>t=!1)),e.$set(S);const $={};y&1&&($.collection=g[0]),!l&&y&1&&(l=!0,$.rule=g[0].updateRule,he(()=>l=!1)),s.$set($);const C={};y&1&&(C.collection=g[0]),!a&&y&1&&(a=!0,C.rule=g[0].deleteRule,he(()=>a=!1)),r.$set(C)},i(g){u||(A(e.$$.fragment,g),A(s.$$.fragment,g),A(r.$$.fragment,g),u=!0)},o(g){L(e.$$.fragment,g),L(s.$$.fragment,g),L(r.$$.fragment,g),u=!1},d(g){H(e,g),g&&k(i),H(s,g),g&&k(o),H(r,g)}}}function zd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=$e(ze.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(s){s&&k(e),t=!1,i()}}}function CT(n){let e,t=!n[10]&&zd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=zd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&k(e)}}}function Vd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[$T]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),te.push(()=>ce(e,"rule",s)),{c(){B(e.$$.fragment)},m(o,r){V(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,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function $T(n){let e,t,i;return{c(){e=v("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=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&k(e),s&&k(t),s&&k(i)}}}function TT(n){var R,N;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,_,h,g,y,S,$,C,T=n[1]&&Rd(n);function M(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Cs({props:O}),te.push(()=>ce(f,"rule",M));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),m=new Cs({props:I}),te.push(()=>ce(m,"rule",D));let P=((R=n[0])==null?void 0:R.type)!=="view"&&jd(n),F=((N=n[0])==null?void 0:N.type)==="auth"&&Vd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the -
    PocketBase filter syntax and operators - .`,s=E(),l=v("button"),r=U(o),a=E(),T&&T.c(),u=E(),B(f.$$.fragment),d=E(),B(m.$$.fragment),h=E(),P&&P.c(),g=E(),F&&F.c(),y=ye(),p(l,"type","button"),p(l,"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,j){w(q,e,j),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),T&&T.m(e,null),w(q,u,j),V(f,q,j),w(q,d,j),V(m,q,j),w(q,h,j),P&&P.m(q,j),w(q,g,j),F&&F.m(q,j),w(q,y,j),S=!0,$||(C=Y(l,"click",n[3]),$=!0)},p(q,[j]){var K,J;(!S||j&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?T?(T.p(q,j),j&2&&A(T,1)):(T=Rd(q),T.c(),A(T,1),T.m(e,null)):T&&(ae(),L(T,1,1,()=>{T=null}),ue());const Z={};j&1&&(Z.collection=q[0]),!c&&j&1&&(c=!0,Z.rule=q[0].listRule,he(()=>c=!1)),f.$set(Z);const X={};j&1&&(X.collection=q[0]),!_&&j&1&&(_=!0,X.rule=q[0].viewRule,he(()=>_=!1)),m.$set(X),((K=q[0])==null?void 0:K.type)!=="view"?P?(P.p(q,j),j&1&&A(P,1)):(P=jd(q),P.c(),A(P,1),P.m(g.parentNode,g)):P&&(ae(),L(P,1,1,()=>{P=null}),ue()),((J=q[0])==null?void 0:J.type)==="auth"?F?(F.p(q,j),j&1&&A(F,1)):(F=Vd(q),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(ae(),L(F,1,1,()=>{F=null}),ue())},i(q){S||(A(T),A(f.$$.fragment,q),A(m.$$.fragment,q),A(P),A(F),S=!0)},o(q){L(T),L(f.$$.fragment,q),L(m.$$.fragment,q),L(P),L(F),S=!1},d(q){q&&k(e),T&&T.d(),q&&k(u),H(f,q),q&&k(d),H(m,q),q&&k(h),P&&P.d(q),q&&k(g),F&&F.d(q),q&&k(y),$=!1,C()}}}function MT(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class OT extends ve{constructor(e){super(),be(this,e,MT,TT,me,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[9]=e[t],i}function ET(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){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=Rt(o,r(n)),te.push(()=>ce(e,"value",l)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,he(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function DT(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Bd(n){let e,t,i=n[3],s=[];for(let l=0;l
  • 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).
  • `,u=E(),h&&h.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),b(e,t),w(g,s,y),m[l].m(g,y),w(g,r,y),w(g,a,y),w(g,u,y),h&&h.m(g,y),w(g,f,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=l;l=_(g),l===S?m[l].p(g,y):(ae(),L(m[S],1,1,()=>{m[S]=null}),ue(),o=m[l],o?o.p(g,y):(o=m[l]=d[l](g),o.c()),A(o,1),o.m(r.parentNode,r)),g[3].length?h?h.p(g,y):(h=Bd(g),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(g){c||(A(o),c=!0)},o(g){L(o),c=!1},d(g){g&&k(e),g&&k(s),m[l].d(g),g&&k(r),g&&k(a),g&&k(u),h&&h.d(g),g&&k(f)}}}function IT(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[AT,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function LT(n,e,t){let i;Ke(n,wi,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var _;t(3,r=[]);const d=z.getNestedVal(c,"schema",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=z.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const y=d[h][g].message,S=m[h]||h;r.push(z.sentenize(S+": "+y))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await at(()=>import("./CodeEditor-8fadd9a5.js"),["./CodeEditor-8fadd9a5.js","./index-fd4289fb.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&ai("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class PT extends ve{constructor(e){super(),be(this,e,LT,IT,me,{collection:0})}}const FT=n=>({active:n&1}),Wd=n=>({active:n[0]});function Yd(n){let e,t,i;const s=n[15].default,l=wt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ct(l,s,o,o[14],i?St(s,o[14],r,null):$t(o[14]),null)},i(o){i||(A(l,o),o&&Ge(()=>{i&&(t||(t=qe(e,st,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,st,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function NT(n){let e,t,i,s,l,o,r;const a=n[15].header,u=wt(a,n,n[14],Wd);let f=n[0]&&Yd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",Qe(n[17])),Y(t,"drop",Qe(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Qe(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Ct(u,a,c,c[14],l?St(a,c[14],d,FT):$t(c[14]),Wd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Yd(c),f.c(),A(f,1),f.m(e,null)):f&&(ae(),L(f,1,1,()=>{f=null}),ue()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Oe(r)}}}function RT(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function _(){return!!f}function h(){S(),t(0,f=!0),l("expand")}function g(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?g():h()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of P)F.click()}}Xt(()=>()=>clearTimeout(r));function $(P){Fe.call(this,n,P)}const C=()=>c&&y(),T=P=>{u&&(t(7,m=!1),S(),l("drop",P))},M=P=>u&&l("dragstart",P),O=P=>{u&&(t(7,m=!0),l("dragenter",P))},D=P=>{u&&(t(7,m=!1),l("dragleave",P))};function I(P){te[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,s=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,S,o,m,l,d,_,h,g,r,s,i,$,C,T,M,O,D,I]}class ao extends ve{constructor(e){super(),be(this,e,RT,NT,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 qT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function jT(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[qT,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function zT(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function VT(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function HT(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?VT:zT}let a=r(n),u=a(n),f=n[3]&&Kd();return{c(){e=v("div"),e.innerHTML=` - Username/Password`,t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.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,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Kd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),u.d(c),c&&k(l),f&&f.d(c),c&&k(o)}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Jd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(z.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[UT,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(z.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[WT,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(z.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(z.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&Ge(()=>{a&&(r||(r=qe(e,st,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=qe(e,st,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),H(i),H(o),u&&r&&r.end()}}}function UT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[7](g)}let h={id:n[12],disabled:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(ze.call(null,s,{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&4096&&l!==(l=g[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=g[12]),y&1&&(S.disabled=!z.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function WT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[8](g)}let h={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(ze.call(null,s,{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&4096&&l!==(l=g[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=g[12]),y&1&&(S.disabled=!z.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function YT(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[BT,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Jd(n);return{c(){B(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){V(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Jd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function KT(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function JT(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function ZT(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?JT:KT}let a=r(n),u=a(n),f=n[2]&&Zd();return{c(){e=v("div"),e.innerHTML=` - Email/Password`,t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.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,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Zd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),u.d(c),c&&k(l),f&&f.d(c),c&&k(o)}}}function GT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Gd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,st,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,st,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function XT(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[GT,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Gd();return{c(){B(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){V(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function QT(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xT(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function eM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?xT:QT}let a=r(n),u=a(n),f=n[1]&&Xd();return{c(){e=v("div"),e.innerHTML=` - OAuth2`,t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.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,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Xd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),u.d(c),c&&k(l),f&&f.d(c),c&&k(o)}}}function tM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=E(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),$e(ze.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"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Oe(f)}}}function iM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y;return s=new ao({props:{single:!0,$$slots:{header:[HT],default:[jT]},$$scope:{ctx:n}}}),o=new ao({props:{single:!0,$$slots:{header:[ZT],default:[YT]},$$scope:{ctx:n}}}),a=new ao({props:{single:!0,$$slots:{header:[eM],default:[XT]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[tM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[nM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),B(s.$$.fragment),l=E(),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",m=E(),B(_.$$.fragment),h=E(),B(g.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,$){w(S,e,$),w(S,t,$),w(S,i,$),V(s,i,null),b(i,l),V(o,i,null),b(i,r),V(a,i,null),w(S,u,$),w(S,f,$),w(S,c,$),w(S,d,$),w(S,m,$),V(_,S,$),w(S,h,$),V(g,S,$),y=!0},p(S,[$]){const C={};$&8201&&(C.$$scope={dirty:$,ctx:S}),s.$set(C);const T={};$&8197&&(T.$$scope={dirty:$,ctx:S}),o.$set(T);const M={};$&8195&&(M.$$scope={dirty:$,ctx:S}),a.$set(M);const O={};$&12289&&(O.$$scope={dirty:$,ctx:S}),_.$set(O);const D={};$&12289&&(D.$$scope={dirty:$,ctx:S}),g.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(_.$$.fragment,S),A(g.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(_.$$.fragment,S),L(g.$$.fragment,S),y=!1},d(S){S&&k(e),S&&k(t),S&&k(i),H(s),H(o),H(a),S&&k(u),S&&k(f),S&&k(c),S&&k(d),S&&k(m),H(_,S),S&&k(h),H(g,S)}}}function sM(n,e,t){let i,s,l,o;Ke(n,wi,h=>t(4,o=h));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,g,y,S;n.$$.dirty&1&&r.type==="auth"&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!z.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.onlyEmailDomains)||!z.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,_]}class lM extends ve{constructor(e){super(),be(this,e,sM,iM,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=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function np(n){let e,t,i,s,l=n[3]&&ip(n),o=!n[4]&&sp(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),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),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=ip(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=sp(r),o.c(),o.m(i,null))},d(r){r&&k(e),r&&k(t),r&&k(i),l&&l.d(),o&&o.d()}}}function ip(n){var m,_;let e,t,i,s,l=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((_=n[2])==null?void 0:_.name)+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection - `),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(h,g){w(h,e,g),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(h,g){var y,S;g&2&&l!==(l=((y=h[1])==null?void 0:y.name)+"")&&se(o,l),g&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&k(e)}}}function sp(n){let e,t,i,s=n[6],l=[];for(let f=0;f
    ',i=E(),s=v("div"),l=v("p"),l.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=E(),u&&u.c(),r=E(),f&&f.c(),a=ye(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=tp(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=np(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&k(e),u&&u.d(),c&&k(r),f&&f.d(c),c&&k(a)}}}function rM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function aM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Cancel',t=E(),i=v("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(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Oe(l)}}}function uM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[aM],header:[rM],default:[oM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),H(e,s)}}}function fM(n,e,t){let i,s,l,o,r,a;const u=Tt();let f,c,d;async function m(T,M){t(1,c=T),t(2,d=M),await cn(),i||l.length||o.length||r.length?f==null||f.show():h()}function _(){f==null||f.hide()}function h(){_(),u("confirm")}const g=()=>_(),y=()=>h();function S(T){te[T?"unshift":"push"](()=>{f=T,t(5,f)})}function $(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{var T,M,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=((T=d==null?void 0:d.schema)==null?void 0:T.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>{var P,F,R;const I=(P=c==null?void 0:c.schema)==null?void 0:P.find(N=>N.id==D.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((R=D.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[_,c,d,i,s,f,r,o,l,a,h,m,g,y,S,$,C]}class cM extends ve{constructor(e){super(),be(this,e,fM,uM,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 dM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new hT({props:l}),te.push(()=>ce(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new PT({props:l}),te.push(()=>ce(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function up(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new OT({props:o}),te.push(()=>ce(t,"collection",l)),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],he(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function fp(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new lM({props:o}),te.push(()=>ce(t,"collection",l)),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(r,a){w(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],he(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===As)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function mM(n){let e,t,i,s,l,o,r;const a=[pM,dM],u=[];function f(m,_){return m[14]?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===gl&&up(n),d=n[15]&&fp(n);return{c(){e=v("div"),t=v("div"),s.c(),l=E(),c&&c.c(),o=E(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===Li),p(e,"class","tabs-content svelte-12y0yzb")},m(m,_){w(m,e,_),b(e,t),u[i].m(t,null),b(e,l),c&&c.m(e,null),b(e,o),d&&d.m(e,null),r=!0},p(m,_){let h=i;i=f(m),i===h?u[i].p(m,_):(ae(),L(u[h],1,1,()=>{u[h]=null}),ue(),s=u[i],s?s.p(m,_):(s=u[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||_[0]&8)&&Q(t,"active",m[3]===Li),m[3]===gl?c?(c.p(m,_),_[0]&8&&A(c,1)):(c=up(m),c.c(),A(c,1),c.m(e,o)):c&&(ae(),L(c,1,1,()=>{c=null}),ue()),m[15]?d?(d.p(m,_),_[0]&32768&&A(d,1)):(d=fp(m),d.c(),A(d,1),d.m(e,null)):d&&(ae(),L(d,1,1,()=>{d=null}),ue())},i(m){r||(A(s),A(c),A(d),r=!0)},o(m){L(s),L(c),L(d),r=!1},d(m){m&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function cp(n){let e,t,i,s,l,o,r;return o=new Yn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[hM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),B(o.$$.fragment),p(e,"class","flex-fill"),p(s,"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,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),V(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),H(o)}}}function hM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=` - Duplicate`,t=E(),i=v("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),s||(l=[Y(e,"click",n[26]),Y(i,"click",Dn(Qe(n[27])))],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Oe(l)}}}function dp(n){let e,t,i,s;return i=new Yn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[_M]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(e),l&&k(t),H(i,l)}}}function pp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" collection"),u=E(),p(t,"class",i=is(z.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=is(z.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),_[0]&64&&o!==(o=n[50]+"")&&se(r,o),_[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function _M(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{F=null}),ue()):F?(F.p(N,q),q[0]&4&&A(F,1)):(F=dp(N),F.c(),A(F,1),F.m(d,null)),(!D||q[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(N[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",C),(!D||q[0]&4&&T!==(T=!!N[2].id))&&(d.disabled=T),N[2].system?R||(R=mp(),R.c(),R.m(O.parentNode,O)):R&&(R.d(1),R=null)},i(N){D||(A(F),D=!0)},o(N){L(F),D=!1},d(N){N&&k(e),N&&k(s),N&&k(l),N&&k(f),N&&k(c),F&&F.d(),N&&k(M),R&&R.d(N),N&&k(O),I=!1,P()}}}function hp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=$e(t=ze.call(null,e,n[11])),l=!0)},p(r,a){t&&jt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{s&&(i||(i=qe(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Jt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function _p(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function gp(n){var a,u,f;let e,t,i,s=!z.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&bp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=E(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(c,d){w(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[33]),l=!0)},p(c,d){var m,_,h;d[0]&32&&(s=!z.isEmpty((m=c[5])==null?void 0:m.options)&&!((h=(_=c[5])==null?void 0:_.options)!=null&&h.manageRule)),s?r?d[0]&32&&A(r,1):(r=bp(),r.c(),A(r,1),r.m(e,null)):r&&(ae(),L(r,1,1,()=>{r=null}),ue()),d[0]&8&&Q(e,"active",c[3]===As)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function bp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function bM(n){var j,Z,X,K,J,le,ie;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,m,_=n[14]?"Query":"Fields",h,g,y=!z.isEmpty(n[11]),S,$,C,T,M=!z.isEmpty((j=n[5])==null?void 0:j.listRule)||!z.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!z.isEmpty((X=n[5])==null?void 0:X.createRule)||!z.isEmpty((K=n[5])==null?void 0:K.updateRule)||!z.isEmpty((J=n[5])==null?void 0:J.deleteRule)||!z.isEmpty((ie=(le=n[5])==null?void 0:le.options)==null?void 0:ie.manageRule),O,D,I,P,F=!!n[2].id&&!n[2].system&&cp(n);r=new de({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[gM,({uniqueId:ee})=>({48:ee}),({uniqueId:ee})=>[0,ee?131072:0]]},$$scope:{ctx:n}}});let R=y&&hp(n),N=M&&_p(),q=n[15]&&gp(n);return{c(){e=v("h4"),i=U(t),s=E(),F&&F.c(),l=E(),o=v("form"),B(r.$$.fragment),a=E(),u=v("input"),f=E(),c=v("div"),d=v("button"),m=v("span"),h=U(_),g=E(),R&&R.c(),S=E(),$=v("button"),C=v("span"),C.textContent="API Rules",T=E(),N&&N.c(),O=E(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===Li),p(C,"class","txt"),p($,"type","button"),p($,"class","tab-item"),Q($,"active",n[3]===gl),p(c,"class","tabs-header stretched")},m(ee,Te){w(ee,e,Te),b(e,i),w(ee,s,Te),F&&F.m(ee,Te),w(ee,l,Te),w(ee,o,Te),V(r,o,null),b(o,a),b(o,u),w(ee,f,Te),w(ee,c,Te),b(c,d),b(d,m),b(m,h),b(d,g),R&&R.m(d,null),b(c,S),b(c,$),b($,C),b($,T),N&&N.m($,null),b(c,O),q&&q.m(c,null),D=!0,I||(P=[Y(o,"submit",Qe(n[30])),Y(d,"click",n[31]),Y($,"click",n[32])],I=!0)},p(ee,Te){var je,Ve,ke,Ce,Je,_t,Ze;(!D||Te[0]&4)&&t!==(t=ee[2].id?"Edit collection":"New collection")&&se(i,t),ee[2].id&&!ee[2].system?F?(F.p(ee,Te),Te[0]&4&&A(F,1)):(F=cp(ee),F.c(),A(F,1),F.m(l.parentNode,l)):F&&(ae(),L(F,1,1,()=>{F=null}),ue());const Pe={};Te[0]&8192&&(Pe.class="form-field collection-field-name required m-b-0 "+(ee[13]?"disabled":"")),Te[0]&41028|Te[1]&4325376&&(Pe.$$scope={dirty:Te,ctx:ee}),r.$set(Pe),(!D||Te[0]&16384)&&_!==(_=ee[14]?"Query":"Fields")&&se(h,_),Te[0]&2048&&(y=!z.isEmpty(ee[11])),y?R?(R.p(ee,Te),Te[0]&2048&&A(R,1)):(R=hp(ee),R.c(),A(R,1),R.m(d,null)):R&&(ae(),L(R,1,1,()=>{R=null}),ue()),(!D||Te[0]&8)&&Q(d,"active",ee[3]===Li),Te[0]&32&&(M=!z.isEmpty((je=ee[5])==null?void 0:je.listRule)||!z.isEmpty((Ve=ee[5])==null?void 0:Ve.viewRule)||!z.isEmpty((ke=ee[5])==null?void 0:ke.createRule)||!z.isEmpty((Ce=ee[5])==null?void 0:Ce.updateRule)||!z.isEmpty((Je=ee[5])==null?void 0:Je.deleteRule)||!z.isEmpty((Ze=(_t=ee[5])==null?void 0:_t.options)==null?void 0:Ze.manageRule)),M?N?Te[0]&32&&A(N,1):(N=_p(),N.c(),A(N,1),N.m($,null)):N&&(ae(),L(N,1,1,()=>{N=null}),ue()),(!D||Te[0]&8)&&Q($,"active",ee[3]===gl),ee[15]?q?q.p(ee,Te):(q=gp(ee),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(ee){D||(A(F),A(r.$$.fragment,ee),A(R),A(N),D=!0)},o(ee){L(F),L(r.$$.fragment,ee),L(R),L(N),D=!1},d(ee){ee&&k(e),ee&&k(s),F&&F.d(ee),ee&&k(l),ee&&k(o),H(r),ee&&k(f),ee&&k(c),R&&R.d(),N&&N.d(),q&&q.d(),I=!1,Oe(P)}}}function vM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=[Y(e,"click",n[24]),Y(s,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Oe(f)}}}function yM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[vM],header:[bM],default:[mM]},$$scope:{ctx:n}};e=new on({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new cM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(r,a){V(e,r,a),w(r,t,a),V(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[39](null),H(e,r),r&&k(t),n[42](null),H(i,r)}}}const Li="schema",gl="api_rules",As="options",kM="base",vp="auth",yp="view";function Lr(n){return JSON.stringify(n)}function wM(n,e,t){let i,s,l,o,r,a;Ke(n,wi,_e=>t(5,a=_e));const u={};u[kM]="Base",u[yp]="View",u[vp]="Auth";const f=Tt();let c,d,m=null,_=z.initCollection(),h=!1,g=!1,y=Li,S=Lr(_),$="";function C(_e){t(3,y=_e)}function T(_e){return O(_e),t(10,g=!0),C(Li),c==null?void 0:c.show()}function M(){return c==null?void 0:c.hide()}async function O(_e){tn({}),typeof _e<"u"?(t(22,m=_e),t(2,_=structuredClone(_e))):(t(22,m=null),t(2,_=z.initCollection())),t(2,_.schema=_.schema||[],_),t(2,_.originalName=_.name||"",_),await cn(),t(23,S=Lr(_))}function D(){_.id?d==null||d.show(m,_):I()}function I(){if(h)return;t(9,h=!0);const _e=P();let Ye;_.id?Ye=fe.collections.update(_.id,_e):Ye=fe.collections.create(_e),Ye.then(Mt=>{Ia(),Iy(Mt),t(10,g=!1),M(),Ht(_.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!_.id,collection:Mt})}).catch(Mt=>{fe.error(Mt)}).finally(()=>{t(9,h=!1)})}function P(){const _e=Object.assign({},_);_e.schema=_e.schema.slice(0);for(let Ye=_e.schema.length-1;Ye>=0;Ye--)_e.schema[Ye].toDelete&&_e.schema.splice(Ye,1);return _e}function F(){m!=null&&m.id&&hn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>fe.collections.delete(m.id).then(()=>{M(),Ht(`Successfully deleted collection "${m.name}".`),f("delete",m),Ly(m)}).catch(_e=>{fe.error(_e)}))}function R(_e){t(2,_.type=_e,_),ai("schema")}function N(){o?hn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const _e=m?structuredClone(m):null;if(_e){if(_e.id="",_e.created="",_e.updated="",_e.name+="_duplicate",!z.isEmpty(_e.schema))for(const Ye of _e.schema)Ye.id="";if(!z.isEmpty(_e.indexes))for(let Ye=0;Ye<_e.indexes.length;Ye++){const Mt=z.parseIndex(_e.indexes[Ye]);Mt.indexName="idx_"+z.randomString(7),Mt.tableName=_e.name,_e.indexes[Ye]=z.buildIndex(Mt)}}T(_e),await cn(),t(23,S="")}const j=()=>M(),Z=()=>D(),X=()=>N(),K=()=>F(),J=_e=>{t(2,_.name=z.slugify(_e.target.value),_),_e.target.value=_.name},le=_e=>R(_e),ie=()=>{r&&D()},ee=()=>C(Li),Te=()=>C(gl),Pe=()=>C(As);function je(_e){_=_e,t(2,_),t(22,m)}function Ve(_e){_=_e,t(2,_),t(22,m)}function ke(_e){_=_e,t(2,_),t(22,m)}function Ce(_e){_=_e,t(2,_),t(22,m)}const Je=()=>o&&g?(hn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),M()}),!1):!0;function _t(_e){te[_e?"unshift":"push"](()=>{c=_e,t(7,c)})}function Ze(_e){Fe.call(this,n,_e)}function We(_e){Fe.call(this,n,_e)}function yt(_e){te[_e?"unshift":"push"](()=>{d=_e,t(8,d)})}const pe=()=>I();return n.$$.update=()=>{var _e,Ye;n.$$.dirty[0]&4&&_.type==="view"&&(t(2,_.createRule=null,_),t(2,_.updateRule=null,_),t(2,_.deleteRule=null,_),t(2,_.indexes=[],_)),n.$$.dirty[0]&4194308&&_.name&&(m==null?void 0:m.name)!=_.name&&_.indexes.length>0&&t(2,_.indexes=(_e=_.indexes)==null?void 0:_e.map(Mt=>z.replaceIndexTableName(Mt,_.name)),_),n.$$.dirty[0]&4&&t(15,i=_.type===vp),n.$$.dirty[0]&4&&t(14,s=_.type===yp),n.$$.dirty[0]&32&&(a.schema||(Ye=a.options)!=null&&Ye.query?t(11,$=z.getNestedVal(a,"schema.message")||"Has errors"):t(11,$="")),n.$$.dirty[0]&4&&t(13,l=!!_.id&&_.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Lr(_)),n.$$.dirty[0]&20&&t(12,r=!_.id||o),n.$$.dirty[0]&12&&y===As&&_.type!=="auth"&&C(Li)},[C,M,_,y,o,a,u,c,d,h,g,$,r,l,s,i,D,I,F,R,N,T,m,S,j,Z,X,K,J,le,ie,ee,Te,Pe,je,Ve,ke,Ce,Je,_t,Ze,We,yt,pe]}class au extends ve{constructor(e){super(),be(this,e,wM,yM,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 kp(n,e,t){const i=n.slice();return i[15]=e[t],i}function wp(n){let e,t=n[1].length&&Sp();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=Sp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Sp(n){let e;return{c(){e=v("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&&k(e)}}}function Cp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d,m;return{key:n,first:null,c(){var _;t=v("a"),i=v("i"),l=E(),o=v("span"),a=U(r),u=E(),p(i,"class",s=z.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),p(t,"title",c=e[15].name),Q(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id),this.first=t},m(_,h){w(_,t,h),b(t,i),b(t,l),b(t,o),b(o,a),b(t,u),d||(m=$e(rn.call(null,t)),d=!0)},p(_,h){var g;e=_,h&8&&s!==(s=z.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),h&8&&r!==(r=e[15].name+"")&&se(a,r),h&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),h&8&&c!==(c=e[15].name)&&p(t,"title",c),h&40&&Q(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id)},d(_){_&&k(t),d=!1,m()}}}function $p(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=` - New collection`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function SM(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,_,h,g,y,S,$,C=n[3];const T=I=>I[15].id;for(let I=0;I',o=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div");for(let I=0;I20),p(e,"class","page-sidebar collection-sidebar")},m(I,P){w(I,e,P),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),re(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let F=0;F20),I[7]?O&&(O.d(1),O=null):O?O.p(I,P):(O=$p(I),O.c(),O.m(e,null));const F={};g.$set(F)},i(I){y||(A(g.$$.fragment,I),y=!0)},o(I){L(g.$$.fragment,I),y=!1},d(I){I&&k(e);for(let P=0;P{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function $M(n,e,t){let i,s,l,o,r,a,u;Ke(n,yi,S=>t(5,o=S)),Ke(n,fi,S=>t(9,r=S)),Ke(n,vo,S=>t(6,a=S)),Ke(n,Ms,S=>t(7,u=S));let f,c="";function d(S){ln(yi,o=S,o)}const m=()=>t(0,c="");function _(){c=this.value,t(0,c)}const h=()=>f==null?void 0:f.show();function g(S){te[S?"unshift":"push"](()=>{f=S,t(2,f)})}const y=S=>{var $;($=S.detail)!=null&&$.isNew&&S.detail.collection&&d(S.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&CM(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(S=>S.id==c||S.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,_,h,g,y]}class TM extends ve{constructor(e){super(),be(this,e,$M,SM,me,{})}}function Tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Mp(n){n[18]=n[19].default}function Op(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ep(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Ep();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=E(),l=v("button"),r=U(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,_){w(m,t,_),c&&c.m(m,_),w(m,s,_),w(m,l,_),b(l,r),b(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Ep(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),_&8&&o!==(o=e[15].label+"")&&se(r,o),_&40&&Q(l,"active",e[5]===e[14])},d(m){m&&k(t),c&&c.d(m),m&&k(s),m&&k(l),u=!1,f()}}}function Ap(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:EM,then:OM,catch:MM,value:19,blocks:[,,,]};return mu(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&mu(t,s)||e0(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];L(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function MM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function OM(n){Mp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=E()},m(s,l){V(e,s,l),w(s,t,l),i=!0},p(s,l){Mp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){L(e.$$.fragment,s),i=!1},d(s){H(e,s),s&&k(t)}}}function EM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function Ip(n,e){let t,i,s,l=e[5]===e[14]&&Ap(e);return{key:n,first:null,c(){t=ye(),l&&l.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Ap(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function DM(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=h=>h[14];for(let h=0;hh[14];for(let h=0;hClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function IM(n){let e,t,i={class:"docs-panel",$$slots:{footer:[AM],default:[DM]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function LM(n,e,t){const i={list:{label:"List/Search",component:at(()=>import("./ListApiDocs-63cb84c3.js"),["./ListApiDocs-63cb84c3.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:at(()=>import("./ViewApiDocs-bddeeafe.js"),["./ViewApiDocs-bddeeafe.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},create:{label:"Create",component:at(()=>import("./CreateApiDocs-4f05d49f.js"),["./CreateApiDocs-4f05d49f.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},update:{label:"Update",component:at(()=>import("./UpdateApiDocs-470faa57.js"),["./UpdateApiDocs-470faa57.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},delete:{label:"Delete",component:at(()=>import("./DeleteApiDocs-85dc6d56.js"),["./DeleteApiDocs-85dc6d56.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:at(()=>import("./RealtimeApiDocs-cf5b9787.js"),["./RealtimeApiDocs-cf5b9787.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:at(()=>import("./AuthWithPasswordDocs-688d563f.js"),["./AuthWithPasswordDocs-688d563f.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:at(()=>import("./AuthWithOAuth2Docs-6757f2ab.js"),["./AuthWithOAuth2Docs-6757f2ab.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},refresh:{label:"Auth refresh",component:at(()=>import("./AuthRefreshDocs-4e19bb1d.js"),["./AuthRefreshDocs-4e19bb1d.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},"request-verification":{label:"Request verification",component:at(()=>import("./RequestVerificationDocs-1d25bdc1.js"),["./RequestVerificationDocs-1d25bdc1.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:at(()=>import("./ConfirmVerificationDocs-c9a2216e.js"),["./ConfirmVerificationDocs-c9a2216e.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:at(()=>import("./RequestPasswordResetDocs-1b1b244e.js"),["./RequestPasswordResetDocs-1b1b244e.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:at(()=>import("./ConfirmPasswordResetDocs-8f0f20ec.js"),["./ConfirmPasswordResetDocs-8f0f20ec.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:at(()=>import("./RequestEmailChangeDocs-2c584fa4.js"),["./RequestEmailChangeDocs-2c584fa4.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:at(()=>import("./ConfirmEmailChangeDocs-92660280.js"),["./ConfirmEmailChangeDocs-92660280.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:at(()=>import("./AuthMethodsDocs-d63a36db.js"),["./AuthMethodsDocs-d63a36db.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:at(()=>import("./ListExternalAuthsDocs-4a5594ac.js"),["./ListExternalAuthsDocs-4a5594ac.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-aebe0d79.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:at(()=>import("./UnlinkExternalAuthDocs-12d77ab0.js"),["./UnlinkExternalAuthDocs-12d77ab0.js","./SdkTabs-0096fda4.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),m=y=>c(y);function _(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function h(y){Fe.call(this,n,y)}function g(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!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)))},[f,c,o,a,l,r,i,u,d,m,_,h,g]}class PM extends ve{constructor(e){super(),be(this,e,LM,IM,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 FM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",z.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),re(r,n[0].username),c||(d=Y(r,"input",n[5]),c=!0)},p(m,_){_&8192&&l!==(l=m[13])&&p(e,"for",l),_&4&&a!==(a=!m[2])&&p(r,"requried",a),_&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),_&8192&&f!==(f=m[13])&&p(r,"id",f),_&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&k(e),m&&k(o),m&&k(r),c=!1,d()}}}function NM(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,_,h,g,y,S,$;return{c(){var C;e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("div"),a=v("button"),u=v("span"),f=U("Public: "),d=U(c),_=E(),h=v("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[13]),p(u,"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(h,"type","email"),h.autofocus=n[2],p(h,"autocomplete","off"),p(h,"id",g=n[13]),h.required=y=(C=n[1].options)==null?void 0:C.requireEmail,p(h,"class","svelte-1751a4d")},m(C,T){w(C,e,T),b(e,t),b(e,i),b(e,s),w(C,o,T),w(C,r,T),b(r,a),b(a,u),b(u,f),b(u,d),w(C,_,T),w(C,h,T),re(h,n[0].email),n[2]&&h.focus(),S||($=[$e(ze.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[6]),Y(h,"input",n[7])],S=!0)},p(C,T){var M;T&8192&&l!==(l=C[13])&&p(e,"for",l),T&1&&c!==(c=C[0].emailVisibility?"On":"Off")&&se(d,c),T&1&&m!==(m="btn btn-sm btn-transparent "+(C[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),T&4&&(h.autofocus=C[2]),T&8192&&g!==(g=C[13])&&p(h,"id",g),T&2&&y!==(y=(M=C[1].options)==null?void 0:M.requireEmail)&&(h.required=y),T&1&&h.value!==C[0].email&&re(h,C[0].email)},d(C){C&&k(e),C&&k(o),C&&k(r),C&&k(_),C&&k(h),S=!1,Oe($)}}}function Lp(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[RM,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function RM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Pp(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[qM,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[jM,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&8)&&Q(t,"p-t-xs",f[3])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{u&&(a||(a=qe(e,st,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(e,st,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function qM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[0].password),u||(f=Y(r,"input",n[9]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].password&&re(r,c[0].password)},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function jM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[10]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),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&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function zM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"change",n[11]),Y(e,"change",Qe(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,Oe(a)}}}function VM(n){var g;let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new de({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[FM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[NM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let _=!n[2]&&Lp(n),h=(n[2]||n[3])&&Pp(n);return d=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[zM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),a=v("div"),_&&_.c(),u=E(),h&&h.c(),f=E(),c=v("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"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),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),b(e,a),_&&_.m(a,null),b(a,u),h&&h.m(a,null),b(e,f),b(e,c),V(d,c,null),m=!0},p(y,[S]){var M;const $={};S&4&&($.class="form-field "+(y[2]?"":"required")),S&24581&&($.$$scope={dirty:S,ctx:y}),i.$set($);const C={};S&2&&(C.class="form-field "+((M=y[1].options)!=null&&M.requireEmail?"required":"")),S&24583&&(C.$$scope={dirty:S,ctx:y}),o.$set(C),y[2]?_&&(ae(),L(_,1,1,()=>{_=null}),ue()):_?(_.p(y,S),S&4&&A(_,1)):(_=Lp(y),_.c(),A(_,1),_.m(a,u)),y[2]||y[3]?h?(h.p(y,S),S&12&&A(h,1)):(h=Pp(y),h.c(),A(h,1),h.m(a,null)):h&&(ae(),L(h,1,1,()=>{h=null}),ue());const T={};S&24581&&(T.$$scope={dirty:S,ctx:y}),d.$set(T)},i(y){m||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(_),A(h),A(d.$$.fragment,y),m=!0)},o(y){L(i.$$.fragment,y),L(o.$$.fragment,y),L(_),L(h),L(d.$$.fragment,y),m=!1},d(y){y&&k(e),H(i),H(o),_&&_.d(),h&&h.d(),H(d)}}}function HM(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!!i.id}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){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 _(){i.verified=this.checked,t(0,i),t(3,r)}const h=g=>{l||hn("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,s=g.collection),"isNew"in g&&t(2,l=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),ai("password"),ai("passwordConfirm")))},[i,s,l,r,o,a,u,f,c,d,m,_,h]}class BM extends ve{constructor(e){super(),be(this,e,HM,VM,me,{record:0,collection:1,isNew:2})}}function UM(n){let e,t,i,s=[n[3]],l={};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 f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const _=r.closest("form");_!=null&&_.requestSubmit&&_.requestSubmit()}}Xt(()=>(u(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(3,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class YM extends ve{constructor(e){super(),be(this,e,WM,UM,me,{value:0,maxHeight:4})}}function KM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(h){n[2](h)}let _={id:n[3],required:n[1].required};return n[0]!==void 0&&(_.value=n[0]),f=new YM({props:_}),te.push(()=>ce(f,"value",m)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),B(f.$$.fragment),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),w(h,u,g),V(f,h,g),d=!0},p(h,g){(!d||g&2&&i!==(i=z.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||g&8&&a!==(a=h[3]))&&p(e,"for",a);const y={};g&8&&(y.id=h[3]),g&2&&(y.required=h[1].required),!c&&g&1&&(c=!0,y.value=h[0],he(()=>c=!1)),f.$set(y)},i(h){d||(A(f.$$.fragment,h),d=!0)},o(h){L(f.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(u),H(f,h)}}}function JM(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[KM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZM(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class GM extends ve{constructor(e){super(),be(this,e,ZM,JM,me,{field:1,value:0})}}function XM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,_,h,g;return{c(){var y,S;e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",m=(y=n[1].options)==null?void 0:y.min),p(f,"max",_=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),w(y,f,S),re(f,n[0]),h||(g=Y(f,"input",n[2]),h=!0)},p(y,S){var $,C;S&2&&i!==(i=z.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&se(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&m!==(m=($=y[1].options)==null?void 0:$.min)&&p(f,"min",m),S&2&&_!==(_=(C=y[1].options)==null?void 0:C.max)&&p(f,"max",_),S&1&&pt(f.value)!==y[0]&&re(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),h=!1,g()}}}function QM(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[XM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xM(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class e5 extends ve{constructor(e){super(),be(this,e,xM,QM,me,{field:1,value:0})}}function t5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=E(),s=v("label"),o=U(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),b(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&se(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function n5(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[t5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function i5(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class s5 extends ve{constructor(e){super(),be(this,e,i5,n5,me,{field:1,value:0})}}function l5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,_;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),w(h,u,g),w(h,f,g),re(f,n[0]),m||(_=Y(f,"input",n[2]),m=!0)},p(h,g){g&2&&i!==(i=z.getFieldTypeIcon(h[1].type))&&p(t,"class",i),g&2&&o!==(o=h[1].name+"")&&se(r,o),g&8&&a!==(a=h[3])&&p(e,"for",a),g&8&&c!==(c=h[3])&&p(f,"id",c),g&2&&d!==(d=h[1].required)&&(f.required=d),g&1&&f.value!==h[0]&&re(f,h[0])},d(h){h&&k(e),h&&k(u),h&&k(f),m=!1,_()}}}function o5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[l5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function r5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class a5 extends ve{constructor(e){super(),be(this,e,r5,o5,me,{field:1,value:0})}}function u5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,_;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),w(h,u,g),w(h,f,g),re(f,n[0]),m||(_=Y(f,"input",n[2]),m=!0)},p(h,g){g&2&&i!==(i=z.getFieldTypeIcon(h[1].type))&&p(t,"class",i),g&2&&o!==(o=h[1].name+"")&&se(r,o),g&8&&a!==(a=h[3])&&p(e,"for",a),g&8&&c!==(c=h[3])&&p(f,"id",c),g&2&&d!==(d=h[1].required)&&(f.required=d),g&1&&f.value!==h[0]&&re(f,h[0])},d(h){h&&k(e),h&&k(u),h&&k(f),m=!1,_()}}}function f5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[u5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function c5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class d5 extends ve{constructor(e){super(),be(this,e,c5,f5,me,{field:1,value:0})}}function Fp(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),b(e,t),i||(s=[$e(ze.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,Oe(s)}}}function p5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,_,h,g=n[0]&&!n[1].required&&Fp(n);function y(C){n[6](C)}function S(C){n[7](C)}let $={id:n[8],options:z.defaultFlatpickrOptions()};return n[2]!==void 0&&($.value=n[2]),n[0]!==void 0&&($.formattedValue=n[0]),d=new ou({props:$}),te.push(()=>ce(d,"value",y)),te.push(()=>ce(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" (UTC)"),f=E(),g&&g.c(),c=E(),B(d.$$.fragment),p(t,"class",i=is(z.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(C,T){w(C,e,T),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),w(C,f,T),g&&g.m(C,T),w(C,c,T),V(d,C,T),h=!0},p(C,T){(!h||T&2&&i!==(i=is(z.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!h||T&2)&&o!==(o=C[1].name+"")&&se(r,o),(!h||T&256&&u!==(u=C[8]))&&p(e,"for",u),C[0]&&!C[1].required?g?g.p(C,T):(g=Fp(C),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const M={};T&256&&(M.id=C[8]),!m&&T&4&&(m=!0,M.value=C[2],he(()=>m=!1)),!_&&T&1&&(_=!0,M.formattedValue=C[0],he(()=>_=!1)),d.$set(M)},i(C){h||(A(d.$$.fragment,C),h=!0)},o(C){L(d.$$.fragment,C),h=!1},d(C){C&&k(e),C&&k(f),g&&g.d(C),C&&k(c),H(d,C)}}}function m5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[p5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function h5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class _5 extends ve{constructor(e){super(),be(this,e,h5,m5,me,{field:1,value:0})}}function Np(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=U("Select up to "),s=U(i),l=U(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(s,i)},d(o){o&&k(e)}}}function g5(n){var S,$,C,T,M,O;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,_;function h(D){n[3](D)}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)>=(($=n[1].options)==null?void 0:$.maxSelect),items:(C=n[1].options)==null?void 0:C.values,searchable:((M=(T=n[1].options)==null?void 0:T.values)==null?void 0:M.length)>5};n[0]!==void 0&&(g.selected=n[0]),f=new ru({props:g}),te.push(()=>ce(f,"selected",h));let y=((O=n[1].options)==null?void 0:O.maxSelect)>1&&Np(n);return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),B(f.$$.fragment),d=E(),y&&y.c(),m=ye(),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,I){w(D,e,I),b(e,t),b(e,s),b(e,l),b(l,r),w(D,u,I),V(f,D,I),w(D,d,I),y&&y.m(D,I),w(D,m,I),_=!0},p(D,I){var F,R,N,q,j,Z;(!_||I&2&&i!==(i=z.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!_||I&2)&&o!==(o=D[1].name+"")&&se(r,o),(!_||I&16&&a!==(a=D[4]))&&p(e,"for",a);const P={};I&16&&(P.id=D[4]),I&6&&(P.toggle=!D[1].required||D[2]),I&4&&(P.multiple=D[2]),I&7&&(P.closable=!D[2]||((F=D[0])==null?void 0:F.length)>=((R=D[1].options)==null?void 0:R.maxSelect)),I&2&&(P.items=(N=D[1].options)==null?void 0:N.values),I&2&&(P.searchable=((j=(q=D[1].options)==null?void 0:q.values)==null?void 0:j.length)>5),!c&&I&1&&(c=!0,P.selected=D[0],he(()=>c=!1)),f.$set(P),((Z=D[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(D,I):(y=Np(D),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(D){_||(A(f.$$.fragment,D),_=!0)},o(D){L(f.$$.fragment,D),_=!1},d(D){D&&k(e),D&&k(u),H(f,D),D&&k(d),y&&y.d(D),D&&k(m)}}}function b5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[g5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function v5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class y5 extends ve{constructor(e){super(),be(this,e,v5,b5,me,{field:1,value:0})}}function k5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,_;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("textarea"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4]),p(f,"id",c=n[4]),p(f,"class","txt-mono"),f.required=d=n[1].required,f.value=n[2]},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),w(h,u,g),w(h,f,g),m||(_=Y(f,"input",n[3]),m=!0)},p(h,g){g&2&&i!==(i=z.getFieldTypeIcon(h[1].type))&&p(t,"class",i),g&2&&o!==(o=h[1].name+"")&&se(r,o),g&16&&a!==(a=h[4])&&p(e,"for",a),g&16&&c!==(c=h[4])&&p(f,"id",c),g&2&&d!==(d=h[1].required)&&(f.required=d),g&4&&(f.value=h[2])},d(h){h&&k(e),h&&k(u),h&&k(f),m=!1,_()}}}function w5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[k5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function S5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=JSON.stringify(typeof s>"u"?null:s,null,2);const o=r=>{t(2,l=r.target.value),t(0,s=r.target.value.trim())};return n.$$set=r=>{"field"in r&&t(1,i=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(l==null?void 0:l.trim())&&(t(2,l=JSON.stringify(typeof s>"u"?null:s,null,2)),t(0,s=l))},[s,i,l,o]}class C5 extends ve{constructor(e){super(),be(this,e,S5,w5,me,{field:1,value:0})}}function $5(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function T5(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),gn(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(s,l){w(s,e,l)},p(s,l){l&4&&!gn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function M5(n){let e;function t(l,o){return l[2]?T5:$5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function O5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){z.hasImageExtension(s==null?void 0:s.name)?z.generateThumb(s,l,l).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,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class E5 extends ve{constructor(e){super(),be(this,e,O5,M5,me,{file:0,size:1})}}function Rp(n){let e;function t(l,o){return l[4]==="image"?A5:D5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function D5(n){let e,t;return{c(){e=v("object"),t=U("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function A5(n){let e,t,i;return{c(){e=v("img"),gn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!gn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function I5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Rp(n);return{c(){i&&i.c(),t=ye()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Rp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&k(t)}}}function L5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Qe(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function P5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=U(n[2]),i=E(),s=v("i"),l=E(),o=v("div"),r=E(),a=v("button"),a.textContent="Close",p(s,"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),b(e,t),b(e,i),b(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&k(e),c&&k(l),c&&k(o),c&&k(r),c&&k(a),u=!1,f()}}}function F5(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[P5],header:[L5],default:[I5]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function N5(n,e,t){let i,s,l,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){te[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Fe.call(this,n,m)}function d(m){Fe.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=z.getFileType(s))},[u,r,s,o,l,a,i,f,c,d]}class R5 extends ve{constructor(e){super(),be(this,e,N5,F5,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function q5(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?H5:u[3]==="video"||u[3]==="audio"?V5:z5}let r=o(n),a=r(n);return{c(){e=v("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(u,f){w(u,e,f),a.m(e,null),s||(l=Y(e,"click",Dn(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&k(e),a.d(),s=!1,l()}}}function j5(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function z5(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function V5(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function H5(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),gn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[8]),s=!0)},p(o,r){r&32&&!gn(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&&k(e),s=!1,l()}}}function B5(n){let e,t,i;function s(a,u){return a[2]?j5:q5}let l=s(n),o=l(n),r={};return t=new R5({props:r}),n[12](t),{c(){o.c(),e=E(),B(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),V(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){L(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[12](null),H(t,a)}}}function U5(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!1;m();async function m(){t(2,d=!0);try{t(10,c=await fe.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function _(){t(5,u="")}const h=y=>{s&&(y.preventDefault(),a==null||a.show(f))};function g(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=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=z.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":fe.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":fe.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,s,_,l,c,h,g]}class uu extends ve{constructor(e){super(),be(this,e,U5,B5,me,{record:9,filename:0,size:1})}}function qp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function W5(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[$e(ze.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Oe(i)}}}function Y5(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function K5(n){let e,t,i,s,l,o,r=n[34]+"",a,u,f,c,d,m;i=new uu({props:{record:n[3],filename:n[34]}});function _(y,S){return y[35]?Y5:W5}let h=_(n),g=h(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),o=v("a"),a=U(r),c=E(),d=v("div"),g.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=fe.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),b(e,t),V(i,t,null),b(e,s),b(e,l),b(l,o),b(o,a),b(e,c),b(e,d),g.m(d,null),m=!0},p(y,S){const $={};S[0]&8&&($.record=y[3]),S[0]&32&&($.filename=y[34]),i.$set($),(!m||S[0]&36)&&Q(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&se(a,r),(!m||S[0]&1064&&u!==(u=fe.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),h===(h=_(y))&&g?g.p(y,S):(g.d(1),g=h(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&Q(e,"dragging",y[32]),(!m||S[1]&4)&&Q(e,"dragover",y[33])},i(y){m||(A(i.$$.fragment,y),m=!0)},o(y){L(i.$$.fragment,y),m=!1},d(y){y&&k(e),H(i),g.d()}}}function zp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[K5,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Al({props:r}),te.push(()=>ce(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function J5(n){let e,t,i,s,l,o,r,a,u=n[29].name+"",f,c,d,m,_,h,g;i=new E5({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),B(i.$$.fragment),s=E(),l=v("div"),o=v("small"),o.textContent="New",r=E(),a=v("span"),f=U(u),d=E(),m=v("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"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"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,$){w(S,e,$),b(e,t),V(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,m),_=!0,h||(g=[$e(ze.call(null,m,"Remove file")),Y(m,"click",y)],h=!0)},p(S,$){n=S;const C={};$[0]&2&&(C.file=n[29]),i.$set(C),(!_||$[0]&2)&&u!==(u=n[29].name+"")&&se(f,u),(!_||$[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!_||$[1]&2)&&Q(e,"dragging",n[32]),(!_||$[1]&4)&&Q(e,"dragover",n[33])},i(S){_||(A(i.$$.fragment,S),_=!0)},o(S){L(i.$$.fragment,S),_=!1},d(S){S&&k(e),H(i),h=!1,Oe(g)}}}function Vp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[J5,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Al({props:r}),te.push(()=>ce(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function Z5(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,c=[],d=new Map,m,_=[],h=new Map,g,y,S,$,C,T,M,O,D,I,P,F,R=n[5];const N=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=v("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),V(t,e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!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||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),s=!1,Oe(l)}}}function X5(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,_="";function h(j){z.removeByValue(f,j),t(2,f)}function g(j){z.pushUnique(f,j),t(2,f)}function y(j){z.isEmpty(u[j])||u.splice(j,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(j){var X,K;j.preventDefault(),t(9,m=!1);const Z=((X=j.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const J of Z){const le=s.length+u.length-f.length;if(((K=r.options)==null?void 0:K.maxSelect)<=le)break;u.push(J)}t(1,u)}}Xt(async()=>{t(10,_=await fe.getAdminFileToken(o.collectionId))});const C=j=>h(j),T=j=>g(j);function M(j){a=j,t(0,a),t(6,i),t(4,r)}const O=j=>y(j);function D(j){u=j,t(1,u)}function I(j){te[j?"unshift":"push"](()=>{c=j,t(7,c)})}const P=()=>{for(let j of c.files)u.push(j);t(1,u),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function R(j){te[j?"unshift":"push"](()=>{d=j,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=j=>{"record"in j&&t(3,o=j.record),"field"in j&&t(4,r=j.field),"value"in j&&t(0,a=j.value),"uploadedFiles"in j&&t(1,u=j.uploadedFiles),"deletedFileNames"in j&&t(2,f=j.deletedFileNames)},n.$$.update=()=>{var j,Z;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=z.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((j=r.options)==null?void 0:j.maxSelect)>1),n.$$.dirty[0]&65&&z.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=z.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,m,_,l,h,g,y,$,C,T,M,O,D,I,P,F,R,N,q]}class Q5 extends ve{constructor(e){super(),be(this,e,X5,G5,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Hp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function x5(n,e){e=Hp(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=Hp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Bp(n,e,t){const i=n.slice();i[6]=e[t];const s=z.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Up(n,e,t){const i=n.slice();return i[10]=e[t],i}function Wp(n){let e,t;return e=new uu({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Yp(n){let e=!z.isEmpty(n[10]),t,i,s=e&&Wp(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&3&&(e=!z.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=Wp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ae(),L(s,1,1,()=>{s=null}),ue())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){s&&s.d(l),l&&k(t)}}}function Kp(n){let e,t,i=n[7],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oL(m[h],1,1,()=>{m[h]=null});return{c(){e=v("div"),t=v("i"),s=E();for(let h=0;ht(5,o=u));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=u=>{"record"in u&&t(0,r=u.record),"displayFields"in u&&t(3,a=u.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(u=>u.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(u=>{var f;return!!((f=i==null?void 0:i.schema)!=null&&f.find(c=>c.name==u&&c.type=="file"))}))||[]),n.$$.dirty&10&&t(2,l=(s.length?a==null?void 0:a.filter(u=>!s.includes(u)):a)||[])},[r,s,l,a,i,o]}class er extends ve{constructor(e){super(),be(this,e,t6,e6,me,{record:0,displayFields:3})}}function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function Zp(n,e,t){const i=n.slice();i[50]=e[t];const s=i[9](i[50]);return i[6]=s,i}function Gp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Xp(n){let e,t=!n[13]&&Qp(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=Qp(i),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&k(e)}}}function Qp(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&xp(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=xp(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function xp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[36]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function n6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function i6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function em(n){let e,t,i,s;function l(){return n[33](n[50])}return{c(){e=v("div"),t=v("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),b(e,t),i||(s=[$e(ze.call(null,t,"Edit")),Y(t,"keydown",Dn(n[28])),Y(t,"click",Dn(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,Oe(s)}}}function tm(n,e){let t,i,s,l,o,r,a,u;function f(g,y){return g[6]?i6:n6}let c=f(e),d=c(e);l=new er({props:{record:e[50],displayFields:e[14]}});let m=!e[11]&&em(e);function _(){return e[34](e[50])}function h(...g){return e[35](e[50],...g)}return{key:n,first:null,c(){t=v("div"),d.c(),i=E(),s=v("div"),B(l.$$.fragment),o=E(),m&&m.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),b(t,i),b(t,s),V(l,s,null),b(t,o),m&&m.m(t,null),r=!0,a||(u=[Y(t,"click",_),Y(t,"keydown",h)],a=!0)},p(g,y){e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[50]),y[0]&16384&&(S.displayFields=e[14]),l.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=em(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(A(l.$$.fragment,g),r=!0)},o(g){L(l.$$.fragment,g),r=!1},d(g){g&&k(t),d.d(),H(l),m&&m.d(),a=!1,Oe(u)}}}function nm(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function im(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[4]),o=U(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(l,r[4])},d(r){r&&k(e),r&&k(i),r&&k(s),r&&k(l),r&&k(o)}}}function s6(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function l6(n){let e,t,i=n[6],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=E(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[53]),Q(e,"label-warning",n[54])},m(f,c){w(f,e,c),V(t,e,null),b(e,i),b(e,s),w(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),c[0]&16384&&(d.displayFields=n[14]),t.$set(d),(!o||c[1]&4194304)&&Q(e,"label-danger",n[53]),(!o||c[1]&8388608)&&Q(e,"label-warning",n[54])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){L(t.$$.fragment,f),o=!1},d(f){f&&k(e),H(t),f&&k(l),r=!1,a()}}}function sm(n){let e,t,i;function s(o){n[39](o)}let l={index:n[52],$$slots:{default:[o6,({dragging:o,dragover:r})=>({53:o,54:r}),({dragging:o,dragover:r})=>[0,(o?4194304:0)|(r?8388608:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Al({props:l}),te.push(()=>ce(e,"list",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&16448|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function r6(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,m,_,h,g,y,S,$;t=new Yo({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[31]);let C=!n[11]&&Gp(n),T=n[8];const M=N=>N[50].id;for(let N=0;N1&&im(n);const P=[l6,s6],F=[];function R(N,q){return N[6].length?0:1}return _=R(n),h=F[_]=P[_](n),{c(){e=v("div"),B(t.$$.fragment),i=E(),C&&C.c(),s=E(),l=v("div");for(let N=0;N1?I?I.p(N,q):(I=im(N),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=_;_=R(N),_===Z?F[_].p(N,q):(ae(),L(F[Z],1,1,()=>{F[Z]=null}),ue(),h=F[_],h?h.p(N,q):(h=F[_]=P[_](N),h.c()),A(h,1),h.m(g.parentNode,g))},i(N){if(!y){A(t.$$.fragment,N);for(let q=0;qCancel',t=E(),i=v("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),s||(l=[Y(e,"click",n[29]),Y(i,"click",n[30])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Oe(l)}}}function f6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[20]];let o={$$slots:{footer:[u6],header:[a6],default:[r6]},$$scope:{ctx:n}};for(let a=0;at(27,_=Ie));const h=Tt(),g="picker_"+z.randomString(5);let{value:y}=e,{field:S}=e,$,C,T="",M=[],O=[],D=1,I=0,P=!1,F=!1;function R(){return t(2,T=""),t(8,M=[]),t(6,O=[]),q(),j(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function q(){const Ie=z.toArray(y);if(!s||!Ie.length)return;t(25,F=!0);let rt=[];const Ee=Ie.slice(),lt=[];for(;Ee.length>0;){const Et=[];for(const zt of Ee.splice(0,no))Et.push(`id="${zt}"`);lt.push(fe.collection(s).getFullList(no,{filter:Et.join("||"),$autoCancel:!1}))}try{await Promise.all(lt).then(Et=>{rt=rt.concat(...Et)}),t(6,O=[]);for(const Et of Ie){const zt=z.findByKey(rt,"id",Et);zt&&O.push(zt)}T.trim()||t(8,M=z.filterDuplicatesByKey(O.concat(M))),t(25,F=!1)}catch(Et){Et.isAbort||(fe.error(Et),t(25,F=!1))}}async function j(Ie=!1){if(s){t(3,P=!0),Ie&&(T.trim()?t(8,M=[]):t(8,M=z.toArray(O).slice()));try{const rt=Ie?1:D+1,Ee=z.getAllCollectionIdentifiers(o),lt=await fe.collection(s).getList(rt,no,{filter:z.normalizeSearchFilter(T,Ee),sort:r?"":"-created",skipTotal:1,$cancelKey:g+"loadList"});t(8,M=z.filterDuplicatesByKey(M.concat(lt.items))),D=lt.page,t(24,I=lt.items.length),t(3,P=!1)}catch(rt){rt.isAbort||(fe.error(rt),t(3,P=!1))}}}function Z(Ie){i==1?t(6,O=[Ie]):f&&(z.pushOrReplaceByKey(O,Ie),t(6,O))}function X(Ie){z.removeByKey(O,"id",Ie.id),t(6,O)}function K(Ie){c(Ie)?X(Ie):Z(Ie)}function J(){var Ie;i!=1?t(21,y=O.map(rt=>rt.id)):t(21,y=((Ie=O==null?void 0:O[0])==null?void 0:Ie.id)||""),h("save",O),N()}function le(Ie){Fe.call(this,n,Ie)}const ie=()=>N(),ee=()=>J(),Te=Ie=>t(2,T=Ie.detail),Pe=()=>C==null?void 0:C.show(),je=Ie=>C==null?void 0:C.show(Ie),Ve=Ie=>K(Ie),ke=(Ie,rt)=>{(rt.code==="Enter"||rt.code==="Space")&&(rt.preventDefault(),rt.stopPropagation(),K(Ie))},Ce=()=>t(2,T=""),Je=()=>{u&&!P&&j()},_t=Ie=>X(Ie);function Ze(Ie){O=Ie,t(6,O)}function We(Ie){te[Ie?"unshift":"push"](()=>{$=Ie,t(1,$)})}function yt(Ie){Fe.call(this,n,Ie)}function pe(Ie){Fe.call(this,n,Ie)}function _e(Ie){te[Ie?"unshift":"push"](()=>{C=Ie,t(7,C)})}const Ye=Ie=>{z.removeByKey(M,"id",Ie.detail.id),M.unshift(Ie.detail),t(8,M),Z(Ie.detail)},Mt=Ie=>{z.removeByKey(M,"id",Ie.detail.id),t(8,M),X(Ie.detail)};return n.$$set=Ie=>{e=Re(Re({},e),Gt(Ie)),t(20,m=Xe(e,d)),"value"in Ie&&t(21,y=Ie.value),"field"in Ie&&t(22,S=Ie.field)},n.$$.update=()=>{var Ie,rt,Ee;n.$$.dirty[0]&4194304&&t(4,i=((Ie=S==null?void 0:S.options)==null?void 0:Ie.maxSelect)||null),n.$$.dirty[0]&4194304&&t(26,s=(rt=S==null?void 0:S.options)==null?void 0:rt.collectionId),n.$$.dirty[0]&4194304&&t(14,l=(Ee=S==null?void 0:S.options)==null?void 0:Ee.displayFields),n.$$.dirty[0]&201326592&&t(5,o=_.find(lt=>lt.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&$!=null&&$.isActive()&&j(!0),n.$$.dirty[0]&32&&t(11,r=(o==null?void 0:o.type)==="view"),n.$$.dirty[0]&33554440&&t(13,a=P||F),n.$$.dirty[0]&16777216&&t(12,u=I==no),n.$$.dirty[0]&80&&t(10,f=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,c=function(lt){return z.findByKey(O,"id",lt.id)})},[N,$,T,P,i,o,O,C,M,c,f,r,u,a,l,j,Z,X,K,J,m,y,S,R,I,F,s,_,le,ie,ee,Te,Pe,je,Ve,ke,Ce,Je,_t,Ze,We,yt,pe,_e,Ye,Mt]}class d6 extends ve{constructor(e){super(),be(this,e,c6,f6,me,{value:21,field:22,show:23,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[23]}get hide(){return this.$$.ctx[0]}}function lm(n,e,t){const i=n.slice();return i[20]=e[t],i[22]=t,i}function om(n,e,t){const i=n.slice();return i[25]=e[t],i}function rm(n){let e,t=n[5]&&am(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=am(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function am(n){let e,t=z.toArray(n[0]).slice(0,10),i=[];for(let s=0;s
    - `,p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function p6(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new er({props:{record:n[20],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[10](n[20])}return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='',r=E(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[23]),Q(e,"dragover",n[24])},m(m,_){w(m,e,_),b(e,t),V(i,t,null),b(e,s),b(e,l),b(l,o),w(m,r,_),a=!0,u||(f=[$e(ze.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,_){var g;n=m;const h={};_&16&&(h.record=n[20]),_&4&&(h.displayFields=(g=n[2].options)==null?void 0:g.displayFields),i.$set(h),(!a||_&8388608)&&Q(e,"dragging",n[23]),(!a||_&16777216)&&Q(e,"dragover",n[24])},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){L(i.$$.fragment,m),a=!1},d(m){m&&k(e),H(i),m&&k(r),u=!1,Oe(f)}}}function fm(n,e){let t,i,s,l;function o(a){e[11](a)}let r={group:e[2].name+"_relation",index:e[22],disabled:!e[6],$$slots:{default:[p6,({dragging:a,dragover:u})=>({23:a,24:u}),({dragging:a,dragover:u})=>(a?8388608:0)|(u?16777216:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Al({props:r}),te.push(()=>ce(i,"list",o)),i.$on("sort",e[12]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[22]),u&64&&(f.disabled=!e[6]),u&293601300&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function m6(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d=[],m=new Map,_,h,g,y,S,$,C=n[4];const T=O=>O[20].id;for(let O=0;O - - Open picker`,p(t,"class",i=is(z.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[19]),p(c,"class","relations-list svelte-1ynw0pc"),p(g,"type","button"),p(g,"class","btn btn-transparent btn-sm btn-block"),p(h,"class","list-item list-item-btn"),p(f,"class","list")},m(O,D){w(O,e,D),b(e,t),b(e,s),b(e,l),b(l,r),w(O,u,D),w(O,f,D),b(f,c);for(let I=0;I({19:r}),({uniqueId:r})=>r?524288:0]},$$scope:{ctx:n}};e=new de({props:l}),n[14](e);let o={value:n[0],field:n[2]};return i=new d6({props:o}),n[15](i),i.$on("save",n[16]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(r,a){V(e,r,a),w(r,t,a),V(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&268959863&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[14](null),H(e,r),r&&k(t),n[15](null),H(i,r)}}}const cm=100;function _6(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f;function c(){if(u)return!1;const M=z.toArray(l);return t(4,a=a.filter(O=>M.includes(O.id))),M.length!=a.length}async function d(){var I,P;const M=z.toArray(l);if(t(4,a=[]),!((I=s==null?void 0:s.options)!=null&&I.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const O=M.slice(),D=[];for(;O.length>0;){const F=[];for(const R of O.splice(0,cm))F.push(`id="${R}"`);D.push(fe.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(cm,{filter:F.join("||"),$autoCancel:!1}))}try{let F=[];await Promise.all(D).then(R=>{F=F.concat(...R)});for(const R of M){const N=z.findByKey(F,"id",R);N&&a.push(N)}t(4,a),_()}catch(F){fe.error(F)}t(5,u=!1)}function m(M){z.removeByKey(a,"id",M.id),t(4,a),_()}function _(){var M;i?t(0,l=a.map(O=>O.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Ro(()=>{clearTimeout(f)});const h=M=>m(M);function g(M){a=M,t(4,a)}const y=()=>{_()},S=()=>o==null?void 0:o.show();function $(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function C(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const T=M=>{var O;t(4,a=M.detail||[]),t(0,l=i?a.map(D=>D.id):((O=a[0])==null?void 0:O.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(6,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&529&&c()&&(t(5,u=!0),clearTimeout(f),t(9,f=setTimeout(d,0)))},[l,o,s,r,a,u,i,m,_,f,h,g,y,S,$,C,T]}class g6 extends ve{constructor(e){super(),be(this,e,_6,h6,me,{field:2,value:0,picker:1})}}const b6=["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"],v6=(n,e)=>{b6.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function y6(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),qr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[18](null)}}}function k6(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[17](null)}}}function w6(n){let e;function t(l,o){return l[1]?k6:y6}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:x,o:x,d(l){l&&k(e),s.d(),n[19](null)}}}const S1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),S6=()=>{let n={listeners:[],scriptId:S1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let C6=S6();function $6(n,e,t){var i;let{id:s=S1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:m=""}=e,{cssClass:_="tinymce-wrapper"}=e,h,g,y,S=d,$=o;const C=Tt(),T=()=>{const F=(()=>typeof window<"u"?window:global)();return F&&F.tinymce?F.tinymce:null},M=()=>{const P=Object.assign(Object.assign({},f),{target:g,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:F=>{t(14,y=F),F.on("init",()=>{F.setContent(d),F.on(c,()=>{t(15,S=F.getContent()),S!==d&&(t(5,d=S),t(6,m=F.getContent({format:"text"})))})}),v6(F,C),typeof f.setup=="function"&&f.setup(F)}});t(4,g.style.visibility="",g),T().init(P)};Xt(()=>{if(T()!==null)M();else{const P=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;C6.load(h.ownerDocument,P,()=>{M()})}}),Ro(()=>{var P;y&&((P=T())===null||P===void 0||P.remove(y))});function O(P){te[P?"unshift":"push"](()=>{g=P,t(4,g)})}function D(P){te[P?"unshift":"push"](()=>{g=P,t(4,g)})}function I(P){te[P?"unshift":"push"](()=>{h=P,t(3,h)})}return n.$$set=P=>{"id"in P&&t(0,s=P.id),"inline"in P&&t(1,l=P.inline),"disabled"in P&&t(7,o=P.disabled),"apiKey"in P&&t(8,r=P.apiKey),"channel"in P&&t(9,a=P.channel),"scriptSrc"in P&&t(10,u=P.scriptSrc),"conf"in P&&t(11,f=P.conf),"modelEvents"in P&&t(12,c=P.modelEvents),"value"in P&&t(5,d=P.value),"text"in P&&t(6,m=P.text),"cssClass"in P&&t(2,_=P.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&S!==d&&(y.setContent(d),t(6,m=y.getContent({format:"text"}))),y&&o!==$&&(t(16,$=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,_,h,g,d,m,o,r,a,u,f,c,i,y,S,$,O,D,I]}class fu extends ve{constructor(e){super(),be(this,e,$6,w6,me,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function T6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(h){n[2](h)}let _={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:z.defaultEditorOptions()};return n[0]!==void 0&&(_.value=n[0]),f=new fu({props:_}),te.push(()=>ce(f,"value",m)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),B(f.$$.fragment),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),w(h,u,g),V(f,h,g),d=!0},p(h,g){(!d||g&2&&i!==(i=z.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||g&8&&a!==(a=h[3]))&&p(e,"for",a);const y={};g&8&&(y.id=h[3]),!c&&g&1&&(c=!0,y.value=h[0],he(()=>c=!1)),f.$set(y)},i(h){d||(A(f.$$.fragment,h),d=!0)},o(h){L(f.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(u),H(f,h)}}}function M6(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[T6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function O6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class E6 extends ve{constructor(e){super(),be(this,e,O6,M6,me,{field:1,value:0})}}function D6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].authUrl&&re(l,u[0].authUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function A6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&re(l,u[0].tokenUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function I6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&re(l,u[0].userApiUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function L6(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[D6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[A6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[I6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment),o=E(),B(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),V(i,u,f),w(u,s,f),V(l,u,f),w(u,o,f),V(r,u,f),a=!0},p(u,[f]){const c={};f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const m={};f&2&&(m.name=u[1]+".userApiUrl"),f&97&&(m.$$scope={dirty:f,ctx:u}),r.$set(m)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(i.$$.fragment,u),L(l.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&k(e),u&&k(t),H(i,u),u&&k(s),H(l,u),u&&k(o),H(r,u)}}}function P6(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class dm extends ve{constructor(e){super(),be(this,e,P6,L6,me,{key:1,config:0})}}function F6(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0].authUrl),w(d,a,m),w(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].authUrl&&re(l,d[0].authUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(u),f=!1,c()}}}function N6(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0].tokenUrl),w(d,a,m),w(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&re(l,d[0].tokenUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(u),f=!1,c()}}}function R6(n){let e,t,i,s,l,o;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[F6,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[N6,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),V(i,r,a),w(r,s,a),V(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&k(e),r&&k(t),H(i,r),r&&k(s),H(l,r)}}}function q6(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class j6 extends ve{constructor(e){super(),be(this,e,q6,R6,me,{key:1,config:0})}}function z6(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0].authUrl),w(d,a,m),w(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].authUrl&&re(l,d[0].authUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(u),f=!1,c()}}}function V6(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0].tokenUrl),w(d,a,m),w(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&re(l,d[0].tokenUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(u),f=!1,c()}}}function H6(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0].userApiUrl),w(d,a,m),w(d,u,m),f||(c=Y(l,"input",n[4]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].userApiUrl&&re(l,d[0].userApiUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(u),f=!1,c()}}}function B6(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[z6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[V6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[H6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Endpoints",t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment),o=E(),B(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),V(i,u,f),w(u,s,f),V(l,u,f),w(u,o,f),V(r,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.class="form-field "+(u[0].enabled?"required":"")),f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const m={};f&1&&(m.class="form-field "+(u[0].enabled?"required":"")),f&2&&(m.name=u[1]+".userApiUrl"),f&97&&(m.$$scope={dirty:f,ctx:u}),r.$set(m)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(i.$$.fragment,u),L(l.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&k(e),u&&k(t),H(i,u),u&&k(s),H(l,u),u&&k(o),H(r,u)}}}function U6(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Pr extends ve{constructor(e){super(),be(this,e,U6,B6,me,{key:1,config:0})}}function W6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Y6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Team ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&re(l,u[3])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function K6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Key ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&re(l,u[4])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function J6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",uo),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[6]),u||(f=[$e(ze.call(null,s,{text:`Max ${uo} seconds (~${uo/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,Oe(f)}}}function Z6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Private key"),s=E(),l=v("textarea"),r=E(),a=v("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(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- -... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&re(l,c[5])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function G6(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[W6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[Y6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[K6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[J6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Z6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),a=E(),u=v("div"),B(f.$$.fragment),c=E(),d=v("div"),B(m.$$.fragment),_=E(),B(h.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,C){w($,e,C),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),b(t,a),b(t,u),V(f,u,null),b(t,c),b(t,d),V(m,d,null),b(t,_),V(h,t,null),g=!0,y||(S=Y(e,"submit",Qe(n[17])),y=!0)},p($,C){const T={};C&25165828&&(T.$$scope={dirty:C,ctx:$}),s.$set(T);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:$}),r.$set(M);const O={};C&25165840&&(O.$$scope={dirty:C,ctx:$}),f.$set(O);const D={};C&25165888&&(D.$$scope={dirty:C,ctx:$}),m.$set(D);const I={};C&25165856&&(I.$$scope={dirty:C,ctx:$}),h.$set(I)},i($){g||(A(s.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(h.$$.fragment,$),g=!0)},o($){L(s.$$.fragment,$),L(r.$$.fragment,$),L(f.$$.fragment,$),L(m.$$.fragment,$),L(h.$$.fragment,$),g=!1},d($){$&&k(e),H(s),H(r),H(f),H(m),H(h),y=!1,S()}}}function X6(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Q6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function x6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[Q6],header:[X6],default:[G6]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const uo=15777e3;function eO(n,e,t){let i;const s=Tt(),l="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||uo),tn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const P=await fe.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),Ht("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){fe.error(P)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function C(){f=this.value,t(5,f)}const T=()=>h(),M=()=>!d;function O(P){te[P?"unshift":"push"](()=>{o=P,t(1,o)})}function D(P){Fe.call(this,n,P)}function I(P){Fe.call(this,n,P)}return t(8,i=!0),[_,o,r,a,u,f,c,d,i,l,h,m,g,y,S,$,C,T,M,O,D,I]}class tO extends ve{constructor(e){super(),be(this,e,eO,x6,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function nO(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new tO({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=E(),s=v("span"),s.textContent="Generate secret",o=E(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),b(e,t),b(e,i),b(e,s),w(d,o,m),V(r,d,m),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const _={};r.$set(_)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){L(r.$$.fragment,d),a=!1},d(d){d&&k(e),d&&k(o),n[4](null),H(r,d),u=!1,f()}}}function iO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class sO extends ve{constructor(e){super(),be(this,e,iO,nO,me,{key:1,config:0})}}const fo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:sO},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:j6},{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:dm},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:dm},{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:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Pr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Pr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Pr}];function pm(n,e,t){const i=n.slice();return i[9]=e[t],i}function lO(n){let e;return{c(){e=v("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:x,d(t){t&&k(e)}}}function oO(n){let e,t=n[1],i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mm(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,_,h,g,y,S;function $(){return n[6](n[9])}return{c(){var C;e=v("div"),t=v("figure"),i=v("img"),l=E(),o=v("span"),a=U(r),u=E(),f=v("div"),c=U("ID: "),m=U(d),_=E(),h=v("button"),h.innerHTML='',g=E(),gn(i.src,s="./images/oauth2/"+((C=n[3](n[9].provider))==null?void 0:C.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),b(e,u),b(e,f),b(f,c),b(f,m),b(e,_),b(e,h),b(e,g),y||(S=Y(h,"click",$),y=!0)},p(C,T){var M;n=C,T&2&&!gn(i.src,s="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",s),T&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),T&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(C){C&&k(e),y=!1,S()}}}function aO(n){let e;function t(l,o){var r;return l[2]?rO:(r=l[0])!=null&&r.id&&l[1].length?oO:lO}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function uO(n,e,t){const i=Tt();let{record:s}=e,l=[],o=!1;function r(d){return fo.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||z.sentenize(d,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await fe.collection(s.collectionId).listExternalAuths(s.id))}catch(d){fe.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||hn(`Do you really want to unlink the ${a(d)} provider?`,()=>fe.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{Ht(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(m=>{fe.error(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class fO extends ve{constructor(e){super(),be(this,e,uO,aO,me,{record:0})}}function hm(n,e,t){const i=n.slice();return i[67]=e[t],i[68]=e,i[69]=t,i}function _m(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`The record has previous unsaved changes. - `),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"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),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),m=!0,_||(h=[Y(r,"click",n[37]),$e(ze.call(null,u,"Discard draft")),Y(u,"click",Qe(n[38]))],_=!0)},p:x,i(g){m||(d&&d.end(1),m=!0)},o(g){d=ya(e,st,{duration:150}),m=!1},d(g){g&&k(e),g&&d&&d.end(),_=!1,Oe(h)}}}function gm(n){let e,t,i,s,l;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-calendar-event-line txt-disabled"),p(e,"class","form-field-addon")},m(o,r){w(o,e,r),b(e,t),s||(l=$e(i=ze.call(null,t,{text:`Created: ${n[3].created} -Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&jt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created} -Updated: ${o[3].updated}`,position:"left"})},d(o){o&&k(e),s=!1,l()}}}function cO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h=!n[6]&&gm(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),h&&h.c(),u=E(),f=v("input"),p(t,"class",is(z.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(f,"type","text"),p(f,"id",c=n[70]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(g,a,y),h&&h.m(g,y),w(g,u,y),w(g,f,y),re(f,n[3].id),m||(_=Y(f,"input",n[39]),m=!0)},p(g,y){y[2]&256&&r!==(r=g[70])&&p(e,"for",r),g[6]?h&&(h.d(1),h=null):h?h.p(g,y):(h=gm(g),h.c(),h.m(u.parentNode,u)),y[2]&256&&c!==(c=g[70])&&p(f,"id",c),y[0]&64&&d!==(d=!g[6])&&(f.readOnly=d),y[0]&8&&f.value!==g[3].id&&re(f,g[3].id)},d(g){g&&k(e),g&&k(a),h&&h.d(g),g&&k(u),g&&k(f),m=!1,_()}}}function bm(n){var u,f;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new BM({props:r}),te.push(()=>ce(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&vm();return{c(){B(e.$$.fragment),i=E(),a&&a.c(),s=ye()},m(c,d){V(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!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],he(()=>t=!1)),e.$set(m),(h=(_=c[0])==null?void 0:_.schema)!=null&&h.length?a||(a=vm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){H(e,c),c&&k(i),a&&a.d(c),c&&k(s)}}}function vm(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dO(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new g6({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pO(n){let e,t,i,s,l;function o(f){n[50](f,n[67])}function r(f){n[51](f,n[67])}function a(f){n[52](f,n[67])}let u={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(u.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(u.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(u.deletedFileNames=n[5][n[67].name]),e=new Q5({props:u}),te.push(()=>ce(e,"value",o)),te.push(()=>ce(e,"uploadedFiles",r)),te.push(()=>ce(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,c){V(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],he(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],he(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],he(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function mO(n){let e,t,i;function s(o){n[49](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new C5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function hO(n){let e,t,i;function s(o){n[48](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new y5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _O(n){let e,t,i;function s(o){n[47](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new _5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function gO(n){let e,t,i;function s(o){n[46](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new E6({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function bO(n){let e,t,i;function s(o){n[45](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new d5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function vO(n){let e,t,i;function s(o){n[44](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new a5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function yO(n){let e,t,i;function s(o){n[43](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new s5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function kO(n){let e,t,i;function s(o){n[42](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new e5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function wO(n){let e,t,i;function s(o){n[41](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new GM({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ym(n,e){let t,i,s,l,o;const r=[wO,kO,yO,vO,bO,gO,_O,hO,mO,pO,dO],a=[];function u(f,c){return f[67].type==="text"?0:f[67].type==="number"?1:f[67].type==="bool"?2:f[67].type==="email"?3:f[67].type==="url"?4:f[67].type==="editor"?5:f[67].type==="date"?6:f[67].type==="select"?7:f[67].type==="json"?8:f[67].type==="file"?9:f[67].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),s&&s.c(),l=ye(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(ae(),L(a[d],1,1,()=>{a[d]=null}),ue()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){L(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function km(n){let e,t,i;return t=new fO({props:{record:n[3]}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[12]===bl)},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&Q(e,"active",s[12]===bl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function SO(n){var S;let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,m=!n[7]&&n[9]&&_m(n);s=new de({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[cO,({uniqueId:$})=>({70:$}),({uniqueId:$})=>[0,0,$?256:0]]},$$scope:{ctx:n}}});let _=n[13]&&bm(n),h=((S=n[0])==null?void 0:S.schema)||[];const g=$=>$[67].name;for(let $=0;${m=null}),ue());const T={};C[0]&64&&(T.class="form-field "+($[6]?"":"readonly")),C[0]&72|C[2]&768&&(T.$$scope={dirty:C,ctx:$}),s.$set(T),$[13]?_?(_.p($,C),C[0]&8192&&A(_,1)):(_=bm($),_.c(),A(_,1),_.m(t,o)):_&&(ae(),L(_,1,1,()=>{_=null}),ue()),C[0]&57&&(h=((M=$[0])==null?void 0:M.schema)||[],ae(),r=bt(r,C,g,1,$,h,a,t,Ut,ym,null,hm),ue()),(!f||C[0]&4096)&&Q(t,"active",$[12]===ns),$[13]&&!$[6]?y?(y.p($,C),C[0]&8256&&A(y,1)):(y=km($),y.c(),A(y,1),y.m(e,null)):y&&(ae(),L(y,1,1,()=>{y=null}),ue())},i($){if(!f){A(m),A(s.$$.fragment,$),A(_);for(let C=0;C - Send verification email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Cm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` - Send password reset email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function CO(n){let e,t,i,s,l,o,r,a=n[13]&&!n[2].verified&&n[2].email&&Sm(n),u=n[13]&&n[2].email&&Cm(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=` - Duplicate`,s=E(),l=v("button"),l.innerHTML=` - Delete`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[Y(i,"click",n[33]),Y(l,"click",Dn(Qe(n[34])))],o=!0)},p(f,c){f[13]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Sm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[13]&&f[2].email?u?u.p(f,c):(u=Cm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&k(e),u&&u.d(f),f&&k(t),f&&k(i),f&&k(s),f&&k(l),o=!1,Oe(r)}}}function $m(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[12]===ns),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[12]===bl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[Y(t,"click",n[35]),Y(s,"click",n[36])],l=!0)},p(r,a){a[0]&4096&&Q(t,"active",r[12]===ns),a[0]&4096&&Q(s,"active",r[12]===bl)},d(r){r&&k(e),l=!1,Oe(o)}}}function $O(n){var h;let e,t=n[6]?"New":"Edit",i,s,l,o=((h=n[0])==null?void 0:h.name)+"",r,a,u,f,c,d,m=!n[6]&&wm(n),_=n[13]&&!n[6]&&$m(n);return{c(){e=v("h4"),i=U(t),s=E(),l=v("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),c=ye(),p(e,"class","panel-title svelte-qc5ngu")},m(g,y){w(g,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),w(g,u,y),m&&m.m(g,y),w(g,f,y),_&&_.m(g,y),w(g,c,y),d=!0},p(g,y){var S;(!d||y[0]&64)&&t!==(t=g[6]?"New":"Edit")&&se(i,t),(!d||y[0]&1)&&o!==(o=((S=g[0])==null?void 0:S.name)+"")&&se(r,o),g[6]?m&&(ae(),L(m,1,1,()=>{m=null}),ue()):m?(m.p(g,y),y[0]&64&&A(m,1)):(m=wm(g),m.c(),A(m,1),m.m(f.parentNode,f)),g[13]&&!g[6]?_?_.p(g,y):(_=$m(g),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},i(g){d||(A(m),d=!0)},o(g){L(m),d=!1},d(g){g&&k(e),g&&k(u),m&&m.d(g),g&&k(f),_&&_.d(g),g&&k(c)}}}function TO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[10],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[16]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[14]||n[10],Q(s,"btn-loading",n[10])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=Y(e,"click",n[30]),u=!0)},p(c,d){d[0]&1024&&(e.disabled=c[10]),d[0]&64&&o!==(o=c[6]?"Create":"Save changes")&&se(r,o),d[0]&17408&&a!==(a=!c[14]||c[10])&&(s.disabled=a),d[0]&1024&&Q(s,"btn-loading",c[10])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function MO(n){let e,t,i={class:` - record-panel - `+(n[15]?"overlay-panel-xl":"overlay-panel-lg")+` - `+(n[13]&&!n[6]?"colored-header":"")+` - `,beforeHide:n[54],$$slots:{footer:[TO],header:[$O],default:[SO]},$$scope:{ctx:n}};return e=new on({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=` - record-panel - `+(s[15]?"overlay-panel-xl":"overlay-panel-lg")+` - `+(s[13]&&!s[6]?"colored-header":"")+` - `),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),H(e,s)}}}const ns="form",bl="providers";function OO(n,e,t){let i,s,l,o,r;const a=Tt(),u="record_"+z.randomString(5);let{collection:f}=e,c,d=null,m=null,_=null,h=!1,g=!1,y={},S={},$=JSON.stringify(null),C=$,T=ns,M=!0,O=!1;function D(ge){return P(ge),t(11,g=!0),t(12,T=ns),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function P(ge){t(28,O=!1),tn({}),t(2,d=ge||{}),t(3,m=structuredClone(d)),t(4,y={}),t(5,S={}),await cn(),t(9,_=N()),!_||Z(m,_)?t(9,_=null):(delete _.password,delete _.passwordConfirm),t(26,$=JSON.stringify(m)),t(28,O=!0)}async function F(ge){var ct,xe;tn({}),t(2,d=ge||{}),t(4,y={}),t(5,S={});const we=((xe=(ct=f==null?void 0:f.schema)==null?void 0:ct.filter(Wt=>Wt.type!="file"))==null?void 0:xe.map(Wt=>Wt.name))||[];for(let Wt in ge)we.includes(Wt)||t(3,m[Wt]=ge[Wt],m);await cn(),t(26,$=JSON.stringify(m)),X()}function R(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function N(ge){try{const we=window.localStorage.getItem(R());if(we)return new Record(JSON.parse(we))}catch{}return ge}function q(ge){window.localStorage.setItem(R(),ge)}function j(){_&&(t(3,m=_),t(9,_=null))}function Z(ge,we){var bn;const ct=structuredClone(ge||{}),xe=structuredClone(we||{}),Wt=(bn=f==null?void 0:f.schema)==null?void 0:bn.filter(Pn=>Pn.type==="file");for(let Pn of Wt)delete ct[Pn.name],delete xe[Pn.name];return delete ct.password,delete ct.passwordConfirm,delete xe.password,delete xe.passwordConfirm,JSON.stringify(ct)==JSON.stringify(xe)}function X(){t(9,_=null),window.localStorage.removeItem(R())}function K(ge=!0){if(h||!r||!(f!=null&&f.id))return;t(10,h=!0);const we=le();let ct;M?ct=fe.collection(f.id).create(we):ct=fe.collection(f.id).update(m.id,we),ct.then(xe=>{Ht(M?"Successfully created record.":"Successfully updated record."),X(),ge?(t(11,g=!1),I()):F(xe),a("save",xe)}).catch(xe=>{fe.error(xe)}).finally(()=>{t(10,h=!1)})}function J(){d!=null&&d.id&&hn("Do you really want to delete the selected record?",()=>fe.collection(d.collectionId).delete(d.id).then(()=>{I(),Ht("Successfully deleted record."),a("delete",d)}).catch(ge=>{fe.error(ge)}))}function le(){const ge=structuredClone(m||{}),we=new FormData,ct={id:ge.id};for(const xe of(f==null?void 0:f.schema)||[])ct[xe.name]=!0;i&&(ct.username=!0,ct.email=!0,ct.emailVisibility=!0,ct.password=!0,ct.passwordConfirm=!0,ct.verified=!0);for(const xe in ge)ct[xe]&&(typeof ge[xe]>"u"&&(ge[xe]=null),z.addValueToFormData(we,xe,ge[xe]));for(const xe in y){const Wt=z.toArray(y[xe]);for(const bn of Wt)we.append(xe,bn)}for(const xe in S){const Wt=z.toArray(S[xe]);for(const bn of Wt)we.append(xe+"."+bn,"")}return we}function ie(){!(f!=null&&f.id)||!(d!=null&&d.email)||hn(`Do you really want to sent verification email to ${d.email}?`,()=>fe.collection(f.id).requestVerification(d.email).then(()=>{Ht(`Successfully sent verification email to ${d.email}.`)}).catch(ge=>{fe.error(ge)}))}function ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||hn(`Do you really want to sent password reset email to ${d.email}?`,()=>fe.collection(f.id).requestPasswordReset(d.email).then(()=>{Ht(`Successfully sent password reset email to ${d.email}.`)}).catch(ge=>{fe.error(ge)}))}function Te(){o?hn("You have unsaved changes. Do you really want to discard them?",()=>{Pe()}):Pe()}async function Pe(){let ge=d?structuredClone(d):null;if(ge){ge.id="",ge.created="",ge.updated="";const we=(f==null?void 0:f.schema)||[];for(const ct of we)ct.type==="file"&&delete ge[ct.name]}X(),D(ge),await cn(),t(26,$="")}function je(ge){(ge.ctrlKey||ge.metaKey)&&ge.code=="KeyS"&&(ge.preventDefault(),ge.stopPropagation(),K(!1))}const Ve=()=>I(),ke=()=>ie(),Ce=()=>ee(),Je=()=>Te(),_t=()=>J(),Ze=()=>t(12,T=ns),We=()=>t(12,T=bl),yt=()=>j(),pe=()=>X();function _e(){m.id=this.value,t(3,m)}function Ye(ge){m=ge,t(3,m)}function Mt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Ie(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function rt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Ee(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function lt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Et(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function zt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function In(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Ln(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Kn(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Jn(ge,we){n.$$.not_equal(y[we.name],ge)&&(y[we.name]=ge,t(4,y))}function kt(ge,we){n.$$.not_equal(S[we.name],ge)&&(S[we.name]=ge,t(5,S))}function dn(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}const ti=()=>o&&g?(hn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,g=!1),I()}),!1):(tn({}),X(),!0);function us(ge){te[ge?"unshift":"push"](()=>{c=ge,t(8,c)})}function di(ge){Fe.call(this,n,ge)}function $i(ge){Fe.call(this,n,ge)}return n.$$set=ge=>{"collection"in ge&&t(0,f=ge.collection)},n.$$.update=()=>{var ge;n.$$.dirty[0]&1&&t(13,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(15,s=!!((ge=f==null?void 0:f.schema)!=null&&ge.find(we=>we.type==="editor"))),n.$$.dirty[0]&48&&t(29,l=z.hasNonEmptyProps(y)||z.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(27,C=JSON.stringify(m)),n.$$.dirty[0]&738197504&&t(7,o=l||$!=C),n.$$.dirty[0]&4&&t(6,M=!d||!d.id),n.$$.dirty[0]&192&&t(14,r=M||o),n.$$.dirty[0]&402653184&&O&&q(C)},[f,I,d,m,y,S,M,o,c,_,h,g,T,i,r,s,u,j,X,K,J,ie,ee,Te,je,D,$,C,O,l,Ve,ke,Ce,Je,_t,Ze,We,yt,pe,_e,Ye,Mt,Ie,rt,Ee,lt,Et,zt,In,Ln,Kn,Jn,kt,dn,ti,us,di,$i]}class C1 extends ve{constructor(e){super(),be(this,e,OO,MO,me,{collection:0,show:25,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[1]}}function EO(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){w(o,e,r),s||(l=[$e(i=ze.call(null,e,n[2]?"":"Copy")),Y(e,"click",Dn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&jt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,Oe(l)}}}function DO(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(z.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Xt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class Il extends ve{constructor(e){super(),be(this,e,DO,EO,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Tm(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Mm(n,e,t){const i=n.slice();return i[13]=e[t],i}function Om(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Em(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function AO(n){const e=n.slice(),t=z.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function IO(n){const e=n.slice(),t=z.toArray(e[3]);e[9]=t;const i=z.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function LO(n){const e=n.slice(),t=z.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function PO(n){let e,t;return{c(){e=v("div"),t=U(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function FO(n){let e,t=z.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=z.truncate(n[3]))},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=z.truncate(l[3])+"")&&se(i,t),o&8&&s!==(s=z.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function NO(n){let e,t=[],i=new Map,s,l,o=n[16].slice(0,n[17]);const r=u=>u[8]+u[18];for(let u=0;un[17]&&Am();return{c(){e=v("div");for(let u=0;uu[17]?a||(a=Am(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){if(!l){for(let f=0;fn[11]&&Pm();return{c(){e=v("div"),i.c(),s=E(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ae(),L(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Pm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function qO(n){let e,t=[],i=new Map,s=z.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function VO(n){let e,t=z.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=U(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),b(e,i),s||(l=[$e(ze.call(null,e,"Open in new tab")),Y(e,"click",Dn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=z.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,Oe(l)}}}function HO(n){let e,t;return{c(){e=v("span"),t=U(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function BO(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function UO(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function WO(n){let e,t,i,s;const l=[XO,GO],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),L(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function Dm(n,e){let t,i,s;return i=new uu({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),V(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(i,l)}}}function Am(n){let e;return{c(){e=U("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function YO(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Nm(n);return{c(){e=v("span"),i=U(t),s=E(),r&&r.c(),l=ye(),p(e,"class","txt")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=z.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=Nm(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(ae(),L(r,1,1,()=>{r=null}),ue())},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&k(e),a&&k(s),r&&r.d(a),a&&k(l)}}}function XO(n){let e,t=z.truncate(n[5])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=z.truncate(s[5])+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function Nm(n){let e,t;return e=new Il({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function QO(n){let e,t,i,s,l;const o=[WO,UO,BO,HO,VO,zO,jO,qO,RO,NO,FO,PO],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!z.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?LO(f):c===8?IO(f):c===9?AO(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=ye()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ae(),L(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){r[t].d(f),f&&k(s)}}}function xO(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Fe.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s[l.name])},[s,l,o,i,r]}class $1 extends ve{constructor(e){super(),be(this,e,xO,QO,me,{record:0,field:1,short:2})}}function Rm(n,e,t){const i=n.slice();return i[10]=e[t],i}function qm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new $1({props:{field:n[10],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=U(i),l=E(),o=v("td"),B(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),b(e,t),b(t,s),b(e,l),b(e,o),V(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&se(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){L(r.$$.fragment,u),a=!1},d(u){u&&k(e),H(r)}}}function jm(n){let e,t,i,s,l,o;return l=new ki({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=E(),s=v("td"),B(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function zm(n){let e,t,i,s,l,o;return l=new ki({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=E(),s=v("td"),B(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function eE(n){var M;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,m,_,h,g;a=new Il({props:{value:n[3].id}});let y=(M=n[0])==null?void 0:M.schema,S=[];for(let O=0;OL(S[O],1,1,()=>{S[O]=null});let C=n[3].created&&jm(n),T=n[3].updated&&zm(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=E(),o=v("td"),r=v("div"),B(a.$$.fragment),u=E(),f=v("span"),d=U(c),m=E();for(let O=0;O{C=null}),ue()),O[3].updated?T?(T.p(O,D),D&8&&A(T,1)):(T=zm(O),T.c(),A(T,1),T.m(t,null)):T&&(ae(),L(T,1,1,()=>{T=null}),ue())},i(O){if(!g){A(a.$$.fragment,O);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[6]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function iE(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[nE],header:[tE],default:[eE]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function sE(n,e,t){let i,{collection:s}=e,l,o={};function r(m){return t(3,o=m),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(m){te[m?"unshift":"push"](()=>{l=m,t(2,l)})}function c(m){Fe.call(this,n,m)}function d(m){Fe.call(this,n,m)}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{var m;n.$$.dirty&1&&t(4,i=!!((m=s==null?void 0:s.schema)!=null&&m.find(_=>_.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class lE extends ve{constructor(e){super(),be(this,e,sE,iE,me,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Vm(n,e,t){const i=n.slice();return i[57]=e[t],i}function Hm(n,e,t){const i=n.slice();return i[60]=e[t],i}function Bm(n,e,t){const i=n.slice();return i[60]=e[t],i}function Um(n,e,t){const i=n.slice();return i[53]=e[t],i}function Wm(n){let e;function t(l,o){return l[13]?rE:oE}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function oE(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=E(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),o||(r=Y(t,"change",n[30]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&k(e),o=!1,r()}}}function rE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ym(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[aE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function aE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="id",p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Km(n){let e=!n[6].includes("@username"),t,i=!n[6].includes("@email"),s,l,o=e&&Jm(n),r=i&&Zm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=ye()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){u[0]&64&&(e=!a[6].includes("@username")),e?o?(o.p(a,u),u[0]&64&&A(o,1)):(o=Jm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(ae(),L(o,1,1,()=>{o=null}),ue()),u[0]&64&&(i=!a[6].includes("@email")),i?r?(r.p(a,u),u[0]&64&&A(r,1)):(r=Zm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(ae(),L(r,1,1,()=>{r=null}),ue())},i(a){l||(A(o),A(r),l=!0)},o(a){L(o),L(r),l=!1},d(a){o&&o.d(a),a&&k(t),r&&r.d(a),a&&k(s)}}}function Jm(n){let e,t,i;function s(o){n[32](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[uE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function uE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="username",p(t,"class",z.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Zm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[fE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function fE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="email",p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function cE(n){let e,t,i,s,l,o=n[60].name+"",r;return{c(){e=v("div"),t=v("i"),s=E(),l=v("span"),r=U(o),p(t,"class",i=z.getFieldTypeIcon(n[60].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&524288&&i!==(i=z.getFieldTypeIcon(a[60].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[60].name+"")&&se(r,o)},d(a){a&&k(e)}}}function Gm(n,e){let t,i,s,l;function o(a){e[34](a)}let r={class:"col-type-"+e[60].type+" col-field-"+e[60].name,name:e[60].name,$$slots:{default:[cE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new un({props:r}),te.push(()=>ce(i,"sort",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[60].type+" col-field-"+e[60].name),u[0]&524288&&(f.name=e[60].name),u[0]&524288|u[2]&8&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function Xm(n){let e,t,i;function s(o){n[35](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Qm(n){let e,t,i;function s(o){n[36](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="updated",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function xm(n){let e;return{c(){e=v("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[37](e)},p:x,d(t){t&&k(e),n[37](null)}}}function eh(n){let e;function t(l,o){return l[13]?hE:mE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function mE(n){let e,t,i,s,l;function o(u,f){var c;if((c=u[1])!=null&&c.length)return gE;if(!u[11])return _E}let r=o(n),a=r&&r(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=E(),a&&a.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){w(u,e,f),b(e,t),b(t,i),b(t,s),a&&a.m(t,null),b(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a&&a.d(1),a=r&&r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&k(e),a&&a.d()}}}function hE(n){let e;return{c(){e=v("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _E(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` - New record`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[42]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function gE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[41]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function th(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[38](n[57])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[57].id),i.checked=l=n[5][n[57].id],p(r,"for",a="checkbox_"+n[57].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[Y(i,"change",c),Y(t,"click",Dn(n[28]))],u=!0)},p(d,m){n=d,m[0]&8&&s!==(s="checkbox_"+n[57].id)&&p(i,"id",s),m[0]&40&&l!==(l=n[5][n[57].id])&&(i.checked=l),m[0]&8&&a!==(a="checkbox_"+n[57].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,Oe(f)}}}function nh(n){let e,t,i,s,l,o,r=n[57].id+"",a,u,f;s=new Il({props:{value:n[57].id}});let c=n[10]&&ih(n);return{c(){e=v("td"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),a=U(r),u=E(),c&&c.c(),p(o,"class","txt"),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),b(e,t),b(t,i),V(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,m){const _={};m[0]&8&&(_.value=d[57].id),s.$set(_),(!f||m[0]&8)&&r!==(r=d[57].id+"")&&se(a,r),d[10]?c?c.p(d,m):(c=ih(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){L(s.$$.fragment,d),f=!1},d(d){d&&k(e),H(s),c&&c.d()}}}function ih(n){let e;function t(l,o){return l[57].verified?vE:bE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function bE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=$e(ze.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function vE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=$e(ze.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function sh(n){let e=!n[6].includes("@username"),t,i=!n[6].includes("@email"),s,l=e&&lh(n),o=i&&oh(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&64&&(e=!r[6].includes("@username")),e?l?l.p(r,a):(l=lh(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&64&&(i=!r[6].includes("@email")),i?o?o.p(r,a):(o=oh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&k(t),o&&o.d(r),r&&k(s)}}}function lh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!z.isEmpty(o[57].username)),t?kE:yE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function yE(n){let e,t=n[57].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[57].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[57].username+"")&&se(i,t),o[0]&8&&s!==(s=l[57].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function kE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!z.isEmpty(o[57].email)),t?SE:wE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function wE(n){let e,t=n[57].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[57].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[57].email+"")&&se(i,t),o[0]&8&&s!==(s=l[57].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function SE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rh(n,e){let t,i,s,l;return i=new $1({props:{short:!0,record:e[57],field:e[60]}}),{key:n,first:null,c(){t=v("td"),B(i.$$.fragment),p(t,"class",s="col-type-"+e[60].type+" col-field-"+e[60].name),this.first=t},m(o,r){w(o,t,r),V(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[57]),r[0]&524288&&(a.field=e[60]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[60].type+" col-field-"+e[60].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(i)}}}function ah(n){let e,t,i;return t=new ki({props:{date:n[57].created}}),{c(){e=v("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[57].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function uh(n){let e,t,i;return t=new ki({props:{date:n[57].updated}}),{c(){e=v("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[57].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function fh(n,e){let t,i,s=!e[6].includes("@id"),l,o,r=[],a=new Map,u,f=e[9]&&!e[6].includes("@created"),c,d=e[8]&&!e[6].includes("@updated"),m,_,h,g,y,S,$=!e[11]&&th(e),C=s&&nh(e),T=e[10]&&sh(e),M=e[19];const O=R=>R[60].name;for(let R=0;R',h=E(),p(_,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(R,N){w(R,t,N),$&&$.m(t,null),b(t,i),C&&C.m(t,null),b(t,l),T&&T.m(t,null),b(t,o);for(let q=0;q{C=null}),ue()),e[10]?T?T.p(e,N):(T=sh(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),N[0]&524296&&(M=e[19],ae(),r=bt(r,N,O,1,e,M,a,t,Ut,rh,u,Hm),ue()),N[0]&576&&(f=e[9]&&!e[6].includes("@created")),f?D?(D.p(e,N),N[0]&576&&A(D,1)):(D=ah(e),D.c(),A(D,1),D.m(t,c)):D&&(ae(),L(D,1,1,()=>{D=null}),ue()),N[0]&320&&(d=e[8]&&!e[6].includes("@updated")),d?I?(I.p(e,N),N[0]&320&&A(I,1)):(I=uh(e),I.c(),A(I,1),I.m(t,m)):I&&(ae(),L(I,1,1,()=>{I=null}),ue())},i(R){if(!g){A(C);for(let N=0;NZ[60].name;for(let Z=0;ZZ[11]?Z[57]:Z[57].id;for(let Z=0;Z{M=null}),ue()),Z[10]?O?(O.p(Z,X),X[0]&1024&&A(O,1)):(O=Km(Z),O.c(),A(O,1),O.m(i,r)):O&&(ae(),L(O,1,1,()=>{O=null}),ue()),X[0]&524289&&(D=Z[19],ae(),a=bt(a,X,I,1,Z,D,u,i,Ut,Gm,f,Bm),ue()),X[0]&576&&(c=Z[9]&&!Z[6].includes("@created")),c?P?(P.p(Z,X),X[0]&576&&A(P,1)):(P=Xm(Z),P.c(),A(P,1),P.m(i,d)):P&&(ae(),L(P,1,1,()=>{P=null}),ue()),X[0]&320&&(m=Z[8]&&!Z[6].includes("@updated")),m?F?(F.p(Z,X),X[0]&320&&A(F,1)):(F=Qm(Z),F.c(),A(F,1),F.m(i,_)):F&&(ae(),L(F,1,1,()=>{F=null}),ue()),Z[16].length?R?R.p(Z,X):(R=xm(Z),R.c(),R.m(h,null)):R&&(R.d(1),R=null),X[0]&9973610&&(N=Z[3],ae(),S=bt(S,X,q,1,Z,N,$,y,Ut,fh,null,Vm),ue(),!N.length&&j?j.p(Z,X):N.length?j&&(j.d(1),j=null):(j=eh(Z),j.c(),j.m(y,null))),(!C||X[0]&8192)&&Q(e,"table-loading",Z[13])},i(Z){if(!C){A(M),A(O);for(let X=0;X({56:l}),({uniqueId:l})=>[0,l?33554432:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),V(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65600|o[1]&33554432|o[2]&8&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(i,l)}}}function TE(n){let e,t,i=[],s=new Map,l,o,r=n[16];const a=u=>u[53].id+u[53].name;for(let u=0;u{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function ph(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=v("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),b(e,t),b(e,s),b(e,l),b(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&se(s,i),a[0]&16&&se(o,r[4])},d(r){r&&k(e)}}}function mh(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=U("Load more ("),o=U(l),r=U(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[13]),Q(t,"btn-disabled",n[13]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(i,s),b(i,o),b(i,r),a||(u=Y(t,"click",n[43]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&se(o,l),c[0]&8192&&Q(t,"btn-loading",f[13]),c[0]&8192&&Q(t,"btn-disabled",f[13])},d(f){f&&k(e),a=!1,u()}}}function hh(n){let e,t,i,s,l,o,r=n[7]===1?"record":"records",a,u,f,c,d,m,_,h,g,y,S;return{c(){e=v("div"),t=v("div"),i=U("Selected "),s=v("strong"),l=U(n[7]),o=E(),a=U(r),u=E(),f=v("button"),f.innerHTML='Reset',c=E(),d=v("div"),m=E(),_=v("button"),_.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(_,"type","button"),p(_,"class","btn btn-sm btn-transparent btn-danger"),Q(_,"btn-loading",n[14]),Q(_,"btn-disabled",n[14]),p(e,"class","bulkbar")},m($,C){w($,e,C),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,m),b(e,_),g=!0,y||(S=[Y(f,"click",n[44]),Y(_,"click",n[45])],y=!0)},p($,C){(!g||C[0]&128)&&se(l,$[7]),(!g||C[0]&128)&&r!==(r=$[7]===1?"record":"records")&&se(a,r),(!g||C[0]&16384)&&Q(f,"btn-disabled",$[14]),(!g||C[0]&16384)&&Q(_,"btn-loading",$[14]),(!g||C[0]&16384)&&Q(_,"btn-disabled",$[14])},i($){g||($&&Ge(()=>{g&&(h||(h=qe(e,ui,{duration:150,y:5},!0)),h.run(1))}),g=!0)},o($){$&&(h||(h=qe(e,ui,{duration:150,y:5},!1)),h.run(0)),g=!1},d($){$&&k(e),$&&h&&h.end(),y=!1,Oe(S)}}}function OE(n){let e,t,i,s,l,o;e=new Na({props:{class:"table-wrapper",$$slots:{before:[ME],default:[CE]},$$scope:{ctx:n}}});let r=n[3].length&&ph(n),a=n[3].length&&n[18]&&mh(n),u=n[7]&&hh(n);return{c(){B(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=E(),u&&u.c(),l=ye()},m(f,c){V(e,f,c),w(f,t,c),r&&r.m(f,c),w(f,i,c),a&&a.m(f,c),w(f,s,c),u&&u.m(f,c),w(f,l,c),o=!0},p(f,c){const d={};c[0]&765803|c[2]&8&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[3].length?r?r.p(f,c):(r=ph(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[3].length&&f[18]?a?a.p(f,c):(a=mh(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[7]?u?(u.p(f,c),c[0]&128&&A(u,1)):(u=hh(f),u.c(),A(u,1),u.m(l.parentNode,l)):u&&(ae(),L(u,1,1,()=>{u=null}),ue())},i(f){o||(A(e.$$.fragment,f),A(u),o=!0)},o(f){L(e.$$.fragment,f),L(u),o=!1},d(f){H(e,f),f&&k(t),r&&r.d(f),f&&k(i),a&&a.d(f),f&&k(s),u&&u.d(f),f&&k(l)}}}const EE=/^([\+\-])?(\w+)$/;function DE(n,e,t){let i,s,l,o,r,a,u,f,c,d;const m=Tt();let{collection:_}=e,{sort:h=""}=e,{filter:g=""}=e,y=[],S=1,$=0,C={},T=!0,M=!1,O=0,D,I=[],P=[];function F(){_!=null&&_.id&&localStorage.setItem((_==null?void 0:_.id)+"@hiddenCollumns",JSON.stringify(I))}function R(){if(t(6,I=[]),!!(_!=null&&_.id))try{const Ee=localStorage.getItem(_.id+"@hiddenCollumns");Ee&&t(6,I=JSON.parse(Ee)||[])}catch{}}async function N(){const Ee=S;for(let lt=1;lt<=Ee;lt++)(lt===1||a)&&await q(lt,!1)}async function q(Ee=1,lt=!0){var Kn,Jn;if(!(_!=null&&_.id))return;t(13,T=!0);let Et=h;const zt=Et.match(EE),In=zt?o.find(kt=>kt.name===zt[2]):null;if(zt&&((Jn=(Kn=In==null?void 0:In.options)==null?void 0:Kn.displayFields)==null?void 0:Jn.length)>0){const kt=[];for(const dn of In.options.displayFields)kt.push((zt[1]||"")+zt[2]+"."+dn);Et=kt.join(",")}const Ln=z.getAllCollectionIdentifiers(_);return fe.collection(_.id).getList(Ee,30,{sort:Et,filter:z.normalizeSearchFilter(g,Ln),expand:o.map(kt=>kt.name).join(","),$cancelKey:"records_list"}).then(async kt=>{var dn;if(Ee<=1&&j(),t(13,T=!1),t(12,S=kt.page),t(4,$=kt.totalItems),m("load",y.concat(kt.items)),lt){const ti=++O;for(;(dn=kt.items)!=null&&dn.length&&O==ti;)t(3,y=y.concat(kt.items.splice(0,15))),await z.yieldToMain()}else t(3,y=y.concat(kt.items))}).catch(kt=>{kt!=null&&kt.isAbort||(t(13,T=!1),console.warn(kt),j(),fe.error(kt,!1))})}function j(){t(3,y=[]),t(12,S=1),t(4,$=0),t(5,C={})}function Z(){f?X():K()}function X(){t(5,C={})}function K(){for(const Ee of y)t(5,C[Ee.id]=Ee,C);t(5,C)}function J(Ee){C[Ee.id]?delete C[Ee.id]:t(5,C[Ee.id]=Ee,C),t(5,C)}function le(){hn(`Do you really want to delete the selected ${u===1?"record":"records"}?`,ie)}async function ie(){if(M||!u||!(_!=null&&_.id))return;let Ee=[];for(const lt of Object.keys(C))Ee.push(fe.collection(_.id).delete(lt));return t(14,M=!0),Promise.all(Ee).then(()=>{Ht(`Successfully deleted the selected ${u===1?"record":"records"}.`),X()}).catch(lt=>{fe.error(lt)}).finally(()=>(t(14,M=!1),N()))}function ee(Ee){Fe.call(this,n,Ee)}const Te=(Ee,lt)=>{lt.target.checked?z.removeByValue(I,Ee.id):z.pushUnique(I,Ee.id),t(6,I)},Pe=()=>Z();function je(Ee){h=Ee,t(0,h)}function Ve(Ee){h=Ee,t(0,h)}function ke(Ee){h=Ee,t(0,h)}function Ce(Ee){h=Ee,t(0,h)}function Je(Ee){h=Ee,t(0,h)}function _t(Ee){h=Ee,t(0,h)}function Ze(Ee){te[Ee?"unshift":"push"](()=>{D=Ee,t(15,D)})}const We=Ee=>J(Ee),yt=Ee=>m("select",Ee),pe=(Ee,lt)=>{lt.code==="Enter"&&(lt.preventDefault(),m("select",Ee))},_e=()=>t(1,g=""),Ye=()=>m("new"),Mt=()=>q(S+1),Ie=()=>X(),rt=()=>le();return n.$$set=Ee=>{"collection"in Ee&&t(25,_=Ee.collection),"sort"in Ee&&t(0,h=Ee.sort),"filter"in Ee&&t(1,g=Ee.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(R(),j()),n.$$.dirty[0]&33554432&&t(11,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(10,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(27,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&134217728&&(o=l.filter(Ee=>Ee.type==="relation")),n.$$.dirty[0]&134217792&&t(19,r=l.filter(Ee=>!I.includes(Ee.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&h!==-1&&g!==-1&&q(1),n.$$.dirty[0]&24&&t(18,a=$>y.length),n.$$.dirty[0]&32&&t(7,u=Object.keys(C).length),n.$$.dirty[0]&136&&t(17,f=y.length&&u===y.length),n.$$.dirty[0]&64&&I!==-1&&F(),n.$$.dirty[0]&2056&&t(9,c=!i||y.length>0&&y[0].created!=""),n.$$.dirty[0]&2056&&t(8,d=!i||y.length>0&&y[0].updated!=""),n.$$.dirty[0]&134219520&&t(16,P=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Ee=>({id:Ee.id,name:Ee.name})),c?{id:"@created",name:"created"}:[],d?{id:"@updated",name:"updated"}:[]))},[h,g,q,y,$,C,I,u,d,c,s,i,S,T,M,D,P,f,a,r,m,Z,X,J,le,_,N,l,ee,Te,Pe,je,Ve,ke,Ce,Je,_t,Ze,We,yt,pe,_e,Ye,Mt,Ie,rt]}class AE extends ve{constructor(e){super(),be(this,e,DE,OE,me,{collection:25,sort:0,filter:1,reloadLoadedPages:26,load:2},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[26]}get load(){return this.$$.ctx[2]}}function IE(n){let e,t,i,s;return e=new TM({}),i=new Sn({props:{$$slots:{default:[FE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&16&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function LE(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[qE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&16&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function PE(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[jE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[1]&16&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _h(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[$e(ze.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[15])],t=!0)},p:x,d(s){s&&k(e),t=!1,Oe(i)}}}function gh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` - New record`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function FE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I,P,F=!n[10]&&_h(n);c=new Ko({}),c.$on("refresh",n[16]);let R=n[2].type!=="view"&&gh(n);y=new Yo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function N(Z){n[21](Z)}function q(Z){n[22](Z)}let j={collection:n[2]};return n[0]!==void 0&&(j.filter=n[0]),n[1]!==void 0&&(j.sort=n[1]),T=new AE({props:j}),n[20](T),te.push(()=>ce(T,"filter",N)),te.push(()=>ce(T,"sort",q)),T.$on("select",n[23]),T.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=U(o),a=E(),u=v("div"),F&&F.c(),f=E(),B(c.$$.fragment),d=E(),m=v("div"),_=v("button"),_.innerHTML=` - API Preview`,h=E(),R&&R.c(),g=E(),B(y.$$.fragment),S=E(),$=v("div"),C=E(),B(T.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(_,"type","button"),p(_,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-base")},m(Z,X){w(Z,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),F&&F.m(u,null),b(u,f),V(c,u,null),b(e,d),b(e,m),b(m,_),b(m,h),R&&R.m(m,null),w(Z,g,X),V(y,Z,X),w(Z,S,X),w(Z,$,X),w(Z,C,X),V(T,Z,X),D=!0,I||(P=Y(_,"click",n[17]),I=!0)},p(Z,X){(!D||X[0]&4)&&o!==(o=Z[2].name+"")&&se(r,o),Z[10]?F&&(F.d(1),F=null):F?F.p(Z,X):(F=_h(Z),F.c(),F.m(u,f)),Z[2].type!=="view"?R?R.p(Z,X):(R=gh(Z),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const K={};X[0]&1&&(K.value=Z[0]),X[0]&4&&(K.autocompleteCollection=Z[2]),y.$set(K);const J={};X[0]&4&&(J.collection=Z[2]),!M&&X[0]&1&&(M=!0,J.filter=Z[0],he(()=>M=!1)),!O&&X[0]&2&&(O=!0,J.sort=Z[1],he(()=>O=!1)),T.$set(J)},i(Z){D||(A(c.$$.fragment,Z),A(y.$$.fragment,Z),A(T.$$.fragment,Z),D=!0)},o(Z){L(c.$$.fragment,Z),L(y.$$.fragment,Z),L(T.$$.fragment,Z),D=!1},d(Z){Z&&k(e),F&&F.d(),H(c),R&&R.d(),Z&&k(g),H(y,Z),Z&&k(S),Z&&k($),Z&&k(C),n[20](null),H(T,Z),I=!1,P()}}}function NE(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("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),s||(l=Y(i,"click",n[14]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function RE(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function qE(n){let e,t,i;function s(r,a){return r[10]?RE:NE}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function jE(n){let e;return{c(){e=v("div"),e.innerHTML=` -

    Loading collections...

    `,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[PE,LE,IE],m=[];function _($,C){return $[3]&&!$[9].length?0:$[9].length?2:1}e=_(n),t=m[e]=d[e](n);let h={};s=new au({props:h}),n[25](s);let g={};o=new PM({props:g}),n[26](o);let y={collection:n[2]};a=new C1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let S={collection:n[2]};return f=new lE({props:S}),n[30](f),{c(){t.c(),i=E(),B(s.$$.fragment),l=E(),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),B(f.$$.fragment)},m($,C){m[e].m($,C),w($,i,C),V(s,$,C),w($,l,C),V(o,$,C),w($,r,C),V(a,$,C),w($,u,C),V(f,$,C),c=!0},p($,C){let T=e;e=_($),e===T?m[e].p($,C):(ae(),L(m[T],1,1,()=>{m[T]=null}),ue(),t=m[e],t?t.p($,C):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const D={};C[0]&4&&(D.collection=$[2]),a.$set(D);const I={};C[0]&4&&(I.collection=$[2]),f.$set(I)},i($){c||(A(t),A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){L(t),L(s.$$.fragment,$),L(o.$$.fragment,$),L(a.$$.fragment,$),L(f.$$.fragment,$),c=!1},d($){m[e].d($),$&&k(i),n[25](null),H(s,$),$&&k(l),n[26](null),H(o,$),$&&k(r),n[27](null),H(a,$),$&&k(u),n[30](null),H(f,$)}}}function VE(n,e,t){let i,s,l,o,r,a,u;Ke(n,yi,ee=>t(2,s=ee)),Ke(n,Dt,ee=>t(31,l=ee)),Ke(n,vo,ee=>t(3,o=ee)),Ke(n,ka,ee=>t(13,r=ee)),Ke(n,fi,ee=>t(9,a=ee)),Ke(n,Ms,ee=>t(10,u=ee));const f=new URLSearchParams(r);let c,d,m,_,h,g=f.get("filter")||"",y=f.get("sort")||"-created",S=f.get("collectionId")||(s==null?void 0:s.id);function $(){t(11,S=s==null?void 0:s.id),t(0,g=""),t(1,y="-created"),C()}async function C(){if(!y)return;const ee=z.getAllCollectionIdentifiers(s),Te=y.split(",").map(Pe=>Pe.startsWith("+")||Pe.startsWith("-")?Pe.substring(1):Pe);Te.filter(Pe=>ee.includes(Pe)).length!=Te.length&&(ee.includes("created")?t(1,y="-created"):t(1,y=""))}Py(S);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),O=()=>h==null?void 0:h.load(),D=()=>d==null?void 0:d.show(s),I=()=>m==null?void 0:m.show(),P=ee=>t(0,g=ee.detail);function F(ee){te[ee?"unshift":"push"](()=>{h=ee,t(8,h)})}function R(ee){g=ee,t(0,g)}function N(ee){y=ee,t(1,y)}const q=ee=>{s.type==="view"?_.show(ee==null?void 0:ee.detail):m==null||m.show(ee==null?void 0:ee.detail)},j=()=>m==null?void 0:m.show();function Z(ee){te[ee?"unshift":"push"](()=>{c=ee,t(4,c)})}function X(ee){te[ee?"unshift":"push"](()=>{d=ee,t(5,d)})}function K(ee){te[ee?"unshift":"push"](()=>{m=ee,t(6,m)})}const J=()=>h==null?void 0:h.reloadLoadedPages(),le=()=>h==null?void 0:h.reloadLoadedPages();function ie(ee){te[ee?"unshift":"push"](()=>{_=ee,t(7,_)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=S&&Ay(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&S!=s.id&&$(),n.$$.dirty[0]&4&&s!=null&&s.id&&C(),n.$$.dirty[0]&7&&(y||g||s!=null&&s.id)){const ee=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:y}).toString();qi("/collections?"+ee)}n.$$.dirty[0]&4&&ln(Dt,l=(s==null?void 0:s.name)||"Collections",l)},[g,y,s,o,c,d,m,_,h,a,u,S,i,r,T,M,O,D,I,P,F,R,N,q,j,Z,X,K,J,le,ie]}class HE extends ve{constructor(e){super(),be(this,e,VE,zE,me,{},null,[-1,-1])}}function BE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I,P,F;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=` - Application`,o=E(),r=v("a"),r.innerHTML=` - Mail settings`,a=E(),u=v("a"),u.innerHTML=` - Files storage`,f=E(),c=v("a"),c.innerHTML=` - Backups`,d=E(),m=v("div"),m.innerHTML='Sync',_=E(),h=v("a"),h.innerHTML=` - Export collections`,g=E(),y=v("a"),y.innerHTML=` - Import collections`,S=E(),$=v("div"),$.textContent="Authentication",C=E(),T=v("a"),T.innerHTML=` - Auth providers`,M=E(),O=v("a"),O.innerHTML=` - Token options`,D=E(),I=v("a"),I.innerHTML=` - Admins`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p($,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/tokens"),p(O,"class","sidebar-list-item"),p(I,"href","/settings/admins"),p(I,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(R,N){w(R,e,N),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,m),b(t,_),b(t,h),b(t,g),b(t,y),b(t,S),b(t,$),b(t,C),b(t,T),b(t,M),b(t,O),b(t,D),b(t,I),P||(F=[$e(jn.call(null,l,{path:"/settings"})),$e(rn.call(null,l)),$e(jn.call(null,r,{path:"/settings/mail/?.*"})),$e(rn.call(null,r)),$e(jn.call(null,u,{path:"/settings/storage/?.*"})),$e(rn.call(null,u)),$e(jn.call(null,c,{path:"/settings/backups/?.*"})),$e(rn.call(null,c)),$e(jn.call(null,h,{path:"/settings/export-collections/?.*"})),$e(rn.call(null,h)),$e(jn.call(null,y,{path:"/settings/import-collections/?.*"})),$e(rn.call(null,y)),$e(jn.call(null,T,{path:"/settings/auth-providers/?.*"})),$e(rn.call(null,T)),$e(jn.call(null,O,{path:"/settings/tokens/?.*"})),$e(rn.call(null,O)),$e(jn.call(null,I,{path:"/settings/admins/?.*"})),$e(rn.call(null,I))],P=!0)},p:x,i:x,o:x,d(R){R&&k(e),P=!1,Oe(F)}}}class Ci extends ve{constructor(e){super(),be(this,e,null,BE,me,{})}}function bh(n,e,t){const i=n.slice();return i[31]=e[t],i}function vh(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[UE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),a=v("i"),f=E(),c=v("input"),p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[30]),c.value=m=n[1].id,c.readOnly=!0},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),w(g,r,y),b(r,a),w(g,f,y),w(g,c,y),_||(h=$e(u=ze.call(null,a,{text:`Created: ${n[1].created} -Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(g,y){y[0]&1073741824&&l!==(l=g[30])&&p(e,"for",l),u&&jt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${g[1].created} -Updated: ${g[1].updated}`,position:"left"}),y[0]&1073741824&&d!==(d=g[30])&&p(c,"id",d),y[0]&2&&m!==(m=g[1].id)&&c.value!==m&&(c.value=m)},d(g){g&&k(e),g&&k(o),g&&k(r),g&&k(f),g&&k(c),_=!1,h()}}}function yh(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),gn(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",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){w(u,e,f),b(e,t),b(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=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),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[3]),u||(f=Y(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),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&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function kh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[YE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wh(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[KE,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[JE,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{u&&(a||(a=qe(t,st,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(t,st,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function KE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&re(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function JE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[10]),u||(f=Y(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),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&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function ZE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_=!n[5]&&vh(n),h=[0,1,2,3,4,5,6,7,8,9],g=[];for(let $=0;$<10;$+=1)g[$]=yh(bh(n,h,$));a=new de({props:{class:"form-field required",name:"email",$$slots:{default:[WE,({uniqueId:$})=>({30:$}),({uniqueId:$})=>[$?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&kh(n),S=(n[5]||n[4])&&wh(n);return{c(){e=v("form"),_&&_.c(),t=E(),i=v("div"),s=v("p"),s.textContent="Avatar",l=E(),o=v("div");for(let $=0;$<10;$+=1)g[$].c();r=E(),B(a.$$.fragment),u=E(),y&&y.c(),f=E(),S&&S.c(),p(s,"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($,C){w($,e,C),_&&_.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let T=0;T<10;T+=1)g[T]&&g[T].m(o,null);b(e,r),V(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),S&&S.m(e,null),c=!0,d||(m=Y(e,"submit",Qe(n[13])),d=!0)},p($,C){if($[5]?_&&(ae(),L(_,1,1,()=>{_=null}),ue()):_?(_.p($,C),C[0]&32&&A(_,1)):(_=vh($),_.c(),A(_,1),_.m(e,t)),C[0]&4){h=[0,1,2,3,4,5,6,7,8,9];let M;for(M=0;M<10;M+=1){const O=bh($,h,M);g[M]?g[M].p(O,C):(g[M]=yh(O),g[M].c(),g[M].m(o,null))}for(;M<10;M+=1)g[M].d(1)}const T={};C[0]&1073741832|C[1]&8&&(T.$$scope={dirty:C,ctx:$}),a.$set(T),$[5]?y&&(ae(),L(y,1,1,()=>{y=null}),ue()):y?(y.p($,C),C[0]&32&&A(y,1)):(y=kh($),y.c(),A(y,1),y.m(e,f)),$[5]||$[4]?S?(S.p($,C),C[0]&48&&A(S,1)):(S=wh($),S.c(),A(S,1),S.m(e,null)):S&&(ae(),L(S,1,1,()=>{S=null}),ue())},i($){c||(A(_),A(a.$$.fragment,$),A(y),A(S),c=!0)},o($){L(_),L(a.$$.fragment,$),L(y),L(S),c=!1},d($){$&&k(e),_&&_.d(),ht(g,$),H(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function GE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&se(i,t)},d(s){s&&k(e)}}}function Sh(n){let e,t,i,s,l,o,r,a,u;return o=new Yn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[XE]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=E(),s=v("i"),l=E(),B(o.$$.fragment),r=E(),a=v("div"),p(s,"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(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),V(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){L(o.$$.fragment,f),u=!1},d(f){f&&k(e),H(o),f&&k(r),f&&k(a)}}}function XE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` - Delete`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function QE(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,m=!n[5]&&Sh(n);return{c(){m&&m.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(_,h){m&&m.m(_,h),w(_,e,h),w(_,t,h),b(t,i),w(_,s,h),w(_,l,h),b(l,o),b(o,a),f=!0,c||(d=Y(t,"click",n[17]),c=!0)},p(_,h){_[5]?m&&(ae(),L(m,1,1,()=>{m=null}),ue()):m?(m.p(_,h),h[0]&32&&A(m,1)):(m=Sh(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||h[0]&128)&&(t.disabled=_[7]),(!f||h[0]&32)&&r!==(r=_[5]?"Create":"Save changes")&&se(a,r),(!f||h[0]&2176&&u!==(u=!_[11]||_[7]))&&(l.disabled=u),(!f||h[0]&128)&&Q(l,"btn-loading",_[7])},i(_){f||(A(m),f=!0)},o(_){L(m),f=!1},d(_){m&&m.d(_),_&&k(e),_&&k(t),_&&k(s),_&&k(l),c=!1,d()}}}function xE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[QE],header:[GE],default:[ZE]},$$scope:{ctx:n}};return e=new on({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),H(e,s)}}}function eD(n,e,t){let i,s;const l=Tt(),o="admin_"+z.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",m="",_="",h=!1;function g(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),$()}function $(){t(4,h=!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,_=""),tn({})}function C(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||h)&&(X.password=m,X.passwordConfirm=_);let K;i?K=fe.admins.create(X):K=fe.admins.update(a.id,X),K.then(async J=>{var le;t(8,f=!1),y(),Ht(i?"Successfully created admin.":"Successfully updated admin."),((le=fe.authStore.model)==null?void 0:le.id)===J.id&&fe.authStore.save(fe.authStore.token,J),l("save",J)}).catch(J=>{fe.error(J)}).finally(()=>{t(7,u=!1)})}function T(){a!=null&&a.id&&hn("Do you really want to delete the selected admin?",()=>fe.admins.delete(a.id).then(()=>{t(8,f=!1),y(),Ht("Successfully deleted admin."),l("delete",a)}).catch(X=>{fe.error(X)}))}const M=()=>T(),O=()=>y(),D=X=>t(2,c=X);function I(){d=this.value,t(3,d)}function P(){h=this.checked,t(4,h)}function F(){m=this.value,t(9,m)}function R(){_=this.value,t(10,_)}const N=()=>s&&f?(hn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function j(X){Fe.call(this,n,X)}function Z(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||h||d!==a.email||c!==a.avatar)},[y,a,c,d,h,i,r,u,f,m,_,s,o,C,T,g,M,O,D,I,P,F,R,N,q,j,Z]}class tD extends ve{constructor(e){super(),be(this,e,eD,xE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Ch(n,e,t){const i=n.slice();return i[24]=e[t],i}function nD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="id",p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function iD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="email",p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function sD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function lD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="updated",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function $h(n){let e;function t(l,o){return l[5]?rD:oD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function oD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Th(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Th(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function rD(n){let e;return{c(){e=v("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Th(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Mh(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Oh(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",_,h,g,y,S,$=e[24].email+"",C,T,M,O,D,I,P,F,R,N,q,j,Z,X;f=new Il({props:{value:e[24].id}});let K=e[24].id===e[7].id&&Mh();D=new ki({props:{date:e[24].created}}),F=new ki({props:{date:e[24].updated}});function J(){return e[15](e[24])}function le(...ie){return e[16](e[24],...ie)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),B(f.$$.fragment),c=E(),d=v("span"),_=U(m),h=E(),K&&K.c(),g=E(),y=v("td"),S=v("span"),C=U($),M=E(),O=v("td"),B(D.$$.fragment),I=E(),P=v("td"),B(F.$$.fragment),R=E(),N=v("td"),N.innerHTML='',q=E(),gn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",T=e[24].email),p(y,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(P,"class","col-type-date col-field-updated"),p(N,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ie,ee){w(ie,t,ee),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),V(f,u,null),b(u,c),b(u,d),b(d,_),b(a,h),K&&K.m(a,null),b(t,g),b(t,y),b(y,S),b(S,C),b(t,M),b(t,O),V(D,O,null),b(t,I),b(t,P),V(F,P,null),b(t,R),b(t,N),b(t,q),j=!0,Z||(X=[Y(t,"click",J),Y(t,"keydown",le)],Z=!0)},p(ie,ee){e=ie,(!j||ee&16&&!gn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Te={};ee&16&&(Te.value=e[24].id),f.$set(Te),(!j||ee&16)&&m!==(m=e[24].id+"")&&se(_,m),e[24].id===e[7].id?K||(K=Mh(),K.c(),K.m(a,null)):K&&(K.d(1),K=null),(!j||ee&16)&&$!==($=e[24].email+"")&&se(C,$),(!j||ee&16&&T!==(T=e[24].email))&&p(S,"title",T);const Pe={};ee&16&&(Pe.date=e[24].created),D.$set(Pe);const je={};ee&16&&(je.date=e[24].updated),F.$set(je)},i(ie){j||(A(f.$$.fragment,ie),A(D.$$.fragment,ie),A(F.$$.fragment,ie),j=!0)},o(ie){L(f.$$.fragment,ie),L(D.$$.fragment,ie),L(F.$$.fragment,ie),j=!1},d(ie){ie&&k(t),H(f),K&&K.d(),H(D),H(F),Z=!1,Oe(X)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T=[],M=new Map,O;function D(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[nD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new un({props:I}),te.push(()=>ce(o,"sort",D));function P(J){n[12](J)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[iD]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new un({props:F}),te.push(()=>ce(u,"sort",P));function R(J){n[13](J)}let N={class:"col-type-date col-field-created",name:"created",$$slots:{default:[sD]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),d=new un({props:N}),te.push(()=>ce(d,"sort",R));function q(J){n[14](J)}let j={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[lD]},$$scope:{ctx:n}};n[2]!==void 0&&(j.sort=n[2]),h=new un({props:j}),te.push(()=>ce(h,"sort",q));let Z=n[4];const X=J=>J[24].id;for(let J=0;Jr=!1)),o.$set(ie);const ee={};le&134217728&&(ee.$$scope={dirty:le,ctx:J}),!f&&le&4&&(f=!0,ee.sort=J[2],he(()=>f=!1)),u.$set(ee);const Te={};le&134217728&&(Te.$$scope={dirty:le,ctx:J}),!m&&le&4&&(m=!0,Te.sort=J[2],he(()=>m=!1)),d.$set(Te);const Pe={};le&134217728&&(Pe.$$scope={dirty:le,ctx:J}),!g&&le&4&&(g=!0,Pe.sort=J[2],he(()=>g=!1)),h.$set(Pe),le&186&&(Z=J[4],ae(),T=bt(T,le,X,1,J,Z,M,C,Ut,Oh,null,Ch),ue(),!Z.length&&K?K.p(J,le):Z.length?K&&(K.d(1),K=null):(K=$h(J),K.c(),K.m(C,null))),(!O||le&32)&&Q(e,"table-loading",J[5])},i(J){if(!O){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J),A(h.$$.fragment,J);for(let le=0;le - New admin`,m=E(),B(_.$$.fragment),h=E(),g=v("div"),y=E(),B(S.$$.fragment),$=E(),D&&D.c(),C=ye(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(g,"class","clearfix m-b-base")},m(I,P){w(I,e,P),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),V(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),w(I,m,P),V(_,I,P),w(I,h,P),w(I,g,P),w(I,y,P),V(S,I,P),w(I,$,P),D&&D.m(I,P),w(I,C,P),T=!0,M||(O=Y(d,"click",n[9]),M=!0)},p(I,P){(!T||P&64)&&se(o,I[6]);const F={};P&2&&(F.value=I[1]),_.$set(F);const R={};P&134217918&&(R.$$scope={dirty:P,ctx:I}),S.$set(R),I[4].length?D?D.p(I,P):(D=Eh(I),D.c(),D.m(C.parentNode,C)):D&&(D.d(1),D=null)},i(I){T||(A(a.$$.fragment,I),A(_.$$.fragment,I),A(S.$$.fragment,I),T=!0)},o(I){L(a.$$.fragment,I),L(_.$$.fragment,I),L(S.$$.fragment,I),T=!1},d(I){I&&k(e),H(a),I&&k(m),H(_,I),I&&k(h),I&&k(g),I&&k(y),H(S,I),I&&k($),D&&D.d(I),I&&k(C),M=!1,O()}}}function fD(n){let e,t,i,s,l,o;e=new Ci({}),i=new Sn({props:{$$slots:{default:[uD]},$$scope:{ctx:n}}});let r={};return l=new tD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[18](null),H(l,a)}}}function cD(n,e,t){let i,s,l;Ke(n,ka,F=>t(21,i=F)),Ke(n,Dt,F=>t(6,s=F)),Ke(n,Pa,F=>t(7,l=F)),ln(Dt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const F=z.normalizeSearchFilter(f,["id","email","created","updated"]);return fe.admins.getFullList(100,{sort:c||"-created",filter:F}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),m(),fe.error(R,!1))})}function m(){t(4,a=[])}const _=()=>d(),h=()=>r==null?void 0:r.show(),g=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}const T=F=>r==null?void 0:r.show(F),M=(F,R)=>{(R.code==="Enter"||R.code==="Space")&&(R.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function D(F){te[F?"unshift":"push"](()=>{r=F,t(3,r)})}const I=()=>d(),P=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();qi("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,_,h,g,y,S,$,C,T,M,O,D,I,P]}class dD extends ve{constructor(e){super(),be(this,e,cD,fD,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function pD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[1]),w(d,r,m),w(d,a,m),b(a,u),f||(c=[Y(l,"input",n[5]),$e(rn.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,Oe(c)}}}function hD(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[pD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[mD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=E(),B(s.$$.fragment),l=E(),B(o.$$.fragment),r=E(),a=v("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"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),b(e,t),b(e,i),V(s,e,null),b(e,l),V(o,e,null),b(e,r),b(e,a),u=!0,f||(c=Y(e,"submit",Qe(n[3])),f=!0)},p(d,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:d}),s.$set(_);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),H(s),H(o),f=!1,c()}}}function _D(n){let e,t;return e=new gb({props:{$$slots:{default:[hD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gD(n,e,t){let i;Ke(n,ka,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),fe.admins.authWithPassword(l,o).then(()=>{Ia(),qi("/")}).catch(()=>{Ts("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class bD extends ve{constructor(e){super(),be(this,e,gD,_D,me,{})}}function vD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[kD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[wD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[SD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[CD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Dh(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),B(f.$$.fragment),c=E(),d=v("div"),m=v("div"),_=E(),M&&M.c(),h=E(),g=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(y,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=S=!n[3]||n[2],Q(g,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,D){w(O,e,D),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),V(a,e,null),b(e,u),V(f,e,null),b(e,c),b(e,d),b(d,m),b(d,_),M&&M.m(d,null),b(d,h),b(d,g),b(g,y),$=!0,C||(T=Y(g,"click",n[13]),C=!0)},p(O,D){const I={};D&1572865&&(I.$$scope={dirty:D,ctx:O}),i.$set(I);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:O}),o.$set(P);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:O}),a.$set(F);const R={};D&1572865&&(R.$$scope={dirty:D,ctx:O}),f.$set(R),O[3]?M?M.p(O,D):(M=Dh(O),M.c(),M.m(d,h)):M&&(M.d(1),M=null),(!$||D&12&&S!==(S=!O[3]||O[2]))&&(g.disabled=S),(!$||D&4)&&Q(g,"btn-loading",O[2])},i(O){$||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),$=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),$=!1},d(O){O&&k(e),H(i),H(o),H(a),H(f),M&&M.d(),C=!1,T()}}}function yD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function kD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function wD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application URL"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&re(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function SD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Logs max days retention"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].logs.maxDays&&re(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function CD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),$e(ze.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Oe(f)}}}function Dh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function $D(n){let e,t,i,s,l,o,r,a,u;const f=[yD,vD],c=[];function d(m,_){return m[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML=``,t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",Qe(n[4])),a=!0)},p(m,_){let h=l;l=d(m),l===h?c[l].p(m,_):(ae(),L(c[h],1,1,()=>{c[h]=null}),ue(),o=c[l],o?o.p(m,_):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){L(o),r=!1},d(m){m&&k(e),m&&k(t),m&&k(i),c[l].d(),a=!1,u()}}}function TD(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[$D]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function MD(n,e,t){let i,s,l,o;Ke(n,Ms,M=>t(14,s=M)),Ke(n,ko,M=>t(15,l=M)),Ke(n,Dt,M=>t(16,o=M)),ln(Dt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await fe.settings.getAll()||{};_(M)}catch(M){fe.error(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await fe.settings.update(z.filterRedactedProps(a));_(M),Ht("Successfully saved application settings.")}catch(M){fe.error(M)}t(2,f=!1)}}function _(M={}){var O,D;ln(ko,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),ln(Ms,s=!!((D=M==null?void 0:M.meta)!=null&&D.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){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.logs.maxDays=pt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>h(),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,u,f,i,m,h,r,c,g,y,S,$,C,T]}class OD extends ve{constructor(e){super(),be(this,e,MD,TD,me,{})}}function ED(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ri(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[$e(ze.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){ri(s,a=At(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Oe(o)}}}function AD(n){let e;function t(l,o){return l[3]?DD:ED}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function ID(n,e,t){const i=["value","mask"];let s=Xe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await cn(),r==null||r.focus()}const f=()=>u();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(5,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class cu extends ve{constructor(e){super(),be(this,e,ID,AD,me,{value:0,mask:1})}}function LD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("label"),t=U("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: - `),f=v("button"),f.textContent=`{APP_NAME} - `,c=U(`, - `),d=v("button"),d.textContent=`{APP_URL} - `,m=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"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),b(e,t),w(g,s,y),w(g,l,y),re(l,n[0].subject),w(g,r,y),w(g,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),_||(h=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],_=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(l,"id",o),y[0]&1&&l.value!==g[0].subject&&re(l,g[0].subject)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(r),g&&k(a),_=!1,Oe(h)}}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y;return{c(){e=v("label"),t=U("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: - `),f=v("button"),f.textContent=`{APP_NAME} - `,c=U(`, - `),d=v("button"),d.textContent=`{APP_URL} - `,m=U(`, - `),_=v("button"),_.textContent=`{TOKEN} - `,h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(S,$){w(S,e,$),b(e,t),w(S,s,$),w(S,l,$),re(l,n[0].actionUrl),w(S,r,$),w(S,a,$),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),b(a,_),b(a,h),g||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(_,"click",n[19])],g=!0)},p(S,$){$[1]&1&&i!==(i=S[31])&&p(e,"for",i),$[1]&1&&o!==(o=S[31])&&p(l,"id",o),$[0]&1&&l.value!==S[0].actionUrl&&re(l,S[0].actionUrl)},d(S){S&&k(e),S&&k(s),S&&k(l),S&&k(r),S&&k(a),g=!1,Oe(y)}}}function FD(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function ND(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,he(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C;const T=[ND,FD],M=[];function O(D,I){return D[4]&&!D[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters: - `),f=v("button"),f.textContent=`{APP_NAME} - `,c=U(`, - `),d=v("button"),d.textContent=`{APP_URL} - `,m=U(`, - `),_=v("button"),_.textContent=`{TOKEN} - `,h=U(`, - `),g=v("button"),g.textContent=`{ACTION_URL} - `,y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"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(D,I){w(D,e,I),b(e,t),w(D,s,I),M[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),b(a,_),b(a,h),b(a,g),b(a,y),S=!0,$||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(_,"click",n[24]),Y(g,"click",n[25])],$=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let P=l;l=O(D),l===P?M[l].p(D,I):(ae(),L(M[P],1,1,()=>{M[P]=null}),ue(),o=M[l],o?o.p(D,I):(o=M[l]=T[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&k(e),D&&k(s),M[l].d(D),D&&k(r),D&&k(a),$=!1,Oe(C)}}}function qD(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[LD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[PD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[RD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(r,a){V(e,r,a),w(r,t,a),V(i,r,a),w(r,s,a),V(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&k(t),H(i,r),r&&k(s),H(l,r)}}}function Ah(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function jD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Ah();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Ah(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(o),c&&k(r),c&&k(a),f&&f.d(c),c&&k(u)}}}function zD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[jD],default:[qD]},$$scope:{ctx:n}};for(let l=0;lt(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Ih,d=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await at(()=>import("./CodeEditor-8fadd9a5.js"),["./CodeEditor-8fadd9a5.js","./index-fd4289fb.js"],import.meta.url)).default),Ih=c,t(5,d=!1))}function y(J){z.copyToClipboard(J),bo(`Copied ${J} to clipboard`,2e3)}g();function S(){u.subject=this.value,t(0,u)}const $=()=>y("{APP_NAME}"),C=()=>y("{APP_URL}");function T(){u.actionUrl=this.value,t(0,u)}const M=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function P(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),R=()=>y("{APP_URL}"),N=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function j(J){te[J?"unshift":"push"](()=>{f=J,t(3,f)})}function Z(J){Fe.call(this,n,J)}function X(J){Fe.call(this,n,J)}function K(J){Fe.call(this,n,J)}return n.$$set=J=>{e=Re(Re({},e),Gt(J)),t(8,l=Xe(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ai(r))},[u,r,a,f,c,d,i,y,l,m,_,h,o,S,$,C,T,M,O,D,I,P,F,R,N,q,j,Z,X,K]}class Fr extends ve{constructor(e){super(),be(this,e,VD,zD,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 Lh(n,e,t){const i=n.slice();return i[21]=e[t],i}function Ph(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,m;return c=U1(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=E(),o=v("label"),a=U(r),f=E(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=i.__value,p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(_,h){w(_,t,h),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(m=Y(i,"change",e[10]),d=!0)},p(_,h){e=_,h&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(_){_&&k(t),c.r(),d=!1,m()}}}function HD(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new de({props:{class:"form-field required m-0",name:"email",$$slots:{default:[BD,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),B(t.$$.fragment),i=E(),B(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),V(t,e,null),b(e,i),V(s,e,null),l=!0,o||(r=Y(e,"submit",Qe(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&k(e),H(t),H(s),o=!1,r()}}}function WD(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function YD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function KD(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:[YD],header:[WD],default:[UD]},$$scope:{ctx:n}};return e=new on({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Nr="last_email_test",Fh="email_test_request";function JD(n,e,t){let i;const s=Tt(),l="email_test_"+z.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),u=o[0].value,f=!1,c=null;function d(O="",D=""){t(1,a=O||localStorage.getItem(Nr)),t(2,u=D||o[0].value),tn({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function _(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(c),c=setTimeout(()=>{fe.cancelRequest(Fh),Ts("Test email send timeout.")},3e4);try{await fe.settings.testEmail(a,u,{$cancelKey:Fh}),Ht("Successfully sent test email."),s("submit"),t(4,f=!1),await cn(),m()}catch(O){t(4,f=!1),fe.error(O)}clearTimeout(c)}}const h=[[]];function g(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>_(),$=()=>!f;function C(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function T(O){Fe.call(this,n,O)}function M(O){Fe.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,_,d,g,h,y,S,$,C,T,M]}class ZD extends ve{constructor(e){super(),be(this,e,JD,KD,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function GD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I,P;i=new de({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[QD,({uniqueId:ie})=>({31:ie}),({uniqueId:ie})=>[0,ie?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[xD,({uniqueId:ie})=>({31:ie}),({uniqueId:ie})=>[0,ie?1:0]]},$$scope:{ctx:n}}});function F(ie){n[14](ie)}let R={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(R.config=n[0].meta.verificationTemplate),u=new Fr({props:R}),te.push(()=>ce(u,"config",F));function N(ie){n[15](ie)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new Fr({props:q}),te.push(()=>ce(d,"config",N));function j(ie){n[16](ie)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),h=new Fr({props:Z}),te.push(()=>ce(h,"config",j)),C=new de({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[eA,({uniqueId:ie})=>({31:ie}),({uniqueId:ie})=>[0,ie?1:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&Nh(n);function K(ie,ee){return ie[4]?aA:rA}let J=K(n),le=J(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),a=v("div"),B(u.$$.fragment),c=E(),B(d.$$.fragment),_=E(),B(h.$$.fragment),y=E(),S=v("hr"),$=E(),B(C.$$.fragment),T=E(),X&&X.c(),M=E(),O=v("div"),D=v("div"),I=E(),le.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(O,"class","flex")},m(ie,ee){w(ie,e,ee),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),w(ie,r,ee),w(ie,a,ee),V(u,a,null),b(a,c),V(d,a,null),b(a,_),V(h,a,null),w(ie,y,ee),w(ie,S,ee),w(ie,$,ee),V(C,ie,ee),w(ie,T,ee),X&&X.m(ie,ee),w(ie,M,ee),w(ie,O,ee),b(O,D),b(O,I),le.m(O,null),P=!0},p(ie,ee){const Te={};ee[0]&1|ee[1]&3&&(Te.$$scope={dirty:ee,ctx:ie}),i.$set(Te);const Pe={};ee[0]&1|ee[1]&3&&(Pe.$$scope={dirty:ee,ctx:ie}),o.$set(Pe);const je={};!f&&ee[0]&1&&(f=!0,je.config=ie[0].meta.verificationTemplate,he(()=>f=!1)),u.$set(je);const Ve={};!m&&ee[0]&1&&(m=!0,Ve.config=ie[0].meta.resetPasswordTemplate,he(()=>m=!1)),d.$set(Ve);const ke={};!g&&ee[0]&1&&(g=!0,ke.config=ie[0].meta.confirmEmailChangeTemplate,he(()=>g=!1)),h.$set(ke);const Ce={};ee[0]&1|ee[1]&3&&(Ce.$$scope={dirty:ee,ctx:ie}),C.$set(Ce),ie[0].smtp.enabled?X?(X.p(ie,ee),ee[0]&1&&A(X,1)):(X=Nh(ie),X.c(),A(X,1),X.m(M.parentNode,M)):X&&(ae(),L(X,1,1,()=>{X=null}),ue()),J===(J=K(ie))&&le?le.p(ie,ee):(le.d(1),le=J(ie),le&&(le.c(),le.m(O,null)))},i(ie){P||(A(i.$$.fragment,ie),A(o.$$.fragment,ie),A(u.$$.fragment,ie),A(d.$$.fragment,ie),A(h.$$.fragment,ie),A(C.$$.fragment,ie),A(X),P=!0)},o(ie){L(i.$$.fragment,ie),L(o.$$.fragment,ie),L(u.$$.fragment,ie),L(d.$$.fragment,ie),L(h.$$.fragment,ie),L(C.$$.fragment,ie),L(X),P=!1},d(ie){ie&&k(e),H(i),H(o),ie&&k(r),ie&&k(a),H(u),H(d),H(h),ie&&k(y),ie&&k(S),ie&&k($),H(C,ie),ie&&k(T),X&&X.d(ie),ie&&k(M),ie&&k(O),le.d()}}}function XD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function QD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender name"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&re(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function xD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender address"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&re(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[17]),$e(ze.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"}))],u=!0)},p(c,d){d[1]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Oe(f)}}}function Nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M;return i=new de({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[tA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[nA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[iA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),d=new de({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[sA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field",name:"smtp.username",$$slots:{default:[lA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),S=new de({props:{class:"form-field",name:"smtp.password",$$slots:{default:[oA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),a=v("div"),B(u.$$.fragment),f=E(),c=v("div"),B(d.$$.fragment),m=E(),_=v("div"),B(h.$$.fragment),g=E(),y=v("div"),B(S.$$.fragment),$=E(),C=v("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(_,"class","col-lg-6"),p(y,"class","col-lg-6"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(O,D){w(O,e,D),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),b(e,a),V(u,a,null),b(e,f),b(e,c),V(d,c,null),b(e,m),b(e,_),V(h,_,null),b(e,g),b(e,y),V(S,y,null),b(e,$),b(e,C),M=!0},p(O,D){const I={};D[0]&1|D[1]&3&&(I.$$scope={dirty:D,ctx:O}),i.$set(I);const P={};D[0]&1|D[1]&3&&(P.$$scope={dirty:D,ctx:O}),o.$set(P);const F={};D[0]&1|D[1]&3&&(F.$$scope={dirty:D,ctx:O}),u.$set(F);const R={};D[0]&1|D[1]&3&&(R.$$scope={dirty:D,ctx:O}),d.$set(R);const N={};D[0]&1|D[1]&3&&(N.$$scope={dirty:D,ctx:O}),h.$set(N);const q={};D[0]&1|D[1]&3&&(q.$$scope={dirty:D,ctx:O}),S.$set(q)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(h.$$.fragment,O),A(S.$$.fragment,O),O&&Ge(()=>{M&&(T||(T=qe(e,st,{duration:150},!0)),T.run(1))}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(h.$$.fragment,O),L(S.$$.fragment,O),O&&(T||(T=qe(e,st,{duration:150},!1)),T.run(0)),M=!1},d(O){O&&k(e),H(i),H(o),H(u),H(d),H(h),H(S),O&&T&&T.end()}}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("SMTP server host"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&re(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Port"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&pt(l.value)!==u[0].smtp.port&&re(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function iA(n){let e,t,i,s,l,o,r;function a(f){n[20](f)}let u={id:n[31],items:n[6]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Vi({props:u}),te.push(()=>ce(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("TLS encryption"),s=E(),B(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),V(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),H(l,f)}}}function sA(n){let e,t,i,s,l,o,r;function a(f){n[21](f)}let u={id:n[31],items:n[7]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Vi({props:u}),te.push(()=>ce(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("AUTH method"),s=E(),B(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),V(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),H(l,f)}}}function lA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Username"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&re(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function oA(n){let e,t,i,s,l,o,r;function a(f){n[23](f)}let u={id:n[31]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new cu({props:u}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Password"),s=E(),B(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),V(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),H(l,f)}}}function rA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` - Send test email`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function aA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,Oe(a)}}}function uA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;const y=[XD,GD],S=[];function $(C,T){return C[2]?0:1}return d=$(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[5]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=E(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(C,r,T),w(C,a,T),b(a,u),b(u,f),b(u,c),S[d].m(u,null),_=!0,h||(g=Y(u,"submit",Qe(n[27])),h=!0)},p(C,T){(!_||T[0]&32)&&se(o,C[5]);let M=d;d=$(C),d===M?S[d].p(C,T):(ae(),L(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(C,T):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,g()}}}function fA(n){let e,t,i,s,l,o;e=new Ci({}),i=new Sn({props:{$$slots:{default:[uA]},$$scope:{ctx:n}}});let r={};return l=new ZD({props:r}),n[28](l),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[28](null),H(l,a)}}}function cA(n,e,t){let i,s,l;Ke(n,Dt,K=>t(5,l=K));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];ln(Dt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const K=await fe.settings.getAll()||{};h(K)}catch(K){fe.error(K)}t(2,c=!1)}async function _(){if(!(d||!s)){t(3,d=!0);try{const K=await fe.settings.update(z.filterRedactedProps(f));h(K),tn({}),Ht("Successfully saved mail settings.")}catch(K){fe.error(K)}t(3,d=!1)}}function h(K={}){t(0,f={meta:(K==null?void 0:K.meta)||{},smtp:(K==null?void 0:K.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function g(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function S(){f.meta.senderAddress=this.value,t(0,f)}function $(K){n.$$.not_equal(f.meta.verificationTemplate,K)&&(f.meta.verificationTemplate=K,t(0,f))}function C(K){n.$$.not_equal(f.meta.resetPasswordTemplate,K)&&(f.meta.resetPasswordTemplate=K,t(0,f))}function T(K){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,K)&&(f.meta.confirmEmailChangeTemplate=K,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function D(){f.smtp.port=pt(this.value),t(0,f)}function I(K){n.$$.not_equal(f.smtp.tls,K)&&(f.smtp.tls=K,t(0,f))}function P(K){n.$$.not_equal(f.smtp.authMethod,K)&&(f.smtp.authMethod=K,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function R(K){n.$$.not_equal(f.smtp.password,K)&&(f.smtp.password=K,t(0,f))}const N=()=>g(),q=()=>_(),j=()=>a==null?void 0:a.show(),Z=()=>_();function X(K){te[K?"unshift":"push"](()=>{a=K,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,_,g,u,i,y,S,$,C,T,M,O,D,I,P,F,R,N,q,j,Z,X]}class dA extends ve{constructor(e){super(),be(this,e,cA,fA,me,{},null,[-1,-1])}}const pA=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),Rh=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function mA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&se(l,u[4]),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function qh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M;return i=new de({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[hA,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[_A,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[gA,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),d=new de({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[bA,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[vA,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),S=new de({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[yA,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),a=v("div"),B(u.$$.fragment),f=E(),c=v("div"),B(d.$$.fragment),m=E(),_=v("div"),B(h.$$.fragment),g=E(),y=v("div"),B(S.$$.fragment),$=E(),C=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(_,"class","col-lg-6"),p(y,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(O,D){w(O,e,D),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),b(e,a),V(u,a,null),b(e,f),b(e,c),V(d,c,null),b(e,m),b(e,_),V(h,_,null),b(e,g),b(e,y),V(S,y,null),b(e,$),b(e,C),M=!0},p(O,D){const I={};D&8&&(I.name=O[3]+".endpoint"),D&1081345&&(I.$$scope={dirty:D,ctx:O}),i.$set(I);const P={};D&8&&(P.name=O[3]+".bucket"),D&1081345&&(P.$$scope={dirty:D,ctx:O}),o.$set(P);const F={};D&8&&(F.name=O[3]+".region"),D&1081345&&(F.$$scope={dirty:D,ctx:O}),u.$set(F);const R={};D&8&&(R.name=O[3]+".accessKey"),D&1081345&&(R.$$scope={dirty:D,ctx:O}),d.$set(R);const N={};D&8&&(N.name=O[3]+".secret"),D&1081345&&(N.$$scope={dirty:D,ctx:O}),h.$set(N);const q={};D&8&&(q.name=O[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:O}),S.$set(q)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(h.$$.fragment,O),A(S.$$.fragment,O),O&&Ge(()=>{M&&(T||(T=qe(e,st,{duration:150},!0)),T.run(1))}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(h.$$.fragment,O),L(S.$$.fragment,O),O&&(T||(T=qe(e,st,{duration:150},!1)),T.run(0)),M=!1},d(O){O&&k(e),H(i),H(o),H(u),H(d),H(h),H(S),O&&T&&T.end()}}}function hA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].endpoint),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&re(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function _A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].bucket),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&re(l,u[0].bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function gA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Region"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].region),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].region&&re(l,u[0].region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function bA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Access key"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].accessKey),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&re(l,u[0].accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function vA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new cu({props:u}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Secret"),s=E(),B(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),V(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),H(l,f)}}}function yA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[14]),$e(ze.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"}))],u=!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(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Oe(f)}}}function kA(n){let e,t,i,s,l;e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[mA,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],Rh);let a=n[0].enabled&&qh(n);return{c(){B(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=ye()},m(u,f){V(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&32775)&&Ct(r,o,u,u[15],l?St(o,u[15],f,pA):$t(u[15]),Rh),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=qh(u),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(ae(),L(a,1,1,()=>{a=null}),ue())},i(u){l||(A(e.$$.fragment,u),A(r,u),A(a),l=!0)},o(u){L(e.$$.fragment,u),L(r,u),L(a),l=!1},d(u){H(e,u),u&&k(t),r&&r.d(u),u&&k(i),a&&a.d(u),u&&k(s)}}}const Rr="s3_test_request";function wA(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null;function _(O){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{h()},O)}async function h(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;fe.cancelRequest(Rr),clearTimeout(d),d=setTimeout(()=>{fe.cancelRequest(Rr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let O;try{await fe.settings.testS3(u,{$cancelKey:Rr})}catch(D){O=D}return O!=null&&O.isAbort||(t(1,f=O),t(2,c=!1),clearTimeout(d)),f}Xt(()=>()=>{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 $(){o.region=this.value,t(0,o)}function C(){o.accessKey=this.value,t(0,o)}function T(O){n.$$.not_equal(o.secret,O)&&(o.secret=O,t(0,o))}function M(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=O=>{"originalConfig"in O&&t(5,l=O.originalConfig),"config"in O&&t(0,o=O.config),"configKey"in O&&t(3,r=O.configKey),"toggleLabel"in O&&t(4,a=O.toggleLabel),"testFilesystem"in O&&t(6,u=O.testFilesystem),"testError"in O&&t(1,f=O.testError),"isTesting"in O&&t(2,c=O.isTesting),"$$scope"in O&&t(15,s=O.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&_(100),n.$$.dirty&9&&(o.enabled||ai(r))},[o,f,c,r,a,l,u,i,g,y,S,$,C,T,M,s]}class T1 extends ve{constructor(e){super(),be(this,e,wA,kA,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function SA(n){var O;let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;function y(D){n[11](D)}function S(D){n[12](D)}function $(D){n[13](D)}let C={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[$A]},$$scope:{ctx:n}};n[1].s3!==void 0&&(C.config=n[1].s3),n[4]!==void 0&&(C.isTesting=n[4]),n[5]!==void 0&&(C.testError=n[5]),e=new T1({props:C}),te.push(()=>ce(e,"config",y)),te.push(()=>ce(e,"isTesting",S)),te.push(()=>ce(e,"testError",$));let T=((O=n[1].s3)==null?void 0:O.enabled)&&!n[6]&&!n[3]&&zh(n),M=n[6]&&Vh(n);return{c(){B(e.$$.fragment),l=E(),o=v("div"),r=v("div"),a=E(),T&&T.c(),u=E(),M&&M.c(),f=E(),c=v("button"),d=v("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],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,I){V(e,D,I),w(D,l,I),w(D,o,I),b(o,r),b(o,a),T&&T.m(o,null),b(o,u),M&&M.m(o,null),b(o,f),b(o,c),b(c,d),_=!0,h||(g=Y(c,"click",n[15]),h=!0)},p(D,I){var F;const P={};I&1&&(P.originalConfig=D[0].s3),I&524291&&(P.$$scope={dirty:I,ctx:D}),!t&&I&2&&(t=!0,P.config=D[1].s3,he(()=>t=!1)),!i&&I&16&&(i=!0,P.isTesting=D[4],he(()=>i=!1)),!s&&I&32&&(s=!0,P.testError=D[5],he(()=>s=!1)),e.$set(P),(F=D[1].s3)!=null&&F.enabled&&!D[6]&&!D[3]?T?T.p(D,I):(T=zh(D),T.c(),T.m(o,u)):T&&(T.d(1),T=null),D[6]?M?M.p(D,I):(M=Vh(D),M.c(),M.m(o,f)):M&&(M.d(1),M=null),(!_||I&72&&m!==(m=!D[6]||D[3]))&&(c.disabled=m),(!_||I&8)&&Q(c,"btn-loading",D[3])},i(D){_||(A(e.$$.fragment,D),_=!0)},o(D){L(e.$$.fragment,D),_=!1},d(D){H(e,D),D&&k(l),D&&k(o),T&&T.d(),M&&M.d(),h=!1,g()}}}function CA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function jh(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,_,h,g,y,S,$,C,T,M,O,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually - from the - `),r=v("strong"),u=U(a),f=U(` - to the - `),c=v("strong"),m=U(d),_=U(`. - `),h=v("br"),g=U(` - There are numerous command line tools that can help you, such as: - `),y=v("a"),y.textContent=`rclone - `,S=U(`, - `),$=v("a"),$.textContent=`s5cmd - `,C=U(", etc."),T=E(),M=v("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($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,m),b(l,_),b(l,h),b(l,g),b(l,y),b(l,S),b(l,$),b(l,C),b(e,T),b(e,M),D=!0},p(P,F){var R;(!D||F&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&se(u,a),(!D||F&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){D||(P&&Ge(()=>{D&&(O||(O=qe(e,st,{duration:150},!0)),O.run(1))}),D=!0)},o(P){P&&(O||(O=qe(e,st,{duration:150},!1)),O.run(0)),D=!1},d(P){P&&k(e),P&&O&&O.end()}}}function $A(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&jh(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=jh(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ae(),L(t,1,1,()=>{t=null}),ue())},d(s){t&&t.d(s),s&&k(e)}}}function zh(n){let e;function t(l,o){return l[4]?OA:l[5]?MA:TA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function TA(n){let e;return{c(){e=v("div"),e.innerHTML=` - S3 connected successfully`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function MA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=` - Failed to establish S3 connection`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=$e(t=ze.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function OA(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Vh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function EA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;const y=[CA,SA],S=[];function $(C,T){return C[2]?0:1}return d=$(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML=`

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

    -

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

    `,c=E(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(C,r,T),w(C,a,T),b(a,u),b(u,f),b(u,c),S[d].m(u,null),_=!0,h||(g=Y(u,"submit",Qe(n[16])),h=!0)},p(C,T){(!_||T&128)&&se(o,C[7]);let M=d;d=$(C),d===M?S[d].p(C,T):(ae(),L(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(C,T):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,g()}}}function DA(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[EA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}const AA="s3_test_request";function IA(n,e,t){let i,s,l;Ke(n,Dt,M=>t(7,l=M)),ln(Dt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await fe.settings.getAll()||{};_(M)}catch(M){fe.error(M)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{fe.cancelRequest(AA);const M=await fe.settings.update(z.filterRedactedProps(r));tn({}),await _(M),Ia(),c?Dy("Successfully saved but failed to establish S3 connection."):Ht("Successfully saved files storage settings.")}catch(M){fe.error(M)}t(3,u=!1)}}async function _(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){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){f=M,t(4,f)}function S(M){c=M,t(5,c)}const $=()=>h(),C=()=>m(),T=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,m,h,i,g,y,S,$,C,T]}class LA extends ve{constructor(e){super(),be(this,e,IA,DA,me,{})}}function PA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function FA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),re(l,n[1].clientId),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&re(l,f[1].clientId)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function NA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new cu({props:u}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=E(),B(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),V(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),H(l,f)}}}function Hh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Rt(o,r(n)),te.push(()=>ce(t,"config",l))),{c(){e=v("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){w(a,e,u),t&&V(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],he(()=>i=!1)),u&8&&o!==(o=a[3].optionsComponent)){if(t){ae();const c=t;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(t=Rt(o,r(a)),te.push(()=>ce(t,"config",l)),B(t.$$.fragment),A(t.$$.fragment,1),V(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&L(t.$$.fragment,a),s=!1},d(a){a&&k(e),t&&H(t)}}}function RA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new de({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[PA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[FA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[NA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let _=n[3].optionsComponent&&Hh(n);return{c(){e=v("form"),t=v("div"),B(i.$$.fragment),s=E(),l=v("button"),l.innerHTML='Clear all fields',o=E(),B(r.$$.fragment),a=E(),B(u.$$.fragment),f=E(),_&&_.c(),p(l,"type","button"),p(l,"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(h,g){w(h,e,g),b(e,t),V(i,t,null),b(t,s),b(t,l),b(e,o),V(r,e,null),b(e,a),V(u,e,null),b(e,f),_&&_.m(e,null),c=!0,d||(m=[Y(l,"click",n[8]),Y(e,"submit",Qe(n[15]))],d=!0)},p(h,g){const y={};g&8&&(y.name=h[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:h}),i.$set(y);const S={};g&2&&(S.class="form-field "+(h[1].enabled?"required":"")),g&8&&(S.name=h[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:h}),r.$set(S);const $={};g&2&&($.class="form-field "+(h[1].enabled?"required":"")),g&8&&($.name=h[3].key+".clientSecret"),g&3145730&&($.$$scope={dirty:g,ctx:h}),u.$set($),h[3].optionsComponent?_?(_.p(h,g),g&8&&A(_,1)):(_=Hh(h),_.c(),A(_,1),_.m(e,null)):_&&(ae(),L(_,1,1,()=>{_=null}),ue())},i(h){c||(A(i.$$.fragment,h),A(r.$$.fragment,h),A(u.$$.fragment,h),A(_),c=!0)},o(h){L(i.$$.fragment,h),L(r.$$.fragment,h),L(u.$$.fragment,h),L(_),c=!1},d(h){h&&k(e),H(i),H(r),H(u),_&&_.d(),d=!1,Oe(m)}}}function qA(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=U(t),s=U(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&se(i,t)},d(l){l&&k(e)}}}function jA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function zA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[jA],header:[qA],default:[RA]},$$scope:{ctx:n}};return e=new on({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[16](null),H(e,s)}}}function VA(n,e,t){let i;const s=Tt(),l="provider_popup_"+z.randomString(5);let o,r={},a={},u=!1,f="";function c(O,D){tn({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},D)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const O={};O[r.key]=z.filterRedactedProps(a);const D=await fe.settings.update(O);tn({}),Ht("Successfully updated provider settings."),s("submit",D),d()}catch(O){fe.error(O)}t(4,u=!1)}function _(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function h(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function S(O){a=O,t(1,a)}const $=()=>m();function C(O){te[O?"unshift":"push"](()=>{o=O,t(2,o)})}function T(O){Fe.call(this,n,O)}function M(O){Fe.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,l,m,_,c,f,h,g,y,S,$,C,T,M]}class HA extends ve{constructor(e){super(),be(this,e,VA,zA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Bh(n){let e,t,i;return{c(){e=v("img"),gn(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!gn(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function Uh(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function BA(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,m,_,h,g,y,S,$,C,T=n[1].logo&&Bh(n),M=n[0].enabled&&Uh(),O={};return y=new HA({props:O}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),T&&T.c(),i=E(),s=v("div"),o=U(l),r=E(),a=v("em"),u=U("("),c=U(f),d=U(")"),m=E(),M&&M.c(),_=E(),h=v("button"),h.innerHTML='',g=E(),B(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(h,"type","button"),p(h,"class","btn btn-circle btn-hint btn-transparent"),p(h,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,I){w(D,e,I),b(e,t),T&&T.m(t,null),b(e,i),b(e,s),b(s,o),b(e,r),b(e,a),b(a,u),b(a,c),b(a,d),b(e,m),M&&M.m(e,null),b(e,_),b(e,h),w(D,g,I),V(y,D,I),S=!0,$||(C=Y(h,"click",n[3]),$=!0)},p(D,[I]){D[1].logo?T?T.p(D,I):(T=Bh(D),T.c(),T.m(t,null)):T&&(T.d(1),T=null),(!S||I&2)&&l!==(l=D[1].title+"")&&se(o,l),(!S||I&2)&&f!==(f=D[1].key.slice(0,-4)+"")&&se(c,f),D[0].enabled?M||(M=Uh(),M.c(),M.m(e,_)):M&&(M.d(1),M=null);const P={};y.$set(P)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){L(y.$$.fragment,D),S=!1},d(D){D&&k(e),T&&T.d(),M&&M.d(),D&&k(g),n[4](null),H(y,D),$=!1,C()}}}function UA(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class M1 extends ve{constructor(e){super(),be(this,e,UA,BA,me,{provider:1,config:0})}}function Wh(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Yh(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function WA(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=n[3];const c=h=>h[9].key;for(let h=0;h0&&n[2].length>0&&Jh(),m=n[2];const _=h=>h[9].key;for(let h=0;h0&&h[2].length>0?d||(d=Jh(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),g&5&&(m=h[2],ae(),r=bt(r,g,_,1,h,m,a,o,Ut,Zh,null,Wh),ue())},i(h){if(!u){for(let g=0;gce(i,"config",r)),{key:n,first:null,c(){t=v("div"),B(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),V(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!s&&f&9&&(s=!0,c.config=e[0][e[9].key],he(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),H(i)}}}function Jh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zh(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new M1({props:a}),te.push(()=>ce(i,"config",r)),{key:n,first:null,c(){t=v("div"),B(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),V(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!s&&f&5&&(s=!0,c.config=e[0][e[9].key],he(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),H(i)}}}function KA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_;const h=[YA,WA],g=[];function y(S,$){return S[1]?0:1}return d=y(n),m=g[d]=h[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("div"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=E(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,$){w(S,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(S,r,$),w(S,a,$),b(a,u),b(u,f),b(u,c),g[d].m(u,null),_=!0},p(S,$){(!_||$&16)&&se(o,S[4]);let C=d;d=y(S),d===C?g[d].p(S,$):(ae(),L(g[C],1,1,()=>{g[C]=null}),ue(),m=g[d],m?m.p(S,$):(m=g[d]=h[d](S),m.c()),A(m,1),m.m(u,null))},i(S){_||(A(m),_=!0)},o(S){L(m),_=!1},d(S){S&&k(e),S&&k(r),S&&k(a),g[d].d()}}}function JA(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[KA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function ZA(n,e,t){let i,s,l;Ke(n,Dt,d=>t(4,l=d)),ln(Dt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await fe.settings.getAll()||{};u(d)}catch(d){fe.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const m of fo)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function f(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=fo.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,s=fo.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,s,i,l,f,c]}class GA extends ve{constructor(e){super(),be(this,e,ZA,JA,me,{})}}function XA(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=E(),o=v("input"),a=E(),u=v("div"),f=v("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,_){w(m,e,_),b(e,t),b(e,i),w(m,l,_),w(m,o,_),re(o,n[0]),w(m,a,_),w(m,u,_),b(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(m,_){_&8&&se(t,m[3]),_&64&&s!==(s=m[6])&&p(e,"for",s),_&64&&r!==(r=m[6])&&p(o,"id",r),_&1&&pt(o.value)!==m[0]&&re(o,m[0]),_&2&&Q(f,"txt-success",!!m[1])},d(m){m&&k(e),m&&k(l),m&&k(o),m&&k(a),m&&k(u),c=!1,Oe(d)}}}function QA(n){let e,t;return e=new de({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[XA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xA(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=pt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=z.randomString(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class O1 extends ve{constructor(e){super(),be(this,e,xA,QA,me,{key:2,label:3,duration:0,secret:1})}}function Gh(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Xh(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function eI(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],c=new Map,d,m,_,h,g,y,S,$,C,T,M,O=n[5];const D=R=>R[19].key;for(let R=0;RR[19].key;for(let R=0;Rce(i,"duration",r)),te.push(()=>ce(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),V(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,he(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,he(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),H(i,f)}}}function xh(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new O1({props:u}),te.push(()=>ce(i,"duration",r)),te.push(()=>ce(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),V(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,he(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,he(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),H(i,f)}}}function e_(n){let e,t,i,s;return{c(){e=v("button"),t=v("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(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function nI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;const y=[tI,eI],S=[];function $(C,T){return C[1]?0:1}return d=$(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Adjust common token options.

    ",c=E(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(C,r,T),w(C,a,T),b(a,u),b(u,f),b(u,c),S[d].m(u,null),_=!0,h||(g=Y(u,"submit",Qe(n[7])),h=!0)},p(C,T){(!_||T&16)&&se(o,C[4]);let M=d;d=$(C),d===M?S[d].p(C,T):(ae(),L(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(C,T):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,g()}}}function iI(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[nI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function sI(n,e,t){let i,s,l;Ke(n,Dt,M=>t(4,l=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"}];ln(Dt,l="Token options",l);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const M=await fe.settings.getAll()||{};_(M)}catch(M){fe.error(M)}t(1,f=!1)}async function m(){if(!(c||!s)){t(2,c=!0);try{const M=await fe.settings.update(z.filterRedactedProps(u));_(M),Ht("Successfully saved tokens options.")}catch(M){fe.error(M)}t(2,c=!1)}}function _(M){var D;M=M||{},t(0,u={});const O=o.concat(r);for(const I of O)t(0,u[I.key]={duration:((D=M[I.key])==null?void 0:D.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function h(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function g(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function y(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}function S(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function $(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}const C=()=>h(),T=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,c,s,l,o,r,m,h,a,i,g,y,S,$,C,T]}class lI extends ve{constructor(e){super(),be(this,e,sI,iI,me,{})}}function oI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_;return o=new g1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

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

    `,t=E(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=E(),B(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=` - Download as JSON`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),b(i,s),b(i,l),V(o,i,null),n[8](i),w(h,r,g),w(h,a,g),b(a,u),b(a,f),b(a,c),d=!0,m||(_=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(h,g){const y={};g&4&&(y.content=h[2]),o.$set(y)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){L(o.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(t),h&&k(i),H(o),n[8](null),h&&k(r),h&&k(a),m=!1,Oe(_)}}}function rI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function aI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[rI,oI],_=[];function h(g,y){return g[1]?0:1}return f=h(n),c=_[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(g,r,y),w(g,a,y),b(a,u),_[f].m(u,null),d=!0},p(g,y){(!d||y&8)&&se(o,g[3]);let S=f;f=h(g),f===S?_[f].p(g,y):(ae(),L(_[S],1,1,()=>{_[S]=null}),ue(),c=_[f],c?c.p(g,y):(c=_[f]=m[f](g),c.c()),A(c,1),c.m(u,null))},i(g){d||(A(c),d=!0)},o(g){L(c),d=!1},d(g){g&&k(e),g&&k(r),g&&k(a),_[f].d()}}}function uI(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[aI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function fI(n,e,t){let i,s;Ke(n,Dt,g=>t(3,s=g)),ln(Dt,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await fe.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let g of r)delete g.created,delete g.updated}catch(g){fe.error(g)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function c(){z.copyToClipboard(i),bo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(g){te[g?"unshift":"push"](()=>{o=g,t(0,o)})}const _=g=>{if(g.ctrlKey&&g.code==="KeyA"){g.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},h=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,_,h]}class cI extends ve{constructor(e){super(),be(this,e,fI,uI,me,{})}}function t_(n,e,t){const i=n.slice();return i[14]=e[t],i}function n_(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[14]=e[t],i}function s_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function l_(n,e,t){const i=n.slice();return i[14]=e[t],i}function o_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function r_(n,e,t){const i=n.slice();return i[30]=e[t],i}function dI(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&a_(),a=n[0].name!==n[1].name&&u_(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=a_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=u_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function pI(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=E(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function mI(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=E(),i=v("strong"),l=U(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function a_(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function u_(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function f_(n){var g,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((g=n[0])==null?void 0:g[n[30]])+"",f,c,d,m,_=n[12]((y=n[1])==null?void 0:y[n[30]])+"",h;return{c(){var S,$,C,T,M,O;e=v("tr"),t=v("td"),i=v("span"),l=U(s),o=E(),r=v("td"),a=v("pre"),f=U(u),c=E(),d=v("td"),m=v("pre"),h=U(_),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),Q(r,"changed-old-col",!n[10]&&yn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),Q(r,"changed-none-col",n[10]),p(m,"class","txt"),p(d,"class","svelte-lmkr38"),Q(d,"changed-new-col",!n[5]&&yn((C=n[0])==null?void 0:C[n[30]],(T=n[1])==null?void 0:T[n[30]])),Q(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",yn((M=n[0])==null?void 0:M[n[30]],(O=n[1])==null?void 0:O[n[30]]))},m(S,$){w(S,e,$),b(e,t),b(t,i),b(i,l),b(e,o),b(e,r),b(r,a),b(a,f),b(e,c),b(e,d),b(d,m),b(m,h)},p(S,$){var C,T,M,O,D,I,P,F;$[0]&1&&u!==(u=S[12]((C=S[0])==null?void 0:C[S[30]])+"")&&se(f,u),$[0]&3075&&Q(r,"changed-old-col",!S[10]&&yn((T=S[0])==null?void 0:T[S[30]],(M=S[1])==null?void 0:M[S[30]])),$[0]&1024&&Q(r,"changed-none-col",S[10]),$[0]&2&&_!==(_=S[12]((O=S[1])==null?void 0:O[S[30]])+"")&&se(h,_),$[0]&2083&&Q(d,"changed-new-col",!S[5]&&yn((D=S[0])==null?void 0:D[S[30]],(I=S[1])==null?void 0:I[S[30]])),$[0]&32&&Q(d,"changed-none-col",S[5]),$[0]&2051&&Q(e,"txt-primary",yn((P=S[0])==null?void 0:P[S[30]],(F=S[1])==null?void 0:F[S[30]]))},d(S){S&&k(e)}}}function c_(n){let e,t=n[6],i=[];for(let s=0;sProps - Old - New`,l=E(),o=v("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=E(),h&&h.c(),a=E();for(let C=0;C!["schema","created","updated"].includes(y));function h(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":z.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,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=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")&&h(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=z.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,_,g]}class gI extends ve{constructor(e){super(),be(this,e,_I,hI,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function v_(n,e,t){const i=n.slice();return i[17]=e[t],i}function y_(n){let e,t;return e=new gI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bI(n){let e,t,i=n[2],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await fe.collections.import(o,a),Ht("Successfully imported collections configuration."),i("submit")}catch(C){fe.error(C)}t(4,u=!1),c()}}const h=()=>m(),g=()=>!u;function y(C){te[C?"unshift":"push"](()=>{s=C,t(1,s)})}function S(C){Fe.call(this,n,C)}function $(C){Fe.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,h,g,y,S,$]}class SI extends ve{constructor(e){super(),be(this,e,wI,kI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function k_(n,e,t){const i=n.slice();return i[32]=e[t],i}function w_(n,e,t){const i=n.slice();return i[35]=e[t],i}function S_(n,e,t){const i=n.slice();return i[32]=e[t],i}function CI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[TI,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&$_(),P=n[6]&&n[1].length&&n[7]&&T_(n),F=n[13].length&&R_(n),R=!!n[0]&&q_(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or - `),o=v("button"),o.innerHTML='Load from JSON file',r=E(),B(a.$$.fragment),u=E(),f=E(),I&&I.c(),c=E(),P&&P.c(),d=E(),F&&F.c(),m=E(),_=v("div"),R&&R.c(),h=E(),g=v("div"),y=E(),S=v("button"),$=v("span"),$.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"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p($,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),b(i,s),b(s,l),b(s,o),w(N,r,q),V(a,N,q),w(N,u,q),w(N,f,q),I&&I.m(N,q),w(N,c,q),P&&P.m(N,q),w(N,d,q),F&&F.m(N,q),w(N,m,q),w(N,_,q),R&&R.m(_,null),b(_,h),b(_,g),b(_,y),b(_,S),b(S,$),T=!0,M||(O=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],M=!0)},p(N,q){(!T||q[0]&4096)&&Q(o,"btn-loading",N[12]);const j={};q[0]&64&&(j.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(j.$$scope={dirty:q,ctx:N}),a.$set(j),N[6]&&N[1].length&&!N[7]?I||(I=$_(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),N[6]&&N[1].length&&N[7]?P?P.p(N,q):(P=T_(N),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),N[13].length?F?F.p(N,q):(F=R_(N),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),N[0]?R?R.p(N,q):(R=q_(N),R.c(),R.m(_,h)):R&&(R.d(1),R=null),(!T||q[0]&16384&&C!==(C=!N[14]))&&(S.disabled=C)},i(N){T||(A(a.$$.fragment,N),A(D),T=!0)},o(N){L(a.$$.fragment,N),L(D),T=!1},d(N){N&&k(e),n[19](null),N&&k(t),N&&k(i),N&&k(r),H(a,N),N&&k(u),N&&k(f),I&&I.d(N),N&&k(c),P&&P.d(N),N&&k(d),F&&F.d(N),N&&k(m),N&&k(_),R&&R.d(),M=!1,Oe(O)}}}function $I(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function C_(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function TI(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&C_();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=C_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function $_(n){let e;return{c(){e=v("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&&k(e)}}}function T_(n){let e,t,i,s,l,o=n[9].length&&M_(n),r=n[4].length&&D_(n),a=n[8].length&&P_(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=M_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=D_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=P_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function M_(n){let e=[],t=new Map,i,s=n[9];const l=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=E(),s=v("div"),s.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.`,l=E(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"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(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function q_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function MI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[$I,CI],_=[];function h(g,y){return g[5]?0:1}return f=h(n),c=_[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(g,r,y),w(g,a,y),b(a,u),_[f].m(u,null),d=!0},p(g,y){(!d||y[0]&32768)&&se(o,g[15]);let S=f;f=h(g),f===S?_[f].p(g,y):(ae(),L(_[S],1,1,()=>{_[S]=null}),ue(),c=_[f],c?c.p(g,y):(c=_[f]=m[f](g),c.c()),A(c,1),c.m(u,null))},i(g){d||(A(c),d=!0)},o(g){L(c),d=!1},d(g){g&&k(e),g&&k(r),g&&k(a),_[f].d()}}}function OI(n){let e,t,i,s,l,o;e=new Ci({}),i=new Sn({props:{$$slots:{default:[MI]},$$scope:{ctx:n}}});let r={};return l=new SI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[27](null),H(l,a)}}}function EI(n,e,t){let i,s,l,o,r,a,u;Ke(n,Dt,J=>t(15,u=J)),ln(Dt,u="Import collections",u);let f,c,d="",m=!1,_=[],h=[],g=!0,y=[],S=!1;$();async function $(){t(5,S=!0);try{t(2,h=await fe.collections.getFullList(200));for(let J of h)delete J.created,delete J.updated}catch(J){fe.error(J)}t(5,S=!1)}function C(){if(t(4,y=[]),!!i)for(let J of _){const le=z.findByKey(h,"id",J.id);!(le!=null&&le.id)||!z.hasCollectionChanges(le,J,g)||y.push({new:J,old:le})}}function T(){t(1,_=[]);try{t(1,_=JSON.parse(d))}catch{}Array.isArray(_)?t(1,_=z.filterDuplicatesByKey(_)):t(1,_=[]);for(let J of _)delete J.created,delete J.updated,J.schema=z.filterDuplicatesByKey(J.schema)}function M(){var J,le;for(let ie of _){const ee=z.findByKey(h,"name",ie.name)||z.findByKey(h,"id",ie.id);if(!ee)continue;const Te=ie.id,Pe=ee.id;ie.id=Pe;const je=Array.isArray(ee.schema)?ee.schema:[],Ve=Array.isArray(ie.schema)?ie.schema:[];for(const ke of Ve){const Ce=z.findByKey(je,"name",ke.name);Ce&&Ce.id&&(ke.id=Ce.id)}for(let ke of _)if(Array.isArray(ke.schema))for(let Ce of ke.schema)(J=Ce.options)!=null&&J.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===Te&&(Ce.options.collectionId=Pe)}t(0,d=JSON.stringify(_,null,4))}function O(J){t(12,m=!0);const le=new FileReader;le.onload=async ie=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ie.target.result),await cn(),_.length||(Ts("Invalid collections configuration."),D())},le.onerror=ie=>{console.warn(ie),Ts("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(J)}function D(){t(0,d=""),t(10,f.value="",f),tn({})}function I(J){te[J?"unshift":"push"](()=>{f=J,t(10,f)})}const P=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function R(){d=this.value,t(0,d)}function N(){g=this.checked,t(3,g)}const q=()=>M(),j=()=>D(),Z=()=>c==null?void 0:c.show(h,_,g);function X(J){te[J?"unshift":"push"](()=>{c=J,t(11,c)})}const K=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&_.length&&_.length===_.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=h.filter(J=>i&&g&&!z.findByKey(_,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=_.filter(J=>i&&!z.findByKey(h,"id",J.id))),n.$$.dirty[0]&10&&(typeof _<"u"||typeof g<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=_.filter(J=>{let le=z.findByKey(h,"name",J.name)||z.findByKey(h,"id",J.id);if(!le)return!1;if(le.id!=J.id)return!0;const ie=Array.isArray(le.schema)?le.schema:[],ee=Array.isArray(J.schema)?J.schema:[];for(const Te of ee){if(z.findByKey(ie,"id",Te.id))continue;const je=z.findByKey(ie,"name",Te.name);if(je&&Te.id!=je.id)return!0}return!1}))},[d,_,h,g,y,S,i,o,l,s,f,c,m,a,r,u,M,O,D,I,P,F,R,N,q,j,Z,X,K]}class DI extends ve{constructor(e){super(),be(this,e,EI,OI,me,{},null,[-1,-1])}}function AI(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),r=E(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[2]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&re(l,c[2])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function II(n){let e,t,i,s,l,o,r;return s=new de({props:{class:"form-field m-0",name:"name",$$slots:{default:[AI,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("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=E(),i=v("form"),B(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),V(s,i,null),l=!0,o||(r=Y(i,"submit",Qe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&k(e),a&&k(t),a&&k(i),H(s),o=!1,r()}}}function LI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,r()}}}function FI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[PI],header:[LI],default:[II]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function NI(n,e,t){const i=Tt(),s="backup_create_"+z.randomString(5);let l,o="",r=!1,a;function u(S){tn({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await fe.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),Ht("Successfully generated new backup.")}catch(S){S.isAbort||fe.error(S)}clearTimeout(a),t(3,r=!1)}}Ro(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(bo("A backup has already been started, please wait."),!1):!0,_=()=>(r&&bo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function g(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,m,_,h,g,y]}class RI extends ve{constructor(e){super(),be(this,e,NI,FI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function qI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function jI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;return u=new Il({props:{value:n[1]}}),m=new de({props:{class:"form-field required m-0",name:"name",$$slots:{default:[qI,({uniqueId:y})=>({14:y}),({uniqueId:y})=>y?16384:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`
    -

    Please proceed with caution.

    -

    The restore operation will replace your existing pb_data with the one from the backup - and will restart the application process!

    -

    Backup restore is still experimental and currently works only on UNIX based systems.

    `,t=E(),i=v("div"),s=U(`Type the backup name - `),l=v("div"),o=v("span"),r=U(n[1]),a=E(),B(u.$$.fragment),f=U(` - to confirm:`),c=E(),d=v("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"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),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),V(u,l,null),b(i,f),w(y,c,S),w(y,d,S),V(m,d,null),_=!0,h||(g=Y(d,"submit",Qe(n[7])),h=!0)},p(y,S){(!_||S&2)&&se(r,y[1]);const $={};S&2&&($.value=y[1]),u.$set($);const C={};S&49156&&(C.$$scope={dirty:S,ctx:y}),m.$set(C)},i(y){_||(A(u.$$.fragment,y),A(m.$$.fragment,y),_=!0)},o(y){L(u.$$.fragment,y),L(m.$$.fragment,y),_=!1},d(y){y&&k(e),y&&k(t),y&&k(i),H(u),y&&k(c),y&&k(d),H(m),h=!1,g()}}}function zI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function VI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function HI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[VI],header:[zI],default:[jI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&32822&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function BI(n,e,t){let i;const s="backup_restore_"+z.randomString(5);let l,o="",r="",a=!1;function u(y){tn({}),t(2,r=""),t(1,o=y),t(4,a=!1),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){var y;if(!(!i||a)){t(4,a=!0);try{await fe.backups.restore(o),setTimeout(()=>{window.location.reload()},1e3)}catch(S){S!=null&&S.isAbort||(t(4,a=!1),Ts(((y=S.response)==null?void 0:y.message)||S.message))}}}function d(){r=this.value,t(2,r)}const m=()=>!a;function _(y){te[y?"unshift":"push"](()=>{l=y,t(3,l)})}function h(y){Fe.call(this,n,y)}function g(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[f,o,r,l,a,i,s,c,u,d,m,_,h,g]}class UI extends ve{constructor(e){super(),be(this,e,BI,HI,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function j_(n,e,t){const i=n.slice();return i[22]=e[t],i}function z_(n,e,t){const i=n.slice();return i[19]=e[t],i}function WI(n){let e=[],t=new Map,i,s,l=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:x,d(t){t&&k(e)}}}function H_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d=z.formattedFileSize(e[22].size)+"",m,_,h,g,y,S,$,C,T,M,O,D,I,P,F,R,N,q,j,Z;function X(){return e[10](e[22])}function K(){return e[11](e[22])}function J(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=U(r),u=E(),f=v("span"),c=U("("),m=U(d),_=U(")"),h=E(),g=v("div"),y=v("button"),S=v("i"),C=E(),T=v("button"),M=v("i"),D=E(),I=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(f,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(S,"class","ri-download-line"),p(y,"type","button"),p(y,"class","btn btn-sm btn-circle btn-hint btn-transparent"),y.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(y,"aria-label","Download"),Q(y,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(T,"type","button"),p(T,"class","btn btn-sm btn-circle btn-hint btn-transparent"),T.disabled=O=e[6][e[22].key],p(T,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(I,"type","button"),p(I,"class","btn btn-sm btn-circle btn-hint btn-transparent"),I.disabled=F=e[6][e[22].key],p(I,"aria-label","Delete"),Q(I,"btn-loading",e[6][e[22].key]),p(g,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(le,ie){w(le,t,ie),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,u),b(l,f),b(f,c),b(f,m),b(f,_),b(t,h),b(t,g),b(g,y),b(y,S),b(g,C),b(g,T),b(T,M),b(g,D),b(g,I),b(I,P),b(t,R),q=!0,j||(Z=[$e(ze.call(null,y,"Download")),Y(y,"click",Qe(X)),$e(ze.call(null,T,"Restore")),Y(T,"click",Qe(K)),$e(ze.call(null,I,"Delete")),Y(I,"click",Qe(J))],j=!0)},p(le,ie){e=le,(!q||ie&8)&&r!==(r=e[22].key+"")&&se(a,r),(!q||ie&8)&&d!==(d=z.formattedFileSize(e[22].size)+"")&&se(m,d),(!q||ie&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(y.disabled=$),(!q||ie&40)&&Q(y,"btn-loading",e[5][e[22].key]),(!q||ie&72&&O!==(O=e[6][e[22].key]))&&(T.disabled=O),(!q||ie&72&&F!==(F=e[6][e[22].key]))&&(I.disabled=F),(!q||ie&72)&&Q(I,"btn-loading",e[6][e[22].key])},i(le){q||(le&&Ge(()=>{q&&(N||(N=qe(t,st,{duration:150},!0)),N.run(1))}),q=!0)},o(le){le&&(N||(N=qe(t,st,{duration:150},!1)),N.run(0)),q=!1},d(le){le&&k(t),le&&N&&N.end(),j=!1,Oe(Z)}}}function B_(n){let e;return{c(){e=v("div"),e.innerHTML=` - `,p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function KI(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function JI(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function ZI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;const g=[YI,WI],y=[];function S(D,I){return D[4]?0:1}i=S(n),s=y[i]=g[i](n);function $(D,I){return D[7]?JI:KI}let C=$(n),T=C(n),M={};f=new RI({props:M}),n[14](f),f.$on("submit",n[15]);let O={};return d=new UI({props:O}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),T.c(),u=E(),B(f.$$.fragment),c=E(),B(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(D,I){w(D,e,I),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),T.m(r,null),w(D,u,I),V(f,D,I),w(D,c,I),V(d,D,I),m=!0,_||(h=Y(r,"click",n[13]),_=!0)},p(D,[I]){let P=i;i=S(D),i===P?y[i].p(D,I):(ae(),L(y[P],1,1,()=>{y[P]=null}),ue(),s=y[i],s?s.p(D,I):(s=y[i]=g[i](D),s.c()),A(s,1),s.m(t,null)),C!==(C=$(D))&&(T.d(1),T=C(D),T&&(T.c(),T.m(r,null))),(!m||I&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const F={};f.$set(F);const R={};d.$set(R)},i(D){m||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),m=!0)},o(D){L(s),L(f.$$.fragment,D),L(d.$$.fragment,D),m=!1},d(D){D&&k(e),y[i].d(),T.d(),D&&k(u),n[14](null),H(f,D),D&&k(c),n[16](null),H(d,D),_=!1,h()}}}function GI(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),_();async function f(){t(4,o=!0);try{t(3,l=await fe.backups.getFullList()),l.sort((M,O)=>M.modifiedO.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(fe.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const O=await fe.getAdminFileToken(),D=fe.backups.getDownloadUrl(O,M);z.download(D)}catch(O){O.isAbort||fe.error(O)}delete r[M],t(5,r)}}function d(M){hn(`Do you really want to delete ${M}?`,()=>m(M))}async function m(M){if(!a[M]){t(6,a[M]=!0,a);try{await fe.backups.delete(M),z.removeByKey(l,"name",M),f(),Ht(`Successfully deleted ${M}.`)}catch(O){O.isAbort||fe.error(O)}delete a[M],t(6,a)}}async function _(){var M;try{const O=await fe.health.check({$autoCancel:!1}),D=u;t(7,u=((M=O==null?void 0:O.data)==null?void 0:M.canBackup)||!1),D!=u&&u&&f()}catch{}}Xt(()=>{let M=setInterval(()=>{_()},3e3);return()=>{clearInterval(M)}});const h=M=>c(M.key),g=M=>s.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function $(M){te[M?"unshift":"push"](()=>{i=M,t(1,i)})}const C=()=>{f()};function T(M){te[M?"unshift":"push"](()=>{s=M,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,h,g,y,S,$,C,T]}class XI extends ve{constructor(e){super(),be(this,e,GI,ZI,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function QI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function U_(n){var j,Z,X;let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O;t=new de({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[e8,({uniqueId:K})=>({32:K}),({uniqueId:K})=>[0,K?2:0]]},$$scope:{ctx:n}}});let D=n[2]&&W_(n);function I(K){n[25](K)}function P(K){n[26](K)}function F(K){n[27](K)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(j=n[0].backups)==null?void 0:j.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new T1({props:R}),te.push(()=>ce(r,"config",I)),te.push(()=>ce(r,"isTesting",P)),te.push(()=>ce(r,"testError",F));let N=((X=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&Y_(n),q=n[9]&&K_(n);return{c(){e=v("form"),B(t.$$.fragment),i=E(),D&&D.c(),s=E(),l=v("div"),o=E(),B(r.$$.fragment),c=E(),d=v("div"),m=v("div"),_=E(),N&&N.c(),h=E(),q&&q.c(),g=E(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"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=$=!n[9]||n[5],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(K,J){w(K,e,J),V(t,e,null),b(e,i),D&&D.m(e,null),b(e,s),b(e,l),b(e,o),V(r,e,null),b(e,c),b(e,d),b(d,m),b(d,_),N&&N.m(d,null),b(d,h),q&&q.m(d,null),b(d,g),b(d,y),b(y,S),T=!0,M||(O=[Y(y,"click",n[29]),Y(e,"submit",Qe(n[11]))],M=!0)},p(K,J){var ee,Te,Pe;const le={};J[0]&4|J[1]&6&&(le.$$scope={dirty:J,ctx:K}),t.$set(le),K[2]?D?(D.p(K,J),J[0]&4&&A(D,1)):(D=W_(K),D.c(),A(D,1),D.m(e,s)):D&&(ae(),L(D,1,1,()=>{D=null}),ue());const ie={};J[0]&1&&(ie.originalConfig=(ee=K[0].backups)==null?void 0:ee.s3),!a&&J[0]&2&&(a=!0,ie.config=K[1].backups.s3,he(()=>a=!1)),!u&&J[0]&128&&(u=!0,ie.isTesting=K[7],he(()=>u=!1)),!f&&J[0]&256&&(f=!0,ie.testError=K[8],he(()=>f=!1)),r.$set(ie),(Pe=(Te=K[1].backups)==null?void 0:Te.s3)!=null&&Pe.enabled&&!K[9]&&!K[5]?N?N.p(K,J):(N=Y_(K),N.c(),N.m(d,h)):N&&(N.d(1),N=null),K[9]?q?q.p(K,J):(q=K_(K),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!T||J[0]&544&&$!==($=!K[9]||K[5]))&&(y.disabled=$),(!T||J[0]&32)&&Q(y,"btn-loading",K[5])},i(K){T||(A(t.$$.fragment,K),A(D),A(r.$$.fragment,K),K&&Ge(()=>{T&&(C||(C=qe(e,st,{duration:150},!0)),C.run(1))}),T=!0)},o(K){L(t.$$.fragment,K),L(D),L(r.$$.fragment,K),K&&(C||(C=qe(e,st,{duration:150},!1)),C.run(0)),T=!1},d(K){K&&k(e),H(t),D&&D.d(),H(r),N&&N.d(),q&&q.d(),K&&C&&C.end(),M=!1,Oe(O)}}}function e8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[32]),e.required=!0,p(s,"for",o=n[32])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[18]),r=!0)},p(u,f){f[1]&2&&t!==(t=u[32])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&2&&o!==(o=u[32])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function W_(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[n8,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[i8,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(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(f,c){w(f,e,c),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&6&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&2|c[1]&6&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{u&&(a||(a=qe(e,st,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(e,st,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function t8(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=E(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=E(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=E(),r=v("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(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[20]),Y(i,"click",n[21]),Y(l,"click",n[22]),Y(r,"click",n[23])],a=!0)},p:x,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,Oe(u)}}}function n8(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C;return h=new Yn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[t8]},$$scope:{ctx:n}}}),{c(){var T,M;e=v("label"),t=U("Cron expression"),s=E(),l=v("input"),a=E(),u=v("div"),f=v("button"),c=v("span"),c.textContent="Presets",d=E(),m=v("i"),_=E(),B(h.$$.fragment),g=E(),y=v("div"),y.innerHTML=`

    Supports numeric list, steps and ranges. The timezone is in - UTC.

    `,p(e,"for",i=n[32]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[32]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((M=(T=n[0])==null?void 0:T.backups)!=null&&M.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(y,"class","help-block")},m(T,M){var O,D;w(T,e,M),b(e,t),w(T,s,M),w(T,l,M),re(l,n[1].backups.cron),w(T,a,M),w(T,u,M),b(u,f),b(f,c),b(f,d),b(f,m),b(f,_),V(h,f,null),w(T,g,M),w(T,y,M),S=!0,(D=(O=n[0])==null?void 0:O.backups)!=null&&D.cron||l.focus(),$||(C=Y(l,"input",n[19]),$=!0)},p(T,M){var D,I;(!S||M[1]&2&&i!==(i=T[32]))&&p(e,"for",i),(!S||M[1]&2&&o!==(o=T[32]))&&p(l,"id",o),(!S||M[0]&1&&r!==(r=!((I=(D=T[0])==null?void 0:D.backups)!=null&&I.cron)))&&(l.autofocus=r),M[0]&2&&l.value!==T[1].backups.cron&&re(l,T[1].backups.cron);const O={};M[0]&2|M[1]&4&&(O.$$scope={dirty:M,ctx:T}),h.$set(O)},i(T){S||(A(h.$$.fragment,T),S=!0)},o(T){L(h.$$.fragment,T),S=!1},d(T){T&&k(e),T&&k(s),T&&k(l),T&&k(a),T&&k(u),H(h),T&&k(g),T&&k(y),$=!1,C()}}}function i8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[32]),p(l,"type","number"),p(l,"id",o=n[32]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"input",n[24]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&p(e,"for",i),f[1]&2&&o!==(o=u[32])&&p(l,"id",o),f[0]&2&&pt(l.value)!==u[1].backups.cronMaxKeep&&re(l,u[1].backups.cronMaxKeep)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Y_(n){let e;function t(l,o){return l[7]?o8:l[8]?l8:s8}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function s8(n){let e;return{c(){e=v("div"),e.innerHTML=` - S3 connected successfully`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function l8(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=` - Failed to establish S3 connection`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=$e(t=ze.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function o8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function K_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("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),b(e,t),s||(l=Y(e,"click",n[28]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function r8(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I;m=new Ko({props:{class:"btn-sm",tooltip:"Reload backups list"}}),m.$on("refresh",n[15]);let P={};h=new XI({props:P}),n[16](h);function F(j,Z){return j[6]?xI:QI}let R=F(n),N=R(n),q=n[6]&&!n[4]&&U_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),B(m.$$.fragment),_=E(),B(h.$$.fragment),g=E(),y=v("hr"),S=E(),$=v("button"),C=v("span"),C.textContent="Backups options",T=E(),N.c(),M=E(),q&&q.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-5"),p(C,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(j,Z){w(j,e,Z),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(j,r,Z),w(j,a,Z),b(a,u),b(u,f),b(f,c),b(f,d),V(m,f,null),b(u,_),V(h,u,null),b(u,g),b(u,y),b(u,S),b(u,$),b($,C),b($,T),N.m($,null),b(u,M),q&&q.m(u,null),O=!0,D||(I=[Y($,"click",n[17]),Y(u,"submit",Qe(n[11]))],D=!0)},p(j,Z){(!O||Z[0]&1024)&&se(o,j[10]);const X={};h.$set(X),R!==(R=F(j))&&(N.d(1),N=R(j),N&&(N.c(),N.m($,null))),(!O||Z[0]&16)&&($.disabled=j[4]),(!O||Z[0]&16)&&Q($,"btn-loading",j[4]),j[6]&&!j[4]?q?(q.p(j,Z),Z[0]&80&&A(q,1)):(q=U_(j),q.c(),A(q,1),q.m(u,null)):q&&(ae(),L(q,1,1,()=>{q=null}),ue())},i(j){O||(A(m.$$.fragment,j),A(h.$$.fragment,j),A(q),O=!0)},o(j){L(m.$$.fragment,j),L(h.$$.fragment,j),L(q),O=!1},d(j){j&&k(e),j&&k(r),j&&k(a),H(m),n[16](null),H(h),N.d(),q&&q.d(),D=!1,Oe(I)}}}function a8(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[r8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&4&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function u8(n,e,t){let i,s;Ke(n,Dt,J=>t(10,s=J)),ln(Dt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,_=null;h();async function h(){t(4,a=!0);try{const J=await fe.settings.getAll()||{};y(J)}catch(J){fe.error(J)}t(4,a=!1)}async function g(){if(!(u||!i)){t(5,u=!0);try{const J=await fe.settings.update(z.filterRedactedProps(r));await $(),y(J),Ht("Successfully saved application settings.")}catch(J){fe.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.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 $(){await(l==null?void 0:l.loadBackups())}const C=()=>$();function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const M=()=>t(6,d=!d);function O(){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)},P=()=>{t(1,r.backups.cron="0 0 * * 0",r)},F=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},R=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=pt(this.value),t(1,r),t(2,c)}function q(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function j(J){m=J,t(7,m)}function Z(J){_=J,t(8,_)}const X=()=>S(),K=()=>g();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(ai("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,m,_,i,s,g,S,$,f,C,T,M,O,D,I,P,F,R,N,q,j,Z,X,K]}class f8 extends ve{constructor(e){super(),be(this,e,u8,a8,me,{},null,[-1,-1])}}const Vt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?qi("/"):!0}],c8={"/login":Lt({component:bD,conditions:Vt.concat([n=>!fe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Lt({asyncComponent:()=>at(()=>import("./PageAdminRequestPasswordReset-4a4bbc63.js"),[],import.meta.url),conditions:Vt.concat([n=>!fe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Lt({asyncComponent:()=>at(()=>import("./PageAdminConfirmPasswordReset-2ba29ad7.js"),[],import.meta.url),conditions:Vt.concat([n=>!fe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Lt({component:HE,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Lt({component:F4,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Lt({component:OD,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Lt({component:dD,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Lt({component:dA,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Lt({component:LA,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Lt({component:GA,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Lt({component:lI,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Lt({component:cI,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Lt({component:DI,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Lt({component:f8,conditions:Vt.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmPasswordReset-c41f6637.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmPasswordReset-c41f6637.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmVerification-2bcbd7e4.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmVerification-2bcbd7e4.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmEmailChange-e64c535f.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmEmailChange-e64c535f.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Lt({asyncComponent:()=>at(()=>import("./PageOAuth2Redirect-a1b27cdd.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"*":Lt({component:nk,userData:{showAppSidebar:!1}})};function d8(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Wo}=i;return{delay:f,duration:jt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,_)=>{const h=_*a,g=_*u,y=m+_*e.width/t.width,S=m+_*e.height/t.height;return`transform: ${l} translate(${h}px, ${g}px) scale(${y}, ${S});`}}}function J_(n,e,t){const i=n.slice();return i[2]=e[t],i}function p8(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function m8(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function h8(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _8(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Z_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m,_=x,h,g,y;function S(M,O){return M[2].type==="info"?_8:M[2].type==="success"?h8:M[2].type==="warning"?m8:p8}let $=S(e),C=$(e);function T(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),C.c(),s=E(),l=v("div"),r=U(o),a=E(),u=v("button"),u.innerHTML='',f=E(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,O){w(M,t,O),b(t,i),C.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),h=!0,g||(y=Y(u,"click",Qe(T)),g=!0)},p(M,O){e=M,$!==($=S(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(i,null))),(!h||O&1)&&o!==(o=e[2].message+"")&&se(r,o),(!h||O&1)&&Q(t,"alert-info",e[2].type=="info"),(!h||O&1)&&Q(t,"alert-success",e[2].type=="success"),(!h||O&1)&&Q(t,"alert-danger",e[2].type=="error"),(!h||O&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){G1(t),_(),sg(t,m)},a(){_(),_=Z1(t,m,d8,{duration:150})},i(M){h||(Ge(()=>{h&&(d&&d.end(1),c=rg(t,st,{duration:150}),c.start())}),h=!0)},o(M){c&&c.invalidate(),d=ya(t,Xr,{duration:150}),h=!1},d(M){M&&k(t),C.d(),M&&d&&d.end(),g=!1,y()}}}function g8(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>hb(l)]}class v8 extends ve{constructor(e){super(),be(this,e,b8,g8,me,{})}}function y8(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=U(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),b(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&se(i,t)},d(l){l&&k(e)}}}function k8(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=E(),s=v("button"),l=v("span"),l.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(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Oe(r)}}}function w8(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:[k8],header:[y8]},$$scope:{ctx:n}};return e=new on({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function S8(n,e,t){let i;Ke(n,lu,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await cn(),t(3,o=!1),v1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class C8 extends ve{constructor(e){super(),be(this,e,S8,w8,me,{})}}function G_(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S;return h=new Yn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[$8]},$$scope:{ctx:n}}}),{c(){var $;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=E(),s=v("nav"),l=v("a"),l.innerHTML='',o=E(),r=v("a"),r.innerHTML='',a=E(),u=v("a"),u.innerHTML='',f=E(),c=v("figure"),d=v("img"),_=E(),B(h.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),gn(d.src,m="./images/avatars/avatar"+((($=n[0])==null?void 0:$.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($,C){w($,e,C),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,_),V(h,c,null),g=!0,y||(S=[$e(rn.call(null,t)),$e(rn.call(null,l)),$e(jn.call(null,l,{path:"/collections/?.*",className:"current-route"})),$e(ze.call(null,l,{text:"Collections",position:"right"})),$e(rn.call(null,r)),$e(jn.call(null,r,{path:"/logs/?.*",className:"current-route"})),$e(ze.call(null,r,{text:"Logs",position:"right"})),$e(rn.call(null,u)),$e(jn.call(null,u,{path:"/settings/?.*",className:"current-route"})),$e(ze.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p($,C){var M;(!g||C&1&&!gn(d.src,m="./images/avatars/avatar"+(((M=$[0])==null?void 0:M.avatar)||0)+".svg"))&&p(d,"src",m);const T={};C&4096&&(T.$$scope={dirty:C,ctx:$}),h.$set(T)},i($){g||(A(h.$$.fragment,$),g=!0)},o($){L(h.$$.fragment,$),g=!1},d($){$&&k(e),H(h),y=!1,Oe(S)}}}function $8(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=` - Manage admins`,t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=` - Logout`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[$e(rn.call(null,e)),Y(l,"click",n[7])],o=!0)},p:x,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Oe(r)}}}function X_(n){let e,t,i;return t=new fu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:z.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function T8(n){var g;let e,t,i,s,l,o,r,a,u,f,c,d,m;document.title=e=z.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((g=n[0])==null?void 0:g.id)&&n[1]&&G_(n);o=new u0({props:{routes:c8}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new v8({}),f=new C8({});let h=n[1]&&!n[2]&&X_(n);return{c(){t=E(),i=v("div"),_&&_.c(),s=E(),l=v("div"),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),B(f.$$.fragment),c=E(),h&&h.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),_&&_.m(i,null),b(i,s),b(i,l),V(o,l,null),b(l,r),V(a,l,null),w(y,u,S),V(f,y,S),w(y,c,S),h&&h.m(y,S),w(y,d,S),m=!0},p(y,[S]){var $;(!m||S&24)&&e!==(e=z.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),($=y[0])!=null&&$.id&&y[1]?_?(_.p(y,S),S&3&&A(_,1)):(_=G_(y),_.c(),A(_,1),_.m(i,s)):_&&(ae(),L(_,1,1,()=>{_=null}),ue()),y[1]&&!y[2]?h?(h.p(y,S),S&6&&A(h,1)):(h=X_(y),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(ae(),L(h,1,1,()=>{h=null}),ue())},i(y){m||(A(_),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(h),m=!0)},o(y){L(_),L(o.$$.fragment,y),L(a.$$.fragment,y),L(f.$$.fragment,y),L(h),m=!1},d(y){y&&k(t),y&&k(i),_&&_.d(),H(o),H(a),y&&k(u),H(f,y),y&&k(c),h&&h.d(y),y&&k(d)}}}function M8(n,e,t){let i,s,l,o;Ke(n,Ms,h=>t(10,i=h)),Ke(n,ko,h=>t(3,s=h)),Ke(n,Pa,h=>t(0,l=h)),Ke(n,Dt,h=>t(4,o=h));let r,a=!1,u=!1;function f(h){var g,y,S,$;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=h==null?void 0:h.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=($=h==null?void 0:h.detail)==null?void 0:$.location,ln(Dt,o="",o),tn({}),v1())}function c(){qi("/")}async function d(){var h,g;if(l!=null&&l.id)try{const y=await fe.settings.getAll({$cancelKey:"initialAppSettings"});ln(ko,s=((h=y==null?void 0:y.meta)==null?void 0:h.appName)||"",s),ln(Ms,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(){fe.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,m,_]}class O8 extends ve{constructor(e){super(),be(this,e,M8,T8,me,{})}}new O8({target:document.getElementById("app")});export{Oe as A,Ht as B,z as C,qi as D,ye as E,gb as F,mg as G,Xt as H,Ke as I,fi as J,Tt as K,te as L,g1 as M,bt as N,jo as O,ls as P,Ut as Q,ht as R,ve as S,qr as T,L as a,E as b,B as c,H as d,v as e,p as f,w as g,b as h,be as i,$e as j,ae as k,rn as l,V as m,ue as n,k as o,fe as p,de as q,Q as r,me as s,A as t,Y as u,Qe as v,U as w,se as x,x as y,re as z}; diff --git a/ui/dist/assets/index-352a0704.js b/ui/dist/assets/index-352a0704.js new file mode 100644 index 00000000..aacce620 --- /dev/null +++ b/ui/dist/assets/index-352a0704.js @@ -0,0 +1,231 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const bl=n=>n;function Re(n,e){for(const t in e)n[t]=e[t];return n}function D1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Y_(n){return n()}function af(){return Object.create(null)}function Ee(n){n.forEach(Y_)}function jt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Il;function hn(n,e){return Il||(Il=document.createElement("a")),Il.href=e,n===Il.href}function A1(n){return Object.keys(n).length===0}function ca(n,...e){if(n==null)return x;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function I1(n){let e;return ca(n,t=>e=t)(),e}function Ke(n,e,t){n.$$.on_destroy.push(ca(e,t))}function wt(n,e,t,i){if(n){const s=K_(n,e,t,i);return n[0](s)}}function K_(n,e,t,i){return n[1]&&i?Re(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),da=J_?n=>requestAnimationFrame(n):x;const gs=new Set;function Z_(n){gs.forEach(e=>{e.c(n)||(gs.delete(e),e.f())}),gs.size!==0&&da(Z_)}function Po(n){let e;return gs.size===0&&da(Z_),{promise:new Promise(t=>{gs.add(e={c:n,f:t})}),abort(){gs.delete(e)}}}function g(n,e){n.appendChild(e)}function G_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function L1(n){const e=v("style");return P1(G_(n),e),e.sheet}function P1(n,e){return g(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Qe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function On(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 F1=["width","height"];function ri(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&&F1.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function N1(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 pt(n){return n===""?null:+n}function R1(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function Nr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function X_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Rt(n,e){return new n(e)}const uo=new Map;let co=0;function q1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function j1(n,e){const t={stylesheet:L1(e),rules:{}};return uo.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let f=`{ +`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);f+=b*100+`%{${o(y,1-y)}} +`}const u=f+`100% {${o(t,1-t)}} +}`,c=`__svelte_${q1(u)}_${r}`,d=G_(n),{stylesheet:m,rules:_}=uo.get(d)||j1(d,n);_[c]||(_[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${s}ms 1 both`,co+=1,c}function al(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),co-=s,co||V1())}function V1(){da(()=>{co||(uo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),uo.clear())})}function z1(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=bl,start:a=Lo()+l,end:f=a+o,tick:u=x,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,_;function h(){c&&(_=rl(n,0,1,o,l,r,c)),l||(m=!0)}function b(){c&&al(n,_),d=!1}return Po(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),b()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),h(),u(0,1),b}function H1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Q_(n,s)}}function Q_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fl;function gi(n){fl=n}function vl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Xt(n){vl().$$.on_mount.push(n)}function B1(n){vl().$$.after_update.push(n)}function Fo(n){vl().$$.on_destroy.push(n)}function $t(){const n=vl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=X_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],te=[];let bs=[];const Rr=[],x_=Promise.resolve();let qr=!1;function eg(){qr||(qr=!0,x_.then(pa))}function fn(){return eg(),x_}function Ge(n){bs.push(n)}function he(n){Rr.push(n)}const er=new Set;let us=0;function pa(){if(us!==0)return;const n=fl;do{try{for(;us<_s.length;){const e=_s[us];us++,gi(e),U1(e.$$)}}catch(e){throw _s.length=0,us=0,e}for(gi(null),_s.length=0,us=0;te.length;)te.pop()();for(let e=0;en.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),bs=e}let Rs;function ma(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Qi(n,e,t){n.dispatchEvent(X_(`${e?"intro":"outro"}${t}`))}const to=new Set;let si;function ae(){si={r:0,c:[],p:si}}function fe(){si.r||Ee(si.c),si=si.p}function A(n,e){n&&n.i&&(to.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(to.has(n))return;to.add(n),si.c.push(()=>{to.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ha={duration:0};function tg(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function f(){o&&al(n,o)}function u(){const{delay:d=0,duration:m=300,easing:_=bl,tick:h=x,css:b}=s||ha;b&&(o=rl(n,0,1,m,d,_,b,a++)),h(0,1);const y=Lo()+d,S=y+m;r&&r.abort(),l=!0,Ge(()=>Qi(n,!0,"start")),r=Po(T=>{if(l){if(T>=S)return h(1,0),Qi(n,!0,"end"),f(),l=!1;if(T>=y){const C=_((T-y)/m);h(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),jt(s)?(s=s(i),ma().then(u)):u())},invalidate(){c=!1},end(){l&&(f(),l=!1)}}}function _a(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=si;r.r+=1;function a(){const{delay:f=0,duration:u=300,easing:c=bl,tick:d=x,css:m}=s||ha;m&&(o=rl(n,1,0,u,f,c,m));const _=Lo()+f,h=_+u;Ge(()=>Qi(n,!1,"start")),Po(b=>{if(l){if(b>=h)return d(0,1),Qi(n,!1,"end"),--r.r||Ee(r.c),!1;if(b>=_){const y=c((b-_)/u);d(1-y,y)}}return l})}return jt(s)?ma().then(()=>{s=s(i),a()}):a(),{end(f){f&&s.tick&&s.tick(1,0),l&&(o&&al(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,f=null;function u(){f&&al(n,f)}function c(m,_){const h=m.b-o;return _*=Math.abs(h),{a:o,b:m.b,d:h,duration:_,start:m.start,end:m.start+_,group:m.group}}function d(m){const{delay:_=0,duration:h=300,easing:b=bl,tick:y=x,css:S}=l||ha,T={start:Lo()+_,b:m};m||(T.group=si,si.r+=1),r||a?a=T:(S&&(u(),f=rl(n,o,m,h,_,b,S)),m&&y(0,1),r=c(T,h),Ge(()=>Qi(n,m,"start")),Po(C=>{if(a&&C>a.start&&(r=c(a,h),a=null,Qi(n,r.b,"start"),S&&(u(),f=rl(n,o,r.b,r.duration,0,b,l.css))),r){if(C>=r.end)y(o=r.b,1-o),Qi(n,r.b,"end"),a||(r.b?u():--r.group.r||Ee(r.group.c)),r=null;else if(C>=r.start){const $=C-r.start;o=r.a+r.d*b($/r.duration),y(o,1-o)}}return!!(r||a)}))}return{run(m){jt(l)?ma().then(()=>{l=l(s),d(m)}):d(m)},end(){u(),r=a=null}}}function uf(n,e){const t=e.token={};function i(s,l,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=s&&(e.current=s)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(ae(),L(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),fe())}):e.block.d(1),f.c(),A(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[l]=f),u&&pa()}if(D1(n)){const s=vl();if(n.then(l=>{gi(s),i(e.then,1,e.value,l),gi(null)},l=>{if(gi(s),i(e.catch,2,e.error,l),gi(null),!e.hasCatch)throw l}),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 Y1(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ss(n,e){n.d(1),e.delete(n.key)}function Ut(n,e){L(n,1,1,()=>{e.delete(n.key)})}function K1(n,e){n.f(),Ut(n,e)}function bt(n,e,t,i,s,l,o,r,a,f,u,c){let d=n.length,m=l.length,_=d;const h={};for(;_--;)h[n[_].key]=_;const b=[],y=new Map,S=new Map,T=[];for(_=m;_--;){const E=c(s,l,_),D=t(E);let I=o.get(D);I?i&&T.push(()=>I.p(E,e)):(I=f(D,E),I.c()),y.set(D,b[_]=I),D in h&&S.set(D,Math.abs(_-h[D]))}const C=new Set,$=new Set;function M(E){A(E,1),E.m(r,u),o.set(E.key,E),u=E.first,m--}for(;d&&m;){const E=b[m-1],D=n[d-1],I=E.key,P=D.key;E===D?(u=E.first,d--,m--):y.has(P)?!o.has(I)||C.has(I)?M(E):$.has(P)?d--:S.get(I)>S.get(P)?($.add(I),M(E)):(C.add(P),d--):(a(D,o),d--)}for(;d--;){const E=n[d];y.has(E.key)||a(E,o)}for(;m;)M(b[m-1]);return Ee(T),b}function At(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Qt(n){return typeof n=="object"&&n!==null?n:{}}function ce(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||Ge(()=>{const o=n.$$.on_mount.map(Y_).filter(jt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Ee(o),n.$$.on_mount=[]}),l.forEach(Ge)}function H(n,e){const t=n.$$;t.fragment!==null&&(W1(t.after_update),Ee(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function J1(n,e){n.$$.dirty[0]===-1&&(_s.push(n),eg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const _=m.length?m[0]:d;return f.ctx&&s(f.ctx[c],f.ctx[c]=_)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](_),u&&J1(n,c)),d}):[],f.update(),u=!0,Ee(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=R1(e.target);f.fragment&&f.fragment.l(c),c.forEach(k)}else f.fragment&&f.fragment.c();e.intro&&A(n.$$.fragment),z(n,e.target,e.anchor,e.customElement),pa()}gi(a)}class ve{$destroy(){H(this,1),this.$destroy=x}$on(e,t){if(!jt(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!A1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Lt(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;t{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function ig(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return ng(t,o=>{let r=!1;const a=[];let f=0,u=x;const c=()=>{if(f)return;u();const m=e(i?a[0]:a,o);l?o(m):u=jt(m)?m:x},d=s.map((m,_)=>ca(m,h=>{a[_]=h,f&=~(1<<_),r&&c()},()=>{f|=1<<_}));return r=!0,c(),function(){Ee(d),u(),r=!1}})}function sg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function Z1(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let f=0;f{H(u,1)}),fe()}l?(e=Rt(l,o()),e.$on("routeEvent",r[7]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(f)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function G1(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let f=0;f{H(u,1)}),fe()}l?(e=Rt(l,o()),e.$on("routeEvent",r[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(f)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function X1(n){let e,t,i,s;const l=[G1,Z1],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),s=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(ae(),L(o[u],1,1,()=>{o[u]=null}),fe(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function cf(){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 No=ng(null,function(e){e(cf());const t=()=>{e(cf())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ig(No,n=>n.location);const ga=ig(No,n=>n.querystring),df=Dn(void 0);async function Ri(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await fn();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 ln(n,e){if(e=mf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return pf(n,e),{update(t){t=mf(t),pf(n,t)}}}function Q1(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function pf(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||x1(i.currentTarget.getAttribute("href"))})}function mf(n){return n&&typeof n=="string"?{href:n}:n||{}}function x1(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function e0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor($,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!$||typeof $=="string"&&($.length<1||$.charAt(0)!="/"&&$.charAt(0)!="*")||typeof $=="object"&&!($ instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:E,keys:D}=sg($);this.path=$,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=E,this._keys=D}match($){if(s){if(typeof s=="string")if($.startsWith(s))$=$.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=$.match(s);if(I&&I[0])$=$.substr(I[0].length)||"/";else return null}}const M=this._pattern.exec($);if(M===null)return null;if(this._keys===!1)return M;const E={};let D=0;for(;D{r.push(new o($,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,f=null,u={};const c=$t();async function d(C,$){await fn(),c(C,$)}let m=null,_=null;l&&(_=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",_),B1(()=>{Q1(m)}));let h=null,b=null;const y=No.subscribe(async C=>{h=C;let $=0;for(;${df.set(f)});return}t(0,a=null),b=null,df.set(void 0)});Fo(()=>{y(),_&&window.removeEventListener("popstate",_)});function S(C){Fe.call(this,n,C)}function T(C){Fe.call(this,n,C)}return n.$$set=C=>{"routes"in C&&t(3,i=C.routes),"prefix"in C&&t(4,s=C.prefix),"restoreScrollState"in C&&t(5,l=C.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,f,u,i,s,l,S,T]}class t0 extends ve{constructor(e){super(),be(this,e,e0,X1,me,{routes:3,prefix:4,restoreScrollState:5})}}const no=[];let lg;function og(n){const e=n.pattern.test(lg);hf(n,n.className,e),hf(n,n.inactiveClassName,!e)}function hf(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}No.subscribe(n=>{lg=n.location+(n.querystring?"?"+n.querystring:""),no.map(og)});function qn(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"?sg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return no.push(i),og(i),{destroy(){no.splice(no.indexOf(i),1)}}}const n0="modulepreload",i0=function(n,e){return new URL(n,e).href},_f={},at=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=i0(l,i),l in _f)return;_f[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let u=s.length-1;u>=0;u--){const c=s[u];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const f=document.createElement("link");if(f.rel=o?"stylesheet":n0,o||(f.as="script",f.crossOrigin=""),f.href=l,document.head.appendChild(f),o)return new Promise((u,c)=>{f.addEventListener("load",u),f.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};function xt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(f){try{a(i.next(f))}catch(u){l(u)}}function r(f){try{a(i.throw(f))}catch(u){l(u)}}function a(f){f.done?s(f.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(f.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}class Gn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Gn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Gn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)===null||t===void 0?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((l=(s=(i=this.originalError)===null||i===void 0?void 0:i.cause)===null||s===void 0?void 0:s.message)===null||l===void 0)&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return Object.assign({},this)}}const Ll=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||l0;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}rg=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,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const bf="pb_auth";class r0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ag(this.token)}get isAdmin(){return io(this.token).type==="admin"}get isAuthRecord(){return io(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=bf){const i=s0(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(e,t=bf){var i,s;const l={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=io(this.token);o!=null&&o.exp?l.expires=new Date(1e3*o.exp):l.expires=new Date("1970-01-01"),e=Object.assign({},l,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let a=gf(t,JSON.stringify(r),e);const f=typeof Blob<"u"?new Blob([a]).size:a.length;if(r.model&&f>4096){r.model={id:(i=r==null?void 0:r.model)===null||i===void 0?void 0:i.id,email:(s=r==null?void 0:r.model)===null||s===void 0?void 0:s.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(r.model[c]=this.model[c]);a=gf(t,JSON.stringify(r),e)}return a}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 fg extends r0{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===void 0||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 ls{constructor(e){this.client=e}}class a0 extends ls{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}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)}generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class ba extends ls{decode(e){return e}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)}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(s=>{var l;return s.items=((l=s.items)===null||l===void 0?void 0:l.map(o=>this.decode(o)))||[],s})}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 s;if(!(!((s=i==null?void 0:i.items)===null||s===void 0)&&s.length))throw new Gn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}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=[],s=l=>xt(this,void 0,void 0,function*(){return this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i})});return s(1)}}function Tn(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):e=Object.assign(e,t):e}class f0 extends ba{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)===s.id&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l;return i&&((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)===e&&((l=this.client.authStore.model)===null||l===void 0?void 0:l.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})}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=Tn("This form of authWithPassword(email, pass, body?, query?) is depreacted. Consider replacing it with authWithPassword(email, pass, options?).",l,i,s),this.client.send(this.baseCrudPath+"/auth-with-password",l).then(this.authResponse.bind(this))}authRefresh(e,t){let i={method:"POST"};return i=Tn("This form of authRefresh(body?, query?) is depreacted. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Tn("This form of requestPasswordReset(email, body?, query?) is depreacted. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Tn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is depreacted. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}class u0 extends ba{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}subscribeOne(e,t){return xt(this,void 0,void 0,function*(){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t)})}subscribe(e,t){return xt(this,void 0,void 0,function*(){if(typeof e=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),this.client.realtime.subscribe(this.collectionIdOrName,e);if(!t)throw new Error("Missing subscription callback.");if(e==="")throw new Error("Missing topic.");let i=this.collectionIdOrName;return e!=="*"&&(i+="/"+e),this.client.realtime.subscribe(i,t)})}unsubscribe(e){return xt(this,void 0,void 0,function*(){return e==="*"?this.client.realtime.unsubscribe(this.collectionIdOrName):e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)})}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)===null||r===void 0?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)!==e||((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)===null||o===void 0?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})}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:[]}))}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=Tn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is depreacted. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/auth-with-password",l).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:s,createData:l}};return a=Tn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is depreacted. 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))}authWithOAuth2(...e){return xt(this,void 0,void 0,function*(){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=(yield this.listAuthMethods()).authProviders.find(l=>l.name===t.provider);if(!i)throw new Gn(new Error(`Missing or invalid provider "${t.provider}".`));const s=this.client.buildUrl("/api/oauth2-redirect");return new Promise((l,o)=>xt(this,void 0,void 0,function*(){var r;try{const a=yield this.client.realtime.subscribe("@oauth2",c=>xt(this,void 0,void 0,function*(){const d=this.client.realtime.clientId;try{if(a(),!c.state||d!==c.state)throw new Error("State parameters don't match.");const m=Object.assign({},t);delete m.provider,delete m.scopes,delete m.createData,delete m.urlCallback;const _=yield this.authWithOAuth2Code(i.name,c.code,i.codeVerifier,s,t.createData,m);l(_)}catch(m){o(new Gn(m))}})),f={state:this.client.realtime.clientId};!((r=t.scopes)===null||r===void 0)&&r.length&&(f.scope=t.scopes.join(" "));const u=this._replaceQueryParams(i.authUrl+s,f);yield t.urlCallback?t.urlCallback(u):this._defaultUrlCallback(u)}catch(a){o(new Gn(a))}}))})}authRefresh(e,t){let i={method:"POST"};return i=Tn("This form of authRefresh(body?, query?) is depreacted. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Tn("This form of requestPasswordReset(email, body?, query?) is depreacted. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Tn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is depreacted. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=Tn("This form of requestVerification(email, body?, query?) is depreacted. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=Tn("This form of confirmVerification(token, body?, query?) is depreacted. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>!0)}requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=Tn("This form of requestEmailChange(newEmail, body?, query?) is depreacted. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=Tn("This form of confirmEmailChange(token, password, body?, query?) is depreacted. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}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,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}_defaultUrlCallback(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,i=768,s=window.innerWidth,l=window.innerHeight;t=t>s?s:t,i=i>l?l:i;let o=s/2-t/2,r=l/2-i/2;window.open(e,"oauth2-popup","width="+t+",height="+i+",top="+r+",left="+o+",resizable,menubar=no")}}class c0 extends ba{get baseCrudPath(){return"/api/collections"}import(e,t=!1,i){return xt(this,void 0,void 0,function*(){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)})}}class d0 extends ls{getRequestsList(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/requests",i)}getRequest(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/requests/"+encodeURIComponent(e),t)}getRequestsStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/requests/stats",e)}}class p0 extends ls{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentTopics=[],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}subscribe(e,t){var i;return xt(this,void 0,void 0,function*(){if(!e)throw new Error("topic must be set.");const s=function(l){const o=l;let r;try{r=JSON.parse(o==null?void 0:o.data)}catch{}t(r||{})};return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e].push(s),this.isConnected?this.subscriptions[e].length===1?yield this.submitSubscriptions():(i=this.eventSource)===null||i===void 0||i.addEventListener(e,s):yield this.connect(),()=>xt(this,void 0,void 0,function*(){return this.unsubscribeByTopicAndListener(e,s)})})}unsubscribe(e){var t;return xt(this,void 0,void 0,function*(){if(this.hasSubscriptionListeners(e)){if(e){for(let i of this.subscriptions[e])(t=this.eventSource)===null||t===void 0||t.removeEventListener(e,i);delete this.subscriptions[e]}else this.subscriptions={};this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect()}})}unsubscribeByPrefix(e){var t;return xt(this,void 0,void 0,function*(){let i=!1;for(let s in this.subscriptions)if(s.startsWith(e)){i=!0;for(let l of this.subscriptions[s])(t=this.eventSource)===null||t===void 0||t.removeEventListener(s,l);delete this.subscriptions[s]}i&&(this.hasSubscriptionListeners()?yield this.submitSubscriptions():this.disconnect())})}unsubscribeByTopicAndListener(e,t){var i;return xt(this,void 0,void 0,function*(){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)return;let s=!1;for(let l=this.subscriptions[e].length-1;l>=0;l--)this.subscriptions[e][l]===t&&(s=!0,delete this.subscriptions[e][l],this.subscriptions[e].splice(l,1),(i=this.eventSource)===null||i===void 0||i.removeEventListener(e,t));s&&(this.subscriptions[e].length||delete this.subscriptions[e],this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect())})}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!(!((t=this.subscriptions[e])===null||t===void 0)&&t.length);for(let s in this.subscriptions)if(!((i=this.subscriptions[s])===null||i===void 0)&&i.length)return!0;return!1}submitSubscriptions(){return xt(this,void 0,void 0,function*(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},query:{requestKey:this.getSubscriptionsCancelKey()}}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getNonEmptySubscriptionTopics(){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)}connect(){return xt(this,void 0,void 0,function*(){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(()=>xt(this,void 0,void 0,function*(){let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,yield this.submitSubscriptions()})).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionTopics();if(e.length!=this.lastSentTopics.length)return!0;for(const t of e)if(!this.lastSentTopics.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 Gn(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===void 0||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class m0 extends ls{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class h0 extends ls{getUrl(e,t,i={}){const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildUrl(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}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 _0 extends ls{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}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)}`)}}const g0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];class Ro{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new fg,this.admins=new f0(this),this.collections=new c0(this),this.files=new h0(this),this.logs=new d0(this),this.settings=new a0(this),this.realtime=new p0(this),this.health=new m0(this),this.backups=new _0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new u0(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}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var t;let i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i}send(e,t){return xt(this,void 0,void 0,function*(){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(t.query!==void 0){const s=this.serializeQueryParams(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}if(this.beforeSend){const s=Object.assign({},yield this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}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(s=>xt(this,void 0,void 0,function*(){let l={};try{l=yield s.json()}catch{}if(this.afterSend&&(l=yield this.afterSend(s,l)),s.status>=400)throw new Gn({url:s.url,status:s.status,data:l});return l})).catch(s=>{throw new Gn(s)})})}initSendOptions(e,t){(t=Object.assign({method:"GET"},t)).query=t.query||{},t.body=this.convertToFormDataIfNeeded(t.body);for(let i in t)g0.includes(i)||(t.query[i]=t[i],delete t[i]);if(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;this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.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)t.append(i,e[i]);return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let s of i)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s 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 s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(const o of s)t.push(l+"="+encodeURIComponent(o));else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")}}class os extends Error{}class b0 extends os{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class v0 extends os{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class y0 extends os{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Zs extends os{}class ug extends os{constructor(e){super(`Invalid unit ${e}`)}}class Vn extends os{}class $i extends os{constructor(){super("Zone is an abstract class")}}const De="numeric",xn="short",En="long",jr={year:De,month:De,day:De},cg={year:De,month:xn,day:De},k0={year:De,month:xn,day:De,weekday:xn},dg={year:De,month:En,day:De},pg={year:De,month:En,day:De,weekday:En},mg={hour:De,minute:De},hg={hour:De,minute:De,second:De},_g={hour:De,minute:De,second:De,timeZoneName:xn},gg={hour:De,minute:De,second:De,timeZoneName:En},bg={hour:De,minute:De,hourCycle:"h23"},vg={hour:De,minute:De,second:De,hourCycle:"h23"},yg={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:xn},kg={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:En},wg={year:De,month:De,day:De,hour:De,minute:De},Sg={year:De,month:De,day:De,hour:De,minute:De,second:De},Cg={year:De,month:xn,day:De,hour:De,minute:De},Tg={year:De,month:xn,day:De,hour:De,minute:De,second:De},w0={year:De,month:xn,day:De,weekday:xn,hour:De,minute:De},$g={year:De,month:En,day:De,hour:De,minute:De,timeZoneName:xn},Mg={year:De,month:En,day:De,hour:De,minute:De,second:De,timeZoneName:xn},Eg={year:De,month:En,day:De,weekday:En,hour:De,minute:De,timeZoneName:En},Og={year:De,month:En,day:De,weekday:En,hour:De,minute:De,second:De,timeZoneName:En};function tt(n){return typeof n>"u"}function xi(n){return typeof n=="number"}function qo(n){return typeof n=="number"&&n%1===0}function S0(n){return typeof n=="string"}function C0(n){return Object.prototype.toString.call(n)==="[object Date]"}function Dg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function T0(n){return Array.isArray(n)?n:[n]}function vf(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function $0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Cs(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function bi(n,e,t){return qo(n)&&n>=e&&n<=t}function M0(n,e){return n-e*Math.floor(n/e)}function Yt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ei(n){if(!(tt(n)||n===null||n===""))return parseInt(n,10)}function zi(n){if(!(tt(n)||n===null||n===""))return parseFloat(n)}function va(n){if(!(tt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ya(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function yl(n){return n%4===0&&(n%100!==0||n%400===0)}function xs(n){return yl(n)?366:365}function po(n,e){const t=M0(e-1,12)+1,i=n+(e-t)/12;return t===2?yl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ka(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(e.getUTCFullYear()-1900)),+e}function mo(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Vr(n){return n>99?n:n>60?1900+n:2e3+n}function Ag(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function jo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function Ig(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Vn(`Invalid unit value ${n}`);return e}function ho(n,e){const t={};for(const i in n)if(Cs(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Ig(s)}return t}function el(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Yt(t,2)}:${Yt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Yt(t,2)}${Yt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return $0(n,["hour","minute","second","millisecond"])}const Lg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,E0=["January","February","March","April","May","June","July","August","September","October","November","December"],Pg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],O0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Fg(n){switch(n){case"narrow":return[...O0];case"short":return[...Pg];case"long":return[...E0];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 Ng=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Rg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],D0=["M","T","W","T","F","S","S"];function qg(n){switch(n){case"narrow":return[...D0];case"short":return[...Rg];case"long":return[...Ng];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const jg=["AM","PM"],A0=["Before Christ","Anno Domini"],I0=["BC","AD"],L0=["B","A"];function Vg(n){switch(n){case"narrow":return[...L0];case"short":return[...I0];case"long":return[...A0];default:return null}}function P0(n){return jg[n.hour<12?0:1]}function F0(n,e){return qg(e)[n.weekday-1]}function N0(n,e){return Fg(e)[n.month-1]}function R0(n,e){return Vg(e)[n.year<0?0:1]}function q0(n,e,t="always",i=!1){const s={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."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=s[n],u=i?a?f[1]:f[2]||f[1]:a?s[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function yf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const j0={D:jr,DD:cg,DDD:dg,DDDD:pg,t:mg,tt:hg,ttt:_g,tttt:gg,T:bg,TT:vg,TTT:yg,TTTT:kg,f:wg,ff:Cg,fff:$g,ffff:Eg,F:Sg,FF:Tg,FFF:Mg,FFFF:Og};class yn{static create(e,t={}){return new yn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return j0[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()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Yt(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",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,_)=>this.loc.extract(e,m,_),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?P0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,_)=>i?N0(e,m):l(_?{month:m}:{month:m,day:"numeric"},"month"),f=(m,_)=>i?F0(e,m):l(_?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const _=yn.macroTokenToFormatOpts(m);return _?this.formatWithSystemDefault(e,_):m},c=m=>i?R0(e,m):l({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 s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({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 s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({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 s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({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 s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({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"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 yf(yn.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}},s=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},l=yn.parseFormat(t),o=l.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return yf(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class kl{get type(){throw new $i}get name(){throw new $i}get ianaName(){return this.name}get isUniversal(){throw new $i}offsetName(e,t){throw new $i}formatOffset(e,t){throw new $i}offset(e){throw new $i}equals(e){throw new $i}get isValid(){throw new $i}}let tr=null;class wa extends kl{static get instance(){return tr===null&&(tr=new wa),tr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Ag(e,t,i)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let so={};function V0(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 z0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function H0(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,f,u]=i;return[o,s,l,r,a,f,u]}function B0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?_:1e3+_,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let nr=null;class mn extends kl{static get utcInstance(){return nr===null&&(nr=new mn(0)),nr}static instance(e){return e===0?mn.utcInstance:new mn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new mn(jo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${el(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${el(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return el(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 U0 extends kl{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 Oi(n,e){if(tt(n)||n===null)return e;if(n instanceof kl)return n;if(S0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?mn.utcInstance:mn.parseSpecifier(t)||vi.create(n)}else return xi(n)?mn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new U0(n)}let kf=()=>Date.now(),wf="system",Sf=null,Cf=null,Tf=null,$f;class Zt{static get now(){return kf}static set now(e){kf=e}static set defaultZone(e){wf=e}static get defaultZone(){return Oi(wf,wa.instance)}static get defaultLocale(){return Sf}static set defaultLocale(e){Sf=e}static get defaultNumberingSystem(){return Cf}static set defaultNumberingSystem(e){Cf=e}static get defaultOutputCalendar(){return Tf}static set defaultOutputCalendar(e){Tf=e}static get throwOnInvalid(){return $f}static set throwOnInvalid(e){$f=e}static resetCaches(){It.resetCache(),vi.resetCache()}}let Mf={};function W0(n,e={}){const t=JSON.stringify([n,e]);let i=Mf[t];return i||(i=new Intl.ListFormat(n,e),Mf[t]=i),i}let zr={};function Hr(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Br={};function Y0(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.NumberFormat(n,e),Br[t]=i),i}let Ur={};function K0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Ur[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Ur[s]=l),l}let Gs=null;function J0(){return Gs||(Gs=new Intl.DateTimeFormat().resolvedOptions().locale,Gs)}function Z0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Hr(n).resolvedOptions()}catch{t=Hr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function G0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function X0(n){const e=[];for(let t=1;t<=12;t++){const i=He.utc(2016,t,1);e.push(n(i))}return e}function Q0(n){const e=[];for(let t=1;t<=7;t++){const i=He.utc(2016,11,13+t);e.push(n(i))}return e}function Fl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function x0(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 ev{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Y0(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):ya(e,3);return Yt(t,this.padTo)}}}class tv{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&vi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:He.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Hr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class nv{constructor(e,t,i){this.opts={style:"long",...i},!t&&Dg()&&(this.rtf=K0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):q0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class It{static fromOpts(e){return It.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Zt.defaultLocale,o=l||(s?"en-US":J0()),r=t||Zt.defaultNumberingSystem,a=i||Zt.defaultOutputCalendar;return new It(o,r,a,l)}static resetCache(){Gs=null,zr={},Br={},Ur={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return It.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=Z0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=G0(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=x0(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:It.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Fl(this,e,i,Fg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=X0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Fl(this,e,i,qg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=Q0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Fl(this,void 0,e,()=>jg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[He.utc(2016,11,13,9),He.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Fl(this,e,t,Vg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[He.utc(-40,1,1),He.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new ev(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new tv(e,this.intl,t)}relFormatter(e={}){return new nv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return W0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function As(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Is(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ls(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function zg(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(_||m&&u)?-m:m;return[{years:d(zi(t)),months:d(zi(i)),weeks:d(zi(s)),days:d(zi(l)),hours:d(zi(o)),minutes:d(zi(r)),seconds:d(zi(a),a==="-0"),milliseconds:d(va(f),c)}]}const hv={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 Ta(n,e,t,i,s,l,o){const r={year:e.length===2?Vr(Ei(e)):Ei(e),month:Pg.indexOf(t)+1,day:Ei(i),hour:Ei(s),minute:Ei(l)};return o&&(r.second=Ei(o)),n&&(r.weekday=n.length>3?Ng.indexOf(n)+1:Rg.indexOf(n)+1),r}const _v=/^(?:(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 gv(n){const[,e,t,i,s,l,o,r,a,f,u,c]=n,d=Ta(e,s,i,t,l,o,r);let m;return a?m=hv[a]:f?m=0:m=jo(u,c),[d,new mn(m)]}function bv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const vv=/^(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$/,yv=/^(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$/,kv=/^(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 Ef(n){const[,e,t,i,s,l,o,r]=n;return[Ta(e,s,i,t,l,o,r),mn.utcInstance]}function wv(n){const[,e,t,i,s,l,o,r]=n;return[Ta(e,r,t,i,s,l,o),mn.utcInstance]}const Sv=As(sv,Ca),Cv=As(lv,Ca),Tv=As(ov,Ca),$v=As(Bg),Wg=Is(cv,Ps,wl,Sl),Mv=Is(rv,Ps,wl,Sl),Ev=Is(av,Ps,wl,Sl),Ov=Is(Ps,wl,Sl);function Dv(n){return Ls(n,[Sv,Wg],[Cv,Mv],[Tv,Ev],[$v,Ov])}function Av(n){return Ls(bv(n),[_v,gv])}function Iv(n){return Ls(n,[vv,Ef],[yv,Ef],[kv,wv])}function Lv(n){return Ls(n,[pv,mv])}const Pv=Is(Ps);function Fv(n){return Ls(n,[dv,Pv])}const Nv=As(fv,uv),Rv=As(Ug),qv=Is(Ps,wl,Sl);function jv(n){return Ls(n,[Nv,Wg],[Rv,qv])}const Vv="Invalid Duration",Yg={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}},zv={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},...Yg},Pn=146097/400,ds=146097/4800,Hv={years:{quarters:4,months:12,weeks:Pn/7,days:Pn,hours:Pn*24,minutes:Pn*24*60,seconds:Pn*24*60*60,milliseconds:Pn*24*60*60*1e3},quarters:{months:3,weeks:Pn/28,days:Pn/4,hours:Pn*24/4,minutes:Pn*24*60/4,seconds:Pn*24*60*60/4,milliseconds:Pn*24*60*60*1e3/4},months:{weeks:ds/7,days:ds,hours:ds*24,minutes:ds*24*60,seconds:ds*24*60*60,milliseconds:ds*24*60*60*1e3},...Yg},Ki=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Bv=Ki.slice(0).reverse();function Hi(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};return new ot(i)}function Uv(n){return n<0?Math.floor(n):Math.ceil(n)}function Kg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?Uv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function Wv(n,e){Bv.reduce((t,i)=>tt(e[i])?t:(t&&Kg(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||It.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Hv:zv,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 Vn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:ho(e,ot.normalizeUnit),loc:It.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(xi(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Vn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Lv(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]=Fv(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 Vn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new y0(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 ug(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?yn.create(this.loc,i).formatDurationFromString(this,e):Vv}toHuman(e={}){const t=Ki.map(i=>{const s=this.values[i];return tt(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).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+=ya(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e),i={};for(const s of Ki)(Cs(t.values,s)||Cs(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Hi(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]=Ig(e(this.values[i],i));return Hi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...ho(e,ot.normalizeUnit)};return Hi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Hi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Wv(this.matrix,e),Hi(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={},s=this.toObject();let l;for(const o of Ki)if(e.indexOf(o)>=0){l=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;xi(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const f in s)Ki.indexOf(f)>Ki.indexOf(o)&&Kg(this.matrix,s,f,t,o)}else xi(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Hi(this,{values:t},!0).normalize()}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 Hi(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,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Ki)if(!t(this.values[i],e.values[i]))return!1;return!0}}const qs="Invalid Interval";function Yv(n,e){return!n||!n.isValid?Pt.invalid("missing or invalid start"):!e||!e.isValid?Pt.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?Pt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(zs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Pt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Pt.fromDateTimes(i,l)),i=l,s+=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:Pt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Pt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),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&&s.push(Pt.fromDateTimes(t,a.time)),t=null);return Pt.merge(s)}difference(...e){return Pt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:qs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:qs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:qs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:qs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:qs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Pt.fromDateTimes(e(this.s),e(this.e))}}class Nl{static hasDST(e=Zt.defaultZone){const t=He.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return vi.isValidZone(e)}static normalizeZone(e){return Oi(e,Zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||It.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||It.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||It.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||It.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return It.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return It.create(t,null,"gregory").eras(e)}static features(){return{relative:Dg()}}}function Of(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Kv(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const f=Of(r,a);return(f-f%7)/7}],["days",Of]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let f=a(n,e);o=n.plus({[r]:f}),o>e?(n=n.plus({[r]:f-1}),f-=1):n=o,s[r]=f}return[n,s,o,l]}function Jv(n,e,t,i){let[s,l,o,r]=Kv(n,e,t);const a=e-s,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 $a={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]},Zv=$a.hanidec.replace(/[\[|\]]/g,"").split("");function Gv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Jn({numberingSystem:n},e=""){return new RegExp(`${$a[n||"latn"]}${e}`)}const Xv="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Gv(t))}}const Qv=String.fromCharCode(160),Jg=`[ ${Qv}]`,Zg=new RegExp(Jg,"g");function xv(n){return n.replace(/\./g,"\\.?").replace(Zg,Jg)}function Af(n){return n.replace(/\./g,"").replace(Zg," ").toLowerCase()}function Zn(n,e){return n===null?null:{regex:RegExp(n.map(xv).join("|")),deser:([t])=>n.findIndex(i=>Af(t)===Af(i))+e}}function If(n,e){return{regex:n,deser:([,t,i])=>jo(t,i),groups:e}}function ir(n){return{regex:n,deser:([e])=>e}}function ey(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ty(n,e){const t=Jn(e),i=Jn(e,"{2}"),s=Jn(e,"{3}"),l=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=b=>({regex:RegExp(ey(b.val)),deser:([y])=>y,literal:!0}),h=(b=>{if(n.literal)return m(b);switch(b.val){case"G":return Zn(e.eras("short",!1),0);case"GG":return Zn(e.eras("long",!1),0);case"y":return ft(f);case"yy":return ft(c,Vr);case"yyyy":return ft(l);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Zn(e.months("short",!0,!1),1);case"MMMM":return Zn(e.months("long",!0,!1),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Zn(e.months("short",!1,!1),1);case"LLLL":return Zn(e.months("long",!1,!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(s);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(s);case"u":return ir(u);case"uu":return ir(r);case"uuu":return ft(t);case"a":return Zn(e.meridiems(),0);case"kkkk":return ft(l);case"kk":return ft(c,Vr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Zn(e.weekdays("short",!1,!1),1);case"EEEE":return Zn(e.weekdays("long",!1,!1),1);case"ccc":return Zn(e.weekdays("short",!0,!1),1);case"cccc":return Zn(e.weekdays("long",!0,!1),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 ir(/[a-z_+-/]{1,256}?/i);default:return m(b)}})(n)||{invalidReason:Xv};return h.token=n,h}const ny={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function iy(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=ny[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function sy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function ly(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Cs(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function oy(n){const e=l=>{switch(l){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 tt(n.z)||(t=vi.create(n.z)),tt(n.Z)||(t||(t=new mn(n.Z)),i=n.Z),tt(n.q)||(n.M=(n.q-1)*3+1),tt(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),tt(n.u)||(n.S=va(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let sr=null;function ry(){return sr||(sr=He.fromMillis(1555555555555)),sr}function ay(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=yn.create(e,t).formatDateTimeParts(ry()).map(o=>iy(o,e,t));return l.includes(void 0)?n:l}function fy(n,e){return Array.prototype.concat(...n.map(t=>ay(t,e)))}function Gg(n,e,t){const i=fy(yn.parseFormat(t),n),s=i.map(o=>ty(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=sy(s),a=RegExp(o,"i"),[f,u]=ly(e,a,r),[c,d,m]=u?oy(u):[null,null,void 0];if(Cs(u,"a")&&Cs(u,"H"))throw new Zs("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 uy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Gg(n,e,t);return[i,s,l,o]}const Xg=[0,31,59,90,120,151,181,212,243,273,304,334],Qg=[0,31,60,91,121,152,182,213,244,274,305,335];function Hn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function xg(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function eb(n,e,t){return t+(yl(n)?Qg:Xg)[e-1]}function tb(n,e){const t=yl(n)?Qg:Xg,i=t.findIndex(l=>lmo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function Lf(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=xg(e,1,4),l=xs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=xs(r)):o>l?(r=e+1,o-=xs(e)):r=e;const{month:a,day:f}=tb(r,o);return{year:r,month:a,day:f,...Vo(n)}}function lr(n){const{year:e,month:t,day:i}=n,s=eb(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function Pf(n){const{year:e,ordinal:t}=n,{month:i,day:s}=tb(e,t);return{year:e,month:i,day:s,...Vo(n)}}function cy(n){const e=qo(n.weekYear),t=bi(n.weekNumber,1,mo(n.weekYear)),i=bi(n.weekday,1,7);return e?t?i?!1:Hn("weekday",n.weekday):Hn("week",n.week):Hn("weekYear",n.weekYear)}function dy(n){const e=qo(n.year),t=bi(n.ordinal,1,xs(n.year));return e?t?!1:Hn("ordinal",n.ordinal):Hn("year",n.year)}function nb(n){const e=qo(n.year),t=bi(n.month,1,12),i=bi(n.day,1,po(n.year,n.month));return e?t?i?!1:Hn("day",n.day):Hn("month",n.month):Hn("year",n.year)}function ib(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=bi(e,0,23)||e===24&&t===0&&i===0&&s===0,o=bi(t,0,59),r=bi(i,0,59),a=bi(s,0,999);return l?o?r?a?!1:Hn("millisecond",s):Hn("second",i):Hn("minute",t):Hn("hour",e)}const or="Invalid DateTime",Ff=864e13;function Rl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function rr(n){return n.weekData===null&&(n.weekData=Wr(n.c)),n.weekData}function js(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new He({...t,...e,old:t})}function sb(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Nf(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 lo(n,e,t){return sb(ka(n),e,t)}function Rf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,po(i,s))+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=ka(l);let[a,f]=sb(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function Vs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,f=He.fromObject(n,{...t,zone:a,specificOffset:l});return o?f:f.setZone(r)}else return He.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function ql(n,e,t=!0){return n.isValid?yn.create(It.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+=Yt(n.c.year,t?6:4),e?(i+="-",i+=Yt(n.c.month),i+="-",i+=Yt(n.c.day)):(i+=Yt(n.c.month),i+=Yt(n.c.day)),i}function qf(n,e,t,i,s,l){let o=Yt(n.c.hour);return e?(o+=":",o+=Yt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Yt(n.c.minute),(n.c.second!==0||!t)&&(o+=Yt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Yt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Yt(Math.trunc(-n.o/60)),o+=":",o+=Yt(Math.trunc(-n.o%60))):(o+="+",o+=Yt(Math.trunc(n.o/60)),o+=":",o+=Yt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const lb={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},py={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},my={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ob=["year","month","day","hour","minute","second","millisecond"],hy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],_y=["year","ordinal","hour","minute","second","millisecond"];function jf(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 ug(n);return e}function Vf(n,e){const t=Oi(e.zone,Zt.defaultZone),i=It.fromObject(e),s=Zt.now();let l,o;if(tt(n.year))l=s;else{for(const f of ob)tt(n[f])&&(n[f]=lb[f]);const r=nb(n)||ib(n);if(r)return He.invalid(r);const a=t.offset(s);[l,o]=lo(n,a,t)}return new He({ts:l,zone:t,loc:i,o})}function zf(n,e,t){const i=tt(t.round)?!0:t.round,s=(o,r)=>(o=ya(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=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 s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Hf(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 He{constructor(e){const t=e.zone||Zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:Rl(t));this.ts=tt(e.ts)?Zt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Nf(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||It.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new He({})}static local(){const[e,t]=Hf(arguments),[i,s,l,o,r,a,f]=t;return Vf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Hf(arguments),[i,s,l,o,r,a,f]=t;return e.zone=mn.utcInstance,Vf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=C0(e)?e.valueOf():NaN;if(Number.isNaN(i))return He.invalid("invalid input");const s=Oi(t.zone,Zt.defaultZone);return s.isValid?new He({ts:i,zone:s,loc:It.fromObject(t)}):He.invalid(Rl(s))}static fromMillis(e,t={}){if(xi(e))return e<-Ff||e>Ff?He.invalid("Timestamp out of range"):new He({ts:e,zone:Oi(t.zone,Zt.defaultZone),loc:It.fromObject(t)});throw new Vn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(xi(e))return new He({ts:e*1e3,zone:Oi(t.zone,Zt.defaultZone),loc:It.fromObject(t)});throw new Vn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Oi(t.zone,Zt.defaultZone);if(!i.isValid)return He.invalid(Rl(i));const s=Zt.now(),l=tt(t.specificOffset)?i.offset(s):t.specificOffset,o=ho(e,jf),r=!tt(o.ordinal),a=!tt(o.year),f=!tt(o.month)||!tt(o.day),u=a||f,c=o.weekYear||o.weekNumber,d=It.fromObject(t);if((u||r)&&c)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&r)throw new Zs("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!u;let _,h,b=Nf(s,l);m?(_=hy,h=py,b=Wr(b)):r?(_=_y,h=my,b=lr(b)):(_=ob,h=lb);let y=!1;for(const D of _){const I=o[D];tt(I)?y?o[D]=h[D]:o[D]=b[D]:y=!0}const S=m?cy(o):r?dy(o):nb(o),T=S||ib(o);if(T)return He.invalid(T);const C=m?Lf(o):r?Pf(o):o,[$,M]=lo(C,l,i),E=new He({ts:$,zone:i,o:M,loc:d});return o.weekday&&u&&e.weekday!==E.weekday?He.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=Dv(e);return Vs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=Av(e);return Vs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Iv(e);return Vs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(tt(e)||tt(t))throw new Vn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=It.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,f,u]=uy(o,e,t);return u?He.invalid(u):Vs(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return He.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=jv(e);return Vs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new b0(i);return new He({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}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?rr(this).weekYear:NaN}get weekNumber(){return this.isValid?rr(this).weekNumber:NaN}get weekday(){return this.isValid?rr(this).weekday:NaN}get ordinal(){return this.isValid?lr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Nl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Nl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Nl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Nl.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}get isInLeapYear(){return yl(this.year)}get daysInMonth(){return po(this.year,this.month)}get daysInYear(){return this.isValid?xs(this.year):NaN}get weeksInWeekYear(){return this.isValid?mo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=yn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(mn.instance(e),t)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Oi(e,Zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=lo(o,l,e)}return js(this,{ts:s,zone:e})}else return He.invalid(Rl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return js(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ho(e,jf),i=!tt(t.weekYear)||!tt(t.weekNumber)||!tt(t.weekday),s=!tt(t.ordinal),l=!tt(t.year),o=!tt(t.month)||!tt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Zs("Can't mix ordinal dates with month/day");let f;i?f=Lf({...Wr(this.c),...t}):tt(t.ordinal)?(f={...this.toObject(),...t},tt(t.day)&&(f.day=Math.min(po(f.year,f.month),f.day))):f=Pf({...lr(this.c),...t});const[u,c]=lo(f,this.o,this.zone);return js(this,{ts:u,o:c})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return js(this,Rf(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return js(this,Rf(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?yn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):or}toLocaleString(e=jr,t={}){return this.isValid?yn.create(this.loc.clone(t),e).formatDateTime(this):or}toLocaleParts(e={}){return this.isValid?yn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=ar(this,o);return r+="T",r+=qf(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?ar(this,e==="extended"):null}toISOWeekDate(){return ql(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+qf(this,o==="extended",t,e,i,l):null}toRFC2822(){return ql(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ql(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ar(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),ql(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():or}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ot.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=T0(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,f=Jv(r,a,l,s);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(He.now(),e,t)}until(e){return this.isValid?Pt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}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||He.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(He.isDateTime))throw new Vn("max requires all arguments be DateTimes");return vf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=It.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Gg(o,e,t)}static fromStringExplain(e,t,i={}){return He.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return jr}static get DATE_MED(){return cg}static get DATE_MED_WITH_WEEKDAY(){return k0}static get DATE_FULL(){return dg}static get DATE_HUGE(){return pg}static get TIME_SIMPLE(){return mg}static get TIME_WITH_SECONDS(){return hg}static get TIME_WITH_SHORT_OFFSET(){return _g}static get TIME_WITH_LONG_OFFSET(){return gg}static get TIME_24_SIMPLE(){return bg}static get TIME_24_WITH_SECONDS(){return vg}static get TIME_24_WITH_SHORT_OFFSET(){return yg}static get TIME_24_WITH_LONG_OFFSET(){return kg}static get DATETIME_SHORT(){return wg}static get DATETIME_SHORT_WITH_SECONDS(){return Sg}static get DATETIME_MED(){return Cg}static get DATETIME_MED_WITH_SECONDS(){return Tg}static get DATETIME_MED_WITH_WEEKDAY(){return w0}static get DATETIME_FULL(){return $g}static get DATETIME_FULL_WITH_SECONDS(){return Mg}static get DATETIME_HUGE(){return Eg}static get DATETIME_HUGE_WITH_SECONDS(){return Og}}function zs(n){if(He.isDateTime(n))return n;if(n&&n.valueOf&&xi(n.valueOf()))return He.fromJSDate(n);if(n&&typeof n=="object")return He.fromObject(n);throw new Vn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const gy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],by=[".mp4",".avi",".mov",".3gp",".wmv"],vy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],yy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class V{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||V.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.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return V.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!V.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!V.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){V.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=V.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!V.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!V.isObject(l)&&!Array.isArray(l)||!V.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!V.isObject(s)&&!Array.isArray(s)||!V.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):V.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||V.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||V.isObject(e)&&Object.keys(e).length>0)&&V.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s=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 He.fromFormat(e,i,{zone:"UTC"})}return He.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.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.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",V.download(i,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!!gy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!by.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!vy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!yy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return V.hasImageExtension(e)?"image":V.hasDocumentExtension(e)?"document":V.hasVideoExtension(e)?"video":V.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.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),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(V.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)V.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):V.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,_;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||V.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||V.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const h of t){let b=null;h.type==="number"?b=123:h.type==="date"?b="2022-01-01 10:00:00.123Z":h.type==="bool"?b=!0:h.type==="email"?b="test@example.com":h.type==="url"?b="https://example.com":h.type==="json"?b="JSON":h.type==="file"?(b="filename.jpg",((u=h.options)==null?void 0:u.maxSelect)!==1&&(b=[b])):h.type==="select"?(b=(d=(c=h.options)==null?void 0:c.values)==null?void 0:d[0],((m=h.options)==null?void 0:m.maxSelect)!==1&&(b=[b])):h.type==="relation"?(b="RELATION_RECORD_ID",((_=h.options)==null?void 0:_.maxSelect)!==1&&(b=[b])):b="test",l[h.name]=b}return l}static dummyCollectionSchemaData(e){var s,l,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=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[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 s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(f=>(f==null?void 0:f.id)&&!V.findByKey(l,"id",f.id)),r=l.filter(f=>(f==null?void 0:f.id)&&!V.findByKey(s,"id",f.id)),a=l.filter(f=>{const u=V.isObject(f)&&V.findByKey(s,"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=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(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(){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"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample direction | code fullscreen",file_picker_types:"image",file_picker_callback:(e,t,i)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",l=>{const o=l.target.files[0],r=new FileReader;r.addEventListener("load",()=>{if(!tinymce)return;const a="blobid"+new Date().getTime(),f=tinymce.activeEditor.editorUpload.blobCache,u=r.result.split(",")[1],c=f.create(a,o,u);f.add(c),e(c.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()},setup:e=>{e.on("keydown",i=>{(i.ctrlKey||i.metaKey)&&i.code=="KeyS"&&e.formElement&&(i.preventDefault(),i.stopPropagation(),e.formElement.dispatchEvent(new KeyboardEvent("keydown",i)))});const t="tinymce_last_direction";e.on("init",()=>{var s;const i=(s=window==null?void 0:window.localStorage)==null?void 0:s.getItem(t);!e.isDirty()&&e.getContent()==""&&i=="rtl"&&e.execCommand("mceDirectionRTL")}),e.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:i=>{i([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var l;(l=window==null?void 0:window.localStorage)==null||l.setItem(t,"ltr"),tinymce.activeEditor.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var l;(l=window==null?void 0:window.localStorage)==null||l.setItem(t,"rtl"),tinymce.activeEditor.execCommand("mceDirectionRTL")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=V.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","label","heading","message","key","id"];for(const o of l){let r=V.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(V.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?V.plainText(e):e,V.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return V.truncate(JSON.stringify(e))||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/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of V.extractColumnsFromQuery(e.options.query))V.pushUnique(i,t+l);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 s=e.schema||[];for(const l of s)V.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/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((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!V.isEmpty((f=s[2])==null?void 0:f.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const h=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((h==null?void 0:h.length)!=4)continue;const b=(c=(u=h[1])==null?void 0:u.trim())==null?void 0:c.replace(l,"");b&&t.columns.push({name:b,collate:h[2]||"",sort:((d=h[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[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_"+V.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` + `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, + `),i.length>1&&(t+=` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=V.parseIndex(e);return i.tableName=t,V.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=V.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?V.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}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)}}const zo=Dn([]);function _o(n,e=4e3){return Ho(n,"info",e)}function Ht(n,e=3e3){return Ho(n,"success",e)}function Ts(n,e=4500){return Ho(n,"error",e)}function ky(n,e=4500){return Ho(n,"warning",e)}function Ho(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{rb(i)},t)};zo.update(s=>(Ea(s,i.message),V.pushOrReplaceByKey(s,i,"message"),s))}function rb(n){zo.update(e=>(Ea(e,n),e))}function Ma(){zo.update(n=>{for(let e of n)Ea(n,e);return[]})}function Ea(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}const wi=Dn({});function en(n){wi.set(n||{})}function ai(n){wi.update(e=>(V.deleteByPath(e,n),e))}const Oa=Dn({});function Yr(n){Oa.set(n||{})}const ui=Dn([]),yi=Dn({}),go=Dn(!1),ab=Dn({});function wy(n){ui.update(e=>{const t=V.findByKey(e,"id",n);return t?yi.set(t):e.length&&yi.set(e[0]),e})}function Sy(n){yi.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ui.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Da(),V.sortCollections(e)))}function Cy(n){ui.update(e=>(V.removeByKey(e,"id",n.id),yi.update(t=>t.id===n.id?e[0]:t),Da(),e))}async function Ty(n=null){go.set(!0);try{let e=await ue.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),ui.set(e);const t=n&&V.findByKey(e,"id",n);t?yi.set(t):e.length&&yi.set(e[0]),Da()}catch(e){ue.error(e)}go.set(!1)}function Da(){ab.update(n=>(ui.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const fr="pb_admin_file_token";Ro.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ri("/login")};Ro.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,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Ts(l),V.isEmpty(s.data)||en(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ri("/")};Ro.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=I1(ab);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(fr)||"";return(!t||ag(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 $y extends fg{save(e,t){super.save(e,t),t&&!t.collectionId&&Yr(t)}clear(){super.clear(),Yr(null)}}const ue=new Ro("../",new $y("pb_admin_auth"));ue.authStore.model&&!ue.authStore.model.collectionId&&Yr(ue.authStore.model);function My(n){let e,t,i,s,l,o,r,a,f,u,c,d;const m=n[3].default,_=wt(m,n,n[2],null);return{c(){e=v("div"),t=v("main"),_&&_.c(),i=O(),s=v("footer"),l=v("a"),l.innerHTML=` + Docs`,o=O(),r=v("span"),r.textContent="|",a=O(),f=v("a"),u=v("span"),u.textContent="PocketBase v0.17.5",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(u,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(h,b){w(h,e,b),g(e,t),_&&_.m(t,null),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,f),g(f,u),d=!0},p(h,[b]){_&&_.p&&(!d||b&4)&&Ct(_,m,h,h[2],d?St(m,h[2],b,null):Tt(h[2]),null),(!d||b&2&&c!==(c="page-wrapper "+h[1]))&&p(e,"class",c),(!d||b&3)&&Q(e,"center-content",h[0])},i(h){d||(A(_,h),d=!0)},o(h){L(_,h),d=!1},d(h){h&&k(e),_&&_.d(h)}}}function Ey(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class kn extends ve{constructor(e){super(),be(this,e,Ey,My,me,{center:0,class:1})}}function Bf(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=``,t=O(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Oy(n){let e,t,i,s=!n[0]&&Bf();const l=n[1].default,o=wt(l,n,n[2],null);return{c(){e=v("div"),s&&s.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),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Bf(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Ct(o,l,r,r[2],i?St(l,r[2],a,null):Tt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function Dy(n){let e,t;return e=new kn({props:{class:"full-page",center:!0,$$slots:{default:[Oy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ay(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class fb extends ve{constructor(e){super(),be(this,e,Ay,Dy,me,{nobranding:0})}}function Bo(n){const e=n-1;return e*e*e+1}function Kr(n,{delay:e=0,duration:t=400,easing:i=bl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function fi(n,{delay:e=0,duration:t=400,easing:i=Bo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=ff(s),[m,_]=ff(l);return{delay:e,duration:t,easing:i,css:(h,b)=>` + transform: ${f} translate(${(1-h)*c}${d}, ${(1-h)*m}${_}); + opacity: ${a-u*b}`}}function st(n,{delay:e=0,duration:t=400,easing:i=Bo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),f=s==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${u[0]}`]),d=parseFloat(l[`padding${u[1]}`]),m=parseFloat(l[`margin${u[0]}`]),_=parseFloat(l[`margin${u[1]}`]),h=parseFloat(l[`border${u[0]}Width`]),b=parseFloat(l[`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*_}px;border-${f[0]}-width: ${y*h}px;border-${f[1]}-width: ${y*b}px;`}}function Jt(n,{delay:e=0,duration:t=400,easing:i=Bo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-s,u=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` + transform: ${a} scale(${1-f*d}); + opacity: ${r-u*d} + `}}let Jr,Bi;const Zr="app-tooltip";function Uf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Li(){return Bi=Bi||document.querySelector("."+Zr),Bi||(Bi=document.createElement("div"),Bi.classList.add(Zr),document.body.appendChild(Bi)),Bi}function ub(n,e){let t=Li();if(!t.classList.contains("active")||!(e!=null&&e.text)){Gr();return}t.textContent=e.text,t.className=Zr+" 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,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),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 Gr(){clearTimeout(Jr),Li().classList.remove("active"),Li().activeNode=void 0}function Iy(n,e){Li().activeNode=n,clearTimeout(Jr),Jr=setTimeout(()=>{Li().classList.add("active"),ub(n,e)},isNaN(e.delay)?0:e.delay)}function Ve(n,e){let t=Uf(e);function i(){Iy(n,t)}function s(){Gr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&V.isFocusable(n))&&n.addEventListener("click",s),Li(),{update(l){var o,r;t=Uf(l),(r=(o=Li())==null?void 0:o.activeNode)!=null&&r.contains(n)&&ub(n,t)},destroy(){var l,o;(o=(l=Li())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Gr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Wf(n,e,t){const i=n.slice();return i[12]=e[t],i}const Ly=n=>({}),Yf=n=>({uniqueId:n[4]});function Py(n){let e,t,i=n[3],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=qe(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Kf(n){let e,t,i=bo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=O(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),g(e,t),g(t,s),g(e,l),r=!0},p(a,f){(!r||f&8)&&i!==(i=bo(a[12])+"")&&se(s,i)},i(a){r||(a&&Ge(()=>{r&&(o||(o=qe(e,st,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,st,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Ny(n){let e,t,i,s,l,o,r;const a=n[9].default,f=wt(a,n,n[8],Yf),u=[Fy,Py],c=[];function d(m,_){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=u[i](n),{c(){e=v("div"),f&&f.c(),t=O(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(m,_){w(m,e,_),f&&f.m(e,null),g(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[_]){f&&f.p&&(!l||_&256)&&Ct(f,a,m,m[8],l?St(a,m[8],_,Ly):Tt(m[8]),Yf);let h=i;i=d(m),i===h?c[i].p(m,_):(ae(),L(c[h],1,1,()=>{c[h]=null}),fe(),s=c[i],s?s.p(m,_):(s=c[i]=u[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&p(e,"class",m[1]),(!l||_&10)&&Q(e,"error",m[3].length)},i(m){l||(A(f,m),A(s),l=!0)},o(m){L(f,m),L(s),l=!1},d(m){m&&k(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Jf="Invalid value";function bo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Jf:n||Jf}function Ry(n,e,t){let i;Ke(n,wi,h=>t(7,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){ai(r)}Xt(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(h){Fe.call(this,n,h)}function _(h){te[h?"unshift":"push"](()=>{u=h,t(2,u)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,f=h.class),"$$scope"in h&&t(8,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,Ry,Ny,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function qy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0]),l.focus(),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0]&&re(l,f[0])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function jy(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=U("Password"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[1]),w(c,r,d),w(c,a,d),f||(u=Y(l,"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(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),f=!1,u()}}}function Vy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[2]),r||(a=Y(l,"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(l,"id",o),u&4&&l.value!==f[2]&&re(l,f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function zy(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[qy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[jy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Vy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=O(),B(s.$$.fragment),l=O(),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),u=v("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"),Q(u,"btn-disabled",n[3]),Q(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(_,h){w(_,e,h),g(e,t),g(e,i),z(s,e,null),g(e,l),z(o,e,null),g(e,r),z(a,e,null),g(e,f),g(e,u),c=!0,d||(m=Y(e,"submit",Qe(n[4])),d=!0)},p(_,[h]){const b={};h&1537&&(b.$$scope={dirty:h,ctx:_}),s.$set(b);const y={};h&1538&&(y.$$scope={dirty:h,ctx:_}),o.$set(y);const S={};h&1540&&(S.$$scope={dirty:h,ctx:_}),a.$set(S),(!c||h&8)&&Q(u,"btn-disabled",_[3]),(!c||h&8)&&Q(u,"btn-loading",_[3])},i(_){c||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),c=!0)},o(_){L(s.$$.fragment,_),L(o.$$.fragment,_),L(a.$$.fragment,_),c=!1},d(_){_&&k(e),H(s),H(o),H(a),d=!1,m()}}}function Hy(n,e,t){const i=$t();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ue.admins.create({email:s,password:l,passwordConfirm:o}),await ue.admins.authWithPassword(s,l),i("submit")}catch(d){ue.error(d)}t(3,r=!1)}}function f(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,f,u,c]}class By extends ve{constructor(e){super(),be(this,e,Hy,zy,me,{})}}function Zf(n){let e,t;return e=new fb({props:{$$slots:{default:[Uy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Uy(n){let e,t;return e=new By({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Wy(n){let e,t,i=n[0]&&Zf(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Zf(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),L(i,1,1,()=>{i=null}),fe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function Yy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ue.logout(!1),t(0,i=!0);return}ue.authStore.isValid?Ri("/collections"):ue.logout()}return[i,async()=>{t(0,i=!1),await fn(),window.location.search=""}]}class Ky extends ve{constructor(e){super(),be(this,e,Yy,Wy,me,{})}}const Dt=Dn(""),vo=Dn(""),$s=Dn(!1);function Jy(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function Zy(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let f={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&&(f.value=a[7]),{props:f}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),s=!0},p(a,f){const u={};if(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],he(()=>t=!1)),f&16&&o!==(o=a[4])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(u)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function Gf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,fi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,fi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function Xf(n){let e,t,i,s,l;return{c(){e=v("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,s||(l=Y(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,fi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,fi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Gy(n){let e,t,i,s,l,o,r,a,f,u,c;const d=[Zy,Jy],m=[];function _(y,S){return y[4]&&!y[5]?0:1}l=_(n),o=m[l]=d[l](n);let h=(n[0].length||n[7].length)&&n[7]!=n[0]&&Gf(),b=(n[0].length||n[7].length)&&Xf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=O(),o.c(),r=O(),h&&h.c(),a=O(),b&&b.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),g(e,t),g(t,i),g(e,s),m[l].m(e,null),g(e,r),h&&h.m(e,null),g(e,a),b&&b.m(e,null),f=!0,u||(c=[Y(e,"click",On(n[11])),Y(e,"submit",Qe(n[10]))],u=!0)},p(y,[S]){let T=l;l=_(y),l===T?m[l].p(y,S):(ae(),L(m[T],1,1,()=>{m[T]=null}),fe(),o=m[l],o?o.p(y,S):(o=m[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?h?S&129&&A(h,1):(h=Gf(),h.c(),A(h,1),h.m(e,a)):h&&(ae(),L(h,1,1,()=>{h=null}),fe()),y[0].length||y[7].length?b?(b.p(y,S),S&129&&A(b,1)):(b=Xf(y),b.c(),A(b,1),b.m(e,null)):b&&(ae(),L(b,1,1,()=>{b=null}),fe())},i(y){f||(A(o),A(h),A(b),f=!0)},o(y){L(o),L(h),L(b),f=!1},d(y){y&&k(e),m[l].d(),h&&h.d(),b&&b.d(),u=!1,Ee(c)}}}function Xy(n,e,t){const i=$t(),s="search_"+V.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=V.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function _(){t(0,l=d),i("submit",l)}async function h(){f||u||(t(5,u=!0),t(4,f=(await at(()=>import("./FilterAutocompleteInput-0a758632.js"),["./FilterAutocompleteInput-0a758632.js","./index-eb24c20e.js"],import.meta.url)).default),t(5,u=!1))}Xt(()=>{h()});function b($){Fe.call(this,n,$)}function y($){d=$,t(7,d),t(0,l)}function S($){te[$?"unshift":"push"](()=>{c=$,t(6,c)})}function T(){d=this.value,t(7,d),t(0,l)}const C=()=>{m(!1),_()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,o=$.placeholder),"autocompleteCollection"in $&&t(2,r=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,f,u,c,d,s,m,_,b,y,S,T,C]}class Uo extends ve{constructor(e){super(),be(this,e,Xy,Gy,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Qy(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("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"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),g(e,t),l||(o=[Te(s=Ve.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&jt(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,Ee(o)}}}function xy(n,e,t){const i=$t();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Xt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Wo extends ve{constructor(e){super(),be(this,e,xy,Qy,me,{tooltip:0,class:1})}}function ek(n){let e,t,i,s,l;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&Ct(r,o,a,a[5],i?St(o,a[5],f,null):Tt(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)&&Q(e,"col-sort-disabled",a[3]),(!i||f&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Ee(l)}}}function tk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=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,l=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,s=d.$$scope)},[r,l,o,a,f,s,i,u,c]}class rn extends ve{constructor(e){super(),be(this,e,tk,ek,me,{class:1,name:2,sort:0,disable:3})}}function nk(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function ik(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("div"),i=U(n[2]),s=O(),l=v("div"),o=U(n[1]),r=U(" UTC"),p(t,"class","date"),p(l,"class","time svelte-zdiknu"),p(e,"class","datetime svelte-zdiknu")},m(a,f){w(a,e,f),g(e,t),g(t,i),g(e,s),g(e,l),g(l,o),g(l,r)},p(a,f){f&4&&se(i,a[2]),f&2&&se(o,a[1])},d(a){a&&k(e)}}}function sk(n){let e;function t(l,o){return l[0]?ik:nk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function lk(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class ki extends ve{constructor(e){super(),be(this,e,lk,sk,me,{date:0})}}const ok=n=>({}),Qf=n=>({}),rk=n=>({}),xf=n=>({});function ak(n){let e,t,i,s,l,o,r,a;const f=n[5].before,u=wt(f,n,n[4],xf),c=n[5].default,d=wt(c,n,n[4],null),m=n[5].after,_=wt(m,n,n[4],Qf);return{c(){e=v("div"),u&&u.c(),t=O(),i=v("div"),d&&d.c(),l=O(),_&&_.c(),p(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),p(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(h,b){w(h,e,b),u&&u.m(e,null),g(e,t),g(e,i),d&&d.m(i,null),n[6](i),g(e,l),_&&_.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(h,[b]){u&&u.p&&(!o||b&16)&&Ct(u,f,h,h[4],o?St(f,h[4],b,rk):Tt(h[4]),xf),d&&d.p&&(!o||b&16)&&Ct(d,c,h,h[4],o?St(c,h[4],b,null):Tt(h[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+h[0]+" "+h[3]+" svelte-wc2j9h"))&&p(i,"class",s),_&&_.p&&(!o||b&16)&&Ct(_,m,h,h[4],o?St(m,h[4],b,ok):Tt(h[4]),Qf)},i(h){o||(A(u,h),A(d,h),A(_,h),o=!0)},o(h){L(u,h),L(d,h),L(_,h),o=!1},d(h){h&&k(e),u&&u.d(h),d&&d.d(h),n[6](null),_&&_.d(h),r=!1,Ee(a)}}}function fk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,f;function u(){o&&(clearTimeout(a),a=setTimeout(()=>{const d=o.offsetWidth,m=o.scrollWidth;m-d?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+d==m&&t(3,r+=" scroll-end")):t(3,r="")},100))}Xt(()=>(u(),f=new MutationObserver(()=>{u()}),f.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{f==null||f.disconnect(),clearTimeout(a)}));function c(d){te[d?"unshift":"push"](()=>{o=d,t(2,o)})}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"$$scope"in d&&t(4,s=d.$$scope)},[l,u,o,r,s,i,c]}class Aa extends ve{constructor(e){super(),be(this,e,fk,ak,me,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function eu(n,e,t){const i=n.slice();return i[23]=e[t],i}function uk(n){let e;return{c(){e=v("div"),e.innerHTML=` + Method`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function ck(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="URL",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function dk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="Referer",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function pk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="User IP",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function mk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="Status",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function hk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="Created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function tu(n){let e;function t(l,o){return l[6]?gk:_k}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function _k(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&nu(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function gk(n){let e;return{c(){e=v("tr"),e.innerHTML=` + `},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function nu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function iu(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function su(n,e){var Ce,Je,_t;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,f,u,c=e[23].url+"",d,m,_,h,b,y,S=(e[23].referer||"N/A")+"",T,C,$,M,E,D=(e[23].userIp||"N/A")+"",I,P,F,R,N,q=e[23].status+"",j,Z,X,K,J,le,ie,ee,$e,Pe,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&iu();K=new ki({props:{date:e[23].created}});function ze(){return e[17](e[23])}function ke(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=O(),f=v("td"),u=v("span"),d=U(c),_=O(),je&&je.c(),h=O(),b=v("td"),y=v("span"),T=U(S),$=O(),M=v("td"),E=v("span"),I=U(D),F=O(),R=v("td"),N=v("span"),j=U(q),Z=O(),X=v("td"),B(K.$$.fragment),J=O(),le=v("td"),le.innerHTML='',ie=O(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(u,"class","txt txt-ellipsis"),p(u,"title",m=e[23].url),p(f,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","txt txt-ellipsis"),p(E,"title",P=e[23].userIp),Q(E,"txt-hint",!e[23].userIp),p(M,"class","col-type-number col-field-userIp"),p(N,"class","label"),Q(N,"label-danger",e[23].status>=400),p(R,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(le,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Ze,We){w(Ze,t,We),g(t,i),g(i,s),g(s,o),g(t,a),g(t,f),g(f,u),g(u,d),g(f,_),je&&je.m(f,null),g(t,h),g(t,b),g(b,y),g(y,T),g(t,$),g(t,M),g(M,E),g(E,I),g(t,F),g(t,R),g(R,N),g(N,j),g(t,Z),g(t,X),z(K,X,null),g(t,J),g(t,le),g(t,ie),ee=!0,$e||(Pe=[Y(t,"click",ze),Y(t,"keydown",ke)],$e=!0)},p(Ze,We){var pe,_e,Ye;e=Ze,(!ee||We&8)&&l!==(l=((pe=e[23].method)==null?void 0:pe.toUpperCase())+"")&&se(o,l),(!ee||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ee||We&8)&&c!==(c=e[23].url+"")&&se(d,c),(!ee||We&8&&m!==(m=e[23].url))&&p(u,"title",m),(_e=e[23].meta)!=null&&_e.errorMessage||(Ye=e[23].meta)!=null&&Ye.errorData?je||(je=iu(),je.c(),je.m(f,null)):je&&(je.d(1),je=null),(!ee||We&8)&&S!==(S=(e[23].referer||"N/A")+"")&&se(T,S),(!ee||We&8&&C!==(C=e[23].referer))&&p(y,"title",C),(!ee||We&8)&&Q(y,"txt-hint",!e[23].referer),(!ee||We&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&se(I,D),(!ee||We&8&&P!==(P=e[23].userIp))&&p(E,"title",P),(!ee||We&8)&&Q(E,"txt-hint",!e[23].userIp),(!ee||We&8)&&q!==(q=e[23].status+"")&&se(j,q),(!ee||We&8)&&Q(N,"label-danger",e[23].status>=400);const yt={};We&8&&(yt.date=e[23].created),K.$set(yt)},i(Ze){ee||(A(K.$$.fragment,Ze),ee=!0)},o(Ze){L(K.$$.fragment,Ze),ee=!1},d(Ze){Ze&&k(t),je&&je.d(),H(K),$e=!1,Ee(Pe)}}}function bk(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E,D,I=[],P=new Map,F;function R(ke){n[11](ke)}let N={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[uk]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),s=new rn({props:N}),te.push(()=>ce(s,"sort",R));function q(ke){n[12](ke)}let j={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[ck]},$$scope:{ctx:n}};n[1]!==void 0&&(j.sort=n[1]),r=new rn({props:j}),te.push(()=>ce(r,"sort",q));function Z(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[dk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),u=new rn({props:X}),te.push(()=>ce(u,"sort",Z));function K(ke){n[14](ke)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[pk]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),m=new rn({props:J}),te.push(()=>ce(m,"sort",K));function le(ke){n[15](ke)}let ie={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[mk]},$$scope:{ctx:n}};n[1]!==void 0&&(ie.sort=n[1]),b=new rn({props:ie}),te.push(()=>ce(b,"sort",le));function ee(ke){n[16](ke)}let $e={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[hk]},$$scope:{ctx:n}};n[1]!==void 0&&($e.sort=n[1]),T=new rn({props:$e}),te.push(()=>ce(T,"sort",ee));let Pe=n[3];const je=ke=>ke[23].id;for(let ke=0;kel=!1)),s.$set(Je);const _t={};Ce&67108864&&(_t.$$scope={dirty:Ce,ctx:ke}),!a&&Ce&2&&(a=!0,_t.sort=ke[1],he(()=>a=!1)),r.$set(_t);const Ze={};Ce&67108864&&(Ze.$$scope={dirty:Ce,ctx:ke}),!c&&Ce&2&&(c=!0,Ze.sort=ke[1],he(()=>c=!1)),u.$set(Ze);const We={};Ce&67108864&&(We.$$scope={dirty:Ce,ctx:ke}),!_&&Ce&2&&(_=!0,We.sort=ke[1],he(()=>_=!1)),m.$set(We);const yt={};Ce&67108864&&(yt.$$scope={dirty:Ce,ctx:ke}),!y&&Ce&2&&(y=!0,yt.sort=ke[1],he(()=>y=!1)),b.$set(yt);const pe={};Ce&67108864&&(pe.$$scope={dirty:Ce,ctx:ke}),!C&&Ce&2&&(C=!0,pe.sort=ke[1],he(()=>C=!1)),T.$set(pe),Ce&841&&(Pe=ke[3],ae(),I=bt(I,Ce,je,1,ke,Pe,P,D,Ut,su,null,eu),fe(),!Pe.length&&ze?ze.p(ke,Ce):Pe.length?ze&&(ze.d(1),ze=null):(ze=tu(ke),ze.c(),ze.m(D,null))),(!F||Ce&64)&&Q(e,"table-loading",ke[6])},i(ke){if(!F){A(s.$$.fragment,ke),A(r.$$.fragment,ke),A(u.$$.fragment,ke),A(m.$$.fragment,ke),A(b.$$.fragment,ke),A(T.$$.fragment,ke);for(let Ce=0;Ce{if(P<=1&&h(),t(6,d=!1),t(5,u=R.page),t(4,c=R.totalItems),s("load",f.concat(R.items)),F){const N=++m;for(;R.items.length&&m==N;)t(3,f=f.concat(R.items.splice(0,10))),await V.yieldToMain()}else t(3,f=f.concat(R.items))}).catch(R=>{R!=null&&R.isAbort||(t(6,d=!1),console.warn(R),h(),ue.error(R,!1))})}function h(){t(3,f=[]),t(5,u=1),t(4,c=0)}function b(P){a=P,t(1,a)}function y(P){a=P,t(1,a)}function S(P){a=P,t(1,a)}function T(P){a=P,t(1,a)}function C(P){a=P,t(1,a)}function $(P){a=P,t(1,a)}const M=P=>s("select",P),E=(P,F)=>{F.code==="Enter"&&(F.preventDefault(),s("select",P))},D=()=>t(0,o=""),I=()=>_(u+1);return n.$$set=P=>{"filter"in P&&t(0,o=P.filter),"presets"in P&&t(10,r=P.presets),"sort"in P&&t(1,a=P.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(h(),_(1)),n.$$.dirty&24&&t(7,i=c>f.length)},[o,a,_,f,c,u,d,i,s,l,r,b,y,S,T,C,$,M,E,D,I]}class kk extends ve{constructor(e){super(),be(this,e,yk,vk,me,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + */function pi(){}const wk=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function Et(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 et(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Nn(n,e){return Bt(n)?n:e}function nt(n,e){return typeof n>"u"?e:n}const Sk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,cb=(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 s,l,o;if(Et(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Fi(n,e){return(ru[e]||(ru[e]=$k(e)))(n)}function $k(n){const e=Mk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Mk(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ia(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Bn=n=>typeof n<"u",Ni=n=>typeof n=="function",au=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Ek(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const qt=Math.PI,gt=2*qt,Ok=gt+qt,wo=Number.POSITIVE_INFINITY,Dk=qt/180,Nt=qt/2,Hs=qt/4,fu=qt*2/3,zn=Math.log10,oi=Math.sign;function uu(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Ak(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)=n}function pb(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Pa(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Xi=(n,e,t,i)=>Pa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Pa(n,t,i=>n[i][e]>=t);function Nk(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Ia(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function du(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(hb.forEach(l=>{delete n[l]}),delete n._chartjs)}function _b(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function bb(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,gb.call(window,()=>{s=!1,n.apply(e,l)}))}}function qk(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const jk=n=>n==="start"?"left":n==="end"?"right":"center",pu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function vb(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=an(Math.min(Xi(r,o.axis,f).lo,t?i:Xi(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?l=an(Math.max(Xi(r,o.axis,u,!0).hi+1,t?0:Xi(e,a,o.getPixelForValue(u),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function yb(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const jl=n=>n===0||n===1,mu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*gt/t)),hu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*gt/t)+1,il={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*Nt)+1,easeOutSine:n=>Math.sin(n*Nt),easeInOutSine:n=>-.5*(Math.cos(qt*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=>jl(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=>jl(n)?n:mu(n,.075,.3),easeOutElastic:n=>jl(n)?n:hu(n,.075,.3),easeInOutElastic(n){return jl(n)?n:n<.5?.5*mu(n*2,.1125,.45):.5+.5*hu(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-il.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?il.easeInBounce(n*2)*.5:il.easeOutBounce(n*2-1)*.5+.5};/*! + * @kurkle/color v0.2.1 + * https://github.com/kurkle/color#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT License + */function Cl(n){return n+.5|0}const Di=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return Di(Cl(n*2.55),0,255)}function Pi(n){return Di(Cl(n*255),0,255)}function _i(n){return Di(Cl(n/2.55)/100,0,1)}function _u(n){return Di(Cl(n*100),0,100)}const Fn={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},Qr=[..."0123456789ABCDEF"],Vk=n=>Qr[n&15],zk=n=>Qr[(n&240)>>4]+Qr[n&15],Vl=n=>(n&240)>>4===(n&15),Hk=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Bk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Fn[n[1]]*17,g:255&Fn[n[2]]*17,b:255&Fn[n[3]]*17,a:e===5?Fn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Fn[n[1]]<<4|Fn[n[2]],g:Fn[n[3]]<<4|Fn[n[4]],b:Fn[n[5]]<<4|Fn[n[6]],a:e===9?Fn[n[7]]<<4|Fn[n[8]]:255})),t}const Uk=(n,e)=>n<255?e(n):"";function Wk(n){var e=Hk(n)?Vk:zk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Uk(n.a,e):void 0}const Yk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function kb(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Kk(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function Jk(n,e,t){const i=kb(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function Zk(n,e,t,i,s){return n===s?(e-t)/i+(e.5?u/(2-l-o):u/(l+o),a=Zk(t,i,s,u,l),a=a*60+.5),[a|0,f||0,r]}function Na(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Pi)}function Ra(n,e,t){return Na(kb,n,e,t)}function Gk(n,e,t){return Na(Jk,n,e,t)}function Xk(n,e,t){return Na(Kk,n,e,t)}function wb(n){return(n%360+360)%360}function Qk(n){const e=Yk.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):Pi(+e[5]));const s=wb(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=Gk(s,l,o):e[1]==="hsv"?i=Xk(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function xk(n,e){var t=Fa(n);t[0]=wb(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function e2(n){if(!n)return;const e=Fa(n),t=e[0],i=_u(e[1]),s=_u(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${_i(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const gu={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"},bu={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 t2(){const n={},e=Object.keys(bu),t=Object.keys(gu);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let zl;function n2(n){zl||(zl=t2(),zl.transparent=[0,0,0,0]);const e=zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const i2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function s2(n){const e=i2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Xs(o):Di(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Xs(i):Di(i,0,255)),s=255&(e[4]?Xs(s):Di(s,0,255)),l=255&(e[6]?Xs(l):Di(l,0,255)),{r:i,g:s,b:l,a:t}}}function l2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${_i(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ur=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ps=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function o2(n,e,t){const i=ps(_i(n.r)),s=ps(_i(n.g)),l=ps(_i(n.b));return{r:Pi(ur(i+t*(ps(_i(e.r))-i))),g:Pi(ur(s+t*(ps(_i(e.g))-s))),b:Pi(ur(l+t*(ps(_i(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Hl(n,e,t){if(n){let i=Fa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ra(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Sb(n,e){return n&&Object.assign(e||{},n)}function vu(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=Pi(n[3]))):(e=Sb(n,{r:0,g:0,b:0,a:1}),e.a=Pi(e.a)),e}function r2(n){return n.charAt(0)==="r"?s2(n):Qk(n)}class So{constructor(e){if(e instanceof So)return e;const t=typeof e;let i;t==="object"?i=vu(e):t==="string"&&(i=Bk(e)||n2(e)||r2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Sb(this._rgb);return e&&(e.a=_i(e.a)),e}set rgb(e){this._rgb=vu(e)}rgbString(){return this._valid?l2(this._rgb):void 0}hexString(){return this._valid?Wk(this._rgb):void 0}hslString(){return this._valid?e2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,f=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-f,i.r=255&f*i.r+l*s.r+.5,i.g=255&f*i.g+l*s.g+.5,i.b=255&f*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=o2(this._rgb,e._rgb,t)),this}clone(){return new So(this.rgb)}alpha(e){return this._rgb.a=Pi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Cl(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 Hl(this._rgb,2,e),this}darken(e){return Hl(this._rgb,2,-e),this}saturate(e){return Hl(this._rgb,1,e),this}desaturate(e){return Hl(this._rgb,1,-e),this}rotate(e){return xk(this._rgb,e),this}}function Cb(n){return new So(n)}function Tb(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function yu(n){return Tb(n)?n:Cb(n)}function cr(n){return Tb(n)?n:Cb(n).saturate(.5).darken(.1).hexString()}const is=Object.create(null),xr=Object.create(null);function sl(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.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=(t,i)=>cr(i.backgroundColor),this.hoverBorderColor=(t,i)=>cr(i.borderColor),this.hoverColor=(t,i)=>cr(i.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)}set(e,t){return dr(this,e,t)}get(e){return sl(this,e)}describe(e,t){return dr(xr,e,t)}override(e,t){return dr(is,e,t)}route(e,t,i,s){const l=sl(this,e),o=sl(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[s];return et(a)?Object.assign({},f,a):nt(a,f)},set(a){this[r]=a}}})}}var it=new a2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function f2(n){return!n||dt(n.size)||dt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Co(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function u2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,f,u,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function pl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,f;for(n.save(),n.font=s.string,m2(n,l),a=0;a+n||0;function Va(n,e){const t={},i=et(e),s=i?Object.keys(e):e,l=et(n)?i?o=>nt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=v2(l(o));return t}function $b(n){return Va(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Va(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Un(n){const e=$b(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Mn(n,e){n=n||{},e=e||it.font;let t=nt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=nt(n.style,e.style);i&&!(""+i).match(g2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:nt(n.family,e.family),lineHeight:b2(nt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:nt(n.weight,e.weight),string:""};return s.string=f2(s),s}function Bl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function qi(n,e){return Object.assign(Object.create(n),e)}function za(n,e=[""],t=n,i,s=()=>n[0]){Bn(i)||(i=Db("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>za([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return Eb(o,r,()=>E2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Su(o).includes(r)},ownKeys(o){return Su(o)},set(o,r,a){const f=o._storage||(o._storage=s());return o[r]=f[r]=a,delete o._keys,!0}})}function Es(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Mb(n,i),setContext:l=>Es(n,l,t,i),override:l=>Es(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return Eb(l,o,()=>w2(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function Mb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Ni(t)?t:()=>t,isIndexable:Ni(i)?i:()=>i}}const k2=(n,e)=>n?n+Ia(e):e,Ha=(n,e)=>et(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Eb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function w2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Ni(r)&&o.isScriptable(e)&&(r=S2(e,r,n,t)),Et(r)&&r.length&&(r=C2(e,r,n,o.isIndexable)),Ha(e,r)&&(r=Es(r,s,l&&l[e],o)),r}function S2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ha(n,e)&&(e=Ba(s._scopes,s,n,e)),e}function C2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Bn(l.index)&&i(n))e=e[l.index%e.length];else if(et(e[0])){const a=e,f=s._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=Ba(f,s,n,u);e.push(Es(c,l,o&&o[n],r))}}return e}function Ob(n,e,t){return Ni(n)?n(e,t):n}const T2=(n,e)=>n===!0?e:typeof n=="string"?Fi(e,n):void 0;function $2(n,e,t,i,s){for(const l of e){const o=T2(t,l);if(o){n.add(o);const r=Ob(o._fallback,t,s);if(Bn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Bn(i)&&t!==i)return null}return!1}function Ba(n,e,t,i){const s=e._rootScopes,l=Ob(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=wu(r,o,t,l||t,i);return a===null||Bn(l)&&l!==t&&(a=wu(r,o,l,a,i),a===null)?!1:za(Array.from(r),[""],s,l,()=>M2(e,t,i))}function wu(n,e,t,i,s){for(;t;)t=$2(n,e,t,i,s);return t}function M2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Et(s)&&et(t)?t:s}function E2(n,e,t,i){let s;for(const l of e)if(s=Db(k2(l,n),t),Bn(s))return Ha(n,s)?Ba(t,i,n,s):s}function Db(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Bn(i))return i}}function Su(n){let e=n._keys;return e||(e=n._keys=O2(n._scopes)),e}function O2(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function Ab(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,f,u;for(r=0,a=i;ren==="x"?"y":"x";function A2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Xr(l,s),a=Xr(o,l);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:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function I2(n,e,t){const i=n.length;let s,l,o,r,a,f=Os(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")P2(n,s);else{let f=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function R2(n,e){return Yo(n).getPropertyValue(e)}const q2=["top","right","bottom","left"];function es(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=q2[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const j2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function V2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(j2(s,l,n.target))r=s,a=l;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 Ji(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Yo(t),l=s.boxSizing==="border-box",o=es(s,"padding"),r=es(s,"border","width"),{x:a,y:f,box:u}=V2(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:_}=e;return l&&(m-=o.width+r.width,_-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/_*t.height/i)}}function z2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ua(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Yo(l),a=es(r,"border","width"),f=es(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Mo(r.maxWidth,l,"clientWidth"),s=Mo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||wo,maxHeight:s||wo}}const pr=n=>Math.round(n*10)/10;function H2(n,e,t,i){const s=Yo(n),l=es(s,"margin"),o=Mo(s.maxWidth,n,"clientWidth")||wo,r=Mo(s.maxHeight,n,"clientHeight")||wo,a=z2(n,e,t);let{width:f,height:u}=a;if(s.boxSizing==="content-box"){const c=es(s,"border","width"),d=es(s,"padding");f-=d.width+c.width,u-=d.height+c.height}return f=Math.max(0,f-l.width),u=Math.max(0,i?Math.floor(f/i):u-l.height),f=pr(Math.min(f,o,a.maxWidth)),u=pr(Math.min(u,r,a.maxHeight)),f&&!u&&(u=pr(f/2)),{width:f,height:u}}function Cu(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;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!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const B2=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Tu(n,e){const t=R2(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Zi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function U2(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 W2(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Zi(n,s,t),r=Zi(s,l,t),a=Zi(l,e,t),f=Zi(o,r,t),u=Zi(r,a,t);return Zi(f,u,t)}const $u=new Map;function Y2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=$u.get(t);return i||(i=new Intl.NumberFormat(n,e),$u.set(t,i)),i}function Tl(n,e,t){return Y2(e,t).format(n)}const K2=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}}},J2=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?K2(e,t):J2()}function Z2(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 G2(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Pb(n){return n==="angle"?{between:cl,compare:Lk,normalize:$n}:{between:dl,compare:(e,t)=>e-t,normalize:e=>e}}function Mu({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function X2(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Pb(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(s,T,y)&&r(s,T)!==0,$=()=>r(l,y)===0||a(l,T,y),M=()=>h||C(),E=()=>!h||$();for(let D=u,I=u;D<=c;++D)S=e[D%o],!S.skip&&(y=f(S[i]),y!==T&&(h=a(y,s,l),b===null&&M()&&(b=r(y,s)===0?D:I),b!==null&&E()&&(_.push(Mu({start:b,end:D,loop:d,count:o,style:m})),b=null),I=D,T=y));return b!==null&&_.push(Mu({start:b,end:c,loop:d,count:o,style:m})),_}function Nb(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function x2(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%s];f.skip||f.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function ew(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Q2(t,s,l,i);if(i===!0)return Eu(n,[{start:o,end:r,loop:l}],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=gb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.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,s)=>Math.max(i,s._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 s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var mi=new iw;const Du="transparent",sw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=yu(n||Du),s=i.valid&&yu(e||Du);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class lw{constructor(e,t,i,s){const l=t[i];s=Bl([e.to,s,l,e.from]);const o=Bl([e.from,l,s]);this._active=!0,this._fn=e.fn||sw[e.type||typeof o],this._easing=il[e.easing]||il.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=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Bl([e.to,t,s,e.from]),this._from=Bl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,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 s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});it.set("animations",{colors:{type:"color",properties:rw},numbers:{type:"number",properties:ow}});it.describe("animations",{_fallback:"animation"});it.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:n=>n|0}}}});class Rb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!et(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!et(s))return;const l={};for(const o of aw)l[o]=s[o];(Et(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=uw(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&fw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=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"){s.push(...this._animateOptions(e,t));continue}const u=t[f];let c=l[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}l[f]=c=new lw(d,e,f,u),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return mi.add(this._chart,i),!0}}function fw(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function Fu(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,f=o.axis,u=mw(l,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function gw(n,e){return qi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function bw(n,e,t){return qi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Bs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const _r=n=>n==="reset"||n==="none",Nu=(n,e)=>e?n:Object.assign({},n),vw=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:qb(t,!0),values:null};class ei{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.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Lu(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Bs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,m,_)=>c==="x"?d:c==="r"?_:m,l=t.xAxisID=nt(i.xAxisID,hr(e,"x")),o=t.yAxisID=nt(i.yAxisID,hr(e,"y")),r=t.rAxisID=nt(i.rAxisID,hr(e,"r")),a=t.indexAxis,f=t.iAxisID=s(a,l,o,r),u=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),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&&du(this._data,this),e._stacked&&Bs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(et(t))this._data=pw(t);else if(i!==t){if(i){du(i,this);const s=this._cachedMeta;Bs(s),s._parsed=[]}t&&Object.isExtensible(t)&&Rk(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 s=!1;this._dataCheck();const l=t._stacked;t._stacked=Lu(t.vScale,t),t.stack!==i.stack&&(s=!0,Bs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==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:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{Et(s[e])?d=this.parseArrayData(i,s,e,t):et(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||f&&c[r]h||c=0;--d)if(!_()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),h=f.resolveNamedOptions(d,m,_,c);return h.$shared&&(h.$shared=a,l[o]=Object.freeze(Nu(h,a))),h}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.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 Rb(s,a&&a.animations);return a&&a._cacheable&&(l[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),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){_r(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!_r(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}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 s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function kw(n){const e=n.iScale,t=yw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Bn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,f=o),e[t.axis]=f,e._custom={barStart:a,barEnd:f,start:s,end:l,min:o,max:r}}function jb(n,e,t,i){return Et(n)?Cw(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Ru(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let f,u,c,d;for(f=t,u=t+i;f=t?1:-1)}function $w(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const f=a.controller.getParsed(t),u=f&&f[a.vScale.axis];if(dt(u)||isNaN(u))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:f}=this._getSharedOptions(t,s),u=o.axis,c=r.axis;for(let d=t;dcl(T,r,a,!0)?1:Math.max(C,C*t,$,$*t),_=(T,C,$)=>cl(T,r,a,!0)?-1:Math.min(C,C*t,$,$*t),h=m(0,f,c),b=m(Nt,u,d),y=_(qt,f,c),S=_(qt+Nt,u,d);i=(h-y)/2,s=(b-S)/2,l=-(h+y)/2,o=-(b+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class $l extends ei{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(et(i[e])){const{key:a="value"}=this._parsing;l=f=>+Fi(i[f],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?gt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Tl(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};$l.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return Et(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Ko extends ei{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=vb(t,s,o);this._drawStart=r,this._drawCount=a,yb(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const f=this.resolveDatasetElementOptions(e);this.options.showLine||(f.borderWidth=0),f.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:f},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:f}=this._cachedMeta,{sharedOptions:u,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,m=r.axis,{spanGaps:_,segment:h}=this.options,b=Ms(_)?_:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs($[d]-S[d])>b,h&&(M.parsed=$,M.raw=f.data[T]),c&&(M.options=u||this.resolveDataElementOptions(T,C.active?"active":s)),y||this.updateElement(C,T,M,s),S=$}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ko.id="line";Ko.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ko.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ka extends ei{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Tl(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Ab.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,f=this._cachedMeta.rScale,u=f.xCenter,c=f.yCenter,d=f.getIndexAngle(0)-.5*qt;let m=d,_;const h=360/this.countVisibleElements();for(_=0;_{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}Ka.id="polarArea";Ka.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ka.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Vb extends $l{}Vb.id="pie";Vb.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ja extends ei{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return Ab.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};Si.defaults={};Si.defaultRoutes=void 0;const zb={values(n){return Et(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=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)&&(s="scientific"),l=Aw(n,t)}const o=zn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Tl(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(zn(n)));return i===1||i===2||i===5?zb.numeric.call(this,n,e,t):""}};function Aw(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 Jo={formatters:zb};it.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Jo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});it.route("scale.ticks","color","","color");it.route("scale.grid","color","","borderColor");it.route("scale.grid","borderColor","","borderColor");it.route("scale.title","color","","color");it.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});it.describe("scales",{_fallback:"scale"});it.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function Iw(n,e){const t=n.options.ticks,i=t.maxTicksLimit||Lw(n),s=t.major.enabled?Fw(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Nw(e,a,s,l/i),a;const f=Pw(s,e,i);if(l>0){let u,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Wl(e,a,f,dt(d)?0:o-d,o),u=0,c=l-1;us)return a}return Math.max(s,1)}function Fw(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Vu=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function zu(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function Vw(n,e){mt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Nn(t,Nn(i,t)),max:Nn(i,Nn(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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,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=y2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=an(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-Us(e.grid)-t.padding-Hu(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=La(Math.min(Math.asin(an((u.highest.height+6)/r,-1,1)),Math.asin(an(a/f,-1,1))-Math.asin(an(d/f,-1,1)))),o=Math.max(s,Math.min(l,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:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Hu(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Us(l)+a):(e.height=this.maxHeight,e.width=Us(l)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,_=Qn(this.labelRotation),h=Math.cos(_),b=Math.sin(_);if(r){const y=i.mirror?0:b*c.width+h*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:h*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,b,h)}}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,s){const{ticks:{align:l,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=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="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;l==="start"?(u=0,c=e.height):l==="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:l[E]||0,height:o[E]||0});return{first:M(0),last:M(t-1),widest:M(C),highest:M($),widths:l,heights:o}}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 Pk(this._alignToPixels?Ui(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*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),u=this.ticks.length+(r?1:0),c=Us(l),d=[],m=l.setContext(this.getContext()),_=m.drawBorder?m.borderWidth:0,h=_/2,b=function(j){return Ui(i,j,_)};let y,S,T,C,$,M,E,D,I,P,F,R;if(o==="top")y=b(this.bottom),M=this.bottom-c,D=y-h,P=b(e.top)+h,R=e.bottom;else if(o==="bottom")y=b(this.top),P=e.top,R=b(e.bottom)-h,M=y+h,D=this.top+c;else if(o==="left")y=b(this.right),$=this.right-c,E=y-h,I=b(e.left)+h,F=e.right;else if(o==="right")y=b(this.left),I=e.left,F=b(e.right)-h,$=y+h,E=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(et(o)){const j=Object.keys(o)[0],Z=o[j];y=b(this.chart.scales[j].getPixelForValue(Z))}P=e.top,R=e.bottom,M=y+h,D=M+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(et(o)){const j=Object.keys(o)[0],Z=o[j];y=b(this.chart.scales[j].getPixelForValue(Z))}$=y-h,E=$-c,I=e.left,F=e.right}const N=nt(s.ticks.maxTicksLimit,u),q=Math.max(1,Math.ceil(u/N));for(S=0;Sl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,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(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");it.route(l,s,a,r)})}function Kw(n){return"id"in n&&"defaults"in n}class Jw{constructor(){this.controllers=new Yl(ei,"datasets",!0),this.elements=new Yl(Si,"elements"),this.plugins=new Yl(Object,"plugins"),this.scales=new Yl(rs,"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(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):mt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Ia(e);Ft(i["before"+s],[],i),t[e](i),Ft(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs(M[m]-T[m])>y,b&&(E.parsed=M,E.raw=f.data[C]),d&&(E.options=c||this.resolveDataElementOptions(C,$.active?"active":s)),S||this.updateElement($,C,E,s),T=M}this.updateSharedOptions(c,s,u)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Za.id="scatter";Za.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Za.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Wi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ta{constructor(e){this.options=e||{}}init(e){}formats(){return Wi()}parse(e,t){return Wi()}format(e,t){return Wi()}add(e,t,i){return Wi()}diff(e,t,i){return Wi()}startOf(e,t,i){return Wi()}endOf(e,t){return Wi()}}ta.override=function(n){Object.assign(ta.prototype,n)};var Hb={_date:ta};function Zw(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?Fk:Xi;if(i){if(s._sharedOptions){const f=l[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(l,e,t-u),d=a(l,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Ml(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var xw={evaluateInteractionItems:Ml,modes:{index(n,e,t,i){const s=Ji(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?br(n,s,l,i,o):vr(n,s,l,!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 s=Ji(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?br(n,s,l,i,o):vr(n,s,l,!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 Uu(n,e){return n.filter(t=>Bb.indexOf(t.pos)===-1&&t.box.axis===e)}function Ys(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function e3(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Ys(Ws(e,"left"),!0),s=Ys(Ws(e,"right")),l=Ys(Ws(e,"top"),!0),o=Ys(Ws(e,"bottom")),r=Uu(e,"x"),a=Uu(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ws(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Wu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Ub(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 s3(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!et(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&Ub(o,l.getPadding());const r=Math.max(0,e.outerWidth-Wu(o,n,"left","right")),a=Math.max(0,e.outerHeight-Wu(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 l3(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function o3(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Qs(n,e,t,i){const s=[];let l,o,r,a,f,u;for(l=0,o=n.length,f=0;l{typeof h.beforeLayout=="function"&&h.beforeLayout()});const u=a.reduce((h,b)=>b.box.options&&b.box.options.display===!1?h:h+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},s);Ub(d,Un(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),_=n3(a.concat(f),c);Qs(r.fullSize,m,c,_),Qs(a,m,c,_),Qs(f,m,c,_)&&Qs(a,m,c,_),l3(m),Yu(r.leftAndTop,m,c,_),m.x+=m.w,m.y+=m.h,Yu(r.rightAndBottom,m,c,_),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,h=>{const b=h.box;Object.assign(b,n.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Wb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class r3 extends Wb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const oo="$chartjs",a3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ku=n=>n===null||n==="";function f3(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[oo]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Ku(s)){const l=Tu(n,"width");l!==void 0&&(n.width=l)}if(Ku(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Tu(n,"height");l!==void 0&&(n.height=l)}return n}const Yb=B2?{passive:!0}:!1;function u3(n,e,t){n.addEventListener(e,t,Yb)}function c3(n,e,t){n.canvas.removeEventListener(e,t,Yb)}function d3(n,e){const t=a3[n.type]||n.type,{x:i,y:s}=Ji(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Eo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function p3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Eo(r.addedNodes,i),o=o&&!Eo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function m3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Eo(r.removedNodes,i),o=o&&!Eo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const ml=new Map;let Ju=0;function Kb(){const n=window.devicePixelRatio;n!==Ju&&(Ju=n,ml.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function h3(n,e){ml.size||window.addEventListener("resize",Kb),ml.set(n,e)}function _3(n){ml.delete(n),ml.size||window.removeEventListener("resize",Kb)}function g3(n,e,t){const i=n.canvas,s=i&&Ua(i);if(!s)return;const l=bb((r,a)=>{const f=s.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||l(f,u)});return o.observe(s),h3(n,l),o}function yr(n,e,t){t&&t.disconnect(),e==="resize"&&_3(n)}function b3(n,e,t){const i=n.canvas,s=bb(l=>{n.ctx!==null&&t(d3(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return u3(i,e,s),s}class v3 extends Wb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(f3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[oo])return!1;const i=t[oo].initial;["height","width"].forEach(l=>{const o=i[l];dt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[oo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:p3,detach:m3,resize:g3}[t]||b3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:yr,detach:yr,resize:yr}[t]||c3)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return H2(e,t,i,s)}isAttached(e){const t=Ua(e);return!!(t&&t.isConnected)}}function y3(n){return!Lb()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?r3:v3}class k3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(Ft(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){dt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=nt(i.options&&i.options.plugins,{}),l=w3(i);return s===!1&&!t?[]:C3(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function w3(n){const e={},t=[],i=Object.keys(li.plugins.items);for(let l=0;l{const a=i[r];if(!et(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const f=ia(r,a),u=M3(f,s),c=t.scales||{};l[f]=l[f]||r,o[r]=tl(Object.create(null),[{axis:f},a,c[f],c[u]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,f=r.indexAxis||na(a,e),c=(is[a]||{}).scales||{};Object.keys(c).forEach(d=>{const m=$3(d,f),_=r[m+"AxisID"]||l[m]||m;o[_]=o[_]||Object.create(null),tl(o[_],[{axis:m},i[_],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];tl(a,[it.scales[a.type],it.scale])}),o}function Jb(n){const e=n.options||(n.options={});e.plugins=nt(e.plugins,{}),e.scales=O3(n,e)}function Zb(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function D3(n){return n=n||{},n.data=Zb(n.data),Jb(n),n}const Zu=new Map,Gb=new Set;function Zl(n,e){let t=Zu.get(n);return t||(t=e(),Zu.set(n,t),Gb.add(t)),t}const Ks=(n,e,t)=>{const i=Fi(e,t);i!==void 0&&n.add(i)};class A3{constructor(e){this._config=D3(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=Zb(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(),Jb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Zl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Zl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Zl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Zl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=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=>Ks(a,e,c))),u.forEach(c=>Ks(a,s,c)),u.forEach(c=>Ks(a,is[l]||{},c)),u.forEach(c=>Ks(a,it,c)),u.forEach(c=>Ks(a,xr,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Gb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,is[t]||{},it.datasets[t]||{},{type:t},it,xr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Gu(this._resolverCache,e,s);let a=o;if(L3(o,t)){l.$shared=!1,i=Ni(i)?i():i;const f=this.createResolver(e,i,r);a=Es(o,i,f)}for(const f of t)l[f]=a[f];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Gu(this._resolverCache,e,i);return et(t)?Es(l,t,void 0,s):l}}function Gu(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:za(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const I3=n=>et(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Ni(n[t]),!1);function L3(n,e){const{isScriptable:t,isIndexable:i}=Mb(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Ni(r)||I3(r))||o&&Et(r))return!0}return!1}var P3="3.9.1";const F3=["top","bottom","left","right","chartArea"];function Xu(n,e){return n==="top"||n==="bottom"||F3.indexOf(n)===-1&&e==="x"}function Qu(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function xu(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ft(t&&t.onComplete,[n],e)}function N3(n){const e=n.chart,t=e.options.animation;Ft(t&&t.onProgress,[n],e)}function Xb(n){return Lb()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Oo={},Qb=n=>{const e=Xb(n);return Object.values(Oo).filter(t=>t.canvas===e).pop()};function R3(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function q3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Do{constructor(e,t){const i=this.config=new A3(t),s=Xb(e),l=Qb(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||y3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=wk(),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 k3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qk(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Oo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}mi.listen(this,"complete",xu),mi.listen(this,"progress",N3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return dt(e)?t&&l?l:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ku(this.canvas,this.ctx),this}stop(){return mi.stop(this),this}resize(e,t){mi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),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,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ia(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),mt(l,o=>{const r=o.options,a=r.id,f=ia(a,r),u=nt(r.type,o.dtype);(r.position===void 0||Xu(r.position,f)!==Xu(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=li.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),mt(s,(o,r)=>{o||delete i[r]}),mt(i,o=>{Jl.configure(this,o,o.options),Jl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=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()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=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(Qu("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=>{Jl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!au(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;R3(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Jl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],mt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),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,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&qa(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&ja(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return pl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=xw.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=qi(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 s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Bn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s: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(),mi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};mt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},s=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},l=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),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 s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!yo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=Ek(e),f=q3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Ft(l.onHover,[e,r,this],this),a&&Ft(l.onClick,[e,r,this],this));const u=!yo(r,s);return(u||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const ec=()=>mt(Do.instances,n=>n._plugins.invalidate()),Mi=!0;Object.defineProperties(Do,{defaults:{enumerable:Mi,value:it},instances:{enumerable:Mi,value:Oo},overrides:{enumerable:Mi,value:is},registry:{enumerable:Mi,value:li},version:{enumerable:Mi,value:P3},getChart:{enumerable:Mi,value:Qb},register:{enumerable:Mi,value:(...n)=>{li.add(...n),ec()}},unregister:{enumerable:Mi,value:(...n)=>{li.remove(...n),ec()}}});function xb(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let f=s/r;n.beginPath(),n.arc(l,o,r,i-f,t+f),a>s?(f=s/a,n.arc(l,o,a,t+f,i-f,!0)):n.arc(l,o,s,t+Nt,i-Nt),n.closePath(),n.clip()}function j3(n){return Va(n,["outerStart","outerEnd","innerStart","innerEnd"])}function V3(n,e,t,i){const s=j3(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const f=(t-Math.min(l,a))*i/2;return an(a,0,Math.min(l,f))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:an(s.innerStart,0,o),innerEnd:an(s.innerEnd,0,o)}}function ms(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function sa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:f,innerRadius:u}=e,c=Math.max(e.outerRadius+i+t-f,0),d=u>0?u+i+t+f:0;let m=0;const _=s-a;if(i){const j=u>0?u-i:0,Z=c>0?c-i:0,X=(j+Z)/2,K=X!==0?_*X/(X+i):_;m=(_-K)/2}const h=Math.max(.001,_*c-t/qt)/c,b=(_-h)/2,y=a+b+m,S=s-b-m,{outerStart:T,outerEnd:C,innerStart:$,innerEnd:M}=V3(e,d,c,S-y),E=c-T,D=c-C,I=y+T/E,P=S-C/D,F=d+$,R=d+M,N=y+$/F,q=S-M/R;if(n.beginPath(),l){if(n.arc(o,r,c,I,P),C>0){const X=ms(D,P,o,r);n.arc(X.x,X.y,C,P,S+Nt)}const j=ms(R,S,o,r);if(n.lineTo(j.x,j.y),M>0){const X=ms(R,q,o,r);n.arc(X.x,X.y,M,S+Nt,q+Math.PI)}if(n.arc(o,r,d,S-M/d,y+$/d,!0),$>0){const X=ms(F,N,o,r);n.arc(X.x,X.y,$,N+Math.PI,y-Nt)}const Z=ms(E,y,o,r);if(n.lineTo(Z.x,Z.y),T>0){const X=ms(E,I,o,r);n.arc(X.x,X.y,T,y-Nt,I)}}else{n.moveTo(o,r);const j=Math.cos(I)*c+o,Z=Math.sin(I)*c+r;n.lineTo(j,Z);const X=Math.cos(P)*c+o,K=Math.sin(P)*c+r;n.lineTo(X,K)}n.closePath()}function z3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){sa(n,e,t,i,o+gt,s);for(let f=0;f=gt||cl(l,r,a),h=dl(o,f+d,u+d);return _&&h}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:f}=this.options,u=(s+l)/2,c=(o+r+f+a)/2;return{x:t+Math.cos(u)*c,y:i+Math.sin(u)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>gt?Math.floor(i/gt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const f=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(f)*r,Math.sin(f)*r),this.circumference>=qt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=z3(e,this,r,l,o);B3(e,this,r,l,a,o),e.restore()}}Ga.id="arc";Ga.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ga.defaultRoutes={backgroundColor:"backgroundColor"};function e1(n,e,t=e){n.lineCap=nt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(nt(t.borderDash,e.borderDash)),n.lineDashOffset=nt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=nt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=nt(t.borderWidth,e.borderWidth),n.strokeStyle=nt(t.borderColor,e.borderColor)}function U3(n,e,t){n.lineTo(t.x,t.y)}function W3(n){return n.stepped?d2:n.tension||n.cubicInterpolationMode==="monotone"?p2:U3}function t1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),f=Math.min(l,r),u=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-C:C))%l,T=()=>{h!==b&&(n.lineTo(u,b),n.lineTo(u,h),n.lineTo(u,y))};for(a&&(m=s[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[S(d)],m.skip)continue;const C=m.x,$=m.y,M=C|0;M===_?($b&&(b=$),u=(c*u+C)/++c):(T(),n.lineTo(C,$),_=M,c=0,h=b=$),y=$}T()}function la(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?K3:Y3}function J3(n){return n.stepped?U2:n.tension||n.cubicInterpolationMode==="monotone"?W2:Zi}function Z3(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),e1(n,e.options),n.stroke(s)}function G3(n,e,t,i){const{segments:s,options:l}=e,o=la(e);for(const r of s)e1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const X3=typeof Path2D=="function";function Q3(n,e,t,i){X3&&!e.options.segment?Z3(n,e,t,i):G3(n,e,t,i)}class ji extends Si{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 s=i.spanGaps?this._loop:this._fullLoop;N2(this._points,i,e,s,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=ew(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,s=e[t],l=this.points,o=Nb(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=J3(i);let f,u;for(f=0,u=o.length;fn!=="borderDash"&&n!=="fill"};function tc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Qa(o,r,s);const a=s[o],f=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:f.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:f.y}))}),l}function Qa(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function nc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function i1(n,e){let t=[],i=!1;return Et(n)?(i=!0,t=n):t=lS(n,e),t.length?new ji({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ic(n){return n&&n.fill!==!1}function oS(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Bt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function rS(n,e,t){const i=cS(n);if(et(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Bt(s)&&Math.floor(s)===s?aS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function aS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function fS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:et(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function uS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:et(n)?i=n.value:i=e.getBaseValue(),i}function cS(n){const e=n.options,t=e.fill;let i=nt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function dS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=pS(e,t);r.push(i1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&Sr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;ic(l)&&Sr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ic(i)||t.drawTime!=="beforeDatasetDraw"||Sr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ll={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` +`):n}function CS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function rc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Mn(e.bodyFont),f=Mn(e.titleFont),u=Mn(e.footerFont),c=l.length,d=s.length,m=i.length,_=Un(e.padding);let h=_.height,b=0,y=i.reduce((C,$)=>C+$.before.length+$.lines.length+$.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*C+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function(C){b=Math.max(b,t.measureText(C).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,C=>{mt(C.before,T),mt(C.lines,T),mt(C.after,T)}),S=0,t.font=u.string,mt(n.footer,T),t.restore(),b+=_.width,{width:b,height:h}}function TS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function $S(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function MS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=s<=(r+a)/2?"left":"right":s<=l/2?f="left":s>=o-l/2&&(f="right"),$S(f,n,e,t)&&(f="center"),f}function ac(n,e,t){const i=t.yAlign||e.yAlign||TS(n,t);return{xAlign:t.xAlign||e.xAlign||MS(n,e,t,i),yAlign:i}}function ES(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function OS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function fc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=s+l,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=ys(o);let _=ES(e,r);const h=OS(e,a,f);return a==="center"?r==="left"?_+=f:r==="right"&&(_-=f):r==="left"?_-=Math.max(u,d)+s:r==="right"&&(_+=Math.max(c,m)+s),{x:an(_,0,i.width-e.width),y:an(h,0,i.height-e.height)}}function Gl(n,e,t){const i=Un(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function uc(n){return ii([],hi(n))}function DS(n,e,t){return qi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function cc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ra extends Si{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||e._chart,this._chart=this.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()),s=i.enabled&&t.options.animation&&i.animations,l=new Rb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=DS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ii(r,hi(s)),r=ii(r,hi(l)),r=ii(r,hi(o)),r}getBeforeBody(e,t){return uc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=cc(i,l);ii(o.before,hi(r.beforeLabel.call(this,l))),ii(o.lines,r.label.call(this,l)),ii(o.after,hi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return uc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ii(r,hi(s)),r=ii(r,hi(l)),r=ii(r,hi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],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=cc(e.callbacks,u);s.push(c.labelColor.call(this,u)),l.push(c.labelPointStyle.call(this,u)),o.push(c.labelTextColor.call(this,u))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ll[i.position].call(this,s,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=rc(this,i),f=Object.assign({},r,a),u=ac(this.chart,i,f),c=fc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,l={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,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=ys(r),{x:d,y:m}=e,{width:_,height:h}=t;let b,y,S,T,C,$;return l==="center"?(C=m+h/2,s==="left"?(b=d,y=b-o,T=C+o,$=C-o):(b=d+_,y=b+o,T=C-o,$=C+o),S=b):(s==="left"?y=d+Math.max(a,u)+o:s==="right"?y=d+_-Math.max(f,c)-o:y=this.caretX,l==="top"?(T=m,C=T-o,b=y-o,S=y+o):(T=m+h,C=T+o,b=y+o,S=y-o),$=T),{x1:b,x2:y,x3:S,y1:T,y2:C,y3:$}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const f=mr(i.rtl,this.x,this.width);for(e.x=Gl(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=Mn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aT!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,$o(e,{x:b,y:h,w:f,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),$o(e,{x:y,y:h+1,w:f-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,h,f,a),e.strokeRect(b,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(y,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=Mn(i.bodyFont);let d=c.lineHeight,m=0;const _=mr(i.rtl,this.x,this.width),h=function(D){t.fillText(D,_.x(e.x+m),e.y+d/2),e.y+=d+l},b=_.textAlign(o);let y,S,T,C,$,M,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Gl(this,b,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,h),m=r&&b!=="right"?o==="center"?f/2+u:f+2+u:0,C=0,M=s.length;C0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ll[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=rc(this,e),a=Object.assign({},o,this._size),f=ac(t,e,a),u=fc(e,a,f,t);(s._to!==u.x||l._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 s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Un(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(l,e,s,t),Z2(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),G2(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=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}}),l=!yo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!yo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ll[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ra.positioners=ll;var AS={id:"tooltip",_element:ra,positioners:ll,afterInit(n,e,t){t&&(n.tooltip=new ra({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)===!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:{beforeTitle:pi,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.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const IS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function LS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return IS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const PS=(n,e)=>n===null?null:an(Math.round(n),0,e);class aa extends rs{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(dt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:LS(i,e,nt(t,e),this._addedLabels),PS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}aa.id="category";aa.defaults={ticks:{callback:aa.prototype.getLabelForValue}};function FS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=l||1,_=u-1,{min:h,max:b}=e,y=!dt(o),S=!dt(r),T=!dt(f),C=(b-h)/(c+1);let $=uu((b-h)/_/m)*m,M,E,D,I;if($<1e-14&&!y&&!S)return[{value:h},{value:b}];I=Math.ceil(b/$)-Math.floor(h/$),I>_&&($=uu(I*$/_/m)*m),dt(a)||(M=Math.pow(10,a),$=Math.ceil($*M)/M),s==="ticks"?(E=Math.floor(h/$)*$,D=Math.ceil(b/$)*$):(E=h,D=b),y&&S&&l&&Ik((r-o)/l,$/1e3)?(I=Math.round(Math.min((r-o)/$,u)),$=(r-o)/I,E=o,D=r):T?(E=y?o:E,D=S?r:D,I=f-1,$=(D-E)/I):(I=(D-E)/$,nl(I,Math.round(I),$/1e3)?I=Math.round(I):I=Math.ceil(I));const P=Math.max(cu($),cu(E));M=Math.pow(10,dt(a)?P:a),E=Math.round(E*M)/M,D=Math.round(D*M)/M;let F=0;for(y&&(d&&E!==o?(t.push({value:o}),Es=t?s:a,r=a=>l=i?l:a;if(e){const a=oi(s),f=oi(l);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={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},l=this._range||this,o=FS(s,l);return e.bounds==="ticks"&&pb(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 s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Tl(e,this.chart.options.locale,this.options.ticks.format)}}class xa extends Ao{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Bt(e)?e:0,this.max=Bt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}xa.id="linear";xa.defaults={ticks:{callback:Jo.formatters.numeric}};function pc(n){return n/Math.pow(10,Math.floor(zn(n)))===1}function NS(n,e){const t=Math.floor(zn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Nn(n.min,Math.pow(10,Math.floor(zn(e.min)))),o=Math.floor(zn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:pc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Bt(e)?Math.max(0,e):null,this.max=Bt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,f)=>Math.pow(10,Math.floor(zn(a))+f);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=NS(t,this);return e.bounds==="ticks"&&pb(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Tl(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zn(e),this._valueRange=zn(this.max)-zn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}l1.id="logarithmic";l1.defaults={ticks:{callback:Jo.formatters.logarithmic,major:{enabled:!0}}};function fa(n){const e=n.ticks;if(e.display&&n.display){const t=Un(e.backdropPadding);return nt(e.font&&e.font.size,it.font.size)+t.height}return 0}function RS(n,e,t){return t=Et(t)?t:[t],{w:u2(n,e.string,t),h:t.length*e.lineHeight}}function mc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function qS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?qt/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function VS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=fa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?qt/s:0;for(let f=0;f270||t<90)&&(n-=e),n}function US(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=Mn(l.font),{x:r,y:a,textAlign:f,left:u,top:c,right:d,bottom:m}=n._pointLabelItems[s],{backdropColor:_}=l;if(!dt(_)){const h=ys(l.borderRadius),b=Un(l.backdropPadding);t.fillStyle=_;const y=u-b.left,S=c-b.top,T=d-u+b.width,C=m-c+b.height;Object.values(h).some($=>$!==0)?(t.beginPath(),$o(t,{x:y,y:S,w:T,h:C,radius:h}),t.fill()):t.fillRect(y,S,T,C)}To(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:f,textBaseline:"middle"})}}function o1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,gt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Ft(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?qS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=gt/(this._pointLabels.length||1),i=this.options.startAngle||0;return $n(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(dt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(dt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(u!==0){r=this.getDistanceFromCenterForValue(f.value);const c=s.setContext(this.getContext(u-1));WS(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const f=i.setContext(this.getPointLabelContext(o)),{color:u,lineWidth:c}=f;!c||!u||(e.lineWidth=c,e.strokeStyle=u,e.setLineDash(f.borderDash),e.lineDashOffset=f.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const f=i.setContext(this.getContext(a)),u=Mn(f.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),f.showLabelBackdrop){e.font=u.string,o=e.measureText(r.label).width,e.fillStyle=f.backdropColor;const c=Un(f.backdropPadding);e.fillRect(-o/2-c.left,-l-u.size/2-c.top,o+c.width,u.size+c.height)}To(e,r.label,0,-l,u,{color:f.color})}),e.restore()}drawTitle(){}}Go.id="radialLinear";Go.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Jo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Go.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Go.descriptors={angleLines:{_fallback:"grid"}};const Xo={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}},vn=Object.keys(Xo);function KS(n,e){return n-e}function hc(n,e){if(dt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Bt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ms(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function _c(n,e,t,i){const s=vn.length;for(let l=vn.indexOf(n);l=vn.indexOf(t);l--){const o=vn[l];if(Xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return vn[t?vn.indexOf(t):0]}function ZS(n){for(let e=vn.indexOf(n)+1,t=vn.length;e=e?t[i]:t[s];n[l]=!0}}function GS(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function bc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=an(t,0,o),i=an(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,s=this.options,l=s.time,o=l.unit||_c(l.minUnit,t,i,this._getLabelCapacity(t)),r=nt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,f=Ms(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 _=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;dh-b).map(h=>+h)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,f=r&&o[r],u=a&&o[a],c=i[t],d=a&&u&&c&&c.major,m=this._adapter.format(e,s||(d?u:f)),_=l.ticks.callback;return _?Ft(_,[m,t,i],this):m}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Xi(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Xi(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const f=o-l;return f?r+(a-r)*(e-l)/f:r}class r1 extends El{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=Xl(t,this.min),this._tableRange=Xl(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&s.push(f);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{i&&(t||(t=qe(e,Jt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Jt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function QS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=O(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function xS(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function eC(n){let e,t,i,s,l,o=n[2]&&vc();function r(u,c){return u[2]?xS:QS}let a=r(n),f=a(n);return{c(){e=v("div"),o&&o.c(),t=O(),i=v("canvas"),s=O(),l=v("div"),f.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Nr(i,"height","250px"),Nr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(u,c){w(u,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),w(u,s,c),w(u,l,c),f.m(l,null)},p(u,[c]){u[2]?o?c&4&&A(o,1):(o=vc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),L(o,1,1,()=>{o=null}),fe()),c&4&&Q(e,"loading",u[2]),a===(a=r(u))&&f?f.p(u,c):(f.d(1),f=a(u),f&&(f.c(),f.m(l,null)))},i(u){A(o)},o(u){L(o)},d(u){u&&k(e),o&&o.d(),n[8](null),u&&k(s),u&&k(l),f.d()}}}function tC(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,f=!1;async function u(){return t(2,f=!0),ue.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),ue.error(m,!1))}).finally(()=>{t(2,f=!1)})}function c(){t(1,a=0),t(7,r=[])}Xt(()=>(Do.register(ji,Zo,Ko,xa,El,SS,AS),t(6,o=new Do(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,f,i,s,u,o,r,d]}class nC extends ve{constructor(e){super(),be(this,e,tC,eC,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var a1={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(T){return T instanceof a?new a(T.type,S(T.content),T.alias):Array.isArray(T)?T.map(S):T.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch($){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack)||[])[1];if(S){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==S)return T[C]}return null}},isActive:function(S,T,C){for(var $="no-"+T;S;){var M=S.classList;if(M.contains(T))return!0;if(M.contains($))return!1;S=S.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,T){var C=r.util.clone(r.languages[S]);for(var $ in T)C[$]=T[$];return C},insertBefore:function(S,T,C,$){$=$||r.languages;var M=$[S],E={};for(var D in M)if(M.hasOwnProperty(D)){if(D==T)for(var I in C)C.hasOwnProperty(I)&&(E[I]=C[I]);C.hasOwnProperty(D)||(E[D]=M[D])}var P=$[S];return $[S]=E,r.languages.DFS(r.languages,function(F,R){R===P&&F!=S&&(this[F]=E)}),E},DFS:function S(T,C,$,M){M=M||{};var E=r.util.objId;for(var D in T)if(T.hasOwnProperty(D)){C.call(T,D,T[D],$||D);var I=T[D],P=r.util.type(I);P==="Object"&&!M[E(I)]?(M[E(I)]=!0,S(I,C,null,M)):P==="Array"&&!M[E(I)]&&(M[E(I)]=!0,S(I,C,D,M))}}},plugins:{},highlightAll:function(S,T){r.highlightAllUnder(document,S,T)},highlightAllUnder:function(S,T,C){var $={callback:C,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",$),$.elements=Array.prototype.slice.apply($.container.querySelectorAll($.selector)),r.hooks.run("before-all-elements-highlight",$);for(var M=0,E;E=$.elements[M++];)r.highlightElement(E,T===!0,$.callback)},highlightElement:function(S,T,C){var $=r.util.getLanguage(S),M=r.languages[$];r.util.setLanguage(S,$);var E=S.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,$);var D=S.textContent,I={element:S,language:$,grammar:M,code:D};function P(R){I.highlightedCode=R,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),E=I.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){P(r.util.encode(I.code));return}if(T&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(R){P(R.data)},F.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else P(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,T,C){var $={code:S,grammar:T,language:C};if(r.hooks.run("before-tokenize",$),!$.grammar)throw new Error('The language "'+$.language+'" has no grammar.');return $.tokens=r.tokenize($.code,$.grammar),r.hooks.run("after-tokenize",$),a.stringify(r.util.encode($.tokens),$.language)},tokenize:function(S,T){var C=T.rest;if(C){for(var $ in C)T[$]=C[$];delete T.rest}var M=new c;return d(M,M.head,S),u(S,M,T,M.head,0),_(M)},hooks:{all:{},add:function(S,T){var C=r.hooks.all;C[S]=C[S]||[],C[S].push(T)},run:function(S,T){var C=r.hooks.all[S];if(!(!C||!C.length))for(var $=0,M;M=C[$++];)M(T)}},Token:a};i.Prism=r;function a(S,T,C,$){this.type=S,this.content=T,this.alias=C,this.length=($||"").length|0}a.stringify=function S(T,C){if(typeof T=="string")return T;if(Array.isArray(T)){var $="";return T.forEach(function(P){$+=S(P,C)}),$}var M={type:T.type,content:S(T.content,C),tag:"span",classes:["token",T.type],attributes:{},language:C},E=T.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(M.classes,E):M.classes.push(E)),r.hooks.run("wrap",M);var D="";for(var I in M.attributes)D+=" "+I+'="'+(M.attributes[I]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+D+">"+M.content+""};function f(S,T,C,$){S.lastIndex=T;var M=S.exec(C);if(M&&$&&M[1]){var E=M[1].length;M.index+=E,M[0]=M[0].slice(E)}return M}function u(S,T,C,$,M,E){for(var D in C)if(!(!C.hasOwnProperty(D)||!C[D])){var I=C[D];I=Array.isArray(I)?I:[I];for(var P=0;P=E.reach);J+=K.value.length,K=K.next){var le=K.value;if(T.length>S.length)return;if(!(le instanceof a)){var ie=1,ee;if(q){if(ee=f(X,J,S,N),!ee||ee.index>=S.length)break;var ze=ee.index,$e=ee.index+ee[0].length,Pe=J;for(Pe+=K.value.length;ze>=Pe;)K=K.next,Pe+=K.value.length;if(Pe-=K.value.length,J=Pe,K.value instanceof a)continue;for(var je=K;je!==T.tail&&(Pe<$e||typeof je.value=="string");je=je.next)ie++,Pe+=je.value.length;ie--,le=S.slice(J,Pe),ee.index-=J}else if(ee=f(X,0,le,N),!ee)continue;var ze=ee.index,ke=ee[0],Ce=le.slice(0,ze),Je=le.slice(ze+ke.length),_t=J+le.length;E&&_t>E.reach&&(E.reach=_t);var Ze=K.prev;Ce&&(Ze=d(T,Ze,Ce),J+=Ce.length),m(T,Ze,ie);var We=new a(D,R?r.tokenize(ke,R):ke,j,ke);if(K=d(T,Ze,We),Je&&d(T,K,Je),ie>1){var yt={cause:D+","+P,reach:_t};u(S,T,C,K.prev,J,yt),E&&yt.reach>E.reach&&(E.reach=yt.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},T={value:null,prev:S,next:null};S.next=T,this.head=S,this.tail=T,this.length=0}function d(S,T,C){var $=T.next,M={value:C,prev:T,next:$};return T.next=M,$.prev=M,S.length++,M}function m(S,T,C){for(var $=T.next,M=0;M/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(h,b){return"✖ Error "+h+" while fetching file: "+b},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",f="loaded",u="failed",c="pre[data-src]:not(["+r+'="'+f+'"]):not(['+r+'="'+a+'"])';function d(h,b,y){var S=new XMLHttpRequest;S.open("GET",h,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?b(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function m(h){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(b){var y=Number(b[1]),S=b[2],T=b[3];return S?T?[y,Number(T)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(h){h.selector+=", "+c}),t.hooks.add("before-sanity-check",function(h){var b=h.element;if(b.matches(c)){h.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var S=b.getAttribute("data-src"),T=h.language;if(T==="none"){var C=(/\.(\w+)$/.exec(S)||[,"none"])[1];T=o[C]||C}t.util.setLanguage(y,T),t.util.setLanguage(b,T);var $=t.plugins.autoloader;$&&$.loadLanguages(T),d(S,function(M){b.setAttribute(r,f);var E=m(b.getAttribute("data-range"));if(E){var D=M.split(/\r\n?|\n/g),I=E[0],P=E[1]==null?D.length:E[1];I<0&&(I+=D.length),I=Math.max(0,Math.min(I-1,D.length)),P<0&&(P+=D.length),P=Math.max(0,Math.min(P,D.length)),M=D.slice(I,P).join(` +`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(I+1))}y.textContent=M,t.highlightElement(y)},function(M){b.setAttribute(r,u),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),S=0,T;T=y[S++];)t.highlightElement(T)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(a1);var sC=a1.exports;const Js=iC(sC);var lC={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;ar&&(u[d]=` +`+u[d],c=m)}a[f]=u.join("")}return a.join(` +`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var f in l)if(Object.hasOwnProperty.call(l,f)){var u=l[f];if(a.hasAttribute("data-"+f))try{var c=JSON.parse(a.getAttribute("data-"+f)||"true");typeof c===u&&(o.settings[f]=c)}catch{}}for(var d=a.childNodes,m="",_="",h=!1,b=0;b>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function oC(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function rC(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class f1 extends ve{constructor(e){super(),be(this,e,rC,oC,me,{class:0,content:2,language:3})}}const aC=n=>({}),kc=n=>({}),fC=n=>({}),wc=n=>({});function Sc(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T=n[4]&&!n[2]&&Cc(n);const C=n[19].header,$=wt(C,n,n[18],wc);let M=n[4]&&n[2]&&Tc(n);const E=n[19].default,D=wt(E,n,n[18],null),I=n[19].footer,P=wt(I,n,n[18],kc);return{c(){e=v("div"),t=v("div"),s=O(),l=v("div"),o=v("div"),T&&T.c(),r=O(),$&&$.c(),a=O(),M&&M.c(),f=O(),u=v("div"),D&&D.c(),c=O(),d=v("div"),P&&P.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(l,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(F,R){w(F,e,R),g(e,t),g(e,s),g(e,l),g(l,o),T&&T.m(o,null),g(o,r),$&&$.m(o,null),g(o,a),M&&M.m(o,null),g(l,f),g(l,u),D&&D.m(u,null),n[21](u),g(l,c),g(l,d),P&&P.m(d,null),b=!0,y||(S=[Y(t,"click",Qe(n[20])),Y(u,"scroll",n[22])],y=!0)},p(F,R){n=F,n[4]&&!n[2]?T?T.p(n,R):(T=Cc(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),$&&$.p&&(!b||R[0]&262144)&&Ct($,C,n,n[18],b?St(C,n[18],R,fC):Tt(n[18]),wc),n[4]&&n[2]?M?M.p(n,R):(M=Tc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),D&&D.p&&(!b||R[0]&262144)&&Ct(D,E,n,n[18],b?St(E,n[18],R,null):Tt(n[18]),null),P&&P.p&&(!b||R[0]&262144)&&Ct(P,I,n,n[18],b?St(I,n[18],R,aC):Tt(n[18]),kc),(!b||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!b||R[0]&262)&&Q(l,"popup",n[2]),(!b||R[0]&4)&&Q(e,"padded",n[2]),(!b||R[0]&1)&&Q(e,"active",n[0])},i(F){b||(F&&Ge(()=>{b&&(i||(i=qe(t,Kr,{duration:hs,opacity:0},!0)),i.run(1))}),A($,F),A(D,F),A(P,F),Ge(()=>{b&&(h&&h.end(1),_=tg(l,fi,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),_.start())}),b=!0)},o(F){F&&(i||(i=qe(t,Kr,{duration:hs,opacity:0},!1)),i.run(0)),L($,F),L(D,F),L(P,F),_&&_.invalidate(),h=_a(l,fi,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),b=!1},d(F){F&&k(e),F&&i&&i.end(),T&&T.d(),$&&$.d(F),M&&M.d(),D&&D.d(F),n[21](null),P&&P.d(F),F&&h&&h.end(),y=!1,Ee(S)}}}function Cc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Qe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Tc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Qe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function uC(n){let e,t,i,s,l=n[0]&&Sc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Sc(o),l.c(),A(l,1),l.m(e,null)):l&&(ae(),L(l,1,1,()=>{l=null}),fe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,Ee(s)}}}let Yi,Cr=[];function u1(){return Yi=Yi||document.querySelector(".overlays"),Yi||(Yi=document.createElement("div"),Yi.classList.add("overlays"),document.body.appendChild(Yi)),Yi}let hs=150;function $c(){return 1e3+u1().querySelectorAll(".overlay-panel-container.active").length}function cC(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=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=$t(),_="op_"+V.randomString(10);let h,b,y,S,T="",C=o;function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function E(){return o}async function D(J){t(17,C=J),J?(y=document.activeElement,m("show"),h==null||h.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await fn(),I()}function I(){h&&(o?t(6,h.style.zIndex=$c(),h):t(6,h.style="",h))}function P(){V.pushUnique(Cr,_),document.body.classList.add("overlay-active")}function F(){V.removeByValue(Cr,_),Cr.length||document.body.classList.remove("overlay-active")}function R(J){o&&u&&J.code=="Escape"&&!V.isInput(J.target)&&h&&h.style.zIndex==$c()&&(J.preventDefault(),M())}function N(J){o&&q(b)}function q(J,le){le&&t(8,T=""),J&&(S||(S=setTimeout(()=>{if(clearTimeout(S),S=null,!J)return;if(J.scrollHeight-J.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}J.scrollTop==0?t(8,T+=" scroll-top-reached"):J.scrollTop+J.offsetHeight==J.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}Xt(()=>(u1().appendChild(h),()=>{var J;clearTimeout(S),F(),(J=h==null?void 0:h.classList)==null||J.add("hidden"),setTimeout(()=>{h==null||h.remove()},0)}));const j=()=>a?M():!0;function Z(J){te[J?"unshift":"push"](()=>{b=J,t(7,b)})}const X=J=>q(J.target);function K(J){te[J?"unshift":"push"](()=>{h=J,t(6,h)})}return n.$$set=J=>{"class"in J&&t(1,l=J.class),"active"in J&&t(0,o=J.active),"popup"in J&&t(2,r=J.popup),"overlayClose"in J&&t(3,a=J.overlayClose),"btnClose"in J&&t(4,f=J.btnClose),"escClose"in J&&t(12,u=J.escClose),"beforeOpen"in J&&t(13,c=J.beforeOpen),"beforeHide"in J&&t(14,d=J.beforeHide),"$$scope"in J&&t(18,s=J.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&C!=o&&D(o),n.$$.dirty[0]&128&&q(b,!0),n.$$.dirty[0]&64&&h&&I(),n.$$.dirty[0]&1&&(o?P():F())},[o,l,r,a,f,M,h,b,T,R,N,q,u,c,d,$,E,C,s,i,j,Z,X,K]}class sn extends ve{constructor(e){super(),be(this,e,cC,uC,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 dC(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function pC(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=U(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),g(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&se(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function mC(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function hC(n){let e,t,i;return t=new f1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function _C(n){var Ae;let e,t,i,s,l,o,r=n[2].id+"",a,f,u,c,d,m,_,h=n[2].status+"",b,y,S,T,C,$,M=((Ae=n[2].method)==null?void 0:Ae.toUpperCase())+"",E,D,I,P,F,R,N=n[2].auth+"",q,j,Z,X,K,J,le=n[2].url+"",ie,ee,$e,Pe,je,ze,ke,Ce,Je,_t,Ze,We=n[2].remoteIp+"",yt,pe,_e,Ye,Mt,Ie,rt=n[2].userIp+"",Oe,lt,Ot,Vt,An,In,Yn=n[2].userAgent+"",Kn,kt,un,ti,as,di,Ti,ge,we,ct,xe,Wt,_n,Ln,tn,cn;function Al(Le,Me){return Le[2].referer?pC:dC}let W=Al(n),G=W(n);const ne=[hC,mC],oe=[];function Se(Le,Me){return Me&4&&(Ti=null),Ti==null&&(Ti=!V.isEmpty(Le[2].meta)),Ti?0:1}return ge=Se(n,-1),we=oe[ge]=ne[ge](n),tn=new ki({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=O(),o=v("td"),a=U(r),f=O(),u=v("tr"),c=v("td"),c.textContent="Status",d=O(),m=v("td"),_=v("span"),b=U(h),y=O(),S=v("tr"),T=v("td"),T.textContent="Method",C=O(),$=v("td"),E=U(M),D=O(),I=v("tr"),P=v("td"),P.textContent="Auth",F=O(),R=v("td"),q=U(N),j=O(),Z=v("tr"),X=v("td"),X.textContent="URL",K=O(),J=v("td"),ie=U(le),ee=O(),$e=v("tr"),Pe=v("td"),Pe.textContent="Referer",je=O(),ze=v("td"),G.c(),ke=O(),Ce=v("tr"),Je=v("td"),Je.textContent="Remote IP",_t=O(),Ze=v("td"),yt=U(We),pe=O(),_e=v("tr"),Ye=v("td"),Ye.textContent="User IP",Mt=O(),Ie=v("td"),Oe=U(rt),lt=O(),Ot=v("tr"),Vt=v("td"),Vt.textContent="UserAgent",An=O(),In=v("td"),Kn=U(Yn),kt=O(),un=v("tr"),ti=v("td"),ti.textContent="Meta",as=O(),di=v("td"),we.c(),ct=O(),xe=v("tr"),Wt=v("td"),Wt.textContent="Created",_n=O(),Ln=v("td"),B(tn.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(_,"class","label"),Q(_,"label-danger",n[2].status>=400),p(T,"class","min-width txt-hint txt-bold"),p(P,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Pe,"class","min-width txt-hint txt-bold"),p(Je,"class","min-width txt-hint txt-bold"),p(Ye,"class","min-width txt-hint txt-bold"),p(Vt,"class","min-width txt-hint txt-bold"),p(ti,"class","min-width txt-hint txt-bold"),p(Wt,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Le,Me){w(Le,e,Me),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,a),g(t,f),g(t,u),g(u,c),g(u,d),g(u,m),g(m,_),g(_,b),g(t,y),g(t,S),g(S,T),g(S,C),g(S,$),g($,E),g(t,D),g(t,I),g(I,P),g(I,F),g(I,R),g(R,q),g(t,j),g(t,Z),g(Z,X),g(Z,K),g(Z,J),g(J,ie),g(t,ee),g(t,$e),g($e,Pe),g($e,je),g($e,ze),G.m(ze,null),g(t,ke),g(t,Ce),g(Ce,Je),g(Ce,_t),g(Ce,Ze),g(Ze,yt),g(t,pe),g(t,_e),g(_e,Ye),g(_e,Mt),g(_e,Ie),g(Ie,Oe),g(t,lt),g(t,Ot),g(Ot,Vt),g(Ot,An),g(Ot,In),g(In,Kn),g(t,kt),g(t,un),g(un,ti),g(un,as),g(un,di),oe[ge].m(di,null),g(t,ct),g(t,xe),g(xe,Wt),g(xe,_n),g(xe,Ln),z(tn,Ln,null),cn=!0},p(Le,Me){var Be;(!cn||Me&4)&&r!==(r=Le[2].id+"")&&se(a,r),(!cn||Me&4)&&h!==(h=Le[2].status+"")&&se(b,h),(!cn||Me&4)&&Q(_,"label-danger",Le[2].status>=400),(!cn||Me&4)&&M!==(M=((Be=Le[2].method)==null?void 0:Be.toUpperCase())+"")&&se(E,M),(!cn||Me&4)&&N!==(N=Le[2].auth+"")&&se(q,N),(!cn||Me&4)&&le!==(le=Le[2].url+"")&&se(ie,le),W===(W=Al(Le))&&G?G.p(Le,Me):(G.d(1),G=W(Le),G&&(G.c(),G.m(ze,null))),(!cn||Me&4)&&We!==(We=Le[2].remoteIp+"")&&se(yt,We),(!cn||Me&4)&&rt!==(rt=Le[2].userIp+"")&&se(Oe,rt),(!cn||Me&4)&&Yn!==(Yn=Le[2].userAgent+"")&&se(Kn,Yn);let Ue=ge;ge=Se(Le,Me),ge===Ue?oe[ge].p(Le,Me):(ae(),L(oe[Ue],1,1,()=>{oe[Ue]=null}),fe(),we=oe[ge],we?we.p(Le,Me):(we=oe[ge]=ne[ge](Le),we.c()),A(we,1),we.m(di,null));const Ne={};Me&4&&(Ne.date=Le[2].created),tn.$set(Ne)},i(Le){cn||(A(we),A(tn.$$.fragment,Le),cn=!0)},o(Le){L(we),L(tn.$$.fragment,Le),cn=!1},d(Le){Le&&k(e),G.d(),oe[ge].d(),H(tn)}}}function gC(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function vC(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[bC],header:[gC],default:[_C]},$$scope:{ctx:n}};return e=new sn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function yC(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function f(c){Fe.call(this,n,c)}function u(c){Fe.call(this,n,c)}return[o,i,s,l,r,a,f,u]}class kC extends ve{constructor(e){super(),be(this,e,yC,vC,me,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function wC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(f,u){w(f,e,u),e.checked=n[1],w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"change",n[10]),r=!0)},p(f,u){u&16384&&t!==(t=f[14])&&p(e,"id",t),u&2&&(e.checked=f[1]),u&16384&&o!==(o=f[14])&&p(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function Mc(n){let e,t;return e=new nC({props:{filter:n[4],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ec(n){let e,t;return e=new kk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SC(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S=n[3],T,C=n[3],$,M;r=new Wo({}),r.$on("refresh",n[9]),d=new de({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[wC,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),_=new Uo({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),_.$on("submit",n[11]);let E=Mc(n),D=Ec(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=U(n[6]),o=O(),B(r.$$.fragment),a=O(),f=v("div"),u=O(),c=v("div"),B(d.$$.fragment),m=O(),B(_.$$.fragment),h=O(),b=v("div"),y=O(),E.c(),T=O(),D.c(),$=ye(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(f,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,P){w(I,e,P),g(e,t),g(t,i),g(i,s),g(s,l),g(t,o),z(r,t,null),g(t,a),g(t,f),g(t,u),g(t,c),z(d,c,null),g(e,m),z(_,e,null),g(e,h),g(e,b),g(e,y),E.m(e,null),w(I,T,P),D.m(I,P),w(I,$,P),M=!0},p(I,P){(!M||P&64)&&se(l,I[6]);const F={};P&49154&&(F.$$scope={dirty:P,ctx:I}),d.$set(F);const R={};P&1&&(R.value=I[0]),_.$set(R),P&8&&me(S,S=I[3])?(ae(),L(E,1,1,x),fe(),E=Mc(I),E.c(),A(E,1),E.m(e,null)):E.p(I,P),P&8&&me(C,C=I[3])?(ae(),L(D,1,1,x),fe(),D=Ec(I),D.c(),A(D,1),D.m($.parentNode,$)):D.p(I,P)},i(I){M||(A(r.$$.fragment,I),A(d.$$.fragment,I),A(_.$$.fragment,I),A(E),A(D),M=!0)},o(I){L(r.$$.fragment,I),L(d.$$.fragment,I),L(_.$$.fragment,I),L(E),L(D),M=!1},d(I){I&&k(e),H(r),H(d),H(_),E.d(I),I&&k(T),I&&k($),D.d(I)}}}function CC(n){let e,t,i,s;e=new kn({props:{$$slots:{default:[SC]},$$scope:{ctx:n}}});let l={};return i=new kC({props:l}),n[13](i),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&k(t),n[13](null),H(i,o)}}}const Oc="includeAdminLogs";function TC(n,e,t){var y;let i,s,l;Ke(n,Dt,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];nn(Dt,l="Request logs",l);let r,a="",f=((y=window.localStorage)==null?void 0:y.getItem(Oc))<<0,u=1;function c(){t(3,u++,u)}const d=()=>c();function m(){f=this.checked,t(1,f)}const _=S=>t(0,a=S.detail),h=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function b(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=f?"":'auth!="admin"'),n.$$.dirty&2&&typeof f<"u"&&window.localStorage&&window.localStorage.setItem(Oc,f<<0),n.$$.dirty&1&&t(4,s=V.normalizeSearchFilter(a,o))},[a,f,r,u,s,i,l,o,c,d,m,_,h,b]}class $C extends ve{constructor(e){super(),be(this,e,TC,CC,me,{})}}const ef=Dn({});function pn(n,e,t){ef.set({text:n,yesCallback:e,noCallback:t})}function c1(){ef.set({})}function Dc(n){let e,t,i;const s=n[17].default,l=wt(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Ct(l,s,o,o[16],i?St(s,o[16],r,null):Tt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&Ge(()=>{i&&(t||(t=qe(e,fi,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,fi,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function MC(n){let e,t,i,s,l=n[0]&&Dc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[Y(window,"mousedown",n[5]),Y(window,"click",n[6]),Y(window,"keydown",n[4]),Y(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Dc(o),l.c(),A(l,1),l.m(e,null)):l&&(ae(),L(l,1,1,()=>{l=null}),fe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,Ee(s)}}}function EC(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=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 b=$t();function y(){t(0,o=!1),h=!1,clearTimeout(_)}function S(){t(0,o=!0),clearTimeout(_),_=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 C(j){return!c||j.classList.contains(f)||(m==null?void 0:m.contains(j))&&!c.contains(j)||c.contains(j)&&j.closest&&j.closest("."+f)}function $(j){(!o||C(j.target))&&(j.preventDefault(),j.stopPropagation(),T())}function M(j){(j.code==="Enter"||j.code==="Space")&&(!o||C(j.target))&&(j.preventDefault(),j.stopPropagation(),T())}function E(j){o&&r&&j.code==="Escape"&&(j.preventDefault(),y())}function D(j){o&&!(c!=null&&c.contains(j.target))?h=!0:h&&(h=!1)}function I(j){var Z;o&&h&&!(c!=null&&c.contains(j.target))&&!(m!=null&&m.contains(j.target))&&!((Z=j.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function P(j){D(j),I(j)}function F(j){R(),c==null||c.addEventListener("click",$),t(15,m=j||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",$),m==null||m.addEventListener("keydown",M)}function R(){clearTimeout(_),c==null||c.removeEventListener("click",$),m==null||m.removeEventListener("click",$),m==null||m.removeEventListener("keydown",M)}Xt(()=>(F(),()=>R()));function N(j){te[j?"unshift":"push"](()=>{d=j,t(3,d)})}function q(j){te[j?"unshift":"push"](()=>{c=j,t(2,c)})}return n.$$set=j=>{"trigger"in j&&t(8,l=j.trigger),"active"in j&&t(0,o=j.active),"escClose"in j&&t(9,r=j.escClose),"autoScroll"in j&&t(10,a=j.autoScroll),"closableClass"in j&&t(11,f=j.closableClass),"class"in j&&t(1,u=j.class),"$$scope"in j&&t(16,s=j.$$scope)},n.$$.update=()=>{var j,Z;n.$$.dirty&260&&c&&F(l),n.$$.dirty&32769&&(o?((j=m==null?void 0:m.classList)==null||j.add("active"),b("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),b("hide")))},[o,u,c,d,E,D,I,P,l,r,a,f,y,S,T,m,s,i,N,q]}class Wn extends ve{constructor(e){super(),be(this,e,EC,MC,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 Ac(n,e,t){const i=n.slice();return i[27]=e[t],i}function OC(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("input"),s=O(),l=v("label"),o=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(u,c){w(u,e,c),w(u,s,c),w(u,l,c),g(l,o),a||(f=Y(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(l,"for",r)},d(u){u&&k(e),u&&k(s),u&&k(l),a=!1,f()}}}function DC(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a){var u;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),s=!0},p(a,f){var c;const u={};if(f[0]&1073741824&&(u.id=a[30]),f[0]&1&&(u.placeholder=`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`),!t&&f[0]&4&&(t=!0,u.value=a[2],he(()=>t=!1)),f[0]&128&&o!==(o=a[7])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),fe()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(u)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function AC(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function IC(n){let e,t,i,s;const l=[AC,DC],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),s=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(ae(),L(o[u],1,1,()=>{o[u]=null}),fe(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function Ic(n){let e,t,i,s=n[10],l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[IC,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Ic(n);return{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment),s=O(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,s,f),r&&r.m(a,f),w(a,l,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=Ic(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),r&&r.d(a),a&&k(l)}}}function PC(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=U(t),s=U(" index")},m(l,o){w(l,e,o),g(e,i),g(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&k(e)}}}function Pc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Te(Ve.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,Ee(i)}}}function FC(n){let e,t,i,s,l,o,r=n[5]!=""&&Pc(n);return{c(){r&&r.c(),e=O(),t=v("button"),t.innerHTML='Cancel',i=O(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"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,s,f),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Pc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&k(i),a&&k(s),l=!1,Ee(o)}}}function NC(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[FC],header:[PC],default:[LC]},$$scope:{ctx:n}};for(let l=0;lK.name==j);X?V.removeByValue(Z.columns,X):V.pushUnique(Z.columns,{name:j}),t(2,d=V.buildIndex(Z))}Xt(async()=>{t(8,h=!0);try{t(7,_=(await at(()=>import("./CodeEditor-04174b89.js"),["./CodeEditor-04174b89.js","./index-eb24c20e.js"],import.meta.url)).default)}catch(j){console.warn(j)}t(8,h=!1)});const M=()=>T(),E=()=>y(),D=()=>C(),I=j=>{t(3,s.unique=j.target.checked,s),t(3,s.tableName=s.tableName||(f==null?void 0:f.name),s),t(2,d=V.buildIndex(s))};function P(j){d=j,t(2,d)}const F=j=>$(j);function R(j){te[j?"unshift":"push"](()=>{u=j,t(4,u)})}function N(j){Fe.call(this,n,j)}function q(j){Fe.call(this,n,j)}return n.$$set=j=>{e=Re(Re({},e),Gt(j)),t(14,r=Xe(e,o)),"collection"in j&&t(0,f=j.collection)},n.$$.update=()=>{var j,Z,X;n.$$.dirty[0]&1&&t(10,i=(((Z=(j=f==null?void 0:f.schema)==null?void 0:j.filter(K=>!K.toDelete))==null?void 0:Z.map(K=>K.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(K=>K.name))||[])},[f,y,d,s,u,c,m,_,h,l,i,T,C,$,r,b,M,E,D,I,P,F,R,N,q]}class qC extends ve{constructor(e){super(),be(this,e,RC,NC,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Fc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=V.parseIndex(i[10]);return i[11]=s,i}function Nc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Rc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(qc).join(", "))+"",l,o,r,a,f,u=n[11].unique&&Nc();function c(){return n[4](n[10],n[13])}return{c(){var m,_;e=v("button"),u&&u.c(),t=O(),i=v("span"),l=U(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((_=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&_.message?"label-danger":"")+" svelte-167lbwu")},m(m,_){var h,b;w(m,e,_),u&&u.m(e,null),g(e,t),g(e,i),g(i,l),a||(f=[Te(r=Ve.call(null,e,((b=(h=n[2].indexes)==null?void 0:h[n[13]])==null?void 0:b.message)||"")),Y(e,"click",c)],a=!0)},p(m,_){var h,b,y,S,T;n=m,n[11].unique?u||(u=Nc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),_&1&&s!==(s=((h=n[11].columns)==null?void 0:h.map(qc).join(", "))+"")&&se(l,s),_&4&&o!==(o="label link-primary "+((y=(b=n[2].indexes)==null?void 0:b[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&jt(r.update)&&_&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&k(e),u&&u.d(),a=!1,Ee(f)}}}function jC(n){var C,$,M;let e,t,i=((($=(C=n[0])==null?void 0:C.indexes)==null?void 0:$.length)||0)+"",s,l,o,r,a,f,u,c,d,m,_,h,b=((M=n[0])==null?void 0:M.indexes)||[],y=[];for(let E=0;Ece(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=O(),r=v("div");for(let E=0;E+ + New index`,u=O(),B(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(E,D){w(E,e,D),g(e,t),g(e,s),g(e,l),w(E,o,D),w(E,r,D);for(let I=0;Id=!1)),c.$set(I)},i(E){m||(A(c.$$.fragment,E),m=!0)},o(E){L(c.$$.fragment,E),m=!1},d(E){E&&k(e),E&&k(o),E&&k(r),ht(y,E),E&&k(u),n[6](null),H(c,E),_=!1,h()}}}const qc=n=>n.name;function VC(n,e,t){let i;Ke(n,wi,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let h=0;hl==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function f(m){te[m?"unshift":"push"](()=>{l=m,t(1,l)})}function u(m){s=m,t(0,s)}const c=m=>{for(let _=0;_{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,f,u,c,d]}class zC extends ve{constructor(e){super(),be(this,e,VC,jC,me,{collection:0})}}function jc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Vc(n){let e,t,i,s,l=n[6].label+"",o,r,a,f;function u(){return n[4](n[6])}function c(...d){return n[5](n[6],...d)}return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),o=U(l),r=O(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(d,m){w(d,e,m),g(e,t),g(e,i),g(e,s),g(s,o),g(e,r),a||(f=[Y(e,"click",On(u)),Y(e,"keydown",On(c))],a=!0)},p(d,m){n=d},d(d){d&&k(e),a=!1,Ee(f)}}}function HC(n){let e,t=n[2],i=[];for(let s=0;s{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,s,l,o,r,a]}class WC extends ve{constructor(e){super(),be(this,e,UC,BC,me,{class:0})}}const YC=n=>({interactive:n&64,hasErrors:n&32}),zc=n=>({interactive:n[6],hasErrors:n[5]}),KC=n=>({interactive:n&64,hasErrors:n&32}),Hc=n=>({interactive:n[6],hasErrors:n[5]}),JC=n=>({interactive:n&64,hasErrors:n&32}),Bc=n=>({interactive:n[6],hasErrors:n[5]}),ZC=n=>({interactive:n&64,hasErrors:n&32}),Uc=n=>({interactive:n[6],hasErrors:n[5]});function Wc(n){let e;return{c(){e=v("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&&k(e)}}}function Yc(n){let e,t,i,s;return{c(){e=v("span"),p(e,"class","marker marker-required")},m(l,o){w(l,e,o),i||(s=Te(t=Ve.call(null,e,n[4])),i=!0)},p(l,o){t&&jt(t.update)&&o&16&&t.update.call(null,l[4])},d(l){l&&k(e),i=!1,s()}}}function GC(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_=n[0].required&&Yc(n);return{c(){e=v("div"),_&&_.c(),t=O(),i=v("div"),s=v("i"),o=O(),r=v("input"),p(e,"class","markers"),p(s,"class",l=V.getFieldTypeIcon(n[0].type)),p(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(i,"txt-disabled",!n[6]),p(r,"type","text"),r.required=!0,r.disabled=a=!n[6],r.readOnly=f=n[0].id&&n[0].system,p(r,"spellcheck","false"),r.autofocus=u=!n[0].id,p(r,"placeholder","Field name"),r.value=c=n[0].name},m(h,b){w(h,e,b),_&&_.m(e,null),w(h,t,b),w(h,i,b),g(i,s),w(h,o,b),w(h,r,b),n[14](r),n[0].id||r.focus(),d||(m=Y(r,"input",n[15]),d=!0)},p(h,b){h[0].required?_?_.p(h,b):(_=Yc(h),_.c(),_.m(e,null)):_&&(_.d(1),_=null),b&1&&l!==(l=V.getFieldTypeIcon(h[0].type))&&p(s,"class",l),b&64&&Q(i,"txt-disabled",!h[6]),b&64&&a!==(a=!h[6])&&(r.disabled=a),b&1&&f!==(f=h[0].id&&h[0].system)&&(r.readOnly=f),b&1&&u!==(u=!h[0].id)&&(r.autofocus=u),b&1&&c!==(c=h[0].name)&&r.value!==c&&(r.value=c)},d(h){h&&k(e),_&&_.d(),h&&k(t),h&&k(i),h&&k(o),h&&k(r),n[14](null),d=!1,m()}}}function XC(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function QC(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("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")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),g(e,t),s||(l=Y(e,"click",n[11]),s=!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&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function xC(n){let e,t,i;return{c(){e=v("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(s,l){w(s,e,l),t||(i=[Te(Ve.call(null,e,"Restore")),Y(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,Ee(i)}}}function Kc(n){let e,t,i,s,l,o,r,a,f,u,c;const d=n[13].options,m=wt(d,n,n[17],Bc),_=n[13].beforeNonempty,h=wt(_,n,n[17],Hc);r=new de({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[e4,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}});const b=n[13].afterNonempty,y=wt(b,n,n[17],zc);let S=!n[0].toDelete&&Jc(n);return{c(){e=v("div"),t=v("div"),i=v("div"),m&&m.c(),s=O(),h&&h.c(),l=O(),o=v("div"),B(r.$$.fragment),a=O(),y&&y.c(),f=O(),S&&S.c(),p(i,"class","col-sm-12 hidden-empty"),p(o,"class","col-sm-4"),p(t,"class","grid grid-sm"),p(e,"class","schema-field-options")},m(T,C){w(T,e,C),g(e,t),g(t,i),m&&m.m(i,null),g(t,s),h&&h.m(t,null),g(t,l),g(t,o),z(r,o,null),g(t,a),y&&y.m(t,null),g(t,f),S&&S.m(t,null),c=!0},p(T,C){m&&m.p&&(!c||C&131168)&&Ct(m,d,T,T[17],c?St(d,T[17],C,JC):Tt(T[17]),Bc),h&&h.p&&(!c||C&131168)&&Ct(h,_,T,T[17],c?St(_,T[17],C,KC):Tt(T[17]),Hc);const $={};C&8519697&&($.$$scope={dirty:C,ctx:T}),r.$set($),y&&y.p&&(!c||C&131168)&&Ct(y,b,T,T[17],c?St(b,T[17],C,YC):Tt(T[17]),zc),T[0].toDelete?S&&(ae(),L(S,1,1,()=>{S=null}),fe()):S?(S.p(T,C),C&1&&A(S,1)):(S=Jc(T),S.c(),A(S,1),S.m(t,null))},i(T){c||(A(m,T),A(h,T),A(r.$$.fragment,T),A(y,T),A(S),T&&Ge(()=>{c&&(u||(u=qe(e,st,{duration:150},!0)),u.run(1))}),c=!0)},o(T){L(m,T),L(h,T),L(r.$$.fragment,T),L(y,T),L(S),T&&(u||(u=qe(e,st,{duration:150},!1)),u.run(0)),c=!1},d(T){T&&k(e),m&&m.d(T),h&&h.d(T),H(r),y&&y.d(T),S&&S.d(),T&&u&&u.end()}}}function e4(n){let e,t,i,s,l,o,r,a,f,u,c,d;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),o=U(n[4]),r=O(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",u=n[23])},m(m,_){w(m,e,_),e.checked=n[0].required,w(m,i,_),w(m,s,_),g(s,l),g(l,o),g(s,r),g(s,a),c||(d=[Y(e,"change",n[16]),Te(f=Ve.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`,position:"right"}))],c=!0)},p(m,_){_&8388608&&t!==(t=m[23])&&p(e,"id",t),_&1&&(e.checked=m[0].required),_&16&&se(o,m[4]),f&&jt(f.update)&&_&1&&f.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(m[0])}.`,position:"right"}),_&8388608&&u!==(u=m[23])&&p(s,"for",u)},d(m){m&&k(e),m&&k(i),m&&k(s),c=!1,Ee(d)}}}function Jc(n){let e,t,i,s,l,o,r,a,f;return a=new Wn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[t4]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=O(),s=v("div"),l=v("button"),o=v("i"),r=O(),B(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 m-l-auto txt-right")},m(u,c){w(u,e,c),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),z(a,l,null),f=!0},p(u,c){const d={};c&131072&&(d.$$scope={dirty:c,ctx:u}),a.$set(d)},i(u){f||(A(a.$$.fragment,u),f=!0)},o(u){L(a.$$.fragment,u),f=!1},d(u){u&&k(e),H(a)}}}function t4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function n4(n){let e,t,i,s,l,o,r,a,f,u=n[6]&&Wc();s=new de({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[GC]},$$scope:{ctx:n}}});const c=n[13].default,d=wt(c,n,n[17],Uc),m=d||XC();function _(S,T){if(S[0].toDelete)return xC;if(S[6])return QC}let h=_(n),b=h&&h(n),y=n[6]&&n[3]&&Kc(n);return{c(){e=v("div"),t=v("div"),u&&u.c(),i=O(),B(s.$$.fragment),l=O(),m&&m.c(),o=O(),b&&b.c(),r=O(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),g(e,t),u&&u.m(t,null),g(t,i),z(s,t,null),g(t,l),m&&m.m(t,null),g(t,o),b&&b.m(t,null),g(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=Wc(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const C={};T&64&&(C.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&(C.name="schema."+S[1]+".name"),T&131157&&(C.$$scope={dirty:T,ctx:S}),s.$set(C),d&&d.p&&(!f||T&131168)&&Ct(d,c,S,S[17],f?St(c,S[17],T,ZC):Tt(S[17]),Uc),h===(h=_(S))&&b?b.p(S,T):(b&&b.d(1),b=h&&h(S),b&&(b.c(),b.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&A(y,1)):(y=Kc(S),y.c(),A(y,1),y.m(e,null)):y&&(ae(),L(y,1,1,()=>{y=null}),fe()),(!f||T&1)&&Q(e,"required",S[0].required),(!f||T&72)&&Q(e,"expanded",S[6]&&S[3]),(!f||T&1)&&Q(e,"deleted",S[0].toDelete)},i(S){f||(A(s.$$.fragment,S),A(m,S),A(y),S&&Ge(()=>{f&&(a||(a=qe(e,st,{duration:150},!0)),a.run(1))}),f=!0)},o(S){L(s.$$.fragment,S),L(m,S),L(y),S&&(a||(a=qe(e,st,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&k(e),u&&u.d(),H(s),m&&m.d(S),b&&b.d(),y&&y.d(),S&&a&&a.end()}}}let Tr=[];function i4(n,e,t){let i,s,l,o;Ke(n,wi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const f="f_"+V.randomString(8),u=$t(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=V.initSchemaField()}=e,_,h=!1;function b(){m.id?t(0,m.toDelete=!0,m):u("remove")}function y(){t(0,m.toDelete=!1,m),en({})}function S(P){return V.slugify(P)}function T(){t(3,h=!0),M()}function C(){t(3,h=!1)}function $(){h?C():T()}function M(){for(let P of Tr)P.id!=f&&P.collapse()}Xt(()=>(Tr.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),_==null||_.select()),()=>{V.removeByKey(Tr,"id",f)}));function E(P){te[P?"unshift":"push"](()=>{_=P,t(2,_)})}const D=P=>{const F=m.name;t(0,m.name=S(P.target.value),m),P.target.value=m.name,u("rename",{oldName:F,newName:m.name})};function I(){m.required=this.checked,t(0,m)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,m=P.field),"$$scope"in P&&t(17,a=P.$$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&4098&&t(5,s=!V.isEmpty(V.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[m==null?void 0:m.type]||"Nonempty")},[m,d,_,h,l,s,i,u,b,y,S,$,o,r,E,D,I,a]}class ci extends ve{constructor(e){super(),be(this,e,i4,n4,me,{key:1,field:0})}}function s4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min length"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(l,"id",o),u&1&&pt(l.value)!==f[0].options.min&&re(l,f[0].options.min)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function l4(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("label"),t=U("Max length"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),g(e,t),w(u,s,c),w(u,l,c),re(l,n[0].options.max),a||(f=Y(l,"input",n[4]),a=!0)},p(u,c){c&512&&i!==(i=u[9])&&p(e,"for",i),c&512&&o!==(o=u[9])&&p(l,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(l,"min",r),c&1&&pt(l.value)!==u[0].options.max&&re(l,u[0].options.max)},d(u){u&&k(e),u&&k(s),u&&k(l),a=!1,f()}}}function o4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Regex pattern"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.pattern),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0].options.pattern&&re(l,f[0].options.pattern)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function r4(n){let e,t,i,s,l,o,r,a,f,u;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[s4,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[l4,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[o4,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),r=O(),a=v("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),g(e,r),g(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&1537&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d&2&&(_.name="schema."+c[1]+".options.max"),d&1537&&(_.$$scope={dirty:d,ctx:c}),o.$set(_);const h={};d&2&&(h.name="schema."+c[1]+".options.pattern"),d&1537&&(h.$$scope={dirty:d,ctx:c}),f.$set(h)},i(c){u||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(f.$$.fragment,c),u=!1},d(c){c&&k(e),H(i),H(o),H(f)}}}function a4(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[r4]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function f4(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=pt(this.value),t(0,l)}function a(){l.options.max=pt(this.value),t(0,l)}function f(){l.options.pattern=this.value,t(0,l)}function u(m){l=m,t(0,l)}function c(m){Fe.call(this,n,m)}function d(m){Fe.call(this,n,m)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(2,s=Xe(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,f,u,c,d]}class u4 extends ve{constructor(e){super(),be(this,e,f4,a4,me,{field:0,key:1})}}function c4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min"),s=O(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8])},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(l,"id",o),u&1&&pt(l.value)!==f[0].options.min&&re(l,f[0].options.min)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function d4(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("label"),t=U("Max"),s=O(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min",r=n[0].options.min)},m(u,c){w(u,e,c),g(e,t),w(u,s,c),w(u,l,c),re(l,n[0].options.max),a||(f=Y(l,"input",n[4]),a=!0)},p(u,c){c&256&&i!==(i=u[8])&&p(e,"for",i),c&256&&o!==(o=u[8])&&p(l,"id",o),c&1&&r!==(r=u[0].options.min)&&p(l,"min",r),c&1&&pt(l.value)!==u[0].options.max&&re(l,u[0].options.max)},d(u){u&&k(e),u&&k(s),u&&k(l),a=!1,f()}}}function p4(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[c4,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[d4,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&769&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&769&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function m4(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[p4]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&515&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function h4(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=pt(this.value),t(0,l)}function a(){l.options.max=pt(this.value),t(0,l)}function f(d){l=d,t(0,l)}function u(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(2,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,f,u,c]}class _4 extends ve{constructor(e){super(),be(this,e,h4,m4,me,{field:0,key:1})}}function g4(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function b4(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(u){l=u,t(0,l)}function a(u){Fe.call(this,n,u)}function f(u){Fe.call(this,n,u)}return n.$$set=u=>{e=Re(Re({},e),Gt(u)),t(2,s=Xe(e,i)),"field"in u&&t(0,l=u.field),"key"in u&&t(1,o=u.key)},[l,o,s,r,a,f]}class v4 extends ve{constructor(e){super(),be(this,e,b4,g4,me,{field:0,key:1})}}function y4(n){let e,t,i,s,l=[{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=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Re(Re({},e),Gt(c)),t(5,l=Xe(e,s)),"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&1&&t(4,i=(o||[]).join(", "))},[o,r,a,f,i,l,u]}class Fs extends ve{constructor(e){super(),be(this,e,k4,y4,me,{value:0,separator:1,readonly:2,disabled:3})}}function w4(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;function _(b){n[3](b)}let h={id:n[8],disabled:!V.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(h.value=n[0].options.exceptDomains),r=new Fs({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=O(),s=v("i"),o=O(),B(r.$$.fragment),f=O(),u=v("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(u,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),z(r,b,y),w(b,f,y),w(b,u,y),c=!0,d||(m=Te(Ve.call(null,s,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&256&&l!==(l=b[8]))&&p(e,"for",l);const S={};y&256&&(S.id=b[8]),y&1&&(S.disabled=!V.isEmpty(b[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.exceptDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),H(r,b),b&&k(f),b&&k(u),d=!1,m()}}}function S4(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;function _(b){n[4](b)}let h={id:n[8]+".options.onlyDomains",disabled:!V.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Fs({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=O(),s=v("i"),o=O(),B(r.$$.fragment),f=O(),u=v("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(u,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),z(r,b,y),w(b,f,y),w(b,u,y),c=!0,d||(m=Te(Ve.call(null,s,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&256&&l!==(l=b[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=b[8]+".options.onlyDomains"),y&1&&(S.disabled=!V.isEmpty(b[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.onlyDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),H(r,b),b&&k(f),b&&k(u),d=!1,m()}}}function C4(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[w4,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[S4,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&769&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&769&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function T4(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[C4]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&515&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function $4(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function f(d){l=d,t(0,l)}function u(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(2,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,f,u,c]}class d1 extends ve{constructor(e){super(),be(this,e,$4,T4,me,{field:0,key:1})}}function M4(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function E4(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(u){l=u,t(0,l)}function a(u){Fe.call(this,n,u)}function f(u){Fe.call(this,n,u)}return n.$$set=u=>{e=Re(Re({},e),Gt(u)),t(2,s=Xe(e,i)),"field"in u&&t(0,l=u.field),"key"in u&&t(1,o=u.key)},[l,o,s,r,a,f]}class O4 extends ve{constructor(e){super(),be(this,e,E4,M4,me,{field:0,key:1})}}function D4(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function A4(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(u){l=u,t(0,l)}function a(u){Fe.call(this,n,u)}function f(u){Fe.call(this,n,u)}return n.$$set=u=>{e=Re(Re({},e),Gt(u)),t(2,s=Xe(e,i)),"field"in u&&t(0,l=u.field),"key"in u&&t(1,o=u.key)},[l,o,s,r,a,f]}class I4 extends ve{constructor(e){super(),be(this,e,A4,D4,me,{field:0,key:1})}}var $r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_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},hl={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},gn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Rn=function(n){return n===!0?1:0};function Zc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Mr=function(n){return n instanceof Array?n:[n]};function dn(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 Ql(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function p1(n,e){if(e(n))return n;if(n.parentNode)return p1(n.parentNode,e)}function xl(n,e){var t=ut("div","numInputWrapper"),i=ut("input","numInput "+n),s=ut("span","arrowUp"),l=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(s),t.appendChild(l),t}function Sn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Io=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},L4={D:Er,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*Rn(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),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},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:Er,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:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Gi={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})"},ol={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ol.w(n,e,t)]},F:function(n,e,t){return Io(ol.n(n,e,t)-1,!1,e)},G:function(n,e,t){return gn(ol.h(n,e,t))},H:function(n){return gn(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[Rn(n.getHours()>11)]},M:function(n,e){return Io(n.getMonth(),!0,e)},S:function(n){return gn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return gn(n.getFullYear(),4)},d:function(n){return gn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return gn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return gn(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)}},m1=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,f){var u=f||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ol[c]&&m[d-1]!=="\\"?ol[c](r,u,t):c!=="\\"?c:""}).join("")}},ua=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var f=a||s,u,c=l;if(l instanceof Date)u=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)u=new Date(l);else if(typeof l=="string"){var d=o||(t||ks).dateFormat,m=String(l).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(l);else{for(var _=void 0,h=[],b=0,y=0,S="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Dr(t.config);G.setHours(ne.hours,ne.minutes,ne.seconds,G.getMilliseconds()),t.selectedDates=[G],t.latestSelectedDateObj=G}W!==void 0&&W.type!=="blur"&&Al(W);var oe=t._input.value;c(),tn(),t._input.value!==oe&&t._debouncedChange()}function f(W,G){return W%12+12*Rn(G===t.l10n.amPM[1])}function u(W){switch(W%24){case 0:case 12:return 12;default:return W%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var W=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,G=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(W=f(W,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Cn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Se=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Cn(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 Ae=Or(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Le=Or(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Me=Or(W,G,ne);if(Me>Le&&Me=12)]),t.secondElement!==void 0&&(t.secondElement.value=gn(ne)))}function _(W){var G=Sn(W),ne=parseInt(G.value)+(W.delta||0);(ne/1e3>1||W.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&ke(ne)}function h(W,G,ne,oe){if(G instanceof Array)return G.forEach(function(Se){return h(W,Se,ne,oe)});if(W instanceof Array)return W.forEach(function(Se){return h(Se,G,ne,oe)});W.addEventListener(G,ne,oe),t._handlers.push({remove:function(){return W.removeEventListener(G,ne,oe)}})}function b(){we("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(oe){return h(oe,"click",t[ne])})}),t.isMobile){Ti();return}var W=Zc(yt,50);if(t._debouncedChange=Zc(b,R4),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&We(Sn(ne))}),h(t._input,"keydown",Ze),t.calendarContainer!==void 0&&h(t.calendarContainer,"keydown",Ze),!t.config.inline&&!t.config.static&&h(window,"resize",W),window.ontouchstart!==void 0?h(window.document,"touchstart",ze):h(window.document,"mousedown",ze),h(window.document,"focus",ze,{capture:!0}),t.config.clickOpens===!0&&(h(t._input,"focus",t.open),h(t._input,"click",t.open)),t.daysContainer!==void 0&&(h(t.monthNav,"click",cn),h(t.monthNav,["keyup","increment"],_),h(t.daysContainer,"click",An)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var G=function(ne){return Sn(ne).select()};h(t.timeContainer,["increment"],a),h(t.timeContainer,"blur",a,{capture:!0}),h(t.timeContainer,"click",T),h([t.hourElement,t.minuteElement],["focus","click"],G),t.secondElement!==void 0&&h(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&h(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&h(t._input,"blur",_t)}function S(W,G){var ne=W!==void 0?t.parseDate(W):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(W);var Se=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&&(!Se&&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 Ae=ut("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ae,t.element),Ae.appendChild(t.element),t.altInput&&Ae.appendChild(t.altInput),Ae.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(W,G,ne,oe){var Se=Ce(G,!0),Ae=ut("span",W,G.getDate().toString());return Ae.dateObj=G,Ae.$i=oe,Ae.setAttribute("aria-label",t.formatDate(G,t.config.ariaDateFormat)),W.indexOf("hidden")===-1&&Cn(G,t.now)===0&&(t.todayDateElem=Ae,Ae.classList.add("today"),Ae.setAttribute("aria-current","date")),Se?(Ae.tabIndex=-1,xe(G)&&(Ae.classList.add("selected"),t.selectedDateElem=Ae,t.config.mode==="range"&&(dn(Ae,"startRange",t.selectedDates[0]&&Cn(G,t.selectedDates[0],!0)===0),dn(Ae,"endRange",t.selectedDates[1]&&Cn(G,t.selectedDates[1],!0)===0),W==="nextMonthDay"&&Ae.classList.add("inRange")))):Ae.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Wt(G)&&!xe(G)&&Ae.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&W!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(G)+""),we("onDayCreate",Ae),Ae}function E(W){W.focus(),t.config.mode==="range"&&We(W)}function D(W){for(var G=W>0?0:t.config.showMonths-1,ne=W>0?t.config.showMonths:-1,oe=G;oe!=ne;oe+=W)for(var Se=t.daysContainer.children[oe],Ae=W>0?0:Se.children.length-1,Le=W>0?Se.children.length:-1,Me=Ae;Me!=Le;Me+=W){var Ue=Se.children[Me];if(Ue.className.indexOf("hidden")===-1&&Ce(Ue.dateObj))return Ue}}function I(W,G){for(var ne=W.className.indexOf("Month")===-1?W.dateObj.getMonth():t.currentMonth,oe=G>0?t.config.showMonths:-1,Se=G>0?1:-1,Ae=ne-t.currentMonth;Ae!=oe;Ae+=Se)for(var Le=t.daysContainer.children[Ae],Me=ne-t.currentMonth===Ae?W.$i+G:G<0?Le.children.length-1:0,Ue=Le.children.length,Ne=Me;Ne>=0&&Ne0?Ue:-1);Ne+=Se){var Be=Le.children[Ne];if(Be.className.indexOf("hidden")===-1&&Ce(Be.dateObj)&&Math.abs(W.$i-Ne)>=Math.abs(G))return E(Be)}t.changeMonth(Se),P(D(Se),0)}function P(W,G){var ne=l(),oe=Je(ne||document.body),Se=W!==void 0?W:oe?ne:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:D(G>0?1:-1);Se===void 0?t._input.focus():oe?I(Se,G):E(Se)}function F(W,G){for(var ne=(new Date(W,G,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((G-1+12)%12,W),Se=t.utils.getDaysInMonth(G,W),Ae=window.document.createDocumentFragment(),Le=t.config.showMonths>1,Me=Le?"prevMonthDay hidden":"prevMonthDay",Ue=Le?"nextMonthDay hidden":"nextMonthDay",Ne=oe+1-ne,Be=0;Ne<=oe;Ne++,Be++)Ae.appendChild(M("flatpickr-day "+Me,new Date(W,G-1,Ne),Ne,Be));for(Ne=1;Ne<=Se;Ne++,Be++)Ae.appendChild(M("flatpickr-day",new Date(W,G,Ne),Ne,Be));for(var vt=Se+1;vt<=42-ne&&(t.config.showMonths===1||Be%7!==0);vt++,Be++)Ae.appendChild(M("flatpickr-day "+Ue,new Date(W,G+1,vt%Se),vt,Be));var ni=ut("div","dayContainer");return ni.appendChild(Ae),ni}function R(){if(t.daysContainer!==void 0){Ql(t.daysContainer),t.weekNumbers&&Ql(t.weekNumbers);for(var W=document.createDocumentFragment(),G=0;G1||t.config.monthSelectorType!=="dropdown")){var W=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var G=0;G<12;G++)if(W(G)){var ne=ut("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,G).getMonth().toString(),ne.textContent=Io(G,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===G&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var W=ut("div","flatpickr-month"),G=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),h(t.monthsDropdownContainer,"change",function(Le){var Me=Sn(Le),Ue=parseInt(Me.value,10);t.changeMonth(Ue-t.currentMonth),we("onMonthChange")}),N(),ne=t.monthsDropdownContainer);var oe=xl("cur-year",{tabindex:"-1"}),Se=oe.getElementsByTagName("input")[0];Se.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Se.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Se.setAttribute("max",t.config.maxDate.getFullYear().toString()),Se.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ae=ut("div","flatpickr-current-month");return Ae.appendChild(ne),Ae.appendChild(oe),G.appendChild(Ae),W.appendChild(G),{container:W,yearElement:Se,monthElement:ne}}function j(){Ql(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var W=t.config.showMonths;W--;){var G=q();t.yearElements.push(G.yearElement),t.monthElements.push(G.monthElement),t.monthNav.appendChild(G.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,j(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(W){t.__hidePrevMonthArrow!==W&&(dn(t.prevMonthNav,"flatpickr-disabled",W),t.__hidePrevMonthArrow=W)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(W){t.__hideNextMonthArrow!==W&&(dn(t.nextMonthNav,"flatpickr-disabled",W),t.__hideNextMonthArrow=W)}}),t.currentYearElement=t.yearElements[0],_n(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var W=Dr(t.config);t.timeContainer=ut("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var G=ut("span","flatpickr-time-separator",":"),ne=xl("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var oe=xl("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?W.hours:u(W.hours)),t.minuteElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():W.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(G),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Se=xl("flatpickr-second");t.secondElement=Se.getElementsByTagName("input")[0],t.secondElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():W.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(Se)}return t.config.time_24hr||(t.amPM=ut("span","flatpickr-am-pm",t.l10n.amPM[Rn((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 K(){t.weekdayContainer?Ql(t.weekdayContainer):t.weekdayContainer=ut("div","flatpickr-weekdays");for(var W=t.config.showMonths;W--;){var G=ut("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(G)}return J(),t.weekdayContainer}function J(){if(t.weekdayContainer){var W=t.l10n.firstDayOfWeek,G=Gc(t.l10n.weekdays.shorthand);W>0&&W + `+G.join("")+` + + `}}function le(){t.calendarContainer.classList.add("hasWeeks");var W=ut("div","flatpickr-weekwrapper");W.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ut("div","flatpickr-weeks");return W.appendChild(G),{weekWrapper:W,weekNumbers:G}}function ie(W,G){G===void 0&&(G=!0);var ne=G?W:W-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,we("onYearChange"),N()),R(),we("onMonthChange"),_n())}function ee(W,G){if(W===void 0&&(W=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Dr(t.config),oe=ne.hours,Se=ne.minutes,Ae=ne.seconds;m(oe,Se,Ae)}t.redraw(),W&&we("onChange")}function $e(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),we("onClose")}function Pe(){t.config!==void 0&&we("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(W){return t.calendarContainer.contains(W)}function ze(W){if(t.isOpen&&!t.config.inline){var G=Sn(W),ne=je(G),oe=G===t.input||G===t.altInput||t.element.contains(G)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Se=!oe&&!ne&&!je(W.relatedTarget),Ae=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(G)});Se&&Ae&&(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 ke(W){if(!(!W||t.config.minDate&&Wt.config.maxDate.getFullYear())){var G=W,ne=t.currentYear!==G;t.currentYear=G||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(),we("onYearChange"),N())}}function Ce(W,G){var ne;G===void 0&&(G=!0);var oe=t.parseDate(W,void 0,G);if(t.config.minDate&&oe&&Cn(oe,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Cn(oe,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Se=!!t.config.enable,Ae=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Le=0,Me=void 0;Le=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return Se}return!Se}function Je(W){return t.daysContainer!==void 0?W.className.indexOf("hidden")===-1&&W.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(W):!1}function _t(W){var G=W.target===t._input,ne=t._input.value.trimEnd()!==Ln();G&&ne&&!(W.relatedTarget&&je(W.relatedTarget))&&t.setDate(t._input.value,!0,W.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ze(W){var G=Sn(W),ne=t.config.wrap?n.contains(G):G===t._input,oe=t.config.allowInput,Se=t.isOpen&&(!oe||!ne),Ae=t.config.inline&&ne&&!oe;if(W.keyCode===13&&ne){if(oe)return t.setDate(t._input.value,!0,G===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),G.blur();t.open()}else if(je(G)||Se||Ae){var Le=!!t.timeContainer&&t.timeContainer.contains(G);switch(W.keyCode){case 13:Le?(W.preventDefault(),a(),Vt()):An(W);break;case 27:W.preventDefault(),Vt();break;case 8:case 46:ne&&!t.config.allowInput&&(W.preventDefault(),t.clear());break;case 37:case 39:if(!Le&&!ne){W.preventDefault();var Me=l();if(t.daysContainer!==void 0&&(oe===!1||Me&&Je(Me))){var Ue=W.keyCode===39?1:-1;W.ctrlKey?(W.stopPropagation(),ie(Ue),P(D(1),0)):P(void 0,Ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:W.preventDefault();var Ne=W.keyCode===40?1:-1;t.daysContainer&&G.$i!==void 0||G===t.input||G===t.altInput?W.ctrlKey?(W.stopPropagation(),ke(t.currentYear-Ne),P(D(1),0)):Le||P(void 0,Ne*7):G===t.currentYearElement?ke(t.currentYear-Ne):t.config.enableTime&&(!Le&&t.hourElement&&t.hourElement.focus(),a(W),t._debouncedChange());break;case 9:if(Le){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(wn){return wn}),vt=Be.indexOf(G);if(vt!==-1){var ni=Be[vt+(W.shiftKey?-1:1)];W.preventDefault(),(ni||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(G)&&W.shiftKey&&(W.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&G===t.amPM)switch(W.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),tn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),tn();break}(ne||je(G))&&we("onKeyDown",W)}function We(W,G){if(G===void 0&&(G="flatpickr-day"),!(t.selectedDates.length!==1||W&&(!W.classList.contains(G)||W.classList.contains("flatpickr-disabled")))){for(var ne=W?W.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Se=Math.min(ne,t.selectedDates[0].getTime()),Ae=Math.max(ne,t.selectedDates[0].getTime()),Le=!1,Me=0,Ue=0,Ne=Se;NeSe&&NeMe)?Me=Ne:Ne>oe&&(!Ue||Ne ."+G));Be.forEach(function(vt){var ni=vt.dateObj,wn=ni.getTime(),Ns=Me>0&&wn0&&wn>Ue;if(Ns){vt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fs){vt.classList.remove(fs)});return}else if(Le&&!Ns)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fs){vt.classList.remove(fs)}),W!==void 0&&(W.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),oene&&wn===oe&&vt.classList.add("endRange"),wn>=Me&&(Ue===0||wn<=Ue)&&P4(wn,oe,ne)&&vt.classList.add("inRange"))})}}function yt(){t.isOpen&&!t.config.static&&!t.config.inline&&rt()}function pe(W,G){if(G===void 0&&(G=t._positionElement),t.isMobile===!0){if(W){W.preventDefault();var ne=Sn(W);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),we("onOpen");return}else if(t._input.disabled||t.config.inline)return;var oe=t.isOpen;t.isOpen=!0,oe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),we("onOpen"),rt(G)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(W===void 0||!t.timeContainer.contains(W.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function _e(W){return function(G){var ne=t.config["_"+W+"Date"]=t.parseDate(G,t.config.dateFormat),oe=t.config["_"+(W==="min"?"max":"min")+"Date"];ne!==void 0&&(t[W==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Se){return Ce(Se)}),!t.selectedDates.length&&W==="min"&&d(ne),tn()),t.daysContainer&&(Ot(),ne!==void 0?t.currentYearElement[W]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(W),t.currentYearElement.disabled=!!oe&&ne!==void 0&&oe.getFullYear()===ne.getFullYear())}}function Ye(){var W=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=on(on({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=G.parseDate,t.config.formatDate=G.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=un(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=un(Be)}});var oe=G.mode==="time";if(!G.dateFormat&&(G.enableTime||oe)){var Se=Kt.defaultConfig.dateFormat||ks.dateFormat;ne.dateFormat=G.noCalendar||oe?"H:i"+(G.enableSeconds?":S":""):Se+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||oe)&&!G.altFormat){var Ae=Kt.defaultConfig.altFormat||ks.altFormat;ne.altFormat=G.noCalendar||oe?"h:i"+(G.enableSeconds?":S K":" K"):Ae+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:_e("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:_e("max")});var Le=function(Be){return function(vt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(vt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Le("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Le("max")}),G.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,G);for(var Me=0;Me-1?t.config[Ne]=Mr(Ue[Ne]).map(o).concat(t.config[Ne]):typeof G[Ne]>"u"&&(t.config[Ne]=Ue[Ne])}G.altInputClass||(t.config.altInputClass=Mt().className+" "+t.config.altInputClass),we("onParseConfig")}function Mt(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ie(){typeof t.config.locale!="object"&&typeof Kt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=on(on({},Kt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Kt.l10ns[t.config.locale]:void 0),Gi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Gi.l="("+t.l10n.weekdays.longhand.join("|")+")",Gi.M="("+t.l10n.months.shorthand.join("|")+")",Gi.F="("+t.l10n.months.longhand.join("|")+")",Gi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var W=on(on({},e),JSON.parse(JSON.stringify(n.dataset||{})));W.time_24hr===void 0&&Kt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=m1(t),t.parseDate=ua({config:t.config,l10n:t.l10n})}function rt(W){if(typeof t.config.position=="function")return void t.config.position(t,W);if(t.calendarContainer!==void 0){we("onPreCalendarPosition");var G=W||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(E1,O1){return E1+O1.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Se=t.config.position.split(" "),Ae=Se[0],Le=Se.length>1?Se[1]:null,Me=G.getBoundingClientRect(),Ue=window.innerHeight-Me.bottom,Ne=Ae==="above"||Ae!=="below"&&Uene,Be=window.pageYOffset+Me.top+(Ne?-ne-2:G.offsetHeight+2);if(dn(t.calendarContainer,"arrowTop",!Ne),dn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var vt=window.pageXOffset+Me.left,ni=!1,wn=!1;Le==="center"?(vt-=(oe-Me.width)/2,ni=!0):Le==="right"&&(vt-=oe-Me.width,wn=!0),dn(t.calendarContainer,"arrowLeft",!ni&&!wn),dn(t.calendarContainer,"arrowCenter",ni),dn(t.calendarContainer,"arrowRight",wn);var Ns=window.document.body.offsetWidth-(window.pageXOffset+Me.right),fs=vt+oe>window.document.body.offsetWidth,k1=Ns+oe>window.document.body.offsetWidth;if(dn(t.calendarContainer,"rightMost",fs),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!fs)t.calendarContainer.style.left=vt+"px",t.calendarContainer.style.right="auto";else if(!k1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Ns+"px";else{var xo=Oe();if(xo===void 0)return;var w1=window.document.body.offsetWidth,S1=Math.max(0,w1/2-oe/2),C1=".flatpickr-calendar.centerMost:before",T1=".flatpickr-calendar.centerMost:after",$1=xo.cssRules.length,M1="{left:"+Me.left+"px;right:auto;}";dn(t.calendarContainer,"rightMost",!1),dn(t.calendarContainer,"centerMost",!0),xo.insertRule(C1+","+T1+M1,$1),t.calendarContainer.style.left=S1+"px",t.calendarContainer.style.right="auto"}}}}function Oe(){for(var W=null,G=0;Gt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Se];else if(t.config.mode==="multiple"){var Le=xe(Se);Le?t.selectedDates.splice(parseInt(Le),1):t.selectedDates.push(Se)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Se,t.selectedDates.push(Se),Cn(Se,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,vt){return Be.getTime()-vt.getTime()}));if(c(),Ae){var Me=t.currentYear!==Se.getFullYear();t.currentYear=Se.getFullYear(),t.currentMonth=Se.getMonth(),Me&&(we("onYearChange"),N()),we("onMonthChange")}if(_n(),R(),tn(),!Ae&&t.config.mode!=="range"&&t.config.showMonths===1?E(oe):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 Ue=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ue||Ne)&&Vt()}b()}}var In={locale:[Ie,J],showMonths:[j,r,K],minDate:[S],maxDate:[S],positionElement:[di],clickOpens:[function(){t.config.clickOpens===!0?(h(t._input,"focus",t.open),h(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Yn(W,G){if(W!==null&&typeof W=="object"){Object.assign(t.config,W);for(var ne in W)In[ne]!==void 0&&In[ne].forEach(function(oe){return oe()})}else t.config[W]=G,In[W]!==void 0?In[W].forEach(function(oe){return oe()}):$r.indexOf(W)>-1&&(t.config[W]=Mr(G));t.redraw(),tn(!0)}function Kn(W,G){var ne=[];if(W instanceof Array)ne=W.map(function(oe){return t.parseDate(oe,G)});else if(W instanceof Date||typeof W=="number")ne=[t.parseDate(W,G)];else if(typeof W=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(W,G)];break;case"multiple":ne=W.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,G)});break;case"range":ne=W.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,G)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(W)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(oe){return oe instanceof Date&&Ce(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Se){return oe.getTime()-Se.getTime()})}function kt(W,G,ne){if(G===void 0&&(G=!1),ne===void 0&&(ne=t.config.dateFormat),W!==0&&!W||W instanceof Array&&W.length===0)return t.clear(G);Kn(W,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,G),d(),t.selectedDates.length===0&&t.clear(!1),tn(G),G&&we("onChange")}function un(W){return W.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?t.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:t.parseDate(G.from,void 0),to:t.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function ti(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var W=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);W&&Kn(W,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 as(){if(t.input=Mt(),!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"),di()}function di(){t._positionElement=t.config.positionElement||t._input}function Ti(){var W=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=W,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=W==="datetime-local"?"Y-m-d\\TH:i:S":W==="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{}h(t.mobileInput,"change",function(G){t.setDate(Sn(G).value,!1,t.mobileFormatStr),we("onChange"),we("onClose")})}function ge(W){if(t.isOpen===!0)return t.close();t.open(W)}function we(W,G){if(t.config!==void 0){var ne=t.config[W];if(ne!==void 0&&ne.length>0)for(var oe=0;ne[oe]&&oe=0&&Cn(W,t.selectedDates[1])<=0}function _n(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(W,G){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+G),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[G].textContent=Io(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),W.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 Ln(W){var G=W||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,G)}).filter(function(ne,oe,Se){return t.config.mode!=="range"||t.config.enableTime||Se.indexOf(ne)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function tn(W){W===void 0&&(W=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ln(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ln(t.config.altFormat)),W!==!1&&we("onValueUpdate")}function cn(W){var G=Sn(W),ne=t.prevMonthNav.contains(G),oe=t.nextMonthNav.contains(G);ne||oe?ie(ne?-1:1):t.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):G.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Al(W){W.preventDefault();var G=W.type==="keydown",ne=Sn(W),oe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Rn(t.amPM.textContent===t.l10n.amPM[0])]);var Se=parseFloat(oe.getAttribute("min")),Ae=parseFloat(oe.getAttribute("max")),Le=parseFloat(oe.getAttribute("step")),Me=parseInt(oe.value,10),Ue=W.delta||(G?W.which===38?1:-1:0),Ne=Me+Le*Ue;if(typeof oe.value<"u"&&oe.value.length===2){var Be=oe===t.hourElement,vt=oe===t.minuteElement;NeAe&&(Ne=oe===t.hourElement?Ne-Ae-Rn(!t.amPM):Se,vt&&C(void 0,1,t.hourElement)),t.amPM&&Be&&(Le===1?Ne+Me===23:Math.abs(Ne-Me)>Le)&&(t.amPM.textContent=t.l10n.amPM[Rn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=gn(Ne)}}return s(),t}function ws(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function H4(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Xe(e,i),{$$slots:l={},$$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:_=void 0,flatpickr:h=void 0}=e;Xt(()=>{const C=u??_,$=y(d);return $.onReady.push((M,E,D)=>{a===void 0&&S(M,E,D),fn().then(()=>{t(8,m=!0)})}),t(3,h=Kt(C,Object.assign($,u?{wrap:!0}:{}))),()=>{h.destroy()}});const b=$t();function y(C={}){C=Object.assign({},C);for(const $ of r){const M=(E,D,I)=>{b(z4($),[E,D,I])};$ in C?(Array.isArray(C[$])||(C[$]=[C[$]]),C[$].push(M)):C[$]=[M]}return C.onChange&&!C.onChange.includes(S)&&C.onChange.push(S),C}function S(C,$,M){const E=Xc(M,C);!Qc(a,E)&&(a||E)&&t(2,a=E),t(4,f=$)}function T(C){te[C?"unshift":"push"](()=>{_=C,t(0,_)})}return n.$$set=C=>{e=Re(Re({},e),Gt(C)),t(1,s=Xe(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,f=C.formattedValue),"element"in C&&t(5,u=C.element),"dateFormat"in C&&t(6,c=C.dateFormat),"options"in C&&t(7,d=C.options),"input"in C&&t(0,_=C.input),"flatpickr"in C&&t(3,h=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&h&&m&&(Qc(a,Xc(h,h.selectedDates))||h.setDate(a,!0,c)),n.$$.dirty&392&&h&&m)for(const[C,$]of Object.entries(y(d)))h.set(C,$)},[_,s,a,h,f,u,c,d,m,o,l,T]}class tf extends ve{constructor(e){super(),be(this,e,H4,V4,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function B4(n){let e,t,i,s,l,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[15],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new tf({props:c}),te.push(()=>ce(l,"value",f)),te.push(()=>ce(l,"formattedValue",u)),l.$on("close",n[8]),{c(){e=v("label"),t=U("Min date (UTC)"),s=O(),B(l.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),g(e,t),w(d,s,m),z(l,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const _={};m&32768&&(_.id=d[15]),!o&&m&4&&(o=!0,_.value=d[2],he(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=d[0].options.min,he(()=>r=!1)),l.$set(_)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&k(e),d&&k(s),H(l,d)}}}function U4(n){let e,t,i,s,l,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[15],options:V.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new tf({props:c}),te.push(()=>ce(l,"value",f)),te.push(()=>ce(l,"formattedValue",u)),l.$on("close",n[11]),{c(){e=v("label"),t=U("Max date (UTC)"),s=O(),B(l.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),g(e,t),w(d,s,m),z(l,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const _={};m&32768&&(_.id=d[15]),!o&&m&8&&(o=!0,_.value=d[3],he(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=d[0].options.max,he(()=>r=!1)),l.$set(_)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&k(e),d&&k(s),H(l,d)}}}function W4(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[B4,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[U4,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&98309&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&98313&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function Y4(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[W4]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?At(s,[a&2&&{key:r[1]},a&32&&Qt(r[5])]):{};a&65551&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function K4(n,e,t){var T,C;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=(T=l==null?void 0:l.options)==null?void 0:T.min,a=(C=l==null?void 0:l.options)==null?void 0:C.max;function f($,M){$.detail&&$.detail.length==3&&t(0,l.options[M]=$.detail[1],l)}function u($){r=$,t(2,r),t(0,l)}function c($){n.$$.not_equal(l.options.min,$)&&(l.options.min=$,t(0,l))}const d=$=>f($,"min");function m($){a=$,t(3,a),t(0,l)}function _($){n.$$.not_equal(l.options.max,$)&&(l.options.max=$,t(0,l))}const h=$=>f($,"max");function b($){l=$,t(0,l)}function y($){Fe.call(this,n,$)}function S($){Fe.call(this,n,$)}return n.$$set=$=>{e=Re(Re({},e),Gt($)),t(5,s=Xe(e,i)),"field"in $&&t(0,l=$.field),"key"in $&&t(1,o=$.key)},n.$$.update=()=>{var $,M,E,D;n.$$.dirty&5&&r!=(($=l==null?void 0:l.options)==null?void 0:$.min)&&t(2,r=(M=l==null?void 0:l.options)==null?void 0:M.min),n.$$.dirty&9&&a!=((E=l==null?void 0:l.options)==null?void 0:E.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,f,s,u,c,d,m,_,h,b,y,S]}class J4 extends ve{constructor(e){super(),be(this,e,K4,Y4,me,{field:0,key:1})}}const Z4=n=>({}),xc=n=>({});function ed(n,e,t){const i=n.slice();return i[47]=e[t],i}const G4=n=>({}),td=n=>({});function nd(n,e,t){const i=n.slice();return i[47]=e[t],i[51]=t,i}function id(n){let e,t,i;return{c(){e=v("div"),t=U(n[2]),i=O(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),g(e,t),g(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function X4(n){let e,t=n[47]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=s[47]+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function Q4(n){let e,t,i;const s=[{item:n[47]},n[10]];var l=n[9];function o(r){let a={};for(let f=0;f{H(u,1)}),fe()}l?(e=Rt(l,o()),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(f)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function sd(n){let e,t,i;function s(){return n[35](n[47])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Te(Ve.call(null,e,"Clear")),Y(e,"click",On(Qe(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ee(i)}}}function ld(n){let e,t,i,s,l,o;const r=[Q4,X4],a=[];function f(c,d){return c[9]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[7])&&sd(n);return{c(){e=v("div"),i.c(),s=O(),u&&u.c(),l=O(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),g(e,s),u&&u.m(e,null),g(e,l),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(ae(),L(a[m],1,1,()=>{a[m]=null}),fe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[7]?u?u.p(c,d):(u=sd(c),u.c(),u.m(e,l)):u&&(u.d(1),u=null)},i(c){o||(A(i),o=!0)},o(c){L(i),o=!1},d(c){c&&k(e),a[t].d(),u&&u.d()}}}function od(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[19],$$slots:{default:[tT]},$$scope:{ctx:n}};return e=new Wn({props:i}),n[40](e),e.$on("show",n[25]),e.$on("hide",n[41]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,l){const o={};l[0]&524288&&(o.trigger=s[19]),l[0]&3225866|l[1]&4096&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[40](null),H(e,s)}}}function rd(n){let e,t,i,s,l,o,r,a,f=n[16].length&&ad(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=O(),l=v("input"),o=O(),f&&f.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"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),g(e,t),g(t,i),g(t,s),g(t,l),re(l,n[16]),g(t,o),f&&f.m(t,null),l.focus(),r||(a=Y(l,"input",n[37]),r=!0)},p(u,c){c[0]&8&&p(l,"placeholder",u[3]),c[0]&65536&&l.value!==u[16]&&re(l,u[16]),u[16].length?f?f.p(u,c):(f=ad(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&k(e),f&&f.d(),r=!1,a()}}}function ad(n){let e,t,i,s;return{c(){e=v("div"),t=v("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(l,o){w(l,e,o),g(e,t),i||(s=Y(t,"click",On(Qe(n[22]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function fd(n){let e,t=n[1]&&ud(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=ud(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function ud(n){let e,t;return{c(){e=v("div"),t=U(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&k(e)}}}function x4(n){let e=n[47]+"",t;return{c(){t=U(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&2097152&&e!==(e=i[47]+"")&&se(t,e)},i:x,o:x,d(i){i&&k(t)}}}function eT(n){let e,t,i;const s=[{item:n[47]},n[12]];var l=n[11];function o(r){let a={};for(let f=0;f{H(u,1)}),fe()}l?(e=Rt(l,o()),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(f)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function cd(n){let e,t,i,s,l,o,r;const a=[eT,x4],f=[];function u(m,_){return m[11]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[38](n[47],...m)}function d(...m){return n[39](n[47],...m)}return{c(){e=v("div"),i.c(),s=O(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[8]),Q(e,"selected",n[20](n[47]))},m(m,_){w(m,e,_),f[t].m(e,null),g(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,_){n=m;let h=t;t=u(n),t===h?f[t].p(n,_):(ae(),L(f[h],1,1,()=>{f[h]=null}),fe(),i=f[t],i?i.p(n,_):(i=f[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||_[0]&256)&&Q(e,"closable",n[8]),(!l||_[0]&3145728)&&Q(e,"selected",n[20](n[47]))},i(m){l||(A(i),l=!0)},o(m){L(i),l=!1},d(m){m&&k(e),f[t].d(),o=!1,Ee(r)}}}function tT(n){let e,t,i,s,l,o=n[13]&&rd(n);const r=n[34].beforeOptions,a=wt(r,n,n[43],td);let f=n[21],u=[];for(let h=0;hL(u[h],1,1,()=>{u[h]=null});let d=null;f.length||(d=fd(n));const m=n[34].afterOptions,_=wt(m,n,n[43],xc);return{c(){o&&o.c(),e=O(),a&&a.c(),t=O(),i=v("div");for(let h=0;hL(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=id(n));let c=!n[5]&&!n[6]&&od(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),fe()),(!o||m[0]&16384&&l!==(l="select "+d[14]))&&p(e,"class",l),(!o||m[0]&16400)&&Q(e,"multiple",d[4]),(!o||m[0]&16416)&&Q(e,"disabled",d[5]),(!o||m[0]&16448)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mYe(Mt,_e))||[]}function ee(pe,_e){pe.preventDefault(),b&&d?j(_e):q(_e)}function $e(pe,_e){(pe.code==="Enter"||pe.code==="Space")&&(ee(pe,_e),y&&K())}function Pe(){le(),setTimeout(()=>{const pe=F==null?void 0:F.querySelector(".dropdown-item.option.selected");pe&&(pe.focus(),pe.scrollIntoView({block:"nearest"}))},0)}function je(pe){pe.stopPropagation(),!_&&!m&&(I==null||I.toggle())}Xt(()=>{const pe=document.querySelectorAll(`label[for="${r}"]`);for(const _e of pe)_e.addEventListener("click",je);return()=>{for(const _e of pe)_e.removeEventListener("click",je)}});const ze=pe=>N(pe);function ke(pe){te[pe?"unshift":"push"](()=>{R=pe,t(19,R)})}function Ce(){P=this.value,t(16,P)}const Je=(pe,_e)=>ee(_e,pe),_t=(pe,_e)=>$e(_e,pe);function Ze(pe){te[pe?"unshift":"push"](()=>{I=pe,t(17,I)})}function We(pe){Fe.call(this,n,pe)}function yt(pe){te[pe?"unshift":"push"](()=>{F=pe,t(18,F)})}return n.$$set=pe=>{"id"in pe&&t(26,r=pe.id),"noOptionsText"in pe&&t(1,a=pe.noOptionsText),"selectPlaceholder"in pe&&t(2,f=pe.selectPlaceholder),"searchPlaceholder"in pe&&t(3,u=pe.searchPlaceholder),"items"in pe&&t(27,c=pe.items),"multiple"in pe&&t(4,d=pe.multiple),"disabled"in pe&&t(5,m=pe.disabled),"readonly"in pe&&t(6,_=pe.readonly),"selected"in pe&&t(0,h=pe.selected),"toggle"in pe&&t(7,b=pe.toggle),"closable"in pe&&t(8,y=pe.closable),"labelComponent"in pe&&t(9,S=pe.labelComponent),"labelComponentProps"in pe&&t(10,T=pe.labelComponentProps),"optionComponent"in pe&&t(11,C=pe.optionComponent),"optionComponentProps"in pe&&t(12,$=pe.optionComponentProps),"searchable"in pe&&t(13,M=pe.searchable),"searchFunc"in pe&&t(28,E=pe.searchFunc),"class"in pe&&t(14,D=pe.class),"$$scope"in pe&&t(43,o=pe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&134217728&&c&&(J(),le()),n.$$.dirty[0]&134283264&&t(21,i=ie(c,P)),n.$$.dirty[0]&1&&t(20,s=function(pe){const _e=V.toArray(h);return V.inArray(_e,pe)})},[h,a,f,u,d,m,_,b,y,S,T,C,$,M,D,N,P,I,F,R,s,i,le,ee,$e,Pe,r,c,E,q,j,Z,X,K,l,ze,ke,Ce,Je,_t,Ze,We,yt,o]}class nf extends ve{constructor(e){super(),be(this,e,sT,nT,me,{id:26,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:27,multiple:4,disabled:5,readonly:6,selected:0,toggle:7,closable:8,labelComponent:9,labelComponentProps:10,optionComponent:11,optionComponentProps:12,searchable:13,searchFunc:28,class:14,deselectItem:15,selectItem:29,toggleItem:30,reset:31,showDropdown:32,hideDropdown:33},null,[-1,-1])}get deselectItem(){return this.$$.ctx[15]}get selectItem(){return this.$$.ctx[29]}get toggleItem(){return this.$$.ctx[30]}get reset(){return this.$$.ctx[31]}get showDropdown(){return this.$$.ctx[32]}get hideDropdown(){return this.$$.ctx[33]}}function dd(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function lT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&dd(n);return{c(){l&&l.c(),e=O(),t=v("span"),s=U(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),g(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=dd(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:x,o:x,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function oT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class pd extends ve{constructor(e){super(),be(this,e,oT,lT,me,{item:0})}}const rT=n=>({}),md=n=>({});function aT(n){let e;const t=n[8].afterOptions,i=wt(t,n,n[12],md);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Ct(i,t,s,s[12],e?St(t,s[12],l,rT):Tt(s[12]),md)},i(s){e||(A(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function fT(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[aT]},$$scope:{ctx:n}};for(let r=0;rce(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&62?At(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Qt(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function uT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=pd}=e,{optionComponent:c=pd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function _(T){T=V.toArray(T,!0);let C=[];for(let $ of T){const M=V.findByKey(r,d,$);M&&C.push(M)}T.length&&!C.length||t(0,f=a?C:C[0])}async function h(T){let C=V.toArray(T,!0).map($=>$[d]);r.length&&t(6,m=a?C:C[0])}function b(T){f=T,t(0,f)}function y(T){Fe.call(this,n,T)}function S(T){Fe.call(this,n,T)}return n.$$set=T=>{e=Re(Re({},e),Gt(T)),t(5,s=Xe(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&&_(m),n.$$.dirty&1&&h(f)},[f,r,a,u,c,s,m,d,l,b,y,S,o]}class Vi extends ve{constructor(e){super(),be(this,e,uT,fT,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function cT(n){let e,t,i,s,l,o;function r(f){n[7](f)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Fs({props:a}),te.push(()=>ce(t,"value",r)),{c(){e=v("div"),B(t.$$.fragment)},m(f,u){w(f,e,u),z(t,e,null),s=!0,l||(o=Te(Ve.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(f,u){const c={};u&8192&&(c.id=f[13]),u&16384&&(c.readonly=!f[14]),!i&&u&1&&(i=!0,c.value=f[0].options.values,he(()=>i=!1)),t.$set(c)},i(f){s||(A(t.$$.fragment,f),s=!0)},o(f){L(t.$$.fragment,f),s=!1},d(f){f&&k(e),H(t),l=!1,o()}}}function dT(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pT(n){let e,t,i,s,l,o,r,a,f,u;return i=new de({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[cT,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[dT,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=O(),B(i.$$.fragment),s=O(),l=v("div"),o=O(),B(r.$$.fragment),a=O(),f=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&16384&&(m.class="form-field required "+(c[14]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&57345&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d&16384&&(_.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},i(c){u||(A(i.$$.fragment,c),A(r.$$.fragment,c),u=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),u=!1},d(c){c&&k(e),c&&k(t),H(i,c),c&&k(s),c&&k(l),c&&k(o),H(r,c),c&&k(a),c&&k(f)}}}function hd(n){let e,t;return e=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[mT,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=O(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[6]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(l,"id",o),u&1&&pt(l.value)!==f[0].options.maxSelect&&re(l,f[0].options.maxSelect)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function hT(n){let e,t,i=!n[2]&&hd(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(ae(),L(i,1,1,()=>{i=null}),fe()):i?(i.p(s,l),l&4&&A(i,1)):(i=hd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function _T(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[hT],default:[pT,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&18?At(s,[a&2&&{key:r[1]},a&16&&Qt(r[4])]):{};a&49159&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function gT(n,e,t){var y;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,f=a;function u(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,f=a)}function c(){l.options.maxSelect=pt(this.value),t(0,l),t(5,f),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,f),t(2,a))}function m(S){a=S,t(2,a)}function _(S){l=S,t(0,l),t(5,f),t(2,a)}function h(S){Fe.call(this,n,S)}function b(S){Fe.call(this,n,S)}return n.$$set=S=>{e=Re(Re({},e),Gt(S)),t(4,s=Xe(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,T;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((T=(S=l.options)==null?void 0:S.values)==null?void 0:T.length)||2,l)),n.$$.dirty&1&&V.isEmpty(l.options)&&u()},[l,o,a,r,s,f,c,d,m,_,h,b]}class bT extends ve{constructor(e){super(),be(this,e,gT,_T,me,{field:0,key:1})}}function vT(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yT(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _d(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E='"{"a":1,"b":2}"',D,I,P,F,R,N,q,j,Z,X,K,J,le;return{c(){e=v("div"),t=v("div"),i=v("div"),s=U("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=U(` and + `),r=v("code"),r.textContent="multipart/form-data",a=U(` + requests, the following normalization rules are applied if the `),f=v("code"),f.textContent="json",u=U(` field + is a + `),c=v("strong"),c.textContent="plain string",d=U(`: + `),m=v("ul"),_=v("li"),_.innerHTML=""true" is converted to the json true",h=O(),b=v("li"),b.innerHTML=""false" is converted to the json false",y=O(),S=v("li"),S.innerHTML=""null" is converted to the json null",T=O(),C=v("li"),C.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",$=O(),M=v("li"),D=U(E),I=U(" is converted to the json "),P=v("code"),P.textContent='{"a":1,"b":2}',F=O(),R=v("li"),R.textContent="numeric strings are converted to json number",N=O(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",j=O(),Z=v("li"),Z.textContent="any other string (empty string too) is double quoted",X=U(` + Alternatively, if you want to avoid the string value normalizations, you can wrap your + data inside an object, eg.`),K=v("code"),K.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,ee){w(ie,e,ee),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,f),g(i,u),g(i,c),g(i,d),g(i,m),g(m,_),g(m,h),g(m,b),g(m,y),g(m,S),g(m,T),g(m,C),g(m,$),g(m,M),g(M,D),g(M,I),g(M,P),g(m,F),g(m,R),g(m,N),g(m,q),g(m,j),g(m,Z),g(i,X),g(i,K),le=!0},i(ie){le||(ie&&Ge(()=>{le&&(J||(J=qe(e,st,{duration:150},!0)),J.run(1))}),le=!0)},o(ie){ie&&(J||(J=qe(e,st,{duration:150},!1)),J.run(0)),le=!1},d(ie){ie&&k(e),ie&&J&&J.end()}}}function kT(n){let e,t,i,s,l,o,r;function a(d,m){return d[2]?yT:vT}let f=a(n),u=f(n),c=n[2]&&_d();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=O(),u.c(),s=O(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),g(e,t),g(e,i),u.m(e,null),w(d,s,m),c&&c.m(d,m),w(d,l,m),o||(r=Y(e,"click",n[4]),o=!0)},p(d,m){f!==(f=a(d))&&(u.d(1),u=f(d),u&&(u.c(),u.m(e,null))),d[2]?c?m&4&&A(c,1):(c=_d(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),L(c,1,1,()=>{c=null}),fe())},d(d){d&&k(e),u.d(),d&&k(s),c&&c.d(d),d&&k(l),o=!1,r()}}}function wT(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[kT]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&10?At(s,[a&2&&{key:r[1]},a&8&&Qt(r[3])]):{};a&260&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function ST(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function f(d){l=d,t(0,l)}function u(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(3,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,f,u,c]}class CT extends ve{constructor(e){super(),be(this,e,ST,wT,me,{field:0,key:1})}}function TT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=O(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,f){w(a,e,f),g(e,i),w(a,s,f),w(a,l,f),g(l,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),f&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&k(e),a&&k(s),a&&k(l)}}}function $T(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class gd extends ve{constructor(e){super(),be(this,e,$T,TT,me,{item:0})}}const MT=[{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 ET(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function OT(n){let e,t,i,s,l,o;return i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[ET,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=O(),B(i.$$.fragment),s=O(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const f={};a&8388608&&(f.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),o=!1},d(r){r&&k(e),r&&k(t),H(i,r),r&&k(s),r&&k(l)}}}function DT(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=O(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=O(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=O(),r=v("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(l,"type","button"),p(l,"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,s,c),w(u,l,c),w(u,o,c),w(u,r,c),a||(f=[Y(e,"click",n[9]),Y(i,"click",n[10]),Y(l,"click",n[11]),Y(r,"click",n[12])],a=!0)},p:x,d(u){u&&k(e),u&&k(t),u&&k(i),u&&k(s),u&&k(l),u&&k(o),u&&k(r),a=!1,Ee(f)}}}function AT(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T;function C(M){n[8](M)}let $={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:gd,optionComponent:gd};return n[0].options.mimeTypes!==void 0&&($.keyOfSelected=n[0].options.mimeTypes),r=new Vi({props:$}),te.push(()=>ce(r,"keyOfSelected",C)),b=new Wn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[DT]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=O(),s=v("i"),o=O(),B(r.$$.fragment),f=O(),u=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",m=O(),_=v("i"),h=O(),B(b.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(_,"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,E){w(M,e,E),g(e,t),g(e,i),g(e,s),w(M,o,E),z(r,M,E),w(M,f,E),w(M,u,E),g(u,c),g(c,d),g(c,m),g(c,_),g(c,h),z(b,c,null),y=!0,S||(T=Te(Ve.call(null,s,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,E){(!y||E&4194304&&l!==(l=M[22]))&&p(e,"for",l);const D={};E&4194304&&(D.id=M[22]),E&8&&(D.items=M[3]),!a&&E&1&&(a=!0,D.keyOfSelected=M[0].options.mimeTypes,he(()=>a=!1)),r.$set(D);const I={};E&16777217&&(I.$$scope={dirty:E,ctx:M}),b.$set(I)},i(M){y||(A(r.$$.fragment,M),A(b.$$.fragment,M),y=!0)},o(M){L(r.$$.fragment,M),L(b.$$.fragment,M),y=!1},d(M){M&&k(e),M&&k(o),H(r,M),M&&k(f),M&&k(u),H(b),S=!1,T()}}}function IT(n){let e;return{c(){e=v("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:x,d(t){t&&k(e)}}}function LT(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$;function M(D){n[13](D)}let E={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(E.value=n[0].options.thumbs),r=new Fs({props:E}),te.push(()=>ce(r,"value",M)),S=new Wn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[IT]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=O(),s=v("i"),o=O(),B(r.$$.fragment),f=O(),u=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=O(),m=v("button"),_=v("span"),_.textContent="Supported formats",h=O(),b=v("i"),y=O(),B(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(_,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(D,I){w(D,e,I),g(e,t),g(e,i),g(e,s),w(D,o,I),z(r,D,I),w(D,f,I),w(D,u,I),g(u,c),g(u,d),g(u,m),g(m,_),g(m,h),g(m,b),g(m,y),z(S,m,null),T=!0,C||($=Te(Ve.call(null,s,{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"})),C=!0)},p(D,I){(!T||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const P={};I&4194304&&(P.id=D[22]),!a&&I&1&&(a=!0,P.value=D[0].options.thumbs,he(()=>a=!1)),r.$set(P);const F={};I&16777216&&(F.$$scope={dirty:I,ctx:D}),S.$set(F)},i(D){T||(A(r.$$.fragment,D),A(S.$$.fragment,D),T=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),T=!1},d(D){D&&k(e),D&&k(o),H(r,D),D&&k(f),D&&k(u),H(S),C=!1,$()}}}function PT(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=U("Max file size"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=Y(l,"input",n[14]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&pt(l.value)!==c[0].options.maxSize&&re(l,c[0].options.maxSize)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),f=!1,u()}}}function bd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[FT,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function FT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=O(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(f,u){u&4194304&&i!==(i=f[22])&&p(e,"for",i),u&4194304&&o!==(o=f[22])&&p(l,"id",o),u&1&&pt(l.value)!==f[0].options.maxSelect&&re(l,f[0].options.maxSelect)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function NT(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[AT,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[LT,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[PT,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let _=!n[2]&&bd(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),a=O(),f=v("div"),B(u.$$.fragment),d=O(),_&&_.c(),p(t,"class","col-sm-12"),p(l,"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(h,b){w(h,e,b),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),g(e,a),g(e,f),z(u,f,null),g(e,d),_&&_.m(e,null),m=!0},p(h,b){const y={};b&2&&(y.name="schema."+h[1]+".options.mimeTypes"),b&20971529&&(y.$$scope={dirty:b,ctx:h}),i.$set(y);const S={};b&2&&(S.name="schema."+h[1]+".options.thumbs"),b&20971521&&(S.$$scope={dirty:b,ctx:h}),o.$set(S),(!m||b&4&&r!==(r=h[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const T={};b&2&&(T.name="schema."+h[1]+".options.maxSize"),b&20971521&&(T.$$scope={dirty:b,ctx:h}),u.$set(T),(!m||b&4&&c!==(c=h[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),h[2]?_&&(ae(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(h,b),b&4&&A(_,1)):(_=bd(h),_.c(),A(_,1),_.m(e,null))},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(_),m=!0)},o(h){L(i.$$.fragment,h),L(o.$$.fragment,h),L(u.$$.fragment,h),L(_),m=!1},d(h){h&&k(e),H(i),H(o),H(u),_&&_.d()}}}function RT(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Protected",r=O(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),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,s,d),g(s,l),w(c,r,d),w(c,a,d),f||(u=Y(e,"change",n[7]),f=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&k(e),c&&k(i),c&&k(s),c&&k(r),c&&k(a),f=!1,u()}}}function qT(n){let e,t,i;return t=new de({props:{class:"form-field form-field-toggle m-0",name:"schema."+n[1]+".options.protected",$$slots:{default:[RT,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","col-sm-4")},m(s,l){w(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.protected"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function jT(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{afterNonempty:[qT],options:[NT],default:[OT,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rce(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?At(s,[a&2&&{key:r[1]},a&32&&Qt(r[5])]):{};a&25165839&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],he(()=>t=!1)),e.$set(f)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function VT(n,e,t){var P;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=MT.slice(),f=((P=l.options)==null?void 0:P.maxSelect)<=1,u=f;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,f=!0),t(6,u=f)}function d(){if(V.isEmpty(l.options.mimeTypes))return;const F=[];for(const R of l.options.mimeTypes)a.find(N=>N.mimeType===R)||F.push({mimeType:R});F.length&&t(3,a=a.concat(F))}function m(){l.options.protected=this.checked,t(0,l),t(6,u),t(2,f)}function _(F){n.$$.not_equal(l.options.mimeTypes,F)&&(l.options.mimeTypes=F,t(0,l),t(6,u),t(2,f))}const h=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},b=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function T(F){n.$$.not_equal(l.options.thumbs,F)&&(l.options.thumbs=F,t(0,l),t(6,u),t(2,f))}function C(){l.options.maxSize=pt(this.value),t(0,l),t(6,u),t(2,f)}function $(){l.options.maxSelect=pt(this.value),t(0,l),t(6,u),t(2,f)}function M(F){f=F,t(2,f)}function E(F){l=F,t(0,l),t(6,u),t(2,f)}function D(F){Fe.call(this,n,F)}function I(F){Fe.call(this,n,F)}return n.$$set=F=>{e=Re(Re({},e),Gt(F)),t(5,s=Xe(e,i)),"field"in F&&t(0,l=F.field),"key"in F&&t(1,o=F.key)},n.$$.update=()=>{var F,R;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((R=(F=l.options)==null?void 0:F.values)==null?void 0:R.length)||99,l)),n.$$.dirty&1&&(V.isEmpty(l.options)?c():d())},[l,o,f,a,r,s,u,m,_,h,b,y,S,T,C,$,M,E,D,I]}class zT extends ve{constructor(e){super(),be(this,e,VT,jT,me,{field:0,key:1})}}function HT(n){let e,t,i,s,l;return{c(){e=v("hr"),t=O(),i=v("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),s||(l=Y(i,"click",n[17]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function BT(n){let e,t,i;function s(o){n[18](o)}let l={id:n[29],searchable:n[6].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[6],readonly:!n[30]||n[0].id,$$slots:{afterOptions:[HT]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&64&&(a.searchable=o[6].length>5),r[0]&64&&(a.items=o[6]),r[0]&1073741825&&(a.readonly=!o[30]||o[0].id),r[0]&8|r[1]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UT(n){let e,t,i;function s(o){n[19](o)}let l={id:n[29],items:n[7],readonly:!n[30]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&1073741824&&(a.readonly=!o[30]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WT(n){let e,t,i,s,l,o,r,a,f,u;return i=new de({props:{class:"form-field required "+(n[30]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[BT,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field form-field-single-multiple-select "+(n[30]?"":"readonly"),inlineError:!0,$$slots:{default:[UT,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=O(),B(i.$$.fragment),s=O(),l=v("div"),o=O(),B(r.$$.fragment),a=O(),f=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d[0]&1073741824&&(m.class="form-field required "+(c[30]?"":"readonly")),d[0]&2&&(m.name="schema."+c[1]+".options.collectionId"),d[0]&1610612809|d[1]&1&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d[0]&1073741824&&(_.class="form-field form-field-single-multiple-select "+(c[30]?"":"readonly")),d[0]&1610612740|d[1]&1&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},i(c){u||(A(i.$$.fragment,c),A(r.$$.fragment,c),u=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),u=!1},d(c){c&&k(e),c&&k(t),H(i,c),c&&k(s),c&&k(l),c&&k(o),H(r,c),c&&k(a),c&&k(f)}}}function vd(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[YT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[KT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),i=O(),s=v("div"),B(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,s,a),z(l,s,null),o=!0},p(r,a){const f={};a[0]&2&&(f.name="schema."+r[1]+".options.minSelect"),a[0]&536870913|a[1]&1&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a[0]&2&&(u.name="schema."+r[1]+".options.maxSelect"),a[0]&536870913|a[1]&1&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(t),r&&k(i),r&&k(s),H(l)}}}function YT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=O(),l=v("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(f,u){u[0]&536870912&&i!==(i=f[29])&&p(e,"for",i),u[0]&536870912&&o!==(o=f[29])&&p(l,"id",o),u[0]&1&&pt(l.value)!==f[0].options.minSelect&&re(l,f[0].options.minSelect)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function KT(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("label"),t=U("Max select"),s=O(),l=v("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),g(e,t),w(u,s,c),w(u,l,c),re(l,n[0].options.maxSelect),a||(f=Y(l,"input",n[14]),a=!0)},p(u,c){c[0]&536870912&&i!==(i=u[29])&&p(e,"for",i),c[0]&536870912&&o!==(o=u[29])&&p(l,"id",o),c[0]&1&&r!==(r=u[0].options.minSelect||2)&&p(l,"min",r),c[0]&1&&pt(l.value)!==u[0].options.maxSelect&&re(l,u[0].options.maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),a=!1,f()}}}function JT(n){let e,t,i,s,l,o,r,a,f,u,c;function d(_){n[15](_)}let m={multiple:!0,searchable:!0,id:n[29],selectPlaceholder:"Auto",items:n[4]};return n[0].options.displayFields!==void 0&&(m.selected=n[0].options.displayFields),r=new nf({props:m}),te.push(()=>ce(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=O(),s=v("i"),o=O(),B(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[29])},m(_,h){w(_,e,h),g(e,t),g(e,i),g(e,s),w(_,o,h),z(r,_,h),f=!0,u||(c=Te(Ve.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),u=!0)},p(_,h){(!f||h[0]&536870912&&l!==(l=_[29]))&&p(e,"for",l);const b={};h[0]&536870912&&(b.id=_[29]),h[0]&16&&(b.items=_[4]),!a&&h[0]&1&&(a=!0,b.selected=_[0].options.displayFields,he(()=>a=!1)),r.$set(b)},i(_){f||(A(r.$$.fragment,_),f=!0)},o(_){L(r.$$.fragment,_),f=!1},d(_){_&&k(e),_&&k(o),H(r,_),u=!1,c()}}}function ZT(n){let e,t,i,s,l,o,r,a,f,u,c,d;function m(h){n[16](h)}let _={id:n[29],items:n[8]};return n[0].options.cascadeDelete!==void 0&&(_.keyOfSelected=n[0].options.cascadeDelete),a=new Vi({props:_}),te.push(()=>ce(a,"keyOfSelected",m)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=O(),s=v("i"),r=O(),B(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[29])},m(h,b){var y,S;w(h,e,b),g(e,t),g(e,i),g(e,s),w(h,r,b),z(a,h,b),u=!0,c||(d=Te(l=Ve.call(null,s,{text:[`Whether on ${((y=n[5])==null?void 0:y.name)||"relation"} record deletion to delete also the corresponding current collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[5])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + +`),position:"top"})),c=!0)},p(h,b){var S,T;l&&jt(l.update)&&b[0]&36&&l.update.call(null,{text:[`Whether on ${((S=h[5])==null?void 0:S.name)||"relation"} record deletion to delete also the corresponding current collection record(s).`,h[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=h[5])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + +`),position:"top"}),(!u||b[0]&536870912&&o!==(o=h[29]))&&p(e,"for",o);const y={};b[0]&536870912&&(y.id=h[29]),!f&&b[0]&1&&(f=!0,y.keyOfSelected=h[0].options.cascadeDelete,he(()=>f=!1)),a.$set(y)},i(h){u||(A(a.$$.fragment,h),u=!0)},o(h){L(a.$$.fragment,h),u=!1},d(h){h&&k(e),h&&k(r),H(a,h),c=!1,d()}}}function GT(n){let e,t,i,s,l,o,r,a,f=!n[2]&&vd(n);return s=new de({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[JT,({uniqueId:u})=>({29:u}),({uniqueId:u})=>[u?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[ZT,({uniqueId:u})=>({29:u}),({uniqueId:u})=>[u?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),f&&f.c(),t=O(),i=v("div"),B(s.$$.fragment),l=O(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(u,c){w(u,e,c),f&&f.m(e,null),g(e,t),g(e,i),z(s,i,null),g(e,l),g(e,o),z(r,o,null),a=!0},p(u,c){u[2]?f&&(ae(),L(f,1,1,()=>{f=null}),fe()):f?(f.p(u,c),c[0]&4&&A(f,1)):(f=vd(u),f.c(),A(f,1),f.m(e,t));const d={};c[0]&2&&(d.name="schema."+u[1]+".options.displayFields"),c[0]&536870929|c[1]&1&&(d.$$scope={dirty:c,ctx:u}),s.$set(d);const m={};c[0]&2&&(m.name="schema."+u[1]+".options.cascadeDelete"),c[0]&536870949|c[1]&1&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){a||(A(f),A(s.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(f),L(s.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&k(e),f&&f.d(),H(s),H(r)}}}function XT(n){let e,t,i,s,l;const o=[{key:n[1]},n[9]];function r(u){n[20](u)}let a={$$slots:{options:[GT],default:[WT,({interactive:u})=>({30:u}),({interactive:u})=>[u?1073741824:0]]},$$scope:{ctx:n}};for(let u=0;uce(e,"field",r)),e.$on("rename",n[21]),e.$on("remove",n[22]);let f={};return s=new sf({props:f}),n[23](s),s.$on("save",n[24]),{c(){B(e.$$.fragment),i=O(),B(s.$$.fragment)},m(u,c){z(e,u,c),w(u,i,c),z(s,u,c),l=!0},p(u,c){const d=c[0]&514?At(o,[c[0]&2&&{key:u[1]},c[0]&512&&Qt(u[9])]):{};c[0]&1073741951|c[1]&1&&(d.$$scope={dirty:c,ctx:u}),!t&&c[0]&1&&(t=!0,d.field=u[0],he(()=>t=!1)),e.$set(d);const m={};s.$set(m)},i(u){l||(A(e.$$.fragment,u),A(s.$$.fragment,u),l=!0)},o(u){L(e.$$.fragment,u),L(s.$$.fragment,u),l=!1},d(u){H(e,u),u&&k(i),n[23](null),H(s,u)}}}function QT(n,e,t){var X;let i,s;const l=["field","key"];let o=Xe(e,l),r;Ke(n,ui,K=>t(12,r=K));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}],d=["id","created","updated"],m=["username","email","emailVisibility","verified"];let _=null,h=[],b=null,y=((X=a.options)==null?void 0:X.maxSelect)==1,S=y;function T(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},a),t(2,y=!0),t(11,S=y)}function C(){var K,J;if(t(4,h=d.slice(0)),!!s){s.type==="auth"&&t(4,h=h.concat(m));for(const le of s.schema)h.push(le.name);if(((J=(K=a.options)==null?void 0:K.displayFields)==null?void 0:J.length)>0)for(let le=a.options.displayFields.length-1;le>=0;le--)h.includes(a.options.displayFields[le])||a.options.displayFields.splice(le,1)}}function $(){a.options.minSelect=pt(this.value),t(0,a),t(11,S),t(2,y)}function M(){a.options.maxSelect=pt(this.value),t(0,a),t(11,S),t(2,y)}function E(K){n.$$.not_equal(a.options.displayFields,K)&&(a.options.displayFields=K,t(0,a),t(11,S),t(2,y))}function D(K){n.$$.not_equal(a.options.cascadeDelete,K)&&(a.options.cascadeDelete=K,t(0,a),t(11,S),t(2,y))}const I=()=>_==null?void 0:_.show();function P(K){n.$$.not_equal(a.options.collectionId,K)&&(a.options.collectionId=K,t(0,a),t(11,S),t(2,y))}function F(K){y=K,t(2,y)}function R(K){a=K,t(0,a),t(11,S),t(2,y)}function N(K){Fe.call(this,n,K)}function q(K){Fe.call(this,n,K)}function j(K){te[K?"unshift":"push"](()=>{_=K,t(3,_)})}const Z=K=>{var J,le;(le=(J=K==null?void 0:K.detail)==null?void 0:J.collection)!=null&&le.id&&K.detail.collection.type!="view"&&t(0,a.options.collectionId=K.detail.collection.id,a)};return n.$$set=K=>{e=Re(Re({},e),Gt(K)),t(9,o=Xe(e,l)),"field"in K&&t(0,a=K.field),"key"in K&&t(1,f=K.key)},n.$$.update=()=>{n.$$.dirty[0]&4096&&t(6,i=r.filter(K=>K.type!="view")),n.$$.dirty[0]&2052&&S!=y&&(t(11,S=y),y?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty[0]&1&&V.isEmpty(a.options)&&T(),n.$$.dirty[0]&4097&&t(5,s=r.find(K=>K.id==a.options.collectionId)||null),n.$$.dirty[0]&1025&&b!=a.options.collectionId&&(t(10,b=a.options.collectionId),C())},[a,f,y,_,h,s,i,u,c,o,b,S,r,$,M,E,D,I,P,F,R,N,q,j,Z]}class xT extends ve{constructor(e){super(),be(this,e,QT,XT,me,{field:0,key:1},null,[-1,-1])}}const e$=n=>({dragging:n&4,dragover:n&8}),yd=n=>({dragging:n[2],dragover:n[3]});function t$(n){let e,t,i,s,l;const o=n[10].default,r=wt(o,n,n[9],yd);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[11])),Y(e,"dragleave",Qe(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&Ct(r,o,a,a[9],i?St(o,a[9],f,e$):Tt(a[9]),yd),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&Q(e,"dragging",a[2]),(!i||f&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Ee(l)}}}function n$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=$t();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(!(!C||f)){if(u&&!C.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),C.preventDefault();return}t(2,c=!0),C.dataTransfer.effectAllowed="move",C.dataTransfer.dropEffect="move",C.dataTransfer.setData("text/plain",JSON.stringify({index:$,group:a})),l("drag",C)}}function _(C,$){if(t(3,d=!1),t(2,c=!1),!C||f)return;C.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse(C.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const E=M.index<<0;E<$?(r.splice($+1,0,r[E]),r.splice(E,1)):(r.splice($,0,r[E]),r.splice(E+1,1)),t(6,r),l("sort",{oldIndex:E,newIndex:$,list:r})}const h=()=>{t(3,d=!0)},b=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=C=>m(C,o),T=C=>_(C,o);return n.$$set=C=>{"index"in C&&t(0,o=C.index),"list"in C&&t(6,r=C.list),"group"in C&&t(7,a=C.group),"disabled"in C&&t(1,f=C.disabled),"dragHandleClass"in C&&t(8,u=C.dragHandleClass),"$$scope"in C&&t(9,s=C.$$scope)},[o,f,c,d,m,_,r,a,u,s,i,h,b,y,S,T]}class Ol extends ve{constructor(e){super(),be(this,e,n$,t$,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function kd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function wd(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, + `),t=v("code"),t.textContent="username",i=U(` , + `),s=v("code"),s.textContent="email",l=U(` , + `),o=v("code"),o.textContent="emailVisibility",r=U(` , + `),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"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,s,u),w(f,l,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),f&&k(a)}}}function i$(n){let e,t,i,s;function l(f){n[6](f,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(f){let u={key:f[4](f[17])};return f[17]!==void 0&&(u.field=f[17]),{props:u}}return r&&(e=Rt(r,a(n)),te.push(()=>ce(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=O()},m(f,u){e&&z(e,f,u),w(f,i,u),s=!0},p(f,u){n=f;const c={};if(u&1&&(c.key=n[4](n[17])),!t&&u&1&&(t=!0,c.field=n[17],he(()=>t=!1)),u&1&&r!==(r=n[1][n[17].type])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),fe()}r?(e=Rt(r,a(n)),te.push(()=>ce(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else r&&e.$set(c)},i(f){s||(e&&A(e.$$.fragment,f),s=!0)},o(f){e&&L(e.$$.fragment,f),s=!1},d(f){e&&H(e,f),f&&k(i)}}}function Sd(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[i$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Ol({props:r}),te.push(()=>ce(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),l=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[19]),f&1&&(u.disabled=e[17].toDelete||e[17].id&&e[17].system),f&1048577&&(u.$$scope={dirty:f,ctx:e}),!s&&f&1&&(s=!0,u.list=e[0].schema,he(()=>s=!1)),i.$set(u)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function s$(n){let e,t,i,s,l,o,r,a,f,u,c,d,m=[],_=new Map,h,b,y,S,T,C,$,M,E=n[0].type==="auth"&&wd(),D=n[0].schema;const I=R=>R[17];for(let R=0;Rce(C,"collection",P)),{c(){e=v("div"),t=v("p"),i=U(`System fields: + `),s=v("code"),s.textContent="id",l=U(` , + `),o=v("code"),o.textContent="created",r=U(` , + `),a=v("code"),a.textContent="updated",f=O(),E&&E.c(),u=U(` + .`),c=O(),d=v("div");for(let R=0;R$=!1)),C.$set(q)},i(R){if(!M){for(let N=0;NM.name===C))}function u(C){return i.findIndex($=>$===C)}function c(C,$){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===$||!$||t(0,s.indexes=s.indexes.map(E=>V.replaceIndexColumn(E,C,$)),s)}function d(C,$,M,E){M[E]=C,t(0,s)}const m=C=>o(C),_=C=>c(C.detail.oldName,C.detail.newName);function h(C){n.$$.not_equal(s.schema,C)&&(s.schema=C,t(0,s))}const b=C=>{if(!C.detail)return;const $=C.detail.target;$.style.opacity=0,setTimeout(()=>{var M;(M=$==null?void 0:$.style)==null||M.removeProperty("opacity")},0),C.detail.dataTransfer.setDragImage($,0,0)},y=()=>{en({})},S=C=>r(C.detail);function T(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,u,c,d,m,_,h,b,y,S,T]}class o$ extends ve{constructor(e){super(),be(this,e,l$,s$,me,{collection:0})}}const r$=n=>({isAdminOnly:n&512}),Cd=n=>({isAdminOnly:n[9]}),a$=n=>({isAdminOnly:n&512}),Td=n=>({isAdminOnly:n[9]}),f$=n=>({isAdminOnly:n&512}),$d=n=>({isAdminOnly:n[9]});function u$(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[d$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function c$(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Md(n){let e,t,i;return{c(){e=v("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(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ed(n){let e,t,i,s,l;return{c(){e=v("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,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function d$(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,_,h,b,y,S;const T=n[12].beforeLabel,C=wt(T,n,n[15],$d),$=n[12].afterLabel,M=wt($,n,n[15],Td);let E=!n[9]&&Md(n);function D(q){n[14](q)}var I=n[7];function P(q){let j={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(j.value=q[0]),{props:j}}I&&(m=Rt(I,P(n)),n[13](m),te.push(()=>ce(m,"value",D)));let F=n[9]&&Ed(n);const R=n[12].default,N=wt(R,n,n[15],Cd);return{c(){e=v("div"),t=v("label"),C&&C.c(),i=O(),s=v("span"),l=U(n[2]),o=O(),a=U(r),f=O(),M&&M.c(),u=O(),E&&E.c(),d=O(),m&&B(m.$$.fragment),h=O(),F&&F.c(),b=O(),y=v("div"),N&&N.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,j){w(q,e,j),g(e,t),C&&C.m(t,null),g(t,i),g(t,s),g(s,l),g(s,o),g(s,a),g(t,f),M&&M.m(t,null),g(t,u),E&&E.m(t,null),g(e,d),m&&z(m,e,null),g(e,h),F&&F.m(e,null),w(q,b,j),w(q,y,j),N&&N.m(y,null),S=!0},p(q,j){C&&C.p&&(!S||j&33280)&&Ct(C,T,q,q[15],S?St(T,q[15],j,f$):Tt(q[15]),$d),(!S||j&4)&&se(l,q[2]),(!S||j&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||j&512)&&Q(s,"txt-hint",q[9]),M&&M.p&&(!S||j&33280)&&Ct(M,$,q,q[15],S?St($,q[15],j,a$):Tt(q[15]),Td),q[9]?E&&(E.d(1),E=null):E?E.p(q,j):(E=Md(q),E.c(),E.m(t,null)),(!S||j&262144&&c!==(c=q[18]))&&p(t,"for",c);const Z={};if(j&262144&&(Z.id=q[18]),j&2&&(Z.baseCollection=q[1]),j&512&&(Z.disabled=q[9]),j&544&&(Z.placeholder=q[9]?"":q[5]),!_&&j&1&&(_=!0,Z.value=q[0],he(()=>_=!1)),j&128&&I!==(I=q[7])){if(m){ae();const X=m;L(X.$$.fragment,1,0,()=>{H(X,1)}),fe()}I?(m=Rt(I,P(q)),q[13](m),te.push(()=>ce(m,"value",D)),B(m.$$.fragment),A(m.$$.fragment,1),z(m,e,h)):m=null}else I&&m.$set(Z);q[9]?F?(F.p(q,j),j&512&&A(F,1)):(F=Ed(q),F.c(),A(F,1),F.m(e,null)):F&&(ae(),L(F,1,1,()=>{F=null}),fe()),N&&N.p&&(!S||j&33280)&&Ct(N,R,q,q[15],S?St(R,q[15],j,r$):Tt(q[15]),Cd)},i(q){S||(A(C,q),A(M,q),m&&A(m.$$.fragment,q),A(F),A(N,q),S=!0)},o(q){L(C,q),L(M,q),m&&L(m.$$.fragment,q),L(F),L(N,q),S=!1},d(q){q&&k(e),C&&C.d(q),M&&M.d(q),E&&E.d(),n[13](null),m&&H(m),F&&F.d(),q&&k(b),q&&k(y),N&&N.d(q)}}}function p$(n){let e,t,i,s;const l=[c$,u$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),s=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(ae(),L(o[u],1,1,()=>{o[u]=null}),fe(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}let Od;function m$(n,e,t){let i,{$$slots:s={},$$scope:l}=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,_=Od,h=!1;b();async function b(){_||h||(t(8,h=!0),t(7,_=(await at(()=>import("./FilterAutocompleteInput-0a758632.js"),["./FilterAutocompleteInput-0a758632.js","./index-eb24c20e.js"],import.meta.url)).default),Od=_,t(8,h=!1))}async function y(){t(0,r=m||""),await fn(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T($){te[$?"unshift":"push"](()=>{d=$,t(6,d)})}function C($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,f=$.formKey),"required"in $&&t(4,u=$.required),"placeholder"in $&&t(5,c=$.placeholder),"$$scope"in $&&t(15,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,_,h,i,y,S,s,T,C,l]}class Ss extends ve{constructor(e){super(),be(this,e,m$,p$,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Dd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ad(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E,D,I=n[2],P=[];for(let F=0;F@request filter:",c=O(),d=v("div"),d.innerHTML=`@request.headers.* + @request.query.* + @request.data.* + @request.auth.*`,m=O(),_=v("hr"),h=O(),b=v("p"),b.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=O(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=O(),C=v("hr"),$=O(),M=v("p"),M.innerHTML=`Example rule: +
    + @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"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(_,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,R){w(F,e,R),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let N=0;N{D&&(E||(E=qe(e,st,{duration:150},!0)),E.run(1))}),D=!0)},o(F){F&&(E||(E=qe(e,st,{duration:150},!1)),E.run(0)),D=!1},d(F){F&&k(e),ht(P,F),F&&E&&E.end()}}}function Id(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function Ld(n){let e,t,i,s,l,o,r,a,f;function u(b){n[6](b)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[h$,({isAdminOnly:b})=>({10:b}),({isAdminOnly:b})=>b?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ss({props:c}),te.push(()=>ce(e,"rule",u));function d(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Ss({props:m}),te.push(()=>ce(s,"rule",d));function _(b){n[8](b)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new Ss({props:h}),te.push(()=>ce(r,"rule",_)),{c(){B(e.$$.fragment),i=O(),B(s.$$.fragment),o=O(),B(r.$$.fragment)},m(b,y){z(e,b,y),w(b,i,y),z(s,b,y),w(b,o,y),z(r,b,y),f=!0},p(b,y){const S={};y&1&&(S.collection=b[0]),y&17408&&(S.$$scope={dirty:y,ctx:b}),!t&&y&1&&(t=!0,S.rule=b[0].createRule,he(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=b[0]),!l&&y&1&&(l=!0,T.rule=b[0].updateRule,he(()=>l=!1)),s.$set(T);const C={};y&1&&(C.collection=b[0]),!a&&y&1&&(a=!0,C.rule=b[0].deleteRule,he(()=>a=!1)),r.$set(C)},i(b){f||(A(e.$$.fragment,b),A(s.$$.fragment,b),A(r.$$.fragment,b),f=!0)},o(b){L(e.$$.fragment,b),L(s.$$.fragment,b),L(r.$$.fragment,b),f=!1},d(b){H(e,b),b&&k(i),H(s,b),b&&k(o),H(r,b)}}}function Pd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Te(Ve.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(s){s&&k(e),t=!1,i()}}}function h$(n){let e,t=!n[10]&&Pd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Pd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&k(e)}}}function Fd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[_$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ss({props:l}),te.push(()=>ce(e,"rule",s)),{c(){B(e.$$.fragment)},m(o,r){z(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,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _$(n){let e,t,i;return{c(){e=v("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=v("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&k(e),s&&k(t),s&&k(i)}}}function g$(n){var R,N;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,_,h,b,y,S,T,C,$=n[1]&&Ad(n);function M(q){n[4](q)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),u=new Ss({props:E}),te.push(()=>ce(u,"rule",M));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),m=new Ss({props:I}),te.push(()=>ce(m,"rule",D));let P=((R=n[0])==null?void 0:R.type)!=="view"&&Ld(n),F=((N=n[0])==null?void 0:N.type)==="auth"&&Fd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the +
    PocketBase filter syntax and operators + .`,s=O(),l=v("button"),r=U(o),a=O(),$&&$.c(),f=O(),B(u.$$.fragment),d=O(),B(m.$$.fragment),h=O(),P&&P.c(),b=O(),F&&F.c(),y=ye(),p(l,"type","button"),p(l,"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,j){w(q,e,j),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),$&&$.m(e,null),w(q,f,j),z(u,q,j),w(q,d,j),z(m,q,j),w(q,h,j),P&&P.m(q,j),w(q,b,j),F&&F.m(q,j),w(q,y,j),S=!0,T||(C=Y(l,"click",n[3]),T=!0)},p(q,[j]){var K,J;(!S||j&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?$?($.p(q,j),j&2&&A($,1)):($=Ad(q),$.c(),A($,1),$.m(e,null)):$&&(ae(),L($,1,1,()=>{$=null}),fe());const Z={};j&1&&(Z.collection=q[0]),!c&&j&1&&(c=!0,Z.rule=q[0].listRule,he(()=>c=!1)),u.$set(Z);const X={};j&1&&(X.collection=q[0]),!_&&j&1&&(_=!0,X.rule=q[0].viewRule,he(()=>_=!1)),m.$set(X),((K=q[0])==null?void 0:K.type)!=="view"?P?(P.p(q,j),j&1&&A(P,1)):(P=Ld(q),P.c(),A(P,1),P.m(b.parentNode,b)):P&&(ae(),L(P,1,1,()=>{P=null}),fe()),((J=q[0])==null?void 0:J.type)==="auth"?F?(F.p(q,j),j&1&&A(F,1)):(F=Fd(q),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(ae(),L(F,1,1,()=>{F=null}),fe())},i(q){S||(A($),A(u.$$.fragment,q),A(m.$$.fragment,q),A(P),A(F),S=!0)},o(q){L($),L(u.$$.fragment,q),L(m.$$.fragment,q),L(P),L(F),S=!1},d(q){q&&k(e),$&&$.d(),q&&k(f),H(u,q),q&&k(d),H(m,q),q&&k(h),P&&P.d(q),q&&k(b),F&&F.d(q),q&&k(y),T=!1,C()}}}function b$(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function f(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function u(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=V.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,f,u,c,d]}class v$ extends ve{constructor(e){super(),be(this,e,b$,g$,me,{collection:0})}}function Nd(n,e,t){const i=n.slice();return i[9]=e[t],i}function y$(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),s=!0},p(a,f){const u={};if(f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,he(()=>t=!1)),f&2&&o!==(o=a[1])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(u)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function k$(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Rd(n){let e,t,i=n[3],s=[];for(let l=0;l
  • 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(),h&&h.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(b,y){w(b,e,y),g(e,t),w(b,s,y),m[l].m(b,y),w(b,r,y),w(b,a,y),w(b,f,y),h&&h.m(b,y),w(b,u,y),c=!0},p(b,y){(!c||y&256&&i!==(i=b[8]))&&p(e,"for",i);let S=l;l=_(b),l===S?m[l].p(b,y):(ae(),L(m[S],1,1,()=>{m[S]=null}),fe(),o=m[l],o?o.p(b,y):(o=m[l]=d[l](b),o.c()),A(o,1),o.m(r.parentNode,r)),b[3].length?h?h.p(b,y):(h=Rd(b),h.c(),h.m(u.parentNode,u)):h&&(h.d(1),h=null)},i(b){c||(A(o),c=!0)},o(b){L(o),c=!1},d(b){b&&k(e),b&&k(s),m[l].d(b),b&&k(r),b&&k(a),b&&k(f),h&&h.d(b),b&&k(u)}}}function S$(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[w$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function C$(n,e,t){let i;Ke(n,wi,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var _;t(3,r=[]);const d=V.getNestedVal(c,"schema",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let b in d[h]){const y=d[h][b].message,S=m[h]||h;r.push(V.sentenize(S+": "+y))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await at(()=>import("./CodeEditor-04174b89.js"),["./CodeEditor-04174b89.js","./index-eb24c20e.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const u=()=>{r.length&&ai("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,f,u]}class T$ extends ve{constructor(e){super(),be(this,e,C$,S$,me,{collection:0})}}const $$=n=>({active:n&1}),jd=n=>({active:n[0]});function Vd(n){let e,t,i;const s=n[15].default,l=wt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ct(l,s,o,o[14],i?St(s,o[14],r,null):Tt(o[14]),null)},i(o){i||(A(l,o),o&&Ge(()=>{i&&(t||(t=qe(e,st,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,st,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function M$(n){let e,t,i,s,l,o,r;const a=n[15].header,f=wt(a,n,n[14],jd);let u=n[0]&&Vd(n);return{c(){e=v("div"),t=v("button"),f&&f.c(),i=O(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),g(e,t),f&&f.m(t,null),g(e,i),u&&u.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",Qe(n[17])),Y(t,"drop",Qe(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Qe(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!l||d&16385)&&Ct(f,a,c,c[14],l?St(a,c[14],d,$$):Tt(c[14]),jd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&A(u,1)):(u=Vd(c),u.c(),A(u,1),u.m(e,null)):u&&(ae(),L(u,1,1,()=>{u=null}),fe()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(f,c),A(u),l=!0)},o(c){L(f,c),L(u),l=!1},d(c){c&&k(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,Ee(r)}}}function E$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=$t();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 _(){return!!u}function h(){S(),t(0,u=!0),l("expand")}function b(){t(0,u=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),u?b():h()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of P)F.click()}}Xt(()=>()=>clearTimeout(r));function T(P){Fe.call(this,n,P)}const C=()=>c&&y(),$=P=>{f&&(t(7,m=!1),S(),l("drop",P))},M=P=>f&&l("dragstart",P),E=P=>{f&&(t(7,m=!0),l("dragenter",P))},D=P=>{f&&(t(7,m=!1),l("dragleave",P))};function I(P){te[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,f=P.draggable),"active"in P&&t(0,u=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,s=P.$$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,l,d,_,h,b,r,s,i,T,C,$,M,E,D,I]}class ro extends ve{constructor(e){super(),be(this,e,E$,M$,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 O$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(f,u){u&4096&&t!==(t=f[12])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&4096&&o!==(o=f[12])&&p(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function D$(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[O$,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function A$(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function I$(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Ve.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function L$(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?I$:A$}let a=r(n),f=a(n),u=n[3]&&zd();return{c(){e=v("div"),e.innerHTML=` + Username/Password`,t=O(),i=v("div"),s=O(),f.c(),l=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,s,d),f.m(c,d),w(c,l,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(l.parentNode,l))),c[3]?u?d&8&&A(u,1):(u=zd(),u.c(),A(u,1),u.m(o.parentNode,o)):u&&(ae(),L(u,1,1,()=>{u=null}),fe())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),f.d(c),c&&k(l),u&&u.d(c),c&&k(o)}}}function P$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(f,u){u&4096&&t!==(t=f[12])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&4096&&o!==(o=f[12])&&p(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function Hd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(V.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[F$,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(V.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[N$,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(V.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&12289&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(V.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&12289&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(A(i.$$.fragment,f),A(o.$$.fragment,f),f&&Ge(()=>{a&&(r||(r=qe(e,st,{duration:150},!0)),r.run(1))}),a=!0)},o(f){L(i.$$.fragment,f),L(o.$$.fragment,f),f&&(r||(r=qe(e,st,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&k(e),H(i),H(o),f&&r&&r.end()}}}function F$(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;function _(b){n[7](b)}let h={id:n[12],disabled:!V.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Fs({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=O(),s=v("i"),o=O(),B(r.$$.fragment),f=O(),u=v("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(u,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),z(r,b,y),w(b,f,y),w(b,u,y),c=!0,d||(m=Te(Ve.call(null,s,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=b[12]),y&1&&(S.disabled=!V.isEmpty(b[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.exceptEmailDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),H(r,b),b&&k(f),b&&k(u),d=!1,m()}}}function N$(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;function _(b){n[8](b)}let h={id:n[12],disabled:!V.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Fs({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=O(),s=v("i"),o=O(),B(r.$$.fragment),f=O(),u=v("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(u,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),z(r,b,y),w(b,f,y),w(b,u,y),c=!0,d||(m=Te(Ve.call(null,s,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=b[12]),y&1&&(S.disabled=!V.isEmpty(b[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.onlyEmailDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),H(r,b),b&&k(f),b&&k(u),d=!1,m()}}}function R$(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[P$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Hd(n);return{c(){B(e.$$.fragment),t=O(),l&&l.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Hd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function q$(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function j$(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Ve.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function V$(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?j$:q$}let a=r(n),f=a(n),u=n[2]&&Bd();return{c(){e=v("div"),e.innerHTML=` + Email/Password`,t=O(),i=v("div"),s=O(),f.c(),l=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,s,d),f.m(c,d),w(c,l,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(l.parentNode,l))),c[2]?u?d&4&&A(u,1):(u=Bd(),u.c(),A(u,1),u.m(o.parentNode,o)):u&&(ae(),L(u,1,1,()=>{u=null}),fe())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),f.d(c),c&&k(l),u&&u.d(c),c&&k(o)}}}function z$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(f,u){u&4096&&t!==(t=f[12])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&4096&&o!==(o=f[12])&&p(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function Ud(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,st,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,st,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function H$(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[z$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Ud();return{c(){B(e.$$.fragment),t=O(),l&&l.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Ud(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function B$(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function U$(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Ve.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function W$(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?U$:B$}let a=r(n),f=a(n),u=n[1]&&Wd();return{c(){e=v("div"),e.innerHTML=` + OAuth2`,t=O(),i=v("div"),s=O(),f.c(),l=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,s,d),f.m(c,d),w(c,l,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(l.parentNode,l))),c[1]?u?d&2&&A(u,1):(u=Wd(),u.c(),A(u,1),u.m(o.parentNode,o)):u&&(ae(),L(u,1,1,()=>{u=null}),fe())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),f.d(c),c&&k(l),u&&u.d(c),c&&k(o)}}}function Y$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=O(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(f,u){u&4096&&i!==(i=f[12])&&p(e,"for",i),u&4096&&o!==(o=f[12])&&p(l,"id",o),u&1&&pt(l.value)!==f[0].options.minPasswordLength&&re(l,f[0].options.minPasswordLength)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function K$(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Always require email",o=O(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),f||(u=[Y(e,"change",n[11]),Te(Ve.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&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,Ee(u)}}}function J$(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y;return s=new ro({props:{single:!0,$$slots:{header:[L$],default:[D$]},$$scope:{ctx:n}}}),o=new ro({props:{single:!0,$$slots:{header:[V$],default:[R$]},$$scope:{ctx:n}}}),a=new ro({props:{single:!0,$$slots:{header:[W$],default:[H$]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[Y$,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),b=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[K$,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=O(),i=v("div"),B(s.$$.fragment),l=O(),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),u=v("hr"),c=O(),d=v("h4"),d.textContent="General",m=O(),B(_.$$.fragment),h=O(),B(b.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,T){w(S,e,T),w(S,t,T),w(S,i,T),z(s,i,null),g(i,l),z(o,i,null),g(i,r),z(a,i,null),w(S,f,T),w(S,u,T),w(S,c,T),w(S,d,T),w(S,m,T),z(_,S,T),w(S,h,T),z(b,S,T),y=!0},p(S,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:S}),s.$set(C);const $={};T&8197&&($.$$scope={dirty:T,ctx:S}),o.$set($);const M={};T&8195&&(M.$$scope={dirty:T,ctx:S}),a.$set(M);const E={};T&12289&&(E.$$scope={dirty:T,ctx:S}),_.$set(E);const D={};T&12289&&(D.$$scope={dirty:T,ctx:S}),b.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(_.$$.fragment,S),A(b.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(_.$$.fragment,S),L(b.$$.fragment,S),y=!1},d(S){S&&k(e),S&&k(t),S&&k(i),H(s),H(o),H(a),S&&k(f),S&&k(u),S&&k(c),S&&k(d),S&&k(m),H(_,S),S&&k(h),H(b,S)}}}function Z$(n,e,t){let i,s,l,o;Ke(n,wi,h=>t(4,o=h));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(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,b,y,S;n.$$.dirty&1&&r.type==="auth"&&V.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!V.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!V.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!V.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!V.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,f,u,c,d,m,_]}class G$ extends ve{constructor(e){super(),be(this,e,Z$,J$,me,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Kd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Zd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Gd(n){let e,t,i,s,l=n[3]&&Xd(n),o=!n[4]&&Qd(n);return{c(){e=v("h6"),e.textContent="Changes:",t=O(),i=v("ul"),l&&l.c(),s=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),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=Xd(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=Qd(r),o.c(),o.m(i,null))},d(r){r&&k(e),r&&k(t),r&&k(i),l&&l.d(),o&&o.d()}}}function Xd(n){var m,_;let e,t,i,s,l=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((_=n[2])==null?void 0:_.name)+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection + `),s=v("strong"),o=U(l),r=O(),a=v("i"),f=O(),u=v("strong"),d=U(c),p(s,"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(h,b){w(h,e,b),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,f),g(t,u),g(u,d)},p(h,b){var y,S;b&2&&l!==(l=((y=h[1])==null?void 0:y.name)+"")&&se(o,l),b&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&k(e)}}}function Qd(n){let e,t,i,s=n[6],l=[];for(let u=0;u
    ',i=O(),s=v("div"),l=v("p"),l.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(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),f&&f.m(s,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=Zd(),f.c(),f.m(s,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=Gd(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&k(e),f&&f.d(),c&&k(r),u&&u.d(c),c&&k(a)}}}function Q$(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function x$(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Cancel',t=O(),i=v("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(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ee(l)}}}function eM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[x$],header:[Q$],default:[X$]},$$scope:{ctx:n}};return e=new sn({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),H(e,s)}}}function tM(n,e,t){let i,s,l,o,r,a;const f=$t();let u,c,d;async function m($,M){t(1,c=$),t(2,d=M),await fn(),i||l.length||o.length||r.length?u==null||u.show():h()}function _(){u==null||u.hide()}function h(){_(),f("confirm")}const b=()=>_(),y=()=>h();function S($){te[$?"unshift":"push"](()=>{u=$,t(5,u)})}function T($){Fe.call(this,n,$)}function C($){Fe.call(this,n,$)}return n.$$.update=()=>{var $,M,E;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((E=d==null?void 0:d.schema)==null?void 0:E.filter(D=>{var P,F,R;const I=(P=c==null?void 0:c.schema)==null?void 0:P.find(N=>N.id==D.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((R=D.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[_,c,d,i,s,u,r,o,l,a,h,m,b,y,S,T,C]}class nM extends ve{constructor(e){super(),be(this,e,tM,eM,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function np(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function iM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new o$({props:l}),te.push(()=>ce(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function sM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new T$({props:l}),te.push(()=>ce(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ip(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new v$({props:o}),te.push(()=>ce(t,"collection",l)),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),s=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],he(()=>i=!1)),t.$set(f)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function sp(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new G$({props:o}),te.push(()=>ce(t,"collection",l)),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Ds)},m(r,a){w(r,e,a),z(t,e,null),s=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],he(()=>i=!1)),t.$set(f),(!s||a[0]&8)&&Q(e,"active",r[3]===Ds)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function lM(n){let e,t,i,s,l,o,r;const a=[sM,iM],f=[];function u(m,_){return m[14]?0:1}i=u(n),s=f[i]=a[i](n);let c=n[3]===_l&&ip(n),d=n[15]&&sp(n);return{c(){e=v("div"),t=v("div"),s.c(),l=O(),c&&c.c(),o=O(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===Ii),p(e,"class","tabs-content svelte-12y0yzb")},m(m,_){w(m,e,_),g(e,t),f[i].m(t,null),g(e,l),c&&c.m(e,null),g(e,o),d&&d.m(e,null),r=!0},p(m,_){let h=i;i=u(m),i===h?f[i].p(m,_):(ae(),L(f[h],1,1,()=>{f[h]=null}),fe(),s=f[i],s?s.p(m,_):(s=f[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||_[0]&8)&&Q(t,"active",m[3]===Ii),m[3]===_l?c?(c.p(m,_),_[0]&8&&A(c,1)):(c=ip(m),c.c(),A(c,1),c.m(e,o)):c&&(ae(),L(c,1,1,()=>{c=null}),fe()),m[15]?d?(d.p(m,_),_[0]&32768&&A(d,1)):(d=sp(m),d.c(),A(d,1),d.m(e,null)):d&&(ae(),L(d,1,1,()=>{d=null}),fe())},i(m){r||(A(s),A(c),A(d),r=!0)},o(m){L(s),L(c),L(d),r=!1},d(m){m&&k(e),f[i].d(),c&&c.d(),d&&d.d()}}}function lp(n){let e,t,i,s,l,o,r;return o=new Wn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[oM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=O(),i=v("button"),s=v("i"),l=O(),B(o.$$.fragment),p(e,"class","flex-fill"),p(s,"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),g(i,s),g(i,l),z(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||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),H(o)}}}function oM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=` + Duplicate`,t=O(),i=v("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),s||(l=[Y(e,"click",n[26]),Y(i,"click",On(Qe(n[27])))],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ee(l)}}}function op(n){let e,t,i,s;return i=new Wn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[rM]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=O(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),z(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(e),l&&k(t),H(i,l)}}}function rp(n){let e,t,i,s,l,o=n[50]+"",r,a,f,u,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=O(),l=v("span"),r=U(o),a=U(" collection"),f=O(),p(t,"class",i=ns(V.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(m,_){w(m,e,_),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,f),u||(c=Y(e,"click",d),u=!0)},p(m,_){n=m,_[0]&64&&i!==(i=ns(V.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),_[0]&64&&o!==(o=n[50]+"")&&se(r,o),_[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(m){m&&k(e),u=!1,c()}}}function rM(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{F=null}),fe()):F?(F.p(N,q),q[0]&4&&A(F,1)):(F=op(N),F.c(),A(F,1),F.m(d,null)),(!D||q[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(N[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",C),(!D||q[0]&4&&$!==($=!!N[2].id))&&(d.disabled=$),N[2].system?R||(R=ap(),R.c(),R.m(E.parentNode,E)):R&&(R.d(1),R=null)},i(N){D||(A(F),D=!0)},o(N){L(F),D=!1},d(N){N&&k(e),N&&k(s),N&&k(l),N&&k(u),N&&k(c),F&&F.d(),N&&k(M),R&&R.d(N),N&&k(E),I=!1,P()}}}function fp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Te(t=Ve.call(null,e,n[11])),l=!0)},p(r,a){t&&jt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{s&&(i||(i=qe(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Jt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function up(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Ve.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function cp(n){var a,f,u;let e,t,i,s=!V.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),l,o,r=s&&dp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Ds)},m(c,d){w(c,e,d),g(e,t),g(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[33]),l=!0)},p(c,d){var m,_,h;d[0]&32&&(s=!V.isEmpty((m=c[5])==null?void 0:m.options)&&!((h=(_=c[5])==null?void 0:_.options)!=null&&h.manageRule)),s?r?d[0]&32&&A(r,1):(r=dp(),r.c(),A(r,1),r.m(e,null)):r&&(ae(),L(r,1,1,()=>{r=null}),fe()),d[0]&8&&Q(e,"active",c[3]===Ds)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function dp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Ve.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function fM(n){var j,Z,X,K,J,le,ie;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,f,u,c,d,m,_=n[14]?"Query":"Fields",h,b,y=!V.isEmpty(n[11]),S,T,C,$,M=!V.isEmpty((j=n[5])==null?void 0:j.listRule)||!V.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!V.isEmpty((X=n[5])==null?void 0:X.createRule)||!V.isEmpty((K=n[5])==null?void 0:K.updateRule)||!V.isEmpty((J=n[5])==null?void 0:J.deleteRule)||!V.isEmpty((ie=(le=n[5])==null?void 0:le.options)==null?void 0:ie.manageRule),E,D,I,P,F=!!n[2].id&&!n[2].system&&lp(n);r=new de({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[aM,({uniqueId:ee})=>({48:ee}),({uniqueId:ee})=>[0,ee?131072:0]]},$$scope:{ctx:n}}});let R=y&&fp(n),N=M&&up(),q=n[15]&&cp(n);return{c(){e=v("h4"),i=U(t),s=O(),F&&F.c(),l=O(),o=v("form"),B(r.$$.fragment),a=O(),f=v("input"),u=O(),c=v("div"),d=v("button"),m=v("span"),h=U(_),b=O(),R&&R.c(),S=O(),T=v("button"),C=v("span"),C.textContent="API Rules",$=O(),N&&N.c(),E=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"),Q(d,"active",n[3]===Ii),p(C,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),Q(T,"active",n[3]===_l),p(c,"class","tabs-header stretched")},m(ee,$e){w(ee,e,$e),g(e,i),w(ee,s,$e),F&&F.m(ee,$e),w(ee,l,$e),w(ee,o,$e),z(r,o,null),g(o,a),g(o,f),w(ee,u,$e),w(ee,c,$e),g(c,d),g(d,m),g(m,h),g(d,b),R&&R.m(d,null),g(c,S),g(c,T),g(T,C),g(T,$),N&&N.m(T,null),g(c,E),q&&q.m(c,null),D=!0,I||(P=[Y(o,"submit",Qe(n[30])),Y(d,"click",n[31]),Y(T,"click",n[32])],I=!0)},p(ee,$e){var je,ze,ke,Ce,Je,_t,Ze;(!D||$e[0]&4)&&t!==(t=ee[2].id?"Edit collection":"New collection")&&se(i,t),ee[2].id&&!ee[2].system?F?(F.p(ee,$e),$e[0]&4&&A(F,1)):(F=lp(ee),F.c(),A(F,1),F.m(l.parentNode,l)):F&&(ae(),L(F,1,1,()=>{F=null}),fe());const Pe={};$e[0]&8192&&(Pe.class="form-field collection-field-name required m-b-0 "+(ee[13]?"disabled":"")),$e[0]&41028|$e[1]&4325376&&(Pe.$$scope={dirty:$e,ctx:ee}),r.$set(Pe),(!D||$e[0]&16384)&&_!==(_=ee[14]?"Query":"Fields")&&se(h,_),$e[0]&2048&&(y=!V.isEmpty(ee[11])),y?R?(R.p(ee,$e),$e[0]&2048&&A(R,1)):(R=fp(ee),R.c(),A(R,1),R.m(d,null)):R&&(ae(),L(R,1,1,()=>{R=null}),fe()),(!D||$e[0]&8)&&Q(d,"active",ee[3]===Ii),$e[0]&32&&(M=!V.isEmpty((je=ee[5])==null?void 0:je.listRule)||!V.isEmpty((ze=ee[5])==null?void 0:ze.viewRule)||!V.isEmpty((ke=ee[5])==null?void 0:ke.createRule)||!V.isEmpty((Ce=ee[5])==null?void 0:Ce.updateRule)||!V.isEmpty((Je=ee[5])==null?void 0:Je.deleteRule)||!V.isEmpty((Ze=(_t=ee[5])==null?void 0:_t.options)==null?void 0:Ze.manageRule)),M?N?$e[0]&32&&A(N,1):(N=up(),N.c(),A(N,1),N.m(T,null)):N&&(ae(),L(N,1,1,()=>{N=null}),fe()),(!D||$e[0]&8)&&Q(T,"active",ee[3]===_l),ee[15]?q?q.p(ee,$e):(q=cp(ee),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(ee){D||(A(F),A(r.$$.fragment,ee),A(R),A(N),D=!0)},o(ee){L(F),L(r.$$.fragment,ee),L(R),L(N),D=!1},d(ee){ee&&k(e),ee&&k(s),F&&F.d(ee),ee&&k(l),ee&&k(o),H(r),ee&&k(u),ee&&k(c),R&&R.d(),N&&N.d(),q&&q.d(),I=!1,Ee(P)}}}function uM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(l,r),f||(u=[Y(e,"click",n[24]),Y(s,"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")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,Ee(u)}}}function cM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[uM],header:[fM],default:[lM]},$$scope:{ctx:n}};e=new sn({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new nM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),s=!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){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[39](null),H(e,r),r&&k(t),n[42](null),H(i,r)}}}const Ii="schema",_l="api_rules",Ds="options",dM="base",pp="auth",mp="view";function Ar(n){return JSON.stringify(n)}function pM(n,e,t){let i,s,l,o,r,a;Ke(n,wi,_e=>t(5,a=_e));const f={};f[dM]="Base",f[mp]="View",f[pp]="Auth";const u=$t();let c,d,m=null,_=V.initCollection(),h=!1,b=!1,y=Ii,S=Ar(_),T="";function C(_e){t(3,y=_e)}function $(_e){return E(_e),t(10,b=!0),C(Ii),c==null?void 0:c.show()}function M(){return c==null?void 0:c.hide()}async function E(_e){en({}),typeof _e<"u"?(t(22,m=_e),t(2,_=structuredClone(_e))):(t(22,m=null),t(2,_=V.initCollection())),t(2,_.schema=_.schema||[],_),t(2,_.originalName=_.name||"",_),await fn(),t(23,S=Ar(_))}function D(){_.id?d==null||d.show(m,_):I()}function I(){if(h)return;t(9,h=!0);const _e=P();let Ye;_.id?Ye=ue.collections.update(_.id,_e):Ye=ue.collections.create(_e),Ye.then(Mt=>{Ma(),Sy(Mt),t(10,b=!1),M(),Ht(_.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!_.id,collection:Mt})}).catch(Mt=>{ue.error(Mt)}).finally(()=>{t(9,h=!1)})}function P(){const _e=Object.assign({},_);_e.schema=_e.schema.slice(0);for(let Ye=_e.schema.length-1;Ye>=0;Ye--)_e.schema[Ye].toDelete&&_e.schema.splice(Ye,1);return _e}function F(){m!=null&&m.id&&pn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ue.collections.delete(m.id).then(()=>{M(),Ht(`Successfully deleted collection "${m.name}".`),u("delete",m),Cy(m)}).catch(_e=>{ue.error(_e)}))}function R(_e){t(2,_.type=_e,_),ai("schema")}function N(){o?pn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const _e=m?structuredClone(m):null;if(_e){if(_e.id="",_e.created="",_e.updated="",_e.name+="_duplicate",!V.isEmpty(_e.schema))for(const Ye of _e.schema)Ye.id="";if(!V.isEmpty(_e.indexes))for(let Ye=0;Ye<_e.indexes.length;Ye++){const Mt=V.parseIndex(_e.indexes[Ye]);Mt.indexName="idx_"+V.randomString(7),Mt.tableName=_e.name,_e.indexes[Ye]=V.buildIndex(Mt)}}$(_e),await fn(),t(23,S="")}const j=()=>M(),Z=()=>D(),X=()=>N(),K=()=>F(),J=_e=>{t(2,_.name=V.slugify(_e.target.value),_),_e.target.value=_.name},le=_e=>R(_e),ie=()=>{r&&D()},ee=()=>C(Ii),$e=()=>C(_l),Pe=()=>C(Ds);function je(_e){_=_e,t(2,_),t(22,m)}function ze(_e){_=_e,t(2,_),t(22,m)}function ke(_e){_=_e,t(2,_),t(22,m)}function Ce(_e){_=_e,t(2,_),t(22,m)}const Je=()=>o&&b?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,b=!1),M()}),!1):!0;function _t(_e){te[_e?"unshift":"push"](()=>{c=_e,t(7,c)})}function Ze(_e){Fe.call(this,n,_e)}function We(_e){Fe.call(this,n,_e)}function yt(_e){te[_e?"unshift":"push"](()=>{d=_e,t(8,d)})}const pe=()=>I();return n.$$.update=()=>{var _e,Ye;n.$$.dirty[0]&4&&_.type==="view"&&(t(2,_.createRule=null,_),t(2,_.updateRule=null,_),t(2,_.deleteRule=null,_),t(2,_.indexes=[],_)),n.$$.dirty[0]&4194308&&_.name&&(m==null?void 0:m.name)!=_.name&&_.indexes.length>0&&t(2,_.indexes=(_e=_.indexes)==null?void 0:_e.map(Mt=>V.replaceIndexTableName(Mt,_.name)),_),n.$$.dirty[0]&4&&t(15,i=_.type===pp),n.$$.dirty[0]&4&&t(14,s=_.type===mp),n.$$.dirty[0]&32&&(a.schema||(Ye=a.options)!=null&&Ye.query?t(11,T=V.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,l=!!_.id&&_.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Ar(_)),n.$$.dirty[0]&20&&t(12,r=!_.id||o),n.$$.dirty[0]&12&&y===Ds&&_.type!=="auth"&&C(Ii)},[C,M,_,y,o,a,f,c,d,h,b,T,r,l,s,i,D,I,F,R,N,$,m,S,j,Z,X,K,J,le,ie,ee,$e,Pe,je,ze,ke,Ce,Je,_t,Ze,We,yt,pe]}class sf extends ve{constructor(e){super(),be(this,e,pM,cM,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 hp(n,e,t){const i=n.slice();return i[15]=e[t],i}function _p(n){let e,t=n[1].length&&gp();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=gp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function gp(n){let e;return{c(){e=v("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&&k(e)}}}function bp(n,e){let t,i,s,l,o,r=e[15].name+"",a,f,u,c,d,m;return{key:n,first:null,c(){var _;t=v("a"),i=v("i"),l=O(),o=v("span"),a=U(r),f=O(),p(i,"class",s=V.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",u="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),p(t,"title",c=e[15].name),Q(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id),this.first=t},m(_,h){w(_,t,h),g(t,i),g(t,l),g(t,o),g(o,a),g(t,f),d||(m=Te(ln.call(null,t)),d=!0)},p(_,h){var b;e=_,h&8&&s!==(s=V.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),h&8&&r!==(r=e[15].name+"")&&se(a,r),h&8&&u!==(u="/collections?collectionId="+e[15].id)&&p(t,"href",u),h&8&&c!==(c=e[15].name)&&p(t,"title",c),h&40&&Q(t,"active",((b=e[5])==null?void 0:b.id)===e[15].id)},d(_){_&&k(t),d=!1,m()}}}function vp(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=` + New collection`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function mM(n){let e,t,i,s,l,o,r,a,f,u,c,d=[],m=new Map,_,h,b,y,S,T,C=n[3];const $=I=>I[15].id;for(let I=0;I',o=O(),r=v("input"),a=O(),f=v("hr"),u=O(),c=v("div");for(let I=0;I20),p(e,"class","page-sidebar collection-sidebar")},m(I,P){w(I,e,P),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),re(r,n[0]),g(e,a),g(e,f),g(e,u),g(e,c);for(let F=0;F20),I[7]?E&&(E.d(1),E=null):E?E.p(I,P):(E=vp(I),E.c(),E.m(e,null));const F={};b.$set(F)},i(I){y||(A(b.$$.fragment,I),y=!0)},o(I){L(b.$$.fragment,I),y=!1},d(I){I&&k(e);for(let P=0;P{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function _M(n,e,t){let i,s,l,o,r,a,f;Ke(n,yi,S=>t(5,o=S)),Ke(n,ui,S=>t(9,r=S)),Ke(n,go,S=>t(6,a=S)),Ke(n,$s,S=>t(7,f=S));let u,c="";function d(S){nn(yi,o=S,o)}const m=()=>t(0,c="");function _(){c=this.value,t(0,c)}const h=()=>u==null?void 0:u.show();function b(S){te[S?"unshift":"push"](()=>{u=S,t(2,u)})}const y=S=>{var T;(T=S.detail)!=null&&T.isNew&&S.detail.collection&&d(S.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&hM(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(S=>S.id==c||S.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,u,l,s,o,a,f,d,r,m,_,h,b,y]}class gM extends ve{constructor(e){super(),be(this,e,_M,mM,me,{})}}function yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function kp(n){n[18]=n[19].default}function wp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Sp(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Cp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,f,u,c=i&&Sp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=O(),l=v("button"),r=U(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,_){w(m,t,_),c&&c.m(m,_),w(m,s,_),w(m,l,_),g(l,r),g(l,a),f||(u=Y(l,"click",d),f=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Sp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),_&8&&o!==(o=e[15].label+"")&&se(r,o),_&40&&Q(l,"active",e[5]===e[14])},d(m){m&&k(t),c&&c.d(m),m&&k(s),m&&k(l),f=!1,u()}}}function Tp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:yM,then:vM,catch:bM,value:19,blocks:[,,,]};return uf(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&uf(t,s)||Y1(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];L(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function bM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function vM(n){kp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=O()},m(s,l){z(e,s,l),w(s,t,l),i=!0},p(s,l){kp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){L(e.$$.fragment,s),i=!1},d(s){H(e,s),s&&k(t)}}}function yM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function $p(n,e){let t,i,s,l=e[5]===e[14]&&Tp(e);return{key:n,first:null,c(){t=ye(),l&&l.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Tp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function kM(n){let e,t,i,s=[],l=new Map,o,r,a=[],f=new Map,u,c=Object.entries(n[3]);const d=h=>h[14];for(let h=0;hh[14];for(let h=0;hClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function SM(n){let e,t,i={class:"docs-panel",$$slots:{footer:[wM],default:[kM]},$$scope:{ctx:n}};return e=new sn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function CM(n,e,t){const i={list:{label:"List/Search",component:at(()=>import("./ListApiDocs-ff0e14ff.js"),["./ListApiDocs-ff0e14ff.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:at(()=>import("./ViewApiDocs-a8491c7b.js"),["./ViewApiDocs-a8491c7b.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},create:{label:"Create",component:at(()=>import("./CreateApiDocs-26ff026a.js"),["./CreateApiDocs-26ff026a.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},update:{label:"Update",component:at(()=>import("./UpdateApiDocs-84870d7b.js"),["./UpdateApiDocs-84870d7b.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},delete:{label:"Delete",component:at(()=>import("./DeleteApiDocs-339172a8.js"),["./DeleteApiDocs-339172a8.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:at(()=>import("./RealtimeApiDocs-688ce291.js"),["./RealtimeApiDocs-688ce291.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:at(()=>import("./AuthWithPasswordDocs-583707fb.js"),["./AuthWithPasswordDocs-583707fb.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:at(()=>import("./AuthWithOAuth2Docs-e8983e95.js"),["./AuthWithOAuth2Docs-e8983e95.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},refresh:{label:"Auth refresh",component:at(()=>import("./AuthRefreshDocs-2a227aa4.js"),["./AuthRefreshDocs-2a227aa4.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},"request-verification":{label:"Request verification",component:at(()=>import("./RequestVerificationDocs-dd991b38.js"),["./RequestVerificationDocs-dd991b38.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:at(()=>import("./ConfirmVerificationDocs-4dc49abd.js"),["./ConfirmVerificationDocs-4dc49abd.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:at(()=>import("./RequestPasswordResetDocs-e1a9e426.js"),["./RequestPasswordResetDocs-e1a9e426.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:at(()=>import("./ConfirmPasswordResetDocs-9860c6ec.js"),["./ConfirmPasswordResetDocs-9860c6ec.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:at(()=>import("./RequestEmailChangeDocs-9dfe810b.js"),["./RequestEmailChangeDocs-9dfe810b.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:at(()=>import("./ConfirmEmailChangeDocs-18835cec.js"),["./ConfirmEmailChangeDocs-18835cec.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:at(()=>import("./AuthMethodsDocs-f6471d93.js"),["./AuthMethodsDocs-f6471d93.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:at(()=>import("./ListExternalAuthsDocs-e75a87f6.js"),["./ListExternalAuthsDocs-e75a87f6.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-d00fc8d6.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:at(()=>import("./UnlinkExternalAuthDocs-b79405e3.js"),["./UnlinkExternalAuthDocs-b79405e3.js","./SdkTabs-17fc08c7.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function u(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function _(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function h(y){Fe.call(this,n,y)}function b(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!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,l,r,i,f,d,m,_,h,b]}class TM extends ve{constructor(e){super(),be(this,e,CM,SM,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 $M(n){let e,t,i,s,l,o,r,a,f,u,c,d;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Username",o=O(),r=v("input"),p(t,"class",V.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=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,_){w(m,e,_),g(e,t),g(e,i),g(e,s),w(m,o,_),w(m,r,_),re(r,n[0].username),c||(d=Y(r,"input",n[5]),c=!0)},p(m,_){_&8192&&l!==(l=m[13])&&p(e,"for",l),_&4&&a!==(a=!m[2])&&p(r,"requried",a),_&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),_&8192&&u!==(u=m[13])&&p(r,"id",u),_&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&k(e),m&&k(o),m&&k(r),c=!1,d()}}}function MM(n){let e,t,i,s,l,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,_,h,b,y,S,T;return{c(){var C;e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Email",o=O(),r=v("div"),a=v("button"),f=v("span"),u=U("Public: "),d=U(c),_=O(),h=v("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=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(h,"type","email"),h.autofocus=n[2],p(h,"autocomplete","off"),p(h,"id",b=n[13]),h.required=y=(C=n[1].options)==null?void 0:C.requireEmail,p(h,"class","svelte-1751a4d")},m(C,$){w(C,e,$),g(e,t),g(e,i),g(e,s),w(C,o,$),w(C,r,$),g(r,a),g(a,f),g(f,u),g(f,d),w(C,_,$),w(C,h,$),re(h,n[0].email),n[2]&&h.focus(),S||(T=[Te(Ve.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[6]),Y(h,"input",n[7])],S=!0)},p(C,$){var M;$&8192&&l!==(l=C[13])&&p(e,"for",l),$&1&&c!==(c=C[0].emailVisibility?"On":"Off")&&se(d,c),$&1&&m!==(m="btn btn-sm btn-transparent "+(C[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),$&4&&(h.autofocus=C[2]),$&8192&&b!==(b=C[13])&&p(h,"id",b),$&2&&y!==(y=(M=C[1].options)==null?void 0:M.requireEmail)&&(h.required=y),$&1&&h.value!==C[0].email&&re(h,C[0].email)},d(C){C&&k(e),C&&k(o),C&&k(r),C&&k(_),C&&k(h),S=!1,Ee(T)}}}function Mp(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[EM,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function EM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(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(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function Ep(n){let e,t,i,s,l,o,r,a,f;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[OM,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[DM,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=O(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),g(e,t),g(t,i),z(s,i,null),g(t,l),g(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:u}),s.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&Q(t,"p-t-xs",u[3])},i(u){f||(A(s.$$.fragment,u),A(r.$$.fragment,u),u&&Ge(()=>{f&&(a||(a=qe(e,st,{duration:150},!0)),a.run(1))}),f=!0)},o(u){L(s.$$.fragment,u),L(r.$$.fragment,u),u&&(a||(a=qe(e,st,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&k(e),H(s),H(r),u&&a&&a.end()}}}function OM(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password",o=O(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[0].password),f||(u=Y(r,"input",n[9]),f=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].password&&re(r,c[0].password)},d(c){c&&k(e),c&&k(o),c&&k(r),f=!1,u()}}}function DM(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password confirm",o=O(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=Y(r,"input",n[10]),f=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),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&&k(e),c&&k(o),c&&k(r),f=!1,u()}}}function AM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,s,u),g(s,l),r||(a=[Y(e,"change",n[11]),Y(e,"change",Qe(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(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,Ee(a)}}}function IM(n){var b;let e,t,i,s,l,o,r,a,f,u,c,d,m;i=new de({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[$M,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[MM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let _=!n[2]&&Mp(n),h=(n[2]||n[3])&&Ep(n);return d=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[AM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),r=O(),a=v("div"),_&&_.c(),f=O(),h&&h.c(),u=O(),c=v("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"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),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),g(e,r),g(e,a),_&&_.m(a,null),g(a,f),h&&h.m(a,null),g(e,u),g(e,c),z(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 C={};S&2&&(C.class="form-field "+((M=y[1].options)!=null&&M.requireEmail?"required":"")),S&24583&&(C.$$scope={dirty:S,ctx:y}),o.$set(C),y[2]?_&&(ae(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(y,S),S&4&&A(_,1)):(_=Mp(y),_.c(),A(_,1),_.m(a,f)),y[2]||y[3]?h?(h.p(y,S),S&12&&A(h,1)):(h=Ep(y),h.c(),A(h,1),h.m(a,null)):h&&(ae(),L(h,1,1,()=>{h=null}),fe());const $={};S&24581&&($.$$scope={dirty:S,ctx:y}),d.$set($)},i(y){m||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(_),A(h),A(d.$$.fragment,y),m=!0)},o(y){L(i.$$.fragment,y),L(o.$$.fragment,y),L(_),L(h),L(d.$$.fragment,y),m=!1},d(y){y&&k(e),H(i),H(o),_&&_.d(),h&&h.d(),H(d)}}}function LM(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!!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 _(){i.verified=this.checked,t(0,i),t(3,r)}const h=b=>{l||pn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!b.target.checked,i)})};return n.$$set=b=>{"record"in b&&t(0,i=b.record),"collection"in b&&t(1,s=b.collection),"isNew"in b&&t(2,l=b.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),ai("password"),ai("passwordConfirm")))},[i,s,l,r,o,a,f,u,c,d,m,_,h]}class PM extends ve{constructor(e){super(),be(this,e,LM,IM,me,{record:0,collection:1,isNew:2})}}function FM(n){let e,t,i,s=[n[3]],l={};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 _=r.closest("form");_!=null&&_.requestSubmit&&_.requestSubmit()}}Xt(()=>(f(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(3,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&f()},[l,r,u,s,o,c,d]}class RM extends ve{constructor(e){super(),be(this,e,NM,FM,me,{value:0,maxHeight:4})}}function qM(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d;function m(h){n[2](h)}let _={id:n[3],required:n[1].required};return n[0]!==void 0&&(_.value=n[0]),u=new RM({props:_}),te.push(()=>ce(u,"value",m)),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),B(u.$$.fragment),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(h,b){w(h,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(h,f,b),z(u,h,b),d=!0},p(h,b){(!d||b&2&&i!==(i=V.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||b&8&&a!==(a=h[3]))&&p(e,"for",a);const y={};b&8&&(y.id=h[3]),b&2&&(y.required=h[1].required),!c&&b&1&&(c=!0,y.value=h[0],he(()=>c=!1)),u.$set(y)},i(h){d||(A(u.$$.fragment,h),d=!0)},o(h){L(u.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(f),H(u,h)}}}function jM(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VM(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class zM extends ve{constructor(e){super(),be(this,e,VM,jM,me,{field:1,value:0})}}function HM(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d,m,_,h,b;return{c(){var y,S;e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),u=v("input"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"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",_=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),g(e,t),g(e,s),g(e,l),g(l,r),w(y,f,S),w(y,u,S),re(u,n[0]),h||(b=Y(u,"input",n[2]),h=!0)},p(y,S){var T,C;S&2&&i!==(i=V.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&se(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&&_!==(_=(C=y[1].options)==null?void 0:C.max)&&p(u,"max",_),S&1&&pt(u.value)!==y[0]&&re(u,y[0])},d(y){y&&k(e),y&&k(f),y&&k(u),h=!1,b()}}}function BM(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[HM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UM(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class WM extends ve{constructor(e){super(),be(this,e,UM,BM,me,{field:1,value:0})}}function YM(n){let e,t,i,s,l=n[1].name+"",o,r,a,f;return{c(){e=v("input"),i=O(),s=v("label"),o=U(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,s,c),g(s,o),a||(f=Y(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&&l!==(l=u[1].name+"")&&se(o,l),c&8&&r!==(r=u[3])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),a=!1,f()}}}function KM(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[YM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JM(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class ZM extends ve{constructor(e){super(),be(this,e,JM,KM,me,{field:1,value:0})}}function GM(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d,m,_;return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),u=v("input"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"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(h,b){w(h,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(h,f,b),w(h,u,b),re(u,n[0]),m||(_=Y(u,"input",n[2]),m=!0)},p(h,b){b&2&&i!==(i=V.getFieldTypeIcon(h[1].type))&&p(t,"class",i),b&2&&o!==(o=h[1].name+"")&&se(r,o),b&8&&a!==(a=h[3])&&p(e,"for",a),b&8&&c!==(c=h[3])&&p(u,"id",c),b&2&&d!==(d=h[1].required)&&(u.required=d),b&1&&u.value!==h[0]&&re(u,h[0])},d(h){h&&k(e),h&&k(f),h&&k(u),m=!1,_()}}}function XM(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[GM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function QM(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class xM extends ve{constructor(e){super(),be(this,e,QM,XM,me,{field:1,value:0})}}function e5(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d,m,_;return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),u=v("input"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"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(h,b){w(h,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(h,f,b),w(h,u,b),re(u,n[0]),m||(_=Y(u,"input",n[2]),m=!0)},p(h,b){b&2&&i!==(i=V.getFieldTypeIcon(h[1].type))&&p(t,"class",i),b&2&&o!==(o=h[1].name+"")&&se(r,o),b&8&&a!==(a=h[3])&&p(e,"for",a),b&8&&c!==(c=h[3])&&p(u,"id",c),b&2&&d!==(d=h[1].required)&&(u.required=d),b&1&&u.value!==h[0]&&re(u,h[0])},d(h){h&&k(e),h&&k(f),h&&k(u),m=!1,_()}}}function t5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[e5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function n5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class i5 extends ve{constructor(e){super(),be(this,e,n5,t5,me,{field:1,value:0})}}function Op(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),g(e,t),i||(s=[Te(Ve.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,Ee(s)}}}function s5(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d,m,_,h,b=n[0]&&!n[1].required&&Op(n);function y(C){n[6](C)}function S(C){n[7](C)}let T={id:n[8],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new tf({props:T}),te.push(()=>ce(d,"value",y)),te.push(()=>ce(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),a=U(" (UTC)"),u=O(),b&&b.c(),c=O(),B(d.$$.fragment),p(t,"class",i=ns(V.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",f=n[8])},m(C,$){w(C,e,$),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),w(C,u,$),b&&b.m(C,$),w(C,c,$),z(d,C,$),h=!0},p(C,$){(!h||$&2&&i!==(i=ns(V.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!h||$&2)&&o!==(o=C[1].name+"")&&se(r,o),(!h||$&256&&f!==(f=C[8]))&&p(e,"for",f),C[0]&&!C[1].required?b?b.p(C,$):(b=Op(C),b.c(),b.m(c.parentNode,c)):b&&(b.d(1),b=null);const M={};$&256&&(M.id=C[8]),!m&&$&4&&(m=!0,M.value=C[2],he(()=>m=!1)),!_&&$&1&&(_=!0,M.formattedValue=C[0],he(()=>_=!1)),d.$set(M)},i(C){h||(A(d.$$.fragment,C),h=!0)},o(C){L(d.$$.fragment,C),h=!1},d(C){C&&k(e),C&&k(u),b&&b.d(C),C&&k(c),H(d,C)}}}function l5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[s5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function o5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function f(c){l=c,t(2,l),t(0,s)}function u(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,f,u]}class r5 extends ve{constructor(e){super(),be(this,e,o5,l5,me,{field:1,value:0})}}function Dp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=U("Select up to "),s=U(i),l=U(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(s,i)},d(o){o&&k(e)}}}function a5(n){var S,T,C,$,M,E;let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d,m,_;function h(D){n[3](D)}let b={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:(C=n[1].options)==null?void 0:C.values,searchable:((M=($=n[1].options)==null?void 0:$.values)==null?void 0:M.length)>5};n[0]!==void 0&&(b.selected=n[0]),u=new nf({props:b}),te.push(()=>ce(u,"selected",h));let y=((E=n[1].options)==null?void 0:E.maxSelect)>1&&Dp(n);return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),B(u.$$.fragment),d=O(),y&&y.c(),m=ye(),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,I){w(D,e,I),g(e,t),g(e,s),g(e,l),g(l,r),w(D,f,I),z(u,D,I),w(D,d,I),y&&y.m(D,I),w(D,m,I),_=!0},p(D,I){var F,R,N,q,j,Z;(!_||I&2&&i!==(i=V.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!_||I&2)&&o!==(o=D[1].name+"")&&se(r,o),(!_||I&16&&a!==(a=D[4]))&&p(e,"for",a);const P={};I&16&&(P.id=D[4]),I&6&&(P.toggle=!D[1].required||D[2]),I&4&&(P.multiple=D[2]),I&7&&(P.closable=!D[2]||((F=D[0])==null?void 0:F.length)>=((R=D[1].options)==null?void 0:R.maxSelect)),I&2&&(P.items=(N=D[1].options)==null?void 0:N.values),I&2&&(P.searchable=((j=(q=D[1].options)==null?void 0:q.values)==null?void 0:j.length)>5),!c&&I&1&&(c=!0,P.selected=D[0],he(()=>c=!1)),u.$set(P),((Z=D[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(D,I):(y=Dp(D),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(D){_||(A(u.$$.fragment,D),_=!0)},o(D){L(u.$$.fragment,D),_=!1},d(D){D&&k(e),D&&k(f),H(u,D),D&&k(d),y&&y.d(D),D&&k(m)}}}function f5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[a5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function u5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class c5 extends ve{constructor(e){super(),be(this,e,u5,f5,me,{field:1,value:0})}}function d5(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d,m,_;return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),u=v("textarea"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4]),p(u,"id",c=n[4]),p(u,"class","txt-mono"),u.required=d=n[1].required,u.value=n[2]},m(h,b){w(h,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(h,f,b),w(h,u,b),m||(_=Y(u,"input",n[3]),m=!0)},p(h,b){b&2&&i!==(i=V.getFieldTypeIcon(h[1].type))&&p(t,"class",i),b&2&&o!==(o=h[1].name+"")&&se(r,o),b&16&&a!==(a=h[4])&&p(e,"for",a),b&16&&c!==(c=h[4])&&p(u,"id",c),b&2&&d!==(d=h[1].required)&&(u.required=d),b&4&&(u.value=h[2])},d(h){h&&k(e),h&&k(f),h&&k(u),m=!1,_()}}}function p5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[d5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function m5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=JSON.stringify(typeof s>"u"?null:s,null,2);const o=r=>{t(2,l=r.target.value),t(0,s=r.target.value.trim())};return n.$$set=r=>{"field"in r&&t(1,i=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(l==null?void 0:l.trim())&&(t(2,l=JSON.stringify(typeof s>"u"?null:s,null,2)),t(0,s=l))},[s,i,l,o]}class h5 extends ve{constructor(e){super(),be(this,e,m5,p5,me,{field:1,value:0})}}function _5(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function g5(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),hn(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(s,l){w(s,e,l)},p(s,l){l&4&&!hn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function b5(n){let e;function t(l,o){return l[2]?g5:_5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function v5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){V.hasImageExtension(s==null?void 0:s.name)?V.generateThumb(s,l,l).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,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class y5 extends ve{constructor(e){super(),be(this,e,v5,b5,me,{file:0,size:1})}}function Ap(n){let e;function t(l,o){return l[4]==="image"?w5:k5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function k5(n){let e,t;return{c(){e=v("object"),t=U("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),g(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function w5(n){let e,t,i;return{c(){e=v("img"),hn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!hn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function S5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Ap(n);return{c(){i&&i.c(),t=ye()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Ap(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&k(t)}}}function C5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Qe(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function T5(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("a"),t=U(n[2]),i=O(),s=v("i"),l=O(),o=v("div"),r=O(),a=v("button"),a.textContent="Close",p(s,"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),g(e,t),g(e,i),g(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=Y(a,"click",n[0]),f=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&k(e),c&&k(l),c&&k(o),c&&k(r),c&&k(a),f=!1,u()}}}function $5(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[T5],header:[C5],default:[S5]},$$scope:{ctx:n}};return e=new sn({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function M5(n,e,t){let i,s,l,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){te[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Fe.call(this,n,m)}function d(m){Fe.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=V.getFileType(s))},[f,r,s,o,l,a,i,u,c,d]}class E5 extends ve{constructor(e){super(),be(this,e,M5,$5,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function O5(n){let e,t,i,s,l;function o(f,u){return f[3]==="image"?L5:f[3]==="video"||f[3]==="audio"?I5:A5}let r=o(n),a=r(n);return{c(){e=v("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),s||(l=Y(e,"click",On(n[11])),s=!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&&k(e),a.d(),s=!1,l()}}}function D5(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function A5(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function I5(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function L5(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),hn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[8]),s=!0)},p(o,r){r&32&&!hn(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&&k(e),s=!1,l()}}}function P5(n){let e,t,i;function s(a,f){return a[2]?D5:O5}let l=s(n),o=l(n),r={};return t=new E5({props:r}),n[12](t),{c(){o.c(),e=O(),B(t.$$.fragment)},m(a,f){o.m(a,f),w(a,e,f),z(t,a,f),i=!0},p(a,[f]){l===(l=s(a))&&o?o.p(a,f):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const u={};t.$set(u)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){L(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[12](null),H(t,a)}}}function F5(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!1;m();async function m(){t(2,d=!0);try{t(10,c=await ue.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function _(){t(5,f="")}const h=y=>{s&&(y.preventDefault(),a==null||a.show(u))};function b(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=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=V.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ue.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ue.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,s,_,l,c,h,b]}class lf extends ve{constructor(e){super(),be(this,e,F5,P5,me,{record:9,filename:0,size:1})}}function Ip(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Lp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function N5(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Te(Ve.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ee(i)}}}function R5(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function q5(n){let e,t,i,s,l,o,r=n[34]+"",a,f,u,c,d,m;i=new lf({props:{record:n[3],filename:n[34]}});function _(y,S){return y[35]?R5:N5}let h=_(n),b=h(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),o=v("a"),a=U(r),c=O(),d=v("div"),b.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ue.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(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),g(e,t),z(i,t,null),g(e,s),g(e,l),g(l,o),g(o,a),g(e,c),g(e,d),b.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)&&Q(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&se(a,r),(!m||S[0]&1064&&f!==(f=ue.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===(h=_(y))&&b?b.p(y,S):(b.d(1),b=h(y),b&&(b.c(),b.m(d,null))),(!m||S[1]&2)&&Q(e,"dragging",y[32]),(!m||S[1]&4)&&Q(e,"dragover",y[33])},i(y){m||(A(i.$$.fragment,y),m=!0)},o(y){L(i.$$.fragment,y),m=!1},d(y){y&&k(e),H(i),b.d()}}}function Pp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[q5,({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 Ol({props:r}),te.push(()=>ce(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),l=!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}),!s&&f[0]&1&&(s=!0,u.list=e[0],he(()=>s=!1)),i.$set(u)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function j5(n){let e,t,i,s,l,o,r,a,f=n[29].name+"",u,c,d,m,_,h,b;i=new y5({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),B(i.$$.fragment),s=O(),l=v("div"),o=v("small"),o.textContent="New",r=O(),a=v("span"),u=U(f),d=O(),m=v("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"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"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,T){w(S,e,T),g(e,t),z(i,t,null),g(e,s),g(e,l),g(l,o),g(l,r),g(l,a),g(a,u),g(e,d),g(e,m),_=!0,h||(b=[Te(Ve.call(null,m,"Remove file")),Y(m,"click",y)],h=!0)},p(S,T){n=S;const C={};T[0]&2&&(C.file=n[29]),i.$set(C),(!_||T[0]&2)&&f!==(f=n[29].name+"")&&se(u,f),(!_||T[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!_||T[1]&2)&&Q(e,"dragging",n[32]),(!_||T[1]&4)&&Q(e,"dragover",n[33])},i(S){_||(A(i.$$.fragment,S),_=!0)},o(S){L(i.$$.fragment,S),_=!1},d(S){S&&k(e),H(i),h=!1,Ee(b)}}}function Fp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[j5,({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 Ol({props:r}),te.push(()=>ce(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),l=!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}),!s&&f[0]&2&&(s=!0,u.list=e[1],he(()=>s=!1)),i.$set(u)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function V5(n){let e,t,i,s,l,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,_=[],h=new Map,b,y,S,T,C,$,M,E,D,I,P,F,R=n[5];const N=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=v("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!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||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),s=!1,Ee(l)}}}function H5(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,_="";function h(j){V.removeByValue(u,j),t(2,u)}function b(j){V.pushUnique(u,j),t(2,u)}function y(j){V.isEmpty(f[j])||f.splice(j,1),t(1,f)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function T(j){var X,K;j.preventDefault(),t(9,m=!1);const Z=((X=j.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const J of Z){const le=s.length+f.length-u.length;if(((K=r.options)==null?void 0:K.maxSelect)<=le)break;f.push(J)}t(1,f)}}Xt(async()=>{t(10,_=await ue.getAdminFileToken(o.collectionId))});const C=j=>h(j),$=j=>b(j);function M(j){a=j,t(0,a),t(6,i),t(4,r)}const E=j=>y(j);function D(j){f=j,t(1,f)}function I(j){te[j?"unshift":"push"](()=>{c=j,t(7,c)})}const P=()=>{for(let j of c.files)f.push(j);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function R(j){te[j?"unshift":"push"](()=>{d=j,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=j=>{"record"in j&&t(3,o=j.record),"field"in j&&t(4,r=j.field),"value"in j&&t(0,a=j.value),"uploadedFiles"in j&&t(1,f=j.uploadedFiles),"deletedFileNames"in j&&t(2,u=j.deletedFileNames)},n.$$.update=()=>{var j,Z;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=V.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=V.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((j=r.options)==null?void 0:j.maxSelect)>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=V.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||f.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,s,i,c,d,m,_,l,h,b,y,T,C,$,M,E,D,I,P,F,R,N,q]}class B5 extends ve{constructor(e){super(),be(this,e,H5,z5,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Np(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function U5(n,e){e=Np(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=Np(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Rp(n,e,t){const i=n.slice();i[6]=e[t];const s=V.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function qp(n,e,t){const i=n.slice();return i[10]=e[t],i}function jp(n){let e,t;return e=new lf({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Vp(n){let e=!V.isEmpty(n[10]),t,i,s=e&&jp(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&3&&(e=!V.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=jp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ae(),L(s,1,1,()=>{s=null}),fe())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){s&&s.d(l),l&&k(t)}}}function zp(n){let e,t,i=n[7],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oL(m[h],1,1,()=>{m[h]=null});return{c(){e=v("div"),t=v("i"),s=O();for(let h=0;ht(5,o=f));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=f=>{"record"in f&&t(0,r=f.record),"displayFields"in f&&t(3,a=f.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(f=>f.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(f=>{var u;return!!((u=i==null?void 0:i.schema)!=null&&u.find(c=>c.name==f&&c.type=="file"))}))||[]),n.$$.dirty&10&&t(2,l=(s.length?a==null?void 0:a.filter(f=>!s.includes(f)):a)||[])},[r,s,l,a,i,o]}class Qo extends ve{constructor(e){super(),be(this,e,Y5,W5,me,{record:0,displayFields:3})}}function Hp(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function Bp(n,e,t){const i=n.slice();i[50]=e[t];const s=i[9](i[50]);return i[6]=s,i}function Up(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Wp(n){let e,t=!n[13]&&Yp(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=Yp(i),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&k(e)}}}function Yp(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Kp(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=O(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),g(e,t),g(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=Kp(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function Kp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[36]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function K5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function J5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Jp(n){let e,t,i,s;function l(){return n[33](n[50])}return{c(){e=v("div"),t=v("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),g(e,t),i||(s=[Te(Ve.call(null,t,"Edit")),Y(t,"keydown",On(n[28])),Y(t,"click",On(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,Ee(s)}}}function Zp(n,e){let t,i,s,l,o,r,a,f;function u(b,y){return b[6]?J5:K5}let c=u(e),d=c(e);l=new Qo({props:{record:e[50],displayFields:e[14]}});let m=!e[11]&&Jp(e);function _(){return e[34](e[50])}function h(...b){return e[35](e[50],...b)}return{key:n,first:null,c(){t=v("div"),d.c(),i=O(),s=v("div"),B(l.$$.fragment),o=O(),m&&m.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(b,y){w(b,t,y),d.m(t,null),g(t,i),g(t,s),z(l,s,null),g(t,o),m&&m.m(t,null),r=!0,a||(f=[Y(t,"click",_),Y(t,"keydown",h)],a=!0)},p(b,y){e=b,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[50]),y[0]&16384&&(S.displayFields=e[14]),l.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=Jp(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(b){r||(A(l.$$.fragment,b),r=!0)},o(b){L(l.$$.fragment,b),r=!1},d(b){b&&k(t),d.d(),H(l),m&&m.d(),a=!1,Ee(f)}}}function Gp(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[4]),o=U(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(l,r[4])},d(r){r&&k(e),r&&k(i),r&&k(s),r&&k(l),r&&k(o)}}}function Z5(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function G5(n){let e,t,i=n[6],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=O(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[53]),Q(e,"label-warning",n[54])},m(u,c){w(u,e,c),z(t,e,null),g(e,i),g(e,s),w(u,l,c),o=!0,r||(a=Y(s,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[50]),c[0]&16384&&(d.displayFields=n[14]),t.$set(d),(!o||c[1]&4194304)&&Q(e,"label-danger",n[53]),(!o||c[1]&8388608)&&Q(e,"label-warning",n[54])},i(u){o||(A(t.$$.fragment,u),o=!0)},o(u){L(t.$$.fragment,u),o=!1},d(u){u&&k(e),H(t),u&&k(l),r=!1,a()}}}function Qp(n){let e,t,i;function s(o){n[39](o)}let l={index:n[52],$$slots:{default:[X5,({dragging:o,dragover:r})=>({53:o,54:r}),({dragging:o,dragover:r})=>[0,(o?4194304:0)|(r?8388608:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Ol({props:l}),te.push(()=>ce(e,"list",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&16448|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Q5(n){let e,t,i,s,l,o=[],r=new Map,a,f,u,c,d,m,_,h,b,y,S,T;t=new Uo({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[31]);let C=!n[11]&&Up(n),$=n[8];const M=N=>N[50].id;for(let N=0;N<$.length;N+=1){let q=Bp(n,$,N),j=M(q);r.set(j,o[N]=Zp(j,q))}let E=null;$.length||(E=Wp(n));let D=n[13]&&Gp(),I=n[4]>1&&Xp(n);const P=[G5,Z5],F=[];function R(N,q){return N[6].length?0:1}return _=R(n),h=F[_]=P[_](n),{c(){e=v("div"),B(t.$$.fragment),i=O(),C&&C.c(),s=O(),l=v("div");for(let N=0;N1?I?I.p(N,q):(I=Xp(N),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=_;_=R(N),_===Z?F[_].p(N,q):(ae(),L(F[Z],1,1,()=>{F[Z]=null}),fe(),h=F[_],h?h.p(N,q):(h=F[_]=P[_](N),h.c()),A(h,1),h.m(b.parentNode,b))},i(N){if(!y){A(t.$$.fragment,N);for(let q=0;q<$.length;q+=1)A(o[q]);A(h),y=!0}},o(N){L(t.$$.fragment,N);for(let q=0;qCancel',t=O(),i=v("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),s||(l=[Y(e,"click",n[29]),Y(i,"click",n[30])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ee(l)}}}function t6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[20]];let o={$$slots:{footer:[e6],header:[x5],default:[Q5]},$$scope:{ctx:n}};for(let a=0;at(27,_=Ie));const h=$t(),b="picker_"+V.randomString(5);let{value:y}=e,{field:S}=e,T,C,$="",M=[],E=[],D=1,I=0,P=!1,F=!1;function R(){return t(2,$=""),t(8,M=[]),t(6,E=[]),q(),j(!0),T==null?void 0:T.show()}function N(){return T==null?void 0:T.hide()}async function q(){const Ie=V.toArray(y);if(!s||!Ie.length)return;t(25,F=!0);let rt=[];const Oe=Ie.slice(),lt=[];for(;Oe.length>0;){const Ot=[];for(const Vt of Oe.splice(0,eo))Ot.push(`id="${Vt}"`);lt.push(ue.collection(s).getFullList(eo,{filter:Ot.join("||"),$autoCancel:!1}))}try{await Promise.all(lt).then(Ot=>{rt=rt.concat(...Ot)}),t(6,E=[]);for(const Ot of Ie){const Vt=V.findByKey(rt,"id",Ot);Vt&&E.push(Vt)}$.trim()||t(8,M=V.filterDuplicatesByKey(E.concat(M))),t(25,F=!1)}catch(Ot){Ot.isAbort||(ue.error(Ot),t(25,F=!1))}}async function j(Ie=!1){if(s){t(3,P=!0),Ie&&($.trim()?t(8,M=[]):t(8,M=V.toArray(E).slice()));try{const rt=Ie?1:D+1,Oe=V.getAllCollectionIdentifiers(o),lt=await ue.collection(s).getList(rt,eo,{filter:V.normalizeSearchFilter($,Oe),sort:r?"":"-created",skipTotal:1,$cancelKey:b+"loadList"});t(8,M=V.filterDuplicatesByKey(M.concat(lt.items))),D=lt.page,t(24,I=lt.items.length),t(3,P=!1)}catch(rt){rt.isAbort||(ue.error(rt),t(3,P=!1))}}}function Z(Ie){i==1?t(6,E=[Ie]):u&&(V.pushOrReplaceByKey(E,Ie),t(6,E))}function X(Ie){V.removeByKey(E,"id",Ie.id),t(6,E)}function K(Ie){c(Ie)?X(Ie):Z(Ie)}function J(){var Ie;i!=1?t(21,y=E.map(rt=>rt.id)):t(21,y=((Ie=E==null?void 0:E[0])==null?void 0:Ie.id)||""),h("save",E),N()}function le(Ie){Fe.call(this,n,Ie)}const ie=()=>N(),ee=()=>J(),$e=Ie=>t(2,$=Ie.detail),Pe=()=>C==null?void 0:C.show(),je=Ie=>C==null?void 0:C.show(Ie),ze=Ie=>K(Ie),ke=(Ie,rt)=>{(rt.code==="Enter"||rt.code==="Space")&&(rt.preventDefault(),rt.stopPropagation(),K(Ie))},Ce=()=>t(2,$=""),Je=()=>{f&&!P&&j()},_t=Ie=>X(Ie);function Ze(Ie){E=Ie,t(6,E)}function We(Ie){te[Ie?"unshift":"push"](()=>{T=Ie,t(1,T)})}function yt(Ie){Fe.call(this,n,Ie)}function pe(Ie){Fe.call(this,n,Ie)}function _e(Ie){te[Ie?"unshift":"push"](()=>{C=Ie,t(7,C)})}const Ye=Ie=>{V.removeByKey(M,"id",Ie.detail.id),M.unshift(Ie.detail),t(8,M),Z(Ie.detail)},Mt=Ie=>{V.removeByKey(M,"id",Ie.detail.id),t(8,M),X(Ie.detail)};return n.$$set=Ie=>{e=Re(Re({},e),Gt(Ie)),t(20,m=Xe(e,d)),"value"in Ie&&t(21,y=Ie.value),"field"in Ie&&t(22,S=Ie.field)},n.$$.update=()=>{var Ie,rt,Oe;n.$$.dirty[0]&4194304&&t(4,i=((Ie=S==null?void 0:S.options)==null?void 0:Ie.maxSelect)||null),n.$$.dirty[0]&4194304&&t(26,s=(rt=S==null?void 0:S.options)==null?void 0:rt.collectionId),n.$$.dirty[0]&4194304&&t(14,l=(Oe=S==null?void 0:S.options)==null?void 0:Oe.displayFields),n.$$.dirty[0]&201326592&&t(5,o=_.find(lt=>lt.id==s)||null),n.$$.dirty[0]&6&&typeof $<"u"&&T!=null&&T.isActive()&&j(!0),n.$$.dirty[0]&32&&t(11,r=(o==null?void 0:o.type)==="view"),n.$$.dirty[0]&33554440&&t(13,a=P||F),n.$$.dirty[0]&16777216&&t(12,f=I==eo),n.$$.dirty[0]&80&&t(10,u=i===null||i>E.length),n.$$.dirty[0]&64&&t(9,c=function(lt){return V.findByKey(E,"id",lt.id)})},[N,T,$,P,i,o,E,C,M,c,u,r,f,a,l,j,Z,X,K,J,m,y,S,R,I,F,s,_,le,ie,ee,$e,Pe,je,ze,ke,Ce,Je,_t,Ze,We,yt,pe,_e,Ye,Mt]}class i6 extends ve{constructor(e){super(),be(this,e,n6,t6,me,{value:21,field:22,show:23,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[23]}get hide(){return this.$$.ctx[0]}}function xp(n,e,t){const i=n.slice();return i[20]=e[t],i[22]=t,i}function em(n,e,t){const i=n.slice();return i[25]=e[t],i}function tm(n){let e,t=n[5]&&nm(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function nm(n){let e,t=V.toArray(n[0]).slice(0,10),i=[];for(let s=0;s
    + `,p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function s6(n){var d;let e,t,i,s,l,o,r,a,f,u;i=new Qo({props:{record:n[20],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[10](n[20])}return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),o=v("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(l,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[23]),Q(e,"dragover",n[24])},m(m,_){w(m,e,_),g(e,t),z(i,t,null),g(e,s),g(e,l),g(l,o),w(m,r,_),a=!0,f||(u=[Te(Ve.call(null,o,"Remove")),Y(o,"click",c)],f=!0)},p(m,_){var b;n=m;const h={};_&16&&(h.record=n[20]),_&4&&(h.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(h),(!a||_&8388608)&&Q(e,"dragging",n[23]),(!a||_&16777216)&&Q(e,"dragover",n[24])},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){L(i.$$.fragment,m),a=!1},d(m){m&&k(e),H(i),m&&k(r),f=!1,Ee(u)}}}function sm(n,e){let t,i,s,l;function o(a){e[11](a)}let r={group:e[2].name+"_relation",index:e[22],disabled:!e[6],$$slots:{default:[s6,({dragging:a,dragover:f})=>({23:a,24:f}),({dragging:a,dragover:f})=>(a?8388608:0)|(f?16777216:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Ol({props:r}),te.push(()=>ce(i,"list",o)),i.$on("sort",e[12]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),l=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[22]),f&64&&(u.disabled=!e[6]),f&293601300&&(u.$$scope={dirty:f,ctx:e}),!s&&f&16&&(s=!0,u.list=e[4],he(()=>s=!1)),i.$set(u)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function l6(n){let e,t,i,s,l,o=n[2].name+"",r,a,f,u,c,d=[],m=new Map,_,h,b,y,S,T,C=n[4];const $=E=>E[20].id;for(let E=0;E + + Open picker`,p(t,"class",i=ns(V.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[19]),p(c,"class","relations-list svelte-1ynw0pc"),p(b,"type","button"),p(b,"class","btn btn-transparent btn-sm btn-block"),p(h,"class","list-item list-item-btn"),p(u,"class","list")},m(E,D){w(E,e,D),g(e,t),g(e,s),g(e,l),g(l,r),w(E,f,D),w(E,u,D),g(u,c);for(let I=0;I({19:r}),({uniqueId:r})=>r?524288:0]},$$scope:{ctx:n}};e=new de({props:l}),n[14](e);let o={value:n[0],field:n[2]};return i=new i6({props:o}),n[15](i),i.$on("save",n[16]),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),s=!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&268959863&&(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){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[14](null),H(e,r),r&&k(t),n[15](null),H(i,r)}}}const lm=100;function r6(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],f=!1,u;function c(){if(f)return!1;const M=V.toArray(l);return t(4,a=a.filter(E=>M.includes(E.id))),M.length!=a.length}async function d(){var I,P;const M=V.toArray(l);if(t(4,a=[]),!((I=s==null?void 0:s.options)!=null&&I.collectionId)||!M.length){t(5,f=!1);return}t(5,f=!0);const E=M.slice(),D=[];for(;E.length>0;){const F=[];for(const R of E.splice(0,lm))F.push(`id="${R}"`);D.push(ue.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(lm,{filter:F.join("||"),$autoCancel:!1}))}try{let F=[];await Promise.all(D).then(R=>{F=F.concat(...R)});for(const R of M){const N=V.findByKey(F,"id",R);N&&a.push(N)}t(4,a),_()}catch(F){ue.error(F)}t(5,f=!1)}function m(M){V.removeByKey(a,"id",M.id),t(4,a),_()}function _(){var M;i?t(0,l=a.map(E=>E.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Fo(()=>{clearTimeout(u)});const h=M=>m(M);function b(M){a=M,t(4,a)}const y=()=>{_()},S=()=>o==null?void 0:o.show();function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function C(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const $=M=>{var E;t(4,a=M.detail||[]),t(0,l=i?a.map(D=>D.id):((E=a[0])==null?void 0:E.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(6,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&529&&c()&&(t(5,f=!0),clearTimeout(u),t(9,u=setTimeout(d,0)))},[l,o,s,r,a,f,i,m,_,u,h,b,y,S,T,C,$]}class a6 extends ve{constructor(e){super(),be(this,e,r6,o6,me,{field:2,value:0,picker:1})}}const f6=["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"],u6=(n,e)=>{f6.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function c6(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Nr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[18](null)}}}function d6(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[17](null)}}}function p6(n){let e;function t(l,o){return l[1]?d6:c6}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:x,o:x,d(l){l&&k(e),s.d(),n[19](null)}}}const h1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),m6=()=>{let n={listeners:[],scriptId:h1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let h6=m6();function _6(n,e,t){var i;let{id:s=h1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:f=void 0}=e,{conf:u={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:m=""}=e,{cssClass:_="tinymce-wrapper"}=e,h,b,y,S=d,T=o;const C=$t(),$=()=>{const F=(()=>typeof window<"u"?window:global)();return F&&F.tinymce?F.tinymce:null},M=()=>{const P=Object.assign(Object.assign({},u),{target:b,inline:l!==void 0?l:u.inline!==void 0?u.inline:!1,readonly:o,setup:F=>{t(14,y=F),F.on("init",()=>{F.setContent(d),F.on(c,()=>{t(15,S=F.getContent()),S!==d&&(t(5,d=S),t(6,m=F.getContent({format:"text"})))})}),u6(F,C),typeof u.setup=="function"&&u.setup(F)}});t(4,b.style.visibility="",b),$().init(P)};Xt(()=>{if($()!==null)M();else{const P=f||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;h6.load(h.ownerDocument,P,()=>{M()})}}),Fo(()=>{var P;y&&((P=$())===null||P===void 0||P.remove(y))});function E(P){te[P?"unshift":"push"](()=>{b=P,t(4,b)})}function D(P){te[P?"unshift":"push"](()=>{b=P,t(4,b)})}function I(P){te[P?"unshift":"push"](()=>{h=P,t(3,h)})}return n.$$set=P=>{"id"in P&&t(0,s=P.id),"inline"in P&&t(1,l=P.inline),"disabled"in P&&t(7,o=P.disabled),"apiKey"in P&&t(8,r=P.apiKey),"channel"in P&&t(9,a=P.channel),"scriptSrc"in P&&t(10,f=P.scriptSrc),"conf"in P&&t(11,u=P.conf),"modelEvents"in P&&t(12,c=P.modelEvents),"value"in P&&t(5,d=P.value),"text"in P&&t(6,m=P.text),"cssClass"in P&&t(2,_=P.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&S!==d&&(y.setContent(d),t(6,m=y.getContent({format:"text"}))),y&&o!==T&&(t(16,T=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,_,h,b,d,m,o,r,a,f,u,c,i,y,S,T,E,D,I]}class of extends ve{constructor(e){super(),be(this,e,_6,p6,me,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function g6(n){let e,t,i,s,l,o=n[1].name+"",r,a,f,u,c,d;function m(h){n[2](h)}let _={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:V.defaultEditorOptions()};return n[0]!==void 0&&(_.value=n[0]),u=new of({props:_}),te.push(()=>ce(u,"value",m)),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=U(o),f=O(),B(u.$$.fragment),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(h,b){w(h,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(h,f,b),z(u,h,b),d=!0},p(h,b){(!d||b&2&&i!==(i=V.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||b&8&&a!==(a=h[3]))&&p(e,"for",a);const y={};b&8&&(y.id=h[3]),!c&&b&1&&(c=!0,y.value=h[0],he(()=>c=!1)),u.$set(y)},i(h){d||(A(u.$$.fragment,h),d=!0)},o(h){L(u.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(f),H(u,h)}}}function b6(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[g6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function v6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class y6 extends ve{constructor(e){super(),be(this,e,v6,b6,me,{field:1,value:0})}}function k6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Auth URL"),s=O(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(f,u){u&32&&i!==(i=f[5])&&p(e,"for",i),u&32&&o!==(o=f[5])&&p(l,"id",o),u&1&&l.value!==f[0].authUrl&&re(l,f[0].authUrl)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function w6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Token URL"),s=O(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(f,u){u&32&&i!==(i=f[5])&&p(e,"for",i),u&32&&o!==(o=f[5])&&p(l,"id",o),u&1&&l.value!==f[0].tokenUrl&&re(l,f[0].tokenUrl)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function S6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("User API URL"),s=O(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(f,u){u&32&&i!==(i=f[5])&&p(e,"for",i),u&32&&o!==(o=f[5])&&p(l,"id",o),u&1&&l.value!==f[0].userApiUrl&&re(l,f[0].userApiUrl)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function C6(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[k6,({uniqueId:f})=>({5:f}),({uniqueId:f})=>f?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[w6,({uniqueId:f})=>({5:f}),({uniqueId:f})=>f?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[S6,({uniqueId:f})=>({5:f}),({uniqueId:f})=>f?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment),o=O(),B(r.$$.fragment),p(e,"class","section-title")},m(f,u){w(f,e,u),w(f,t,u),z(i,f,u),w(f,s,u),z(l,f,u),w(f,o,u),z(r,f,u),a=!0},p(f,[u]){const c={};u&2&&(c.name=f[1]+".authUrl"),u&97&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&2&&(d.name=f[1]+".tokenUrl"),u&97&&(d.$$scope={dirty:u,ctx:f}),l.$set(d);const m={};u&2&&(m.name=f[1]+".userApiUrl"),u&97&&(m.$$scope={dirty:u,ctx:f}),r.$set(m)},i(f){a||(A(i.$$.fragment,f),A(l.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){L(i.$$.fragment,f),L(l.$$.fragment,f),L(r.$$.fragment,f),a=!1},d(f){f&&k(e),f&&k(t),H(i,f),f&&k(s),H(l,f),f&&k(o),H(r,f)}}}function T6(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class om extends ve{constructor(e){super(),be(this,e,T6,C6,me,{key:1,config:0})}}function $6(n){let e,t,i,s,l,o,r,a,f,u,c;return{c(){e=v("label"),t=U("Auth URL"),s=O(),l=v("input"),a=O(),f=v("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=Y(l,"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(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].authUrl&&re(l,d[0].authUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(f),u=!1,c()}}}function M6(n){let e,t,i,s,l,o,r,a,f,u,c;return{c(){e=v("label"),t=U("Token URL"),s=O(),l=v("input"),a=O(),f=v("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=Y(l,"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(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&re(l,d[0].tokenUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(f),u=!1,c()}}}function E6(n){let e,t,i,s,l,o;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[$6,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[M6,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,s,a),z(l,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}),l.$set(u)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&k(e),r&&k(t),H(i,r),r&&k(s),H(l,r)}}}function O6(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class D6 extends ve{constructor(e){super(),be(this,e,O6,E6,me,{key:1,config:0})}}function A6(n){let e,t,i,s,l,o,r,a,f,u,c;return{c(){e=v("label"),t=U("Auth URL"),s=O(),l=v("input"),a=O(),f=v("div"),f.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=Y(l,"input",n[2]),u=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].authUrl&&re(l,d[0].authUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(f),u=!1,c()}}}function I6(n){let e,t,i,s,l,o,r,a,f,u,c;return{c(){e=v("label"),t=U("Token URL"),s=O(),l=v("input"),a=O(),f=v("div"),f.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=Y(l,"input",n[3]),u=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&re(l,d[0].tokenUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(f),u=!1,c()}}}function L6(n){let e,t,i,s,l,o,r,a,f,u,c;return{c(){e=v("label"),t=U("User API URL"),s=O(),l=v("input"),a=O(),f=v("div"),f.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0].userApiUrl),w(d,a,m),w(d,f,m),u||(c=Y(l,"input",n[4]),u=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].userApiUrl&&re(l,d[0].userApiUrl)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(a),d&&k(f),u=!1,c()}}}function P6(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[A6,({uniqueId:f})=>({5:f}),({uniqueId:f})=>f?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[I6,({uniqueId:f})=>({5:f}),({uniqueId:f})=>f?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[L6,({uniqueId:f})=>({5:f}),({uniqueId:f})=>f?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Endpoints",t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment),o=O(),B(r.$$.fragment),p(e,"class","section-title")},m(f,u){w(f,e,u),w(f,t,u),z(i,f,u),w(f,s,u),z(l,f,u),w(f,o,u),z(r,f,u),a=!0},p(f,[u]){const c={};u&1&&(c.class="form-field "+(f[0].enabled?"required":"")),u&2&&(c.name=f[1]+".authUrl"),u&97&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(f[0].enabled?"required":"")),u&2&&(d.name=f[1]+".tokenUrl"),u&97&&(d.$$scope={dirty:u,ctx:f}),l.$set(d);const m={};u&1&&(m.class="form-field "+(f[0].enabled?"required":"")),u&2&&(m.name=f[1]+".userApiUrl"),u&97&&(m.$$scope={dirty:u,ctx:f}),r.$set(m)},i(f){a||(A(i.$$.fragment,f),A(l.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){L(i.$$.fragment,f),L(l.$$.fragment,f),L(r.$$.fragment,f),a=!1},d(f){f&&k(e),f&&k(t),H(i,f),f&&k(s),H(l,f),f&&k(o),H(r,f)}}}function F6(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Ir extends ve{constructor(e){super(),be(this,e,F6,P6,me,{key:1,config:0})}}function N6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Client ID"),s=O(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[2]),r||(a=Y(l,"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(l,"id",o),u&4&&l.value!==f[2]&&re(l,f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function R6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Team ID"),s=O(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[3]),r||(a=Y(l,"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(l,"id",o),u&8&&l.value!==f[3]&&re(l,f[3])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function q6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Key ID"),s=O(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[4]),r||(a=Y(l,"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(l,"id",o),u&16&&l.value!==f[4]&&re(l,f[4])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function j6(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=O(),s=v("i"),o=O(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",ao),r.required=!0},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[6]),f||(u=[Te(Ve.call(null,s,{text:`Max ${ao} seconds (~${ao/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&k(e),c&&k(o),c&&k(r),f=!1,Ee(u)}}}function V6(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=U("Private key"),s=O(),l=v("textarea"),r=O(),a=v("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(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- +... +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[5]),w(c,r,d),w(c,a,d),f||(u=Y(l,"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(l,"id",o),d&32&&re(l,c[5])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),f=!1,u()}}}function z6(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[N6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[R6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[q6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[j6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[V6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),B(s.$$.fragment),l=O(),o=v("div"),B(r.$$.fragment),a=O(),f=v("div"),B(u.$$.fragment),c=O(),d=v("div"),B(m.$$.fragment),_=O(),B(h.$$.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,C){w(T,e,C),g(e,t),g(t,i),z(s,i,null),g(t,l),g(t,o),z(r,o,null),g(t,a),g(t,f),z(u,f,null),g(t,c),g(t,d),z(m,d,null),g(t,_),z(h,t,null),b=!0,y||(S=Y(e,"submit",Qe(n[17])),y=!0)},p(T,C){const $={};C&25165828&&($.$$scope={dirty:C,ctx:T}),s.$set($);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:T}),r.$set(M);const E={};C&25165840&&(E.$$scope={dirty:C,ctx:T}),u.$set(E);const D={};C&25165888&&(D.$$scope={dirty:C,ctx:T}),m.$set(D);const I={};C&25165856&&(I.$$scope={dirty:C,ctx:T}),h.$set(I)},i(T){b||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(h.$$.fragment,T),b=!0)},o(T){L(s.$$.fragment,T),L(r.$$.fragment,T),L(u.$$.fragment,T),L(m.$$.fragment,T),L(h.$$.fragment,T),b=!1},d(T){T&&k(e),H(s),H(r),H(u),H(m),H(h),y=!1,S()}}}function H6(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function B6(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("button"),t=U("Close"),i=O(),s=v("button"),l=v("i"),o=O(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),f||(u=Y(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,u()}}}function U6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[B6],header:[H6],default:[z6]},$$scope:{ctx:n}};return e=new sn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const ao=15777e3;function W6(n,e,t){let i;const s=$t(),l="apple_secret_"+V.randomString(5);let o,r,a,f,u,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,f=P.keyId||""),t(5,u=P.privateKey||""),t(6,c=P.duration||ao),en({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const P=await ue.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Ht("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){ue.error(P)}t(7,d=!1)}function b(){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 C(){u=this.value,t(5,u)}const $=()=>h(),M=()=>!d;function E(P){te[P?"unshift":"push"](()=>{o=P,t(1,o)})}function D(P){Fe.call(this,n,P)}function I(P){Fe.call(this,n,P)}return t(8,i=!0),[_,o,r,a,f,u,c,d,i,l,h,m,b,y,S,T,C,$,M,E,D,I]}class Y6 extends ve{constructor(e){super(),be(this,e,W6,U6,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function K6(n){let e,t,i,s,l,o,r,a,f,u,c={};return r=new Y6({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=O(),s=v("span"),s.textContent="Generate secret",o=O(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),g(e,t),g(e,i),g(e,s),w(d,o,m),z(r,d,m),a=!0,f||(u=Y(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const _={};r.$set(_)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){L(r.$$.fragment,d),a=!1},d(d){d&&k(e),d&&k(o),n[4](null),H(r,d),f=!1,u()}}}function J6(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(f){te[f?"unshift":"push"](()=>{l=f,t(2,l)})}const a=f=>{var u;t(0,s.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",s)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,s=f.config)},[s,i,l,o,r,a]}class Z6 extends ve{constructor(e){super(),be(this,e,J6,K6,me,{key:1,config:0})}}const fo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:Z6},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:D6},{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:om},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:om},{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:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{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 rm(n,e,t){const i=n.slice();return i[9]=e[t],i}function G6(n){let e;return{c(){e=v("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:x,d(t){t&&k(e)}}}function X6(n){let e,t=n[1],i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function am(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,_,h,b,y,S;function T(){return n[6](n[9])}return{c(){var C;e=v("div"),t=v("figure"),i=v("img"),l=O(),o=v("span"),a=U(r),f=O(),u=v("div"),c=U("ID: "),m=U(d),_=O(),h=v("button"),h.innerHTML='',b=O(),hn(i.src,s="./images/oauth2/"+((C=n[3](n[9].provider))==null?void 0:C.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(C,$){w(C,e,$),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),g(e,f),g(e,u),g(u,c),g(u,m),g(e,_),g(e,h),g(e,b),y||(S=Y(h,"click",T),y=!0)},p(C,$){var M;n=C,$&2&&!hn(i.src,s="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",s),$&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),$&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(C){C&&k(e),y=!1,S()}}}function x6(n){let e;function t(l,o){var r;return l[2]?Q6:(r=l[0])!=null&&r.id&&l[1].length?X6:G6}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function eE(n,e,t){const i=$t();let{record:s}=e,l=[],o=!1;function r(d){return fo.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||V.sentenize(d,!1)}async function f(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await ue.collection(s.collectionId).listExternalAuths(s.id))}catch(d){ue.error(d)}t(2,o=!1)}function u(d){!(s!=null&&s.id)||!d||pn(`Do you really want to unlink the ${a(d)} provider?`,()=>ue.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{Ht(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{ue.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,u,c]}class tE extends ve{constructor(e){super(),be(this,e,eE,x6,me,{record:0})}}function fm(n,e,t){const i=n.slice();return i[67]=e[t],i[68]=e,i[69]=t,i}function um(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=O(),l=v("div"),o=U(`The record has previous unsaved changes. + `),r=v("button"),r.textContent="Restore draft",a=O(),f=v("button"),f.innerHTML='',u=O(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"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(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(t,a),g(t,f),g(e,u),g(e,c),m=!0,_||(h=[Y(r,"click",n[37]),Te(Ve.call(null,f,"Discard draft")),Y(f,"click",Qe(n[38]))],_=!0)},p:x,i(b){m||(d&&d.end(1),m=!0)},o(b){d=_a(e,st,{duration:150}),m=!1},d(b){b&&k(e),b&&d&&d.end(),_=!1,Ee(h)}}}function cm(n){let e,t,i,s,l;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-calendar-event-line txt-disabled"),p(e,"class","form-field-addon")},m(o,r){w(o,e,r),g(e,t),s||(l=Te(i=Ve.call(null,t,{text:`Created: ${n[3].created} +Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&jt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created} +Updated: ${o[3].updated}`,position:"left"})},d(o){o&&k(e),s=!1,l()}}}function nE(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h=!n[6]&&cm(n);return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="id",l=O(),o=v("span"),a=O(),h&&h.c(),f=O(),u=v("input"),p(t,"class",ns(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(u,"type","text"),p(u,"id",c=n[70]),p(u,"placeholder","Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=d=!n[6]},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),w(b,a,y),h&&h.m(b,y),w(b,f,y),w(b,u,y),re(u,n[3].id),m||(_=Y(u,"input",n[39]),m=!0)},p(b,y){y[2]&256&&r!==(r=b[70])&&p(e,"for",r),b[6]?h&&(h.d(1),h=null):h?h.p(b,y):(h=cm(b),h.c(),h.m(f.parentNode,f)),y[2]&256&&c!==(c=b[70])&&p(u,"id",c),y[0]&64&&d!==(d=!b[6])&&(u.readOnly=d),y[0]&8&&u.value!==b[3].id&&re(u,b[3].id)},d(b){b&&k(e),b&&k(a),h&&h.d(b),b&&k(f),b&&k(u),m=!1,_()}}}function dm(n){var f,u;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new PM({props:r}),te.push(()=>ce(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&pm();return{c(){B(e.$$.fragment),i=O(),a&&a.c(),s=ye()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!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],he(()=>t=!1)),e.$set(m),(h=(_=c[0])==null?void 0:_.schema)!=null&&h.length?a||(a=pm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){H(e,c),c&&k(i),a&&a.d(c),c&&k(s)}}}function pm(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function iE(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new a6({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function sE(n){let e,t,i,s,l;function o(u){n[50](u,n[67])}function r(u){n[51](u,n[67])}function a(u){n[52](u,n[67])}let f={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(f.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(f.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(f.deletedFileNames=n[5][n[67].name]),e=new B5({props:f}),te.push(()=>ce(e,"value",o)),te.push(()=>ce(e,"uploadedFiles",r)),te.push(()=>ce(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(u,c){z(e,u,c),l=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],he(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],he(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],he(()=>s=!1)),e.$set(d)},i(u){l||(A(e.$$.fragment,u),l=!0)},o(u){L(e.$$.fragment,u),l=!1},d(u){H(e,u)}}}function lE(n){let e,t,i;function s(o){n[49](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new h5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function oE(n){let e,t,i;function s(o){n[48](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new c5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function rE(n){let e,t,i;function s(o){n[47](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new r5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function aE(n){let e,t,i;function s(o){n[46](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new y6({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function fE(n){let e,t,i;function s(o){n[45](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new i5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function uE(n){let e,t,i;function s(o){n[44](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new xM({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function cE(n){let e,t,i;function s(o){n[43](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new ZM({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dE(n){let e,t,i;function s(o){n[42](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new WM({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pE(n){let e,t,i;function s(o){n[41](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new zM({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mm(n,e){let t,i,s,l,o;const r=[pE,dE,cE,uE,fE,aE,rE,oE,lE,sE,iE],a=[];function f(u,c){return u[67].type==="text"?0:u[67].type==="number"?1:u[67].type==="bool"?2:u[67].type==="email"?3:u[67].type==="url"?4:u[67].type==="editor"?5:u[67].type==="date"?6:u[67].type==="select"?7:u[67].type==="json"?8:u[67].type==="file"?9:u[67].type==="relation"?10:-1}return~(i=f(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),s&&s.c(),l=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,l,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(s&&(ae(),L(a[d],1,1,()=>{a[d]=null}),fe()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(u){o||(A(s),o=!0)},o(u){L(s),o=!1},d(u){u&&k(t),~i&&a[i].d(u),u&&k(l)}}}function hm(n){let e,t,i;return t=new tE({props:{record:n[3]}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[12]===gl)},m(s,l){w(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&Q(e,"active",s[12]===gl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function mE(n){var S;let e,t,i,s,l,o,r=[],a=new Map,f,u,c,d,m=!n[7]&&n[9]&&um(n);s=new de({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[nE,({uniqueId:T})=>({70:T}),({uniqueId:T})=>[0,0,T?256:0]]},$$scope:{ctx:n}}});let _=n[13]&&dm(n),h=((S=n[0])==null?void 0:S.schema)||[];const b=T=>T[67].name;for(let T=0;T{m=null}),fe());const $={};C[0]&64&&($.class="form-field "+(T[6]?"":"readonly")),C[0]&72|C[2]&768&&($.$$scope={dirty:C,ctx:T}),s.$set($),T[13]?_?(_.p(T,C),C[0]&8192&&A(_,1)):(_=dm(T),_.c(),A(_,1),_.m(t,o)):_&&(ae(),L(_,1,1,()=>{_=null}),fe()),C[0]&57&&(h=((M=T[0])==null?void 0:M.schema)||[],ae(),r=bt(r,C,b,1,T,h,a,t,Ut,mm,null,fm),fe()),(!u||C[0]&4096)&&Q(t,"active",T[12]===ts),T[13]&&!T[6]?y?(y.p(T,C),C[0]&8256&&A(y,1)):(y=hm(T),y.c(),A(y,1),y.m(e,null)):y&&(ae(),L(y,1,1,()=>{y=null}),fe())},i(T){if(!u){A(m),A(s.$$.fragment,T),A(_);for(let C=0;C + Send verification email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function bm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` + Send password reset email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function hE(n){let e,t,i,s,l,o,r,a=n[13]&&!n[2].verified&&n[2].email&&gm(n),f=n[13]&&n[2].email&&bm(n);return{c(){a&&a.c(),e=O(),f&&f.c(),t=O(),i=v("button"),i.innerHTML=` + Duplicate`,s=O(),l=v("button"),l.innerHTML=` + Delete`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"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,s,c),w(u,l,c),o||(r=[Y(i,"click",n[33]),Y(l,"click",On(Qe(n[34])))],o=!0)},p(u,c){u[13]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=gm(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[13]&&u[2].email?f?f.p(u,c):(f=bm(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){a&&a.d(u),u&&k(e),f&&f.d(u),u&&k(t),u&&k(i),u&&k(s),u&&k(l),o=!1,Ee(r)}}}function vm(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=O(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[12]===ts),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[12]===gl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[35]),Y(s,"click",n[36])],l=!0)},p(r,a){a[0]&4096&&Q(t,"active",r[12]===ts),a[0]&4096&&Q(s,"active",r[12]===gl)},d(r){r&&k(e),l=!1,Ee(o)}}}function _E(n){var h;let e,t=n[6]?"New":"Edit",i,s,l,o=((h=n[0])==null?void 0:h.name)+"",r,a,f,u,c,d,m=!n[6]&&_m(n),_=n[13]&&!n[6]&&vm(n);return{c(){e=v("h4"),i=U(t),s=O(),l=v("strong"),r=U(o),a=U(" record"),f=O(),m&&m.c(),u=O(),_&&_.c(),c=ye(),p(e,"class","panel-title svelte-qc5ngu")},m(b,y){w(b,e,y),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),w(b,f,y),m&&m.m(b,y),w(b,u,y),_&&_.m(b,y),w(b,c,y),d=!0},p(b,y){var S;(!d||y[0]&64)&&t!==(t=b[6]?"New":"Edit")&&se(i,t),(!d||y[0]&1)&&o!==(o=((S=b[0])==null?void 0:S.name)+"")&&se(r,o),b[6]?m&&(ae(),L(m,1,1,()=>{m=null}),fe()):m?(m.p(b,y),y[0]&64&&A(m,1)):(m=_m(b),m.c(),A(m,1),m.m(u.parentNode,u)),b[13]&&!b[6]?_?_.p(b,y):(_=vm(b),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},i(b){d||(A(m),d=!0)},o(b){L(m),d=!1},d(b){b&&k(e),b&&k(f),m&&m.d(b),b&&k(u),_&&_.d(b),b&&k(c)}}}function gE(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,f,u;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[10],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[16]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[14]||n[10],Q(s,"btn-loading",n[10])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(l,r),f||(u=Y(e,"click",n[30]),f=!0)},p(c,d){d[0]&1024&&(e.disabled=c[10]),d[0]&64&&o!==(o=c[6]?"Create":"Save changes")&&se(r,o),d[0]&17408&&a!==(a=!c[14]||c[10])&&(s.disabled=a),d[0]&1024&&Q(s,"btn-loading",c[10])},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,u()}}}function bE(n){let e,t,i={class:` + record-panel + `+(n[15]?"overlay-panel-xl":"overlay-panel-lg")+` + `+(n[13]&&!n[6]?"colored-header":"")+` + `,beforeHide:n[54],$$slots:{footer:[gE],header:[_E],default:[mE]},$$scope:{ctx:n}};return e=new sn({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=` + record-panel + `+(s[15]?"overlay-panel-xl":"overlay-panel-lg")+` + `+(s[13]&&!s[6]?"colored-header":"")+` + `),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),H(e,s)}}}const ts="form",gl="providers";function vE(n,e,t){let i,s,l,o,r;const a=$t(),f="record_"+V.randomString(5);let{collection:u}=e,c,d=null,m=null,_=null,h=!1,b=!1,y={},S={},T=JSON.stringify(null),C=T,$=ts,M=!0,E=!1;function D(ge){return P(ge),t(11,b=!0),t(12,$=ts),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function P(ge){t(28,E=!1),en({}),t(2,d=ge||{}),t(3,m=structuredClone(d)),t(4,y={}),t(5,S={}),await fn(),t(9,_=N()),!_||Z(m,_)?t(9,_=null):(delete _.password,delete _.passwordConfirm),t(26,T=JSON.stringify(m)),t(28,E=!0)}async function F(ge){var ct,xe;en({}),t(2,d=ge||{}),t(4,y={}),t(5,S={});const we=((xe=(ct=u==null?void 0:u.schema)==null?void 0:ct.filter(Wt=>Wt.type!="file"))==null?void 0:xe.map(Wt=>Wt.name))||[];for(let Wt in ge)we.includes(Wt)||t(3,m[Wt]=ge[Wt],m);await fn(),t(26,T=JSON.stringify(m)),X()}function R(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function N(ge){try{const we=window.localStorage.getItem(R());if(we)return new Record(JSON.parse(we))}catch{}return ge}function q(ge){window.localStorage.setItem(R(),ge)}function j(){_&&(t(3,m=_),t(9,_=null))}function Z(ge,we){var _n;const ct=structuredClone(ge||{}),xe=structuredClone(we||{}),Wt=(_n=u==null?void 0:u.schema)==null?void 0:_n.filter(Ln=>Ln.type==="file");for(let Ln of Wt)delete ct[Ln.name],delete xe[Ln.name];return delete ct.password,delete ct.passwordConfirm,delete xe.password,delete xe.passwordConfirm,JSON.stringify(ct)==JSON.stringify(xe)}function X(){t(9,_=null),window.localStorage.removeItem(R())}function K(ge=!0){if(h||!r||!(u!=null&&u.id))return;t(10,h=!0);const we=le();let ct;M?ct=ue.collection(u.id).create(we):ct=ue.collection(u.id).update(m.id,we),ct.then(xe=>{Ht(M?"Successfully created record.":"Successfully updated record."),X(),ge?(t(11,b=!1),I()):F(xe),a("save",xe)}).catch(xe=>{ue.error(xe)}).finally(()=>{t(10,h=!1)})}function J(){d!=null&&d.id&&pn("Do you really want to delete the selected record?",()=>ue.collection(d.collectionId).delete(d.id).then(()=>{I(),Ht("Successfully deleted record."),a("delete",d)}).catch(ge=>{ue.error(ge)}))}function le(){const ge=structuredClone(m||{}),we=new FormData,ct={id:ge.id};for(const xe of(u==null?void 0:u.schema)||[])ct[xe.name]=!0;i&&(ct.username=!0,ct.email=!0,ct.emailVisibility=!0,ct.password=!0,ct.passwordConfirm=!0,ct.verified=!0);for(const xe in ge)ct[xe]&&(typeof ge[xe]>"u"&&(ge[xe]=null),V.addValueToFormData(we,xe,ge[xe]));for(const xe in y){const Wt=V.toArray(y[xe]);for(const _n of Wt)we.append(xe,_n)}for(const xe in S){const Wt=V.toArray(S[xe]);for(const _n of Wt)we.append(xe+"."+_n,"")}return we}function ie(){!(u!=null&&u.id)||!(d!=null&&d.email)||pn(`Do you really want to sent verification email to ${d.email}?`,()=>ue.collection(u.id).requestVerification(d.email).then(()=>{Ht(`Successfully sent verification email to ${d.email}.`)}).catch(ge=>{ue.error(ge)}))}function ee(){!(u!=null&&u.id)||!(d!=null&&d.email)||pn(`Do you really want to sent password reset email to ${d.email}?`,()=>ue.collection(u.id).requestPasswordReset(d.email).then(()=>{Ht(`Successfully sent password reset email to ${d.email}.`)}).catch(ge=>{ue.error(ge)}))}function $e(){o?pn("You have unsaved changes. Do you really want to discard them?",()=>{Pe()}):Pe()}async function Pe(){let ge=d?structuredClone(d):null;if(ge){ge.id="",ge.created="",ge.updated="";const we=(u==null?void 0:u.schema)||[];for(const ct of we)ct.type==="file"&&delete ge[ct.name]}X(),D(ge),await fn(),t(26,T="")}function je(ge){(ge.ctrlKey||ge.metaKey)&&ge.code=="KeyS"&&(ge.preventDefault(),ge.stopPropagation(),K(!1))}const ze=()=>I(),ke=()=>ie(),Ce=()=>ee(),Je=()=>$e(),_t=()=>J(),Ze=()=>t(12,$=ts),We=()=>t(12,$=gl),yt=()=>j(),pe=()=>X();function _e(){m.id=this.value,t(3,m)}function Ye(ge){m=ge,t(3,m)}function Mt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Ie(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function rt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Oe(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function lt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Ot(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Vt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function An(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function In(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Yn(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Kn(ge,we){n.$$.not_equal(y[we.name],ge)&&(y[we.name]=ge,t(4,y))}function kt(ge,we){n.$$.not_equal(S[we.name],ge)&&(S[we.name]=ge,t(5,S))}function un(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}const ti=()=>o&&b?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,b=!1),I()}),!1):(en({}),X(),!0);function as(ge){te[ge?"unshift":"push"](()=>{c=ge,t(8,c)})}function di(ge){Fe.call(this,n,ge)}function Ti(ge){Fe.call(this,n,ge)}return n.$$set=ge=>{"collection"in ge&&t(0,u=ge.collection)},n.$$.update=()=>{var ge;n.$$.dirty[0]&1&&t(13,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(15,s=!!((ge=u==null?void 0:u.schema)!=null&&ge.find(we=>we.type==="editor"))),n.$$.dirty[0]&48&&t(29,l=V.hasNonEmptyProps(y)||V.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(27,C=JSON.stringify(m)),n.$$.dirty[0]&738197504&&t(7,o=l||T!=C),n.$$.dirty[0]&4&&t(6,M=!d||!d.id),n.$$.dirty[0]&192&&t(14,r=M||o),n.$$.dirty[0]&402653184&&E&&q(C)},[u,I,d,m,y,S,M,o,c,_,h,b,$,i,r,s,f,j,X,K,J,ie,ee,$e,je,D,T,C,E,l,ze,ke,Ce,Je,_t,Ze,We,yt,pe,_e,Ye,Mt,Ie,rt,Oe,lt,Ot,Vt,An,In,Yn,Kn,kt,un,ti,as,di,Ti]}class _1 extends ve{constructor(e){super(),be(this,e,vE,bE,me,{collection:0,show:25,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[1]}}function yE(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){w(o,e,r),s||(l=[Te(i=Ve.call(null,e,n[2]?"":"Copy")),Y(e,"click",On(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&jt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,Ee(l)}}}function kE(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(V.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Xt(()=>()=>{r&&clearTimeout(r)}),n.$$set=f=>{"value"in f&&t(4,i=f.value),"idleClasses"in f&&t(0,s=f.idleClasses),"successClasses"in f&&t(1,l=f.successClasses),"successDuration"in f&&t(5,o=f.successDuration)},[s,l,r,a,i,o]}class Dl extends ve{constructor(e){super(),be(this,e,kE,yE,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}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 wm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Sm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function wE(n){const e=n.slice(),t=V.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function SE(n){const e=n.slice(),t=V.toArray(e[3]);e[9]=t;const i=V.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function CE(n){const e=n.slice(),t=V.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function TE(n){let e,t;return{c(){e=v("div"),t=U(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function $E(n){let e,t=V.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=V.truncate(n[3]))},m(l,o){w(l,e,o),g(e,i)},p(l,o){o&8&&t!==(t=V.truncate(l[3])+"")&&se(i,t),o&8&&s!==(s=V.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function ME(n){let e,t=[],i=new Map,s,l,o=n[16].slice(0,n[17]);const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Tm();return{c(){e=v("div");for(let f=0;ff[17]?a||(a=Tm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(f){if(!l){for(let u=0;un[11]&&Em();return{c(){e=v("div"),i.c(),s=O(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),g(e,s),f&&f.m(e,null),l=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(ae(),L(r[d],1,1,()=>{r[d]=null}),fe(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),A(i,1),i.m(e,s)),u[9].length>u[11]?f||(f=Em(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){l||(A(i),l=!0)},o(u){L(i),l=!1},d(u){u&&k(e),r[t].d(),f&&f.d()}}}function OE(n){let e,t=[],i=new Map,s=V.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),fe(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function IE(n){let e,t=V.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=U(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),g(e,i),s||(l=[Te(Ve.call(null,e,"Open in new tab")),Y(e,"click",On(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=V.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,Ee(l)}}}function LE(n){let e,t;return{c(){e=v("span"),t=U(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function PE(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function FE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function NE(n){let e,t,i,s;const l=[HE,zE],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),s=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(ae(),L(o[u],1,1,()=>{o[u]=null}),fe(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function Cm(n,e){let t,i,s;return i=new lf({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),z(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(i,l)}}}function Tm(n){let e;return{c(){e=U("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function RE(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Dm(n);return{c(){e=v("span"),i=U(t),s=O(),r&&r.c(),l=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),g(e,i),w(a,s,f),r&&r.m(a,f),w(a,l,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=V.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,f),f&8&&A(r,1)):(r=Dm(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(ae(),L(r,1,1,()=>{r=null}),fe())},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&k(e),a&&k(s),r&&r.d(a),a&&k(l)}}}function HE(n){let e,t=V.truncate(n[5])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=V.truncate(s[5])+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function Dm(n){let e,t;return e=new Dl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function BE(n){let e,t,i,s,l;const o=[NE,FE,PE,LE,IE,AE,DE,OE,EE,ME,$E,TE],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!V.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?CE(u):c===8?SE(u):c===9?wE(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),s=ye()},m(u,c){r[t].m(u,c),w(u,s,c),l=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(ae(),L(r[d],1,1,()=>{r[d]=null}),fe(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(u){l||(A(i),l=!0)},o(u){L(i),l=!1},d(u){r[t].d(u),u&&k(s)}}}function UE(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Fe.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s[l.name])},[s,l,o,i,r]}class g1 extends ve{constructor(e){super(),be(this,e,UE,BE,me,{record:0,field:1,short:2})}}function Am(n,e,t){const i=n.slice();return i[10]=e[t],i}function Im(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new g1({props:{field:n[10],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=U(i),l=O(),o=v("td"),B(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),g(e,t),g(t,s),g(e,l),g(e,o),z(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[10].name+"")&&se(s,i);const c={};u&1&&(c.field=f[10]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(A(r.$$.fragment,f),a=!0)},o(f){L(r.$$.fragment,f),a=!1},d(f){f&&k(e),H(r)}}}function Lm(n){let e,t,i,s,l,o;return l=new ki({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=O(),s=v("td"),B(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(e,s),z(l,s,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),l.$set(f)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function Pm(n){let e,t,i,s,l,o;return l=new ki({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=O(),s=v("td"),B(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(e,s),z(l,s,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),l.$set(f)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function WE(n){var M;let e,t,i,s,l,o,r,a,f,u,c=n[3].id+"",d,m,_,h,b;a=new Dl({props:{value:n[3].id}});let y=(M=n[0])==null?void 0:M.schema,S=[];for(let E=0;EL(S[E],1,1,()=>{S[E]=null});let C=n[3].created&&Lm(n),$=n[3].updated&&Pm(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=O(),o=v("td"),r=v("div"),B(a.$$.fragment),f=O(),u=v("span"),d=U(c),m=O();for(let E=0;E{C=null}),fe()),E[3].updated?$?($.p(E,D),D&8&&A($,1)):($=Pm(E),$.c(),A($,1),$.m(t,null)):$&&(ae(),L($,1,1,()=>{$=null}),fe())},i(E){if(!b){A(a.$$.fragment,E);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[6]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function JE(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[KE],header:[YE],default:[WE]},$$scope:{ctx:n}};return e=new sn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function ZE(n,e,t){let i,{collection:s}=e,l,o={};function r(m){return t(3,o=m),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const f=()=>a();function u(m){te[m?"unshift":"push"](()=>{l=m,t(2,l)})}function c(m){Fe.call(this,n,m)}function d(m){Fe.call(this,n,m)}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{var m;n.$$.dirty&1&&t(4,i=!!((m=s==null?void 0:s.schema)!=null&&m.find(_=>_.type==="editor")))},[s,a,l,o,i,r,f,u,c,d]}class GE extends ve{constructor(e){super(),be(this,e,ZE,JE,me,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Fm(n,e,t){const i=n.slice();return i[57]=e[t],i}function Nm(n,e,t){const i=n.slice();return i[60]=e[t],i}function Rm(n,e,t){const i=n.slice();return i[60]=e[t],i}function qm(n,e,t){const i=n.slice();return i[53]=e[t],i}function jm(n){let e;function t(l,o){return l[13]?QE:XE}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function XE(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=O(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),g(e,t),g(e,s),g(e,l),o||(r=Y(t,"change",n[30]),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&&k(e),o=!1,r()}}}function QE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Vm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[xE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new rn({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="id",p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function zm(n){let e=!n[6].includes("@username"),t,i=!n[6].includes("@email"),s,l,o=e&&Hm(n),r=i&&Bm(n);return{c(){o&&o.c(),t=O(),r&&r.c(),s=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,s,f),l=!0},p(a,f){f[0]&64&&(e=!a[6].includes("@username")),e?o?(o.p(a,f),f[0]&64&&A(o,1)):(o=Hm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(ae(),L(o,1,1,()=>{o=null}),fe()),f[0]&64&&(i=!a[6].includes("@email")),i?r?(r.p(a,f),f[0]&64&&A(r,1)):(r=Bm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(ae(),L(r,1,1,()=>{r=null}),fe())},i(a){l||(A(o),A(r),l=!0)},o(a){L(o),L(r),l=!1},d(a){o&&o.d(a),a&&k(t),r&&r.d(a),a&&k(s)}}}function Hm(n){let e,t,i;function s(o){n[32](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[eO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new rn({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="username",p(t,"class",V.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function Bm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[tO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new rn({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function tO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="email",p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function nO(n){let e,t,i,s,l,o=n[60].name+"",r;return{c(){e=v("div"),t=v("i"),s=O(),l=v("span"),r=U(o),p(t,"class",i=V.getFieldTypeIcon(n[60].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),g(e,t),g(e,s),g(e,l),g(l,r)},p(a,f){f[0]&524288&&i!==(i=V.getFieldTypeIcon(a[60].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[60].name+"")&&se(r,o)},d(a){a&&k(e)}}}function Um(n,e){let t,i,s,l;function o(a){e[34](a)}let r={class:"col-type-"+e[60].type+" col-field-"+e[60].name,name:e[60].name,$$slots:{default:[nO]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new rn({props:r}),te.push(()=>ce(i,"sort",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),l=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[60].type+" col-field-"+e[60].name),f[0]&524288&&(u.name=e[60].name),f[0]&524288|f[2]&8&&(u.$$scope={dirty:f,ctx:e}),!s&&f[0]&1&&(s=!0,u.sort=e[0],he(()=>s=!1)),i.$set(u)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function Wm(n){let e,t,i;function s(o){n[35](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[iO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new rn({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function iO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function Ym(n){let e,t,i;function s(o){n[36](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[sO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new rn({props:l}),te.push(()=>ce(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function sO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="updated",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function Km(n){let e;return{c(){e=v("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[37](e)},p:x,d(t){t&&k(e),n[37](null)}}}function Jm(n){let e;function t(l,o){return l[13]?oO:lO}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function lO(n){let e,t,i,s,l;function o(f,u){var c;if((c=f[1])!=null&&c.length)return aO;if(!f[11])return rO}let r=o(n),a=r&&r(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=O(),a&&a.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(f,u){w(f,e,u),g(e,t),g(t,i),g(t,s),a&&a.m(t,null),g(e,l)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a&&a.d(1),a=r&&r(f),a&&(a.c(),a.m(t,null)))},d(f){f&&k(e),a&&a.d()}}}function oO(n){let e;return{c(){e=v("tr"),e.innerHTML=` + `},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rO(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` + New record`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[42]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function aO(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[41]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Zm(n){let e,t,i,s,l,o,r,a,f,u;function c(){return n[38](n[57])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=O(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[57].id),i.checked=l=n[5][n[57].id],p(r,"for",a="checkbox_"+n[57].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),f||(u=[Y(i,"change",c),Y(t,"click",On(n[28]))],f=!0)},p(d,m){n=d,m[0]&8&&s!==(s="checkbox_"+n[57].id)&&p(i,"id",s),m[0]&40&&l!==(l=n[5][n[57].id])&&(i.checked=l),m[0]&8&&a!==(a="checkbox_"+n[57].id)&&p(r,"for",a)},d(d){d&&k(e),f=!1,Ee(u)}}}function Gm(n){let e,t,i,s,l,o,r=n[57].id+"",a,f,u;s=new Dl({props:{value:n[57].id}});let c=n[10]&&Xm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),B(s.$$.fragment),l=O(),o=v("div"),a=U(r),f=O(),c&&c.c(),p(o,"class","txt"),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),g(e,t),g(t,i),z(s,i,null),g(i,l),g(i,o),g(o,a),g(t,f),c&&c.m(t,null),u=!0},p(d,m){const _={};m[0]&8&&(_.value=d[57].id),s.$set(_),(!u||m[0]&8)&&r!==(r=d[57].id+"")&&se(a,r),d[10]?c?c.p(d,m):(c=Xm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(A(s.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),u=!1},d(d){d&&k(e),H(s),c&&c.d()}}}function Xm(n){let e;function t(l,o){return l[57].verified?uO:fO}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function fO(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Te(Ve.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function uO(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Te(Ve.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function Qm(n){let e=!n[6].includes("@username"),t,i=!n[6].includes("@email"),s,l=e&&xm(n),o=i&&eh(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&64&&(e=!r[6].includes("@username")),e?l?l.p(r,a):(l=xm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&64&&(i=!r[6].includes("@email")),i?o?o.p(r,a):(o=eh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&k(t),o&&o.d(r),r&&k(s)}}}function xm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!V.isEmpty(o[57].username)),t?dO:cO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function cO(n){let e,t=n[57].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[57].username)},m(l,o){w(l,e,o),g(e,i)},p(l,o){o[0]&8&&t!==(t=l[57].username+"")&&se(i,t),o[0]&8&&s!==(s=l[57].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function dO(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function eh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!V.isEmpty(o[57].email)),t?mO:pO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function pO(n){let e,t=n[57].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[57].email)},m(l,o){w(l,e,o),g(e,i)},p(l,o){o[0]&8&&t!==(t=l[57].email+"")&&se(i,t),o[0]&8&&s!==(s=l[57].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function mO(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function th(n,e){let t,i,s,l;return i=new g1({props:{short:!0,record:e[57],field:e[60]}}),{key:n,first:null,c(){t=v("td"),B(i.$$.fragment),p(t,"class",s="col-type-"+e[60].type+" col-field-"+e[60].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[57]),r[0]&524288&&(a.field=e[60]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[60].type+" col-field-"+e[60].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(i)}}}function nh(n){let e,t,i;return t=new ki({props:{date:n[57].created}}),{c(){e=v("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[57].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function ih(n){let e,t,i;return t=new ki({props:{date:n[57].updated}}),{c(){e=v("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[57].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function sh(n,e){let t,i,s=!e[6].includes("@id"),l,o,r=[],a=new Map,f,u=e[9]&&!e[6].includes("@created"),c,d=e[8]&&!e[6].includes("@updated"),m,_,h,b,y,S,T=!e[11]&&Zm(e),C=s&&Gm(e),$=e[10]&&Qm(e),M=e[19];const E=R=>R[60].name;for(let R=0;R',h=O(),p(_,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(R,N){w(R,t,N),T&&T.m(t,null),g(t,i),C&&C.m(t,null),g(t,l),$&&$.m(t,null),g(t,o);for(let q=0;q{C=null}),fe()),e[10]?$?$.p(e,N):($=Qm(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(M=e[19],ae(),r=bt(r,N,E,1,e,M,a,t,Ut,th,f,Nm),fe()),N[0]&576&&(u=e[9]&&!e[6].includes("@created")),u?D?(D.p(e,N),N[0]&576&&A(D,1)):(D=nh(e),D.c(),A(D,1),D.m(t,c)):D&&(ae(),L(D,1,1,()=>{D=null}),fe()),N[0]&320&&(d=e[8]&&!e[6].includes("@updated")),d?I?(I.p(e,N),N[0]&320&&A(I,1)):(I=ih(e),I.c(),A(I,1),I.m(t,m)):I&&(ae(),L(I,1,1,()=>{I=null}),fe())},i(R){if(!b){A(C);for(let N=0;NZ[60].name;for(let Z=0;ZZ[11]?Z[57]:Z[57].id;for(let Z=0;Z{M=null}),fe()),Z[10]?E?(E.p(Z,X),X[0]&1024&&A(E,1)):(E=zm(Z),E.c(),A(E,1),E.m(i,r)):E&&(ae(),L(E,1,1,()=>{E=null}),fe()),X[0]&524289&&(D=Z[19],ae(),a=bt(a,X,I,1,Z,D,f,i,Ut,Um,u,Rm),fe()),X[0]&576&&(c=Z[9]&&!Z[6].includes("@created")),c?P?(P.p(Z,X),X[0]&576&&A(P,1)):(P=Wm(Z),P.c(),A(P,1),P.m(i,d)):P&&(ae(),L(P,1,1,()=>{P=null}),fe()),X[0]&320&&(m=Z[8]&&!Z[6].includes("@updated")),m?F?(F.p(Z,X),X[0]&320&&A(F,1)):(F=Ym(Z),F.c(),A(F,1),F.m(i,_)):F&&(ae(),L(F,1,1,()=>{F=null}),fe()),Z[16].length?R?R.p(Z,X):(R=Km(Z),R.c(),R.m(h,null)):R&&(R.d(1),R=null),X[0]&9973610&&(N=Z[3],ae(),S=bt(S,X,q,1,Z,N,T,y,Ut,sh,null,Fm),fe(),!N.length&&j?j.p(Z,X):N.length?j&&(j.d(1),j=null):(j=Jm(Z),j.c(),j.m(y,null))),(!C||X[0]&8192)&&Q(e,"table-loading",Z[13])},i(Z){if(!C){A(M),A(E);for(let X=0;X({56:l}),({uniqueId:l})=>[0,l?33554432:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),z(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65600|o[1]&33554432|o[2]&8&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(i,l)}}}function gO(n){let e,t,i=[],s=new Map,l,o,r=n[16];const a=f=>f[53].id+f[53].name;for(let f=0;f{i=null}),fe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function rh(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=v("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&se(s,i),a[0]&16&&se(o,r[4])},d(r){r&&k(e)}}}function ah(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,f;return{c(){e=v("div"),t=v("button"),i=v("span"),s=U("Load more ("),o=U(l),r=U(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[13]),Q(t,"btn-disabled",n[13]),p(e,"class","block txt-center m-t-xs")},m(u,c){w(u,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(f=Y(t,"click",n[43]),a=!0)},p(u,c){c[0]&24&&l!==(l=u[4]-u[3].length+"")&&se(o,l),c[0]&8192&&Q(t,"btn-loading",u[13]),c[0]&8192&&Q(t,"btn-disabled",u[13])},d(u){u&&k(e),a=!1,f()}}}function fh(n){let e,t,i,s,l,o,r=n[7]===1?"record":"records",a,f,u,c,d,m,_,h,b,y,S;return{c(){e=v("div"),t=v("div"),i=U("Selected "),s=v("strong"),l=U(n[7]),o=O(),a=U(r),f=O(),u=v("button"),u.innerHTML='Reset',c=O(),d=v("div"),m=O(),_=v("button"),_.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"),Q(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(_,"type","button"),p(_,"class","btn btn-sm btn-transparent btn-danger"),Q(_,"btn-loading",n[14]),Q(_,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,C){w(T,e,C),g(e,t),g(t,i),g(t,s),g(s,l),g(t,o),g(t,a),g(e,f),g(e,u),g(e,c),g(e,d),g(e,m),g(e,_),b=!0,y||(S=[Y(u,"click",n[44]),Y(_,"click",n[45])],y=!0)},p(T,C){(!b||C[0]&128)&&se(l,T[7]),(!b||C[0]&128)&&r!==(r=T[7]===1?"record":"records")&&se(a,r),(!b||C[0]&16384)&&Q(u,"btn-disabled",T[14]),(!b||C[0]&16384)&&Q(_,"btn-loading",T[14]),(!b||C[0]&16384)&&Q(_,"btn-disabled",T[14])},i(T){b||(T&&Ge(()=>{b&&(h||(h=qe(e,fi,{duration:150,y:5},!0)),h.run(1))}),b=!0)},o(T){T&&(h||(h=qe(e,fi,{duration:150,y:5},!1)),h.run(0)),b=!1},d(T){T&&k(e),T&&h&&h.end(),y=!1,Ee(S)}}}function vO(n){let e,t,i,s,l,o;e=new Aa({props:{class:"table-wrapper",$$slots:{before:[bO],default:[hO]},$$scope:{ctx:n}}});let r=n[3].length&&rh(n),a=n[3].length&&n[18]&&ah(n),f=n[7]&&fh(n);return{c(){B(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),s=O(),f&&f.c(),l=ye()},m(u,c){z(e,u,c),w(u,t,c),r&&r.m(u,c),w(u,i,c),a&&a.m(u,c),w(u,s,c),f&&f.m(u,c),w(u,l,c),o=!0},p(u,c){const d={};c[0]&765803|c[2]&8&&(d.$$scope={dirty:c,ctx:u}),e.$set(d),u[3].length?r?r.p(u,c):(r=rh(u),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),u[3].length&&u[18]?a?a.p(u,c):(a=ah(u),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),u[7]?f?(f.p(u,c),c[0]&128&&A(f,1)):(f=fh(u),f.c(),A(f,1),f.m(l.parentNode,l)):f&&(ae(),L(f,1,1,()=>{f=null}),fe())},i(u){o||(A(e.$$.fragment,u),A(f),o=!0)},o(u){L(e.$$.fragment,u),L(f),o=!1},d(u){H(e,u),u&&k(t),r&&r.d(u),u&&k(i),a&&a.d(u),u&&k(s),f&&f.d(u),u&&k(l)}}}const yO=/^([\+\-])?(\w+)$/;function kO(n,e,t){let i,s,l,o,r,a,f,u,c,d;const m=$t();let{collection:_}=e,{sort:h=""}=e,{filter:b=""}=e,y=[],S=1,T=0,C={},$=!0,M=!1,E=0,D,I=[],P=[];function F(){_!=null&&_.id&&localStorage.setItem((_==null?void 0:_.id)+"@hiddenCollumns",JSON.stringify(I))}function R(){if(t(6,I=[]),!!(_!=null&&_.id))try{const Oe=localStorage.getItem(_.id+"@hiddenCollumns");Oe&&t(6,I=JSON.parse(Oe)||[])}catch{}}async function N(){const Oe=S;for(let lt=1;lt<=Oe;lt++)(lt===1||a)&&await q(lt,!1)}async function q(Oe=1,lt=!0){var Yn,Kn;if(!(_!=null&&_.id))return;t(13,$=!0);let Ot=h;const Vt=Ot.match(yO),An=Vt?o.find(kt=>kt.name===Vt[2]):null;if(Vt&&((Kn=(Yn=An==null?void 0:An.options)==null?void 0:Yn.displayFields)==null?void 0:Kn.length)>0){const kt=[];for(const un of An.options.displayFields)kt.push((Vt[1]||"")+Vt[2]+"."+un);Ot=kt.join(",")}const In=V.getAllCollectionIdentifiers(_);return ue.collection(_.id).getList(Oe,30,{sort:Ot,filter:V.normalizeSearchFilter(b,In),expand:o.map(kt=>kt.name).join(","),$cancelKey:"records_list"}).then(async kt=>{var un;if(Oe<=1&&j(),t(13,$=!1),t(12,S=kt.page),t(4,T=kt.totalItems),m("load",y.concat(kt.items)),lt){const ti=++E;for(;(un=kt.items)!=null&&un.length&&E==ti;)t(3,y=y.concat(kt.items.splice(0,15))),await V.yieldToMain()}else t(3,y=y.concat(kt.items))}).catch(kt=>{kt!=null&&kt.isAbort||(t(13,$=!1),console.warn(kt),j(),ue.error(kt,!1))})}function j(){t(3,y=[]),t(12,S=1),t(4,T=0),t(5,C={})}function Z(){u?X():K()}function X(){t(5,C={})}function K(){for(const Oe of y)t(5,C[Oe.id]=Oe,C);t(5,C)}function J(Oe){C[Oe.id]?delete C[Oe.id]:t(5,C[Oe.id]=Oe,C),t(5,C)}function le(){pn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ie)}async function ie(){if(M||!f||!(_!=null&&_.id))return;let Oe=[];for(const lt of Object.keys(C))Oe.push(ue.collection(_.id).delete(lt));return t(14,M=!0),Promise.all(Oe).then(()=>{Ht(`Successfully deleted the selected ${f===1?"record":"records"}.`),X()}).catch(lt=>{ue.error(lt)}).finally(()=>(t(14,M=!1),N()))}function ee(Oe){Fe.call(this,n,Oe)}const $e=(Oe,lt)=>{lt.target.checked?V.removeByValue(I,Oe.id):V.pushUnique(I,Oe.id),t(6,I)},Pe=()=>Z();function je(Oe){h=Oe,t(0,h)}function ze(Oe){h=Oe,t(0,h)}function ke(Oe){h=Oe,t(0,h)}function Ce(Oe){h=Oe,t(0,h)}function Je(Oe){h=Oe,t(0,h)}function _t(Oe){h=Oe,t(0,h)}function Ze(Oe){te[Oe?"unshift":"push"](()=>{D=Oe,t(15,D)})}const We=Oe=>J(Oe),yt=Oe=>m("select",Oe),pe=(Oe,lt)=>{lt.code==="Enter"&&(lt.preventDefault(),m("select",Oe))},_e=()=>t(1,b=""),Ye=()=>m("new"),Mt=()=>q(S+1),Ie=()=>X(),rt=()=>le();return n.$$set=Oe=>{"collection"in Oe&&t(25,_=Oe.collection),"sort"in Oe&&t(0,h=Oe.sort),"filter"in Oe&&t(1,b=Oe.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(R(),j()),n.$$.dirty[0]&33554432&&t(11,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(10,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(27,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&134217728&&(o=l.filter(Oe=>Oe.type==="relation")),n.$$.dirty[0]&134217792&&t(19,r=l.filter(Oe=>!I.includes(Oe.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&h!==-1&&b!==-1&&q(1),n.$$.dirty[0]&24&&t(18,a=T>y.length),n.$$.dirty[0]&32&&t(7,f=Object.keys(C).length),n.$$.dirty[0]&136&&t(17,u=y.length&&f===y.length),n.$$.dirty[0]&64&&I!==-1&&F(),n.$$.dirty[0]&2056&&t(9,c=!i||y.length>0&&y[0].created!=""),n.$$.dirty[0]&2056&&t(8,d=!i||y.length>0&&y[0].updated!=""),n.$$.dirty[0]&134219520&&t(16,P=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Oe=>({id:Oe.id,name:Oe.name})),c?{id:"@created",name:"created"}:[],d?{id:"@updated",name:"updated"}:[]))},[h,b,q,y,T,C,I,f,d,c,s,i,S,$,M,D,P,u,a,r,m,Z,X,J,le,_,N,l,ee,$e,Pe,je,ze,ke,Ce,Je,_t,Ze,We,yt,pe,_e,Ye,Mt,Ie,rt]}class wO extends ve{constructor(e){super(),be(this,e,kO,vO,me,{collection:25,sort:0,filter:1,reloadLoadedPages:26,load:2},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[26]}get load(){return this.$$.ctx[2]}}function SO(n){let e,t,i,s;return e=new gM({}),i=new kn({props:{$$slots:{default:[$O]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&16&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function CO(n){let e,t;return e=new kn({props:{center:!0,$$slots:{default:[OO]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&16&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function TO(n){let e,t;return e=new kn({props:{center:!0,$$slots:{default:[DO]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s[1]&16&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function uh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Te(Ve.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[15])],t=!0)},p:x,d(s){s&&k(e),t=!1,Ee(i)}}}function ch(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` + New record`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function $O(n){let e,t,i,s,l,o=n[2].name+"",r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E,D,I,P,F=!n[10]&&uh(n);c=new Wo({}),c.$on("refresh",n[16]);let R=n[2].type!=="view"&&ch(n);y=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function N(Z){n[21](Z)}function q(Z){n[22](Z)}let j={collection:n[2]};return n[0]!==void 0&&(j.filter=n[0]),n[1]!==void 0&&(j.sort=n[1]),$=new wO({props:j}),n[20]($),te.push(()=>ce($,"filter",N)),te.push(()=>ce($,"sort",q)),$.$on("select",n[23]),$.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=O(),l=v("div"),r=U(o),a=O(),f=v("div"),F&&F.c(),u=O(),B(c.$$.fragment),d=O(),m=v("div"),_=v("button"),_.innerHTML=` + API Preview`,h=O(),R&&R.c(),b=O(),B(y.$$.fragment),S=O(),T=v("div"),C=O(),B($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(_,"type","button"),p(_,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-base")},m(Z,X){w(Z,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,f),F&&F.m(f,null),g(f,u),z(c,f,null),g(e,d),g(e,m),g(m,_),g(m,h),R&&R.m(m,null),w(Z,b,X),z(y,Z,X),w(Z,S,X),w(Z,T,X),w(Z,C,X),z($,Z,X),D=!0,I||(P=Y(_,"click",n[17]),I=!0)},p(Z,X){(!D||X[0]&4)&&o!==(o=Z[2].name+"")&&se(r,o),Z[10]?F&&(F.d(1),F=null):F?F.p(Z,X):(F=uh(Z),F.c(),F.m(f,u)),Z[2].type!=="view"?R?R.p(Z,X):(R=ch(Z),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const K={};X[0]&1&&(K.value=Z[0]),X[0]&4&&(K.autocompleteCollection=Z[2]),y.$set(K);const J={};X[0]&4&&(J.collection=Z[2]),!M&&X[0]&1&&(M=!0,J.filter=Z[0],he(()=>M=!1)),!E&&X[0]&2&&(E=!0,J.sort=Z[1],he(()=>E=!1)),$.$set(J)},i(Z){D||(A(c.$$.fragment,Z),A(y.$$.fragment,Z),A($.$$.fragment,Z),D=!0)},o(Z){L(c.$$.fragment,Z),L(y.$$.fragment,Z),L($.$$.fragment,Z),D=!1},d(Z){Z&&k(e),F&&F.d(),H(c),R&&R.d(),Z&&k(b),H(y,Z),Z&&k(S),Z&&k(T),Z&&k(C),n[20](null),H($,Z),I=!1,P()}}}function MO(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=O(),i=v("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),s||(l=Y(i,"click",n[14]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function EO(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function OO(n){let e,t,i;function s(r,a){return r[10]?EO:MO}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("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),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function DO(n){let e;return{c(){e=v("div"),e.innerHTML=` +

    Loading collections...

    `,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function AO(n){let e,t,i,s,l,o,r,a,f,u,c;const d=[TO,CO,SO],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=d[e](n);let h={};s=new sf({props:h}),n[25](s);let b={};o=new TM({props:b}),n[26](o);let y={collection:n[2]};a=new _1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let S={collection:n[2]};return u=new GE({props:S}),n[30](u),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),B(u.$$.fragment)},m(T,C){m[e].m(T,C),w(T,i,C),z(s,T,C),w(T,l,C),z(o,T,C),w(T,r,C),z(a,T,C),w(T,f,C),z(u,T,C),c=!0},p(T,C){let $=e;e=_(T),e===$?m[e].p(T,C):(ae(),L(m[$],1,1,()=>{m[$]=null}),fe(),t=m[e],t?t.p(T,C):(t=m[e]=d[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const E={};o.$set(E);const D={};C[0]&4&&(D.collection=T[2]),a.$set(D);const I={};C[0]&4&&(I.collection=T[2]),u.$set(I)},i(T){c||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!0)},o(T){L(t),L(s.$$.fragment,T),L(o.$$.fragment,T),L(a.$$.fragment,T),L(u.$$.fragment,T),c=!1},d(T){m[e].d(T),T&&k(i),n[25](null),H(s,T),T&&k(l),n[26](null),H(o,T),T&&k(r),n[27](null),H(a,T),T&&k(f),n[30](null),H(u,T)}}}function IO(n,e,t){let i,s,l,o,r,a,f;Ke(n,yi,ee=>t(2,s=ee)),Ke(n,Dt,ee=>t(31,l=ee)),Ke(n,go,ee=>t(3,o=ee)),Ke(n,ga,ee=>t(13,r=ee)),Ke(n,ui,ee=>t(9,a=ee)),Ke(n,$s,ee=>t(10,f=ee));const u=new URLSearchParams(r);let c,d,m,_,h,b=u.get("filter")||"",y=u.get("sort")||"-created",S=u.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,S=s==null?void 0:s.id),t(0,b=""),t(1,y="-created"),C()}async function C(){if(!y)return;const ee=V.getAllCollectionIdentifiers(s),$e=y.split(",").map(Pe=>Pe.startsWith("+")||Pe.startsWith("-")?Pe.substring(1):Pe);$e.filter(Pe=>ee.includes(Pe)).length!=$e.length&&(ee.includes("created")?t(1,y="-created"):t(1,y=""))}Ty(S);const $=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),E=()=>h==null?void 0:h.load(),D=()=>d==null?void 0:d.show(s),I=()=>m==null?void 0:m.show(),P=ee=>t(0,b=ee.detail);function F(ee){te[ee?"unshift":"push"](()=>{h=ee,t(8,h)})}function R(ee){b=ee,t(0,b)}function N(ee){y=ee,t(1,y)}const q=ee=>{s.type==="view"?_.show(ee==null?void 0:ee.detail):m==null||m.show(ee==null?void 0:ee.detail)},j=()=>m==null?void 0:m.show();function Z(ee){te[ee?"unshift":"push"](()=>{c=ee,t(4,c)})}function X(ee){te[ee?"unshift":"push"](()=>{d=ee,t(5,d)})}function K(ee){te[ee?"unshift":"push"](()=>{m=ee,t(6,m)})}const J=()=>h==null?void 0:h.reloadLoadedPages(),le=()=>h==null?void 0:h.reloadLoadedPages();function ie(ee){te[ee?"unshift":"push"](()=>{_=ee,t(7,_)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=S&&wy(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&S!=s.id&&T(),n.$$.dirty[0]&4&&s!=null&&s.id&&C(),n.$$.dirty[0]&7&&(y||b||s!=null&&s.id)){const ee=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:y}).toString();Ri("/collections?"+ee)}n.$$.dirty[0]&4&&nn(Dt,l=(s==null?void 0:s.name)||"Collections",l)},[b,y,s,o,c,d,m,_,h,a,f,S,i,r,$,M,E,D,I,P,F,R,N,q,j,Z,X,K,J,le,ie]}class LO extends ve{constructor(e){super(),be(this,e,IO,AO,me,{},null,[-1,-1])}}function PO(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E,D,I,P,F;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=O(),l=v("a"),l.innerHTML=` + Application`,o=O(),r=v("a"),r.innerHTML=` + Mail settings`,a=O(),f=v("a"),f.innerHTML=` + Files storage`,u=O(),c=v("a"),c.innerHTML=` + Backups`,d=O(),m=v("div"),m.innerHTML='Sync',_=O(),h=v("a"),h.innerHTML=` + Export collections`,b=O(),y=v("a"),y.innerHTML=` + Import collections`,S=O(),T=v("div"),T.textContent="Authentication",C=O(),$=v("a"),$.innerHTML=` + Auth providers`,M=O(),E=v("a"),E.innerHTML=` + Token options`,D=O(),I=v("a"),I.innerHTML=` + Admins`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(f,"href","/settings/storage"),p(f,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p(T,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(E,"href","/settings/tokens"),p(E,"class","sidebar-list-item"),p(I,"href","/settings/admins"),p(I,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(R,N){w(R,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,f),g(t,u),g(t,c),g(t,d),g(t,m),g(t,_),g(t,h),g(t,b),g(t,y),g(t,S),g(t,T),g(t,C),g(t,$),g(t,M),g(t,E),g(t,D),g(t,I),P||(F=[Te(qn.call(null,l,{path:"/settings"})),Te(ln.call(null,l)),Te(qn.call(null,r,{path:"/settings/mail/?.*"})),Te(ln.call(null,r)),Te(qn.call(null,f,{path:"/settings/storage/?.*"})),Te(ln.call(null,f)),Te(qn.call(null,c,{path:"/settings/backups/?.*"})),Te(ln.call(null,c)),Te(qn.call(null,h,{path:"/settings/export-collections/?.*"})),Te(ln.call(null,h)),Te(qn.call(null,y,{path:"/settings/import-collections/?.*"})),Te(ln.call(null,y)),Te(qn.call(null,$,{path:"/settings/auth-providers/?.*"})),Te(ln.call(null,$)),Te(qn.call(null,E,{path:"/settings/tokens/?.*"})),Te(ln.call(null,E)),Te(qn.call(null,I,{path:"/settings/admins/?.*"})),Te(ln.call(null,I))],P=!0)},p:x,i:x,o:x,d(R){R&&k(e),P=!1,Ee(F)}}}class Ci extends ve{constructor(e){super(),be(this,e,null,PO,me,{})}}function dh(n,e,t){const i=n.slice();return i[31]=e[t],i}function ph(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[FO,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function FO(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="id",o=O(),r=v("div"),a=v("i"),u=O(),c=v("input"),p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[30]),c.value=m=n[1].id,c.readOnly=!0},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),w(b,r,y),g(r,a),w(b,u,y),w(b,c,y),_||(h=Te(f=Ve.call(null,a,{text:`Created: ${n[1].created} +Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(b,y){y[0]&1073741824&&l!==(l=b[30])&&p(e,"for",l),f&&jt(f.update)&&y[0]&2&&f.update.call(null,{text:`Created: ${b[1].created} +Updated: ${b[1].updated}`,position:"left"}),y[0]&1073741824&&d!==(d=b[30])&&p(c,"id",d),y[0]&2&&m!==(m=b[1].id)&&c.value!==m&&(c.value=m)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(c),_=!1,h()}}}function mh(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=O(),hn(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",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,u){w(f,e,u),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,r()}}}function NO(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Email",o=O(),r=v("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=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),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[3]),f||(u=Y(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),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&&k(e),c&&k(o),c&&k(r),f=!1,u()}}}function hh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[RO,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function RO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(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(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function _h(n){let e,t,i,s,l,o,r,a,f;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[qO,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[jO,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=O(),o=v("div"),B(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),g(e,t),g(t,i),z(s,i,null),g(t,l),g(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),s.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(A(s.$$.fragment,u),A(r.$$.fragment,u),u&&Ge(()=>{f&&(a||(a=qe(t,st,{duration:150},!0)),a.run(1))}),f=!0)},o(u){L(s.$$.fragment,u),L(r.$$.fragment,u),u&&(a||(a=qe(t,st,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&k(e),H(s),H(r),u&&a&&a.end()}}}function qO(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password",o=O(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[9]),f||(u=Y(r,"input",n[21]),f=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&re(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),f=!1,u()}}}function jO(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password confirm",o=O(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[10]),f||(u=Y(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),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&&k(e),c&&k(o),c&&k(r),f=!1,u()}}}function VO(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_=!n[5]&&ph(n),h=[0,1,2,3,4,5,6,7,8,9],b=[];for(let T=0;T<10;T+=1)b[T]=mh(dh(n,h,T));a=new de({props:{class:"form-field required",name:"email",$$slots:{default:[NO,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&hh(n),S=(n[5]||n[4])&&_h(n);return{c(){e=v("form"),_&&_.c(),t=O(),i=v("div"),s=v("p"),s.textContent="Avatar",l=O(),o=v("div");for(let T=0;T<10;T+=1)b[T].c();r=O(),B(a.$$.fragment),f=O(),y&&y.c(),u=O(),S&&S.c(),p(s,"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,C){w(T,e,C),_&&_.m(e,null),g(e,t),g(e,i),g(i,s),g(i,l),g(i,o);for(let $=0;$<10;$+=1)b[$]&&b[$].m(o,null);g(e,r),z(a,e,null),g(e,f),y&&y.m(e,null),g(e,u),S&&S.m(e,null),c=!0,d||(m=Y(e,"submit",Qe(n[13])),d=!0)},p(T,C){if(T[5]?_&&(ae(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(T,C),C[0]&32&&A(_,1)):(_=ph(T),_.c(),A(_,1),_.m(e,t)),C[0]&4){h=[0,1,2,3,4,5,6,7,8,9];let M;for(M=0;M<10;M+=1){const E=dh(T,h,M);b[M]?b[M].p(E,C):(b[M]=mh(E),b[M].c(),b[M].m(o,null))}for(;M<10;M+=1)b[M].d(1)}const $={};C[0]&1073741832|C[1]&8&&($.$$scope={dirty:C,ctx:T}),a.$set($),T[5]?y&&(ae(),L(y,1,1,()=>{y=null}),fe()):y?(y.p(T,C),C[0]&32&&A(y,1)):(y=hh(T),y.c(),A(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,C),C[0]&48&&A(S,1)):(S=_h(T),S.c(),A(S,1),S.m(e,null)):S&&(ae(),L(S,1,1,()=>{S=null}),fe())},i(T){c||(A(_),A(a.$$.fragment,T),A(y),A(S),c=!0)},o(T){L(_),L(a.$$.fragment,T),L(y),L(S),c=!1},d(T){T&&k(e),_&&_.d(),ht(b,T),H(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function zO(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=U(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&se(i,t)},d(s){s&&k(e)}}}function gh(n){let e,t,i,s,l,o,r,a,f;return o=new Wn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[HO]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=O(),s=v("i"),l=O(),B(o.$$.fragment),r=O(),a=v("div"),p(s,"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),g(e,t),g(e,i),g(e,s),g(e,l),z(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||(A(o.$$.fragment,u),f=!0)},o(u){L(o.$$.fragment,u),f=!1},d(u){u&&k(e),H(o),u&&k(r),u&&k(a)}}}function HO(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` + Delete`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function BO(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&gh(n);return{c(){m&&m.c(),e=O(),t=v("button"),i=v("span"),i.textContent="Cancel",s=O(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=f=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(_,h){m&&m.m(_,h),w(_,e,h),w(_,t,h),g(t,i),w(_,s,h),w(_,l,h),g(l,o),g(o,a),u=!0,c||(d=Y(t,"click",n[17]),c=!0)},p(_,h){_[5]?m&&(ae(),L(m,1,1,()=>{m=null}),fe()):m?(m.p(_,h),h[0]&32&&A(m,1)):(m=gh(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!u||h[0]&128)&&(t.disabled=_[7]),(!u||h[0]&32)&&r!==(r=_[5]?"Create":"Save changes")&&se(a,r),(!u||h[0]&2176&&f!==(f=!_[11]||_[7]))&&(l.disabled=f),(!u||h[0]&128)&&Q(l,"btn-loading",_[7])},i(_){u||(A(m),u=!0)},o(_){L(m),u=!1},d(_){m&&m.d(_),_&&k(e),_&&k(t),_&&k(s),_&&k(l),c=!1,d()}}}function UO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[BO],header:[zO],default:[VO]},$$scope:{ctx:n}};return e=new sn({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),H(e,s)}}}function WO(n,e,t){let i,s;const l=$t(),o="admin_"+V.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",_="",h=!1;function b(X){return S(X),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),T()}function T(){t(4,h=!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,_=""),en({})}function C(){if(f||!s)return;t(7,f=!0);const X={email:d,avatar:c};(i||h)&&(X.password=m,X.passwordConfirm=_);let K;i?K=ue.admins.create(X):K=ue.admins.update(a.id,X),K.then(async J=>{var le;t(8,u=!1),y(),Ht(i?"Successfully created admin.":"Successfully updated admin."),((le=ue.authStore.model)==null?void 0:le.id)===J.id&&ue.authStore.save(ue.authStore.token,J),l("save",J)}).catch(J=>{ue.error(J)}).finally(()=>{t(7,f=!1)})}function $(){a!=null&&a.id&&pn("Do you really want to delete the selected admin?",()=>ue.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Ht("Successfully deleted admin."),l("delete",a)}).catch(X=>{ue.error(X)}))}const M=()=>$(),E=()=>y(),D=X=>t(2,c=X);function I(){d=this.value,t(3,d)}function P(){h=this.checked,t(4,h)}function F(){m=this.value,t(9,m)}function R(){_=this.value,t(10,_)}const N=()=>s&&u?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function j(X){Fe.call(this,n,X)}function Z(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||h||d!==a.email||c!==a.avatar)},[y,a,c,d,h,i,r,f,u,m,_,s,o,C,$,b,M,E,D,I,P,F,R,N,q,j,Z]}class YO extends ve{constructor(e){super(),be(this,e,WO,UO,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 KO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="id",p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function JO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="email",p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function ZO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function GO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),s.textContent="updated",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function vh(n){let e;function t(l,o){return l[5]?QO:XO}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function XO(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&yh(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=yh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function QO(n){let e;return{c(){e=v("tr"),e.innerHTML=` + `},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function kh(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wh(n,e){let t,i,s,l,o,r,a,f,u,c,d,m=e[24].id+"",_,h,b,y,S,T=e[24].email+"",C,$,M,E,D,I,P,F,R,N,q,j,Z,X;u=new Dl({props:{value:e[24].id}});let K=e[24].id===e[7].id&&kh();D=new ki({props:{date:e[24].created}}),F=new ki({props:{date:e[24].updated}});function J(){return e[15](e[24])}function le(...ie){return e[16](e[24],...ie)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=O(),a=v("td"),f=v("div"),B(u.$$.fragment),c=O(),d=v("span"),_=U(m),h=O(),K&&K.c(),b=O(),y=v("td"),S=v("span"),C=U(T),M=O(),E=v("td"),B(D.$$.fragment),I=O(),P=v("td"),B(F.$$.fragment),R=O(),N=v("td"),N.innerHTML='',q=O(),hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"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",$=e[24].email),p(y,"class","col-type-email col-field-email"),p(E,"class","col-type-date col-field-created"),p(P,"class","col-type-date col-field-updated"),p(N,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ie,ee){w(ie,t,ee),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,f),z(u,f,null),g(f,c),g(f,d),g(d,_),g(a,h),K&&K.m(a,null),g(t,b),g(t,y),g(y,S),g(S,C),g(t,M),g(t,E),z(D,E,null),g(t,I),g(t,P),z(F,P,null),g(t,R),g(t,N),g(t,q),j=!0,Z||(X=[Y(t,"click",J),Y(t,"keydown",le)],Z=!0)},p(ie,ee){e=ie,(!j||ee&16&&!hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const $e={};ee&16&&($e.value=e[24].id),u.$set($e),(!j||ee&16)&&m!==(m=e[24].id+"")&&se(_,m),e[24].id===e[7].id?K||(K=kh(),K.c(),K.m(a,null)):K&&(K.d(1),K=null),(!j||ee&16)&&T!==(T=e[24].email+"")&&se(C,T),(!j||ee&16&&$!==($=e[24].email))&&p(S,"title",$);const Pe={};ee&16&&(Pe.date=e[24].created),D.$set(Pe);const je={};ee&16&&(je.date=e[24].updated),F.$set(je)},i(ie){j||(A(u.$$.fragment,ie),A(D.$$.fragment,ie),A(F.$$.fragment,ie),j=!0)},o(ie){L(u.$$.fragment,ie),L(D.$$.fragment,ie),L(F.$$.fragment,ie),j=!1},d(ie){ie&&k(t),H(u),K&&K.d(),H(D),H(F),Z=!1,Ee(X)}}}function xO(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$=[],M=new Map,E;function D(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[KO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new rn({props:I}),te.push(()=>ce(o,"sort",D));function P(J){n[12](J)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[JO]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new rn({props:F}),te.push(()=>ce(f,"sort",P));function R(J){n[13](J)}let N={class:"col-type-date col-field-created",name:"created",$$slots:{default:[ZO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),d=new rn({props:N}),te.push(()=>ce(d,"sort",R));function q(J){n[14](J)}let j={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[GO]},$$scope:{ctx:n}};n[2]!==void 0&&(j.sort=n[2]),h=new rn({props:j}),te.push(()=>ce(h,"sort",q));let Z=n[4];const X=J=>J[24].id;for(let J=0;Jr=!1)),o.$set(ie);const ee={};le&134217728&&(ee.$$scope={dirty:le,ctx:J}),!u&&le&4&&(u=!0,ee.sort=J[2],he(()=>u=!1)),f.$set(ee);const $e={};le&134217728&&($e.$$scope={dirty:le,ctx:J}),!m&&le&4&&(m=!0,$e.sort=J[2],he(()=>m=!1)),d.$set($e);const Pe={};le&134217728&&(Pe.$$scope={dirty:le,ctx:J}),!b&&le&4&&(b=!0,Pe.sort=J[2],he(()=>b=!1)),h.$set(Pe),le&186&&(Z=J[4],ae(),$=bt($,le,X,1,J,Z,M,C,Ut,wh,null,bh),fe(),!Z.length&&K?K.p(J,le):Z.length?K&&(K.d(1),K=null):(K=vh(J),K.c(),K.m(C,null))),(!E||le&32)&&Q(e,"table-loading",J[5])},i(J){if(!E){A(o.$$.fragment,J),A(f.$$.fragment,J),A(d.$$.fragment,J),A(h.$$.fragment,J);for(let le=0;le + New admin`,m=O(),B(_.$$.fragment),h=O(),b=v("div"),y=O(),B(S.$$.fragment),T=O(),D&&D.c(),C=ye(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(b,"class","clearfix m-b-base")},m(I,P){w(I,e,P),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),z(a,e,null),g(e,f),g(e,u),g(e,c),g(e,d),w(I,m,P),z(_,I,P),w(I,h,P),w(I,b,P),w(I,y,P),z(S,I,P),w(I,T,P),D&&D.m(I,P),w(I,C,P),$=!0,M||(E=Y(d,"click",n[9]),M=!0)},p(I,P){(!$||P&64)&&se(o,I[6]);const F={};P&2&&(F.value=I[1]),_.$set(F);const R={};P&134217918&&(R.$$scope={dirty:P,ctx:I}),S.$set(R),I[4].length?D?D.p(I,P):(D=Sh(I),D.c(),D.m(C.parentNode,C)):D&&(D.d(1),D=null)},i(I){$||(A(a.$$.fragment,I),A(_.$$.fragment,I),A(S.$$.fragment,I),$=!0)},o(I){L(a.$$.fragment,I),L(_.$$.fragment,I),L(S.$$.fragment,I),$=!1},d(I){I&&k(e),H(a),I&&k(m),H(_,I),I&&k(h),I&&k(b),I&&k(y),H(S,I),I&&k(T),D&&D.d(I),I&&k(C),M=!1,E()}}}function tD(n){let e,t,i,s,l,o;e=new Ci({}),i=new kn({props:{$$slots:{default:[eD]},$$scope:{ctx:n}}});let r={};return l=new YO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,s,f),z(l,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[18](null),H(l,a)}}}function nD(n,e,t){let i,s,l;Ke(n,ga,F=>t(21,i=F)),Ke(n,Dt,F=>t(6,s=F)),Ke(n,Oa,F=>t(7,l=F)),nn(Dt,s="Admins",s);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=V.normalizeSearchFilter(u,["id","email","created","updated"]);return ue.admins.getFullList(100,{sort:c||"-created",filter:F}).then(R=>{t(4,a=R),t(5,f=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,f=!1),console.warn(R),m(),ue.error(R,!1))})}function m(){t(4,a=[])}const _=()=>d(),h=()=>r==null?void 0:r.show(),b=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 C(F){c=F,t(2,c)}const $=F=>r==null?void 0:r.show(F),M=(F,R)=>{(R.code==="Enter"||R.code==="Space")&&(R.preventDefault(),r==null||r.show(F))},E=()=>t(1,u="");function D(F){te[F?"unshift":"push"](()=>{r=F,t(3,r)})}const I=()=>d(),P=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();Ri("/settings/admins?"+F),d()}},[d,u,c,r,a,f,s,l,_,h,b,y,S,T,C,$,M,E,D,I,P]}class iD extends ve{constructor(e){super(),be(this,e,nD,tD,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function sD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=O(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0]),l.focus(),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0]&&re(l,f[0])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function lD(n){let e,t,i,s,l,o,r,a,f,u,c;return{c(){e=v("label"),t=U("Password"),s=O(),l=v("input"),r=O(),a=v("div"),f=v("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.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),g(e,t),w(d,s,m),w(d,l,m),re(l,n[1]),w(d,r,m),w(d,a,m),g(a,f),u||(c=[Y(l,"input",n[5]),Te(ln.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(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),u=!1,Ee(c)}}}function oD(n){let e,t,i,s,l,o,r,a,f,u,c;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[sD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[lD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=O(),B(s.$$.fragment),l=O(),B(o.$$.fragment),r=O(),a=v("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"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),g(e,t),g(e,i),z(s,e,null),g(e,l),z(o,e,null),g(e,r),g(e,a),f=!0,u||(c=Y(e,"submit",Qe(n[3])),u=!0)},p(d,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:d}),s.$set(_);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!f||m&4)&&Q(a,"btn-disabled",d[2]),(!f||m&4)&&Q(a,"btn-loading",d[2])},i(d){f||(A(s.$$.fragment,d),A(o.$$.fragment,d),f=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),f=!1},d(d){d&&k(e),H(s),H(o),u=!1,c()}}}function rD(n){let e,t;return e=new fb({props:{$$slots:{default:[oD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function aD(n,e,t){let i;Ke(n,ga,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ue.admins.authWithPassword(l,o).then(()=>{Ma(),Ri("/")}).catch(()=>{Ts("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){l=this.value,t(0,l)}function u(){o=this.value,t(1,o)}return[l,o,r,a,f,u]}class fD extends ve{constructor(e){super(),be(this,e,aD,rD,me,{})}}function uD(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[dD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[pD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[mD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[hD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Ch(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),B(u.$$.fragment),c=O(),d=v("div"),m=v("div"),_=O(),M&&M.c(),h=O(),b=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=S=!n[3]||n[2],Q(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(E,D){w(E,e,D),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),g(e,r),z(a,e,null),g(e,f),z(u,e,null),g(e,c),g(e,d),g(d,m),g(d,_),M&&M.m(d,null),g(d,h),g(d,b),g(b,y),T=!0,C||($=Y(b,"click",n[13]),C=!0)},p(E,D){const I={};D&1572865&&(I.$$scope={dirty:D,ctx:E}),i.$set(I);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:E}),o.$set(P);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:E}),a.$set(F);const R={};D&1572865&&(R.$$scope={dirty:D,ctx:E}),u.$set(R),E[3]?M?M.p(E,D):(M=Ch(E),M.c(),M.m(d,h)):M&&(M.d(1),M=null),(!T||D&12&&S!==(S=!E[3]||E[2]))&&(b.disabled=S),(!T||D&4)&&Q(b,"btn-loading",E[2])},i(E){T||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(a.$$.fragment,E),A(u.$$.fragment,E),T=!0)},o(E){L(i.$$.fragment,E),L(o.$$.fragment,E),L(a.$$.fragment,E),L(u.$$.fragment,E),T=!1},d(E){E&&k(e),H(i),H(o),H(a),H(u),M&&M.d(),C=!1,$()}}}function cD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function dD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=O(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(f,u){u&524288&&i!==(i=f[19])&&p(e,"for",i),u&524288&&o!==(o=f[19])&&p(l,"id",o),u&1&&l.value!==f[0].meta.appName&&re(l,f[0].meta.appName)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function pD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application URL"),s=O(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(f,u){u&524288&&i!==(i=f[19])&&p(e,"for",i),u&524288&&o!==(o=f[19])&&p(l,"id",o),u&1&&l.value!==f[0].meta.appUrl&&re(l,f[0].meta.appUrl)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Logs max days retention"),s=O(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(f,u){u&524288&&i!==(i=f[19])&&p(e,"for",i),u&524288&&o!==(o=f[19])&&p(l,"id",o),u&1&&pt(l.value)!==f[0].logs.maxDays&&re(l,f[0].logs.maxDays)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function hD(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=O(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),f||(u=[Y(e,"change",n[11]),Te(Ve.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,Ee(u)}}}function Ch(n){let e,t,i,s;return{c(){e=v("button"),t=v("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(l,o){w(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function _D(n){let e,t,i,s,l,o,r,a,f;const u=[cD,uD],c=[];function d(m,_){return m[1]?0:1}return l=d(n),o=c[l]=u[l](n),{c(){e=v("header"),e.innerHTML=``,t=O(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),g(i,s),c[l].m(s,null),r=!0,a||(f=Y(s,"submit",Qe(n[4])),a=!0)},p(m,_){let h=l;l=d(m),l===h?c[l].p(m,_):(ae(),L(c[h],1,1,()=>{c[h]=null}),fe(),o=c[l],o?o.p(m,_):(o=c[l]=u[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){L(o),r=!1},d(m){m&&k(e),m&&k(t),m&&k(i),c[l].d(),a=!1,f()}}}function gD(n){let e,t,i,s;return e=new Ci({}),i=new kn({props:{$$slots:{default:[_D]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function bD(n,e,t){let i,s,l,o;Ke(n,$s,M=>t(14,s=M)),Ke(n,vo,M=>t(15,l=M)),Ke(n,Dt,M=>t(16,o=M)),nn(Dt,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const M=await ue.settings.getAll()||{};_(M)}catch(M){ue.error(M)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const M=await ue.settings.update(V.filterRedactedProps(a));_(M),Ht("Successfully saved application settings.")}catch(M){ue.error(M)}t(2,u=!1)}}function _(M={}){var E,D;nn(vo,l=(E=M==null?void 0:M.meta)==null?void 0:E.appName,l),nn($s,s=!!((D=M==null?void 0:M.meta)!=null&&D.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.logs.maxDays=pt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>h(),$=()=>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,h,r,c,b,y,S,T,C,$]}class vD extends ve{constructor(e){super(),be(this,e,bD,gD,me,{})}}function yD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=O(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ri(s,a)},m(f,u){w(f,e,u),g(e,t),w(f,i,u),w(f,s,u),s.autofocus&&s.focus(),l||(o=[Te(Ve.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(f,u){ri(s,a=At(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&k(e),f&&k(i),f&&k(s),l=!1,Ee(o)}}}function wD(n){let e;function t(l,o){return l[3]?kD:yD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function SD(n,e,t){const i=["value","mask"];let s=Xe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,l=""),t(3,a=!1),await fn(),r==null||r.focus()}const u=()=>f();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(5,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,f,s,u,c,d]}class rf extends ve{constructor(e){super(),be(this,e,SD,wD,me,{value:0,mask:1})}}function CD(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h;return{c(){e=v("label"),t=U("Subject"),s=O(),l=v("input"),r=O(),a=v("div"),f=U(`Available placeholder parameters: + `),u=v("button"),u.textContent=`{APP_NAME} + `,c=U(`, + `),d=v("button"),d.textContent=`{APP_URL} + `,m=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.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(b,y){w(b,e,y),g(e,t),w(b,s,y),w(b,l,y),re(l,n[0].subject),w(b,r,y),w(b,a,y),g(a,f),g(a,u),g(a,c),g(a,d),g(a,m),_||(h=[Y(l,"input",n[13]),Y(u,"click",n[14]),Y(d,"click",n[15])],_=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&re(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),_=!1,Ee(h)}}}function TD(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y;return{c(){e=v("label"),t=U("Action URL"),s=O(),l=v("input"),r=O(),a=v("div"),f=U(`Available placeholder parameters: + `),u=v("button"),u.textContent=`{APP_NAME} + `,c=U(`, + `),d=v("button"),d.textContent=`{APP_URL} + `,m=U(`, + `),_=v("button"),_.textContent=`{TOKEN} + `,h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.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(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),g(e,t),w(S,s,T),w(S,l,T),re(l,n[0].actionUrl),w(S,r,T),w(S,a,T),g(a,f),g(a,u),g(a,c),g(a,d),g(a,m),g(a,_),g(a,h),b||(y=[Y(l,"input",n[16]),Y(u,"click",n[17]),Y(d,"click",n[18]),Y(_,"click",n[19])],b=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(l,"id",o),T[0]&1&&l.value!==S[0].actionUrl&&re(l,S[0].actionUrl)},d(S){S&&k(e),S&&k(s),S&&k(l),S&&k(r),S&&k(a),b=!1,Ee(y)}}}function $D(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function MD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),s=!0},p(a,f){const u={};if(f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,he(()=>t=!1)),f[0]&16&&o!==(o=a[4])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(u)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function ED(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C;const $=[MD,$D],M=[];function E(D,I){return D[4]&&!D[5]?0:1}return l=E(n),o=M[l]=$[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=O(),o.c(),r=O(),a=v("div"),f=U(`Available placeholder parameters: + `),u=v("button"),u.textContent=`{APP_NAME} + `,c=U(`, + `),d=v("button"),d.textContent=`{APP_URL} + `,m=U(`, + `),_=v("button"),_.textContent=`{TOKEN} + `,h=U(`, + `),b=v("button"),b.textContent=`{ACTION_URL} + `,y=U("."),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(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(b,"type","button"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),g(e,t),w(D,s,I),M[l].m(D,I),w(D,r,I),w(D,a,I),g(a,f),g(a,u),g(a,c),g(a,d),g(a,m),g(a,_),g(a,h),g(a,b),g(a,y),S=!0,T||(C=[Y(u,"click",n[22]),Y(d,"click",n[23]),Y(_,"click",n[24]),Y(b,"click",n[25])],T=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let P=l;l=E(D),l===P?M[l].p(D,I):(ae(),L(M[P],1,1,()=>{M[P]=null}),fe(),o=M[l],o?o.p(D,I):(o=M[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&k(e),D&&k(s),M[l].d(D),D&&k(r),D&&k(a),T=!1,Ee(C)}}}function OD(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[CD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[TD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[ED,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,s,a),z(l,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}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&k(t),H(i,r),r&&k(s),H(l,r)}}}function Th(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Ve.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function DD(n){let e,t,i,s,l,o,r,a,f,u=n[6]&&Th();return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),l=U(n[2]),o=O(),r=v("div"),a=O(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),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&&se(l,c[2]),c[6]?u?d[0]&64&&A(u,1):(u=Th(),u.c(),A(u,1),u.m(f.parentNode,f)):u&&(ae(),L(u,1,1,()=>{u=null}),fe())},d(c){c&&k(e),c&&k(o),c&&k(r),c&&k(a),u&&u.d(c),c&&k(f)}}}function AD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[DD],default:[OD]},$$scope:{ctx:n}};for(let l=0;lt(12,o=J));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=$h,d=!1;function m(){u==null||u.expand()}function _(){u==null||u.collapse()}function h(){u==null||u.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await at(()=>import("./CodeEditor-04174b89.js"),["./CodeEditor-04174b89.js","./index-eb24c20e.js"],import.meta.url)).default),$h=c,t(5,d=!1))}function y(J){V.copyToClipboard(J),_o(`Copied ${J} to clipboard`,2e3)}b();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),C=()=>y("{APP_URL}");function $(){f.actionUrl=this.value,t(0,f)}const M=()=>y("{APP_NAME}"),E=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function I(J){n.$$.not_equal(f.body,J)&&(f.body=J,t(0,f))}function P(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),R=()=>y("{APP_URL}"),N=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function j(J){te[J?"unshift":"push"](()=>{u=J,t(3,u)})}function Z(J){Fe.call(this,n,J)}function X(J){Fe.call(this,n,J)}function K(J){Fe.call(this,n,J)}return n.$$set=J=>{e=Re(Re({},e),Gt(J)),t(8,l=Xe(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,f=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||ai(r))},[f,r,a,u,c,d,i,y,l,m,_,h,o,S,T,C,$,M,E,D,I,P,F,R,N,q,j,Z,X,K]}class Lr extends ve{constructor(e){super(),be(this,e,ID,AD,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 Mh(n,e,t){const i=n.slice();return i[21]=e[t],i}function Eh(n,e){let t,i,s,l,o,r=e[21].label+"",a,f,u,c,d,m;return c=N1(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=O(),o=v("label"),a=U(r),u=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=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(_,t,h),g(t,i),i.checked=i.__value===e[2],g(t,l),g(t,o),g(o,a),g(t,u),d||(m=Y(i,"change",e[10]),d=!0)},p(_,h){e=_,h&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(_){_&&k(t),c.r(),d=!1,m()}}}function LD(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new de({props:{class:"form-field required m-0",name:"email",$$slots:{default:[PD,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),B(t.$$.fragment),i=O(),B(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),g(e,i),z(s,e,null),l=!0,o||(r=Y(e,"submit",Qe(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}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&k(e),H(t),H(s),o=!1,r()}}}function ND(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function RD(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("button"),t=U("Close"),i=O(),s=v("button"),l=v("i"),o=O(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),f||(u=Y(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,u()}}}function qD(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:[RD],header:[ND],default:[FD]},$$scope:{ctx:n}};return e=new sn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Pr="last_email_test",Oh="email_test_request";function jD(n,e,t){let i;const s=$t(),l="email_test_"+V.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(Pr),f=o[0].value,u=!1,c=null;function d(E="",D=""){t(1,a=E||localStorage.getItem(Pr)),t(2,f=D||o[0].value),en({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function _(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Pr,a),clearTimeout(c),c=setTimeout(()=>{ue.cancelRequest(Oh),Ts("Test email send timeout.")},3e4);try{await ue.settings.testEmail(a,f,{$cancelKey:Oh}),Ht("Successfully sent test email."),s("submit"),t(4,u=!1),await fn(),m()}catch(E){t(4,u=!1),ue.error(E)}clearTimeout(c)}}const h=[[]];function b(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>_(),T=()=>!u;function C(E){te[E?"unshift":"push"](()=>{r=E,t(3,r)})}function $(E){Fe.call(this,n,E)}function M(E){Fe.call(this,n,E)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,l,o,_,d,b,h,y,S,T,C,$,M]}class VD extends ve{constructor(e){super(),be(this,e,jD,qD,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function zD(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E,D,I,P;i=new de({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[BD,({uniqueId:ie})=>({31:ie}),({uniqueId:ie})=>[0,ie?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[UD,({uniqueId:ie})=>({31:ie}),({uniqueId:ie})=>[0,ie?1:0]]},$$scope:{ctx:n}}});function F(ie){n[14](ie)}let R={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(R.config=n[0].meta.verificationTemplate),f=new Lr({props:R}),te.push(()=>ce(f,"config",F));function N(ie){n[15](ie)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new Lr({props:q}),te.push(()=>ce(d,"config",N));function j(ie){n[16](ie)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),h=new Lr({props:Z}),te.push(()=>ce(h,"config",j)),C=new de({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[WD,({uniqueId:ie})=>({31:ie}),({uniqueId:ie})=>[0,ie?1:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&Dh(n);function K(ie,ee){return ie[4]?xD:QD}let J=K(n),le=J(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),r=O(),a=v("div"),B(f.$$.fragment),c=O(),B(d.$$.fragment),_=O(),B(h.$$.fragment),y=O(),S=v("hr"),T=O(),B(C.$$.fragment),$=O(),X&&X.c(),M=O(),E=v("div"),D=v("div"),I=O(),le.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(E,"class","flex")},m(ie,ee){w(ie,e,ee),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),w(ie,r,ee),w(ie,a,ee),z(f,a,null),g(a,c),z(d,a,null),g(a,_),z(h,a,null),w(ie,y,ee),w(ie,S,ee),w(ie,T,ee),z(C,ie,ee),w(ie,$,ee),X&&X.m(ie,ee),w(ie,M,ee),w(ie,E,ee),g(E,D),g(E,I),le.m(E,null),P=!0},p(ie,ee){const $e={};ee[0]&1|ee[1]&3&&($e.$$scope={dirty:ee,ctx:ie}),i.$set($e);const Pe={};ee[0]&1|ee[1]&3&&(Pe.$$scope={dirty:ee,ctx:ie}),o.$set(Pe);const je={};!u&&ee[0]&1&&(u=!0,je.config=ie[0].meta.verificationTemplate,he(()=>u=!1)),f.$set(je);const ze={};!m&&ee[0]&1&&(m=!0,ze.config=ie[0].meta.resetPasswordTemplate,he(()=>m=!1)),d.$set(ze);const ke={};!b&&ee[0]&1&&(b=!0,ke.config=ie[0].meta.confirmEmailChangeTemplate,he(()=>b=!1)),h.$set(ke);const Ce={};ee[0]&1|ee[1]&3&&(Ce.$$scope={dirty:ee,ctx:ie}),C.$set(Ce),ie[0].smtp.enabled?X?(X.p(ie,ee),ee[0]&1&&A(X,1)):(X=Dh(ie),X.c(),A(X,1),X.m(M.parentNode,M)):X&&(ae(),L(X,1,1,()=>{X=null}),fe()),J===(J=K(ie))&&le?le.p(ie,ee):(le.d(1),le=J(ie),le&&(le.c(),le.m(E,null)))},i(ie){P||(A(i.$$.fragment,ie),A(o.$$.fragment,ie),A(f.$$.fragment,ie),A(d.$$.fragment,ie),A(h.$$.fragment,ie),A(C.$$.fragment,ie),A(X),P=!0)},o(ie){L(i.$$.fragment,ie),L(o.$$.fragment,ie),L(f.$$.fragment,ie),L(d.$$.fragment,ie),L(h.$$.fragment,ie),L(C.$$.fragment,ie),L(X),P=!1},d(ie){ie&&k(e),H(i),H(o),ie&&k(r),ie&&k(a),H(f),H(d),H(h),ie&&k(y),ie&&k(S),ie&&k(T),H(C,ie),ie&&k($),X&&X.d(ie),ie&&k(M),ie&&k(E),le.d()}}}function HD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function BD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender name"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(l,"id",o),u[0]&1&&l.value!==f[0].meta.senderName&&re(l,f[0].meta.senderName)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function UD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender address"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(l,"id",o),u[0]&1&&l.value!==f[0].meta.senderAddress&&re(l,f[0].meta.senderAddress)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function WD(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=O(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),f||(u=[Y(e,"change",n[17]),Te(Ve.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]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,Ee(u)}}}function Dh(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M;return i=new de({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[YD,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[KD,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[JD,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),d=new de({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[ZD,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field",name:"smtp.username",$$slots:{default:[GD,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),S=new de({props:{class:"form-field",name:"smtp.password",$$slots:{default:[XD,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),r=O(),a=v("div"),B(f.$$.fragment),u=O(),c=v("div"),B(d.$$.fragment),m=O(),_=v("div"),B(h.$$.fragment),b=O(),y=v("div"),B(S.$$.fragment),T=O(),C=v("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(_,"class","col-lg-6"),p(y,"class","col-lg-6"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(E,D){w(E,e,D),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),g(e,r),g(e,a),z(f,a,null),g(e,u),g(e,c),z(d,c,null),g(e,m),g(e,_),z(h,_,null),g(e,b),g(e,y),z(S,y,null),g(e,T),g(e,C),M=!0},p(E,D){const I={};D[0]&1|D[1]&3&&(I.$$scope={dirty:D,ctx:E}),i.$set(I);const P={};D[0]&1|D[1]&3&&(P.$$scope={dirty:D,ctx:E}),o.$set(P);const F={};D[0]&1|D[1]&3&&(F.$$scope={dirty:D,ctx:E}),f.$set(F);const R={};D[0]&1|D[1]&3&&(R.$$scope={dirty:D,ctx:E}),d.$set(R);const N={};D[0]&1|D[1]&3&&(N.$$scope={dirty:D,ctx:E}),h.$set(N);const q={};D[0]&1|D[1]&3&&(q.$$scope={dirty:D,ctx:E}),S.$set(q)},i(E){M||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(f.$$.fragment,E),A(d.$$.fragment,E),A(h.$$.fragment,E),A(S.$$.fragment,E),E&&Ge(()=>{M&&($||($=qe(e,st,{duration:150},!0)),$.run(1))}),M=!0)},o(E){L(i.$$.fragment,E),L(o.$$.fragment,E),L(f.$$.fragment,E),L(d.$$.fragment,E),L(h.$$.fragment,E),L(S.$$.fragment,E),E&&($||($=qe(e,st,{duration:150},!1)),$.run(0)),M=!1},d(E){E&&k(e),H(i),H(o),H(f),H(d),H(h),H(S),E&&$&&$.end()}}}function YD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("SMTP server host"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(l,"id",o),u[0]&1&&l.value!==f[0].smtp.host&&re(l,f[0].smtp.host)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function KD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Port"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(l,"id",o),u[0]&1&&pt(l.value)!==f[0].smtp.port&&re(l,f[0].smtp.port)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function JD(n){let e,t,i,s,l,o,r;function a(u){n[20](u)}let f={id:n[31],items:n[6]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),l=new Vi({props:f}),te.push(()=>ce(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("TLS encryption"),s=O(),B(l.$$.fragment),p(e,"for",i=n[31])},m(u,c){w(u,e,c),g(e,t),w(u,s,c),z(l,u,c),r=!0},p(u,c){(!r||c[1]&1&&i!==(i=u[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=u[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,he(()=>o=!1)),l.$set(d)},i(u){r||(A(l.$$.fragment,u),r=!0)},o(u){L(l.$$.fragment,u),r=!1},d(u){u&&k(e),u&&k(s),H(l,u)}}}function ZD(n){let e,t,i,s,l,o,r;function a(u){n[21](u)}let f={id:n[31],items:n[7]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),l=new Vi({props:f}),te.push(()=>ce(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("AUTH method"),s=O(),B(l.$$.fragment),p(e,"for",i=n[31])},m(u,c){w(u,e,c),g(e,t),w(u,s,c),z(l,u,c),r=!0},p(u,c){(!r||c[1]&1&&i!==(i=u[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=u[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,he(()=>o=!1)),l.$set(d)},i(u){r||(A(l.$$.fragment,u),r=!0)},o(u){L(l.$$.fragment,u),r=!1},d(u){u&&k(e),u&&k(s),H(l,u)}}}function GD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Username"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(l,"id",o),u[0]&1&&l.value!==f[0].smtp.username&&re(l,f[0].smtp.username)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function XD(n){let e,t,i,s,l,o,r;function a(u){n[23](u)}let f={id:n[31]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),l=new rf({props:f}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Password"),s=O(),B(l.$$.fragment),p(e,"for",i=n[31])},m(u,c){w(u,e,c),g(e,t),w(u,s,c),z(l,u,c),r=!0},p(u,c){(!r||c[1]&1&&i!==(i=u[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=u[31]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,he(()=>o=!1)),l.$set(d)},i(u){r||(A(l.$$.fragment,u),r=!0)},o(u){L(l.$$.fragment,u),r=!1},d(u){u&&k(e),u&&k(s),H(l,u)}}}function QD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=` + Send test email`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function xD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(f,u){w(f,e,u),g(e,t),w(f,i,u),w(f,s,u),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&24&&o!==(o=!f[4]||f[3])&&(s.disabled=o),u[0]&8&&Q(s,"btn-loading",f[3])},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,Ee(a)}}}function eA(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b;const y=[HD,zD],S=[];function T(C,$){return C[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[5]),r=O(),a=v("div"),f=v("form"),u=v("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"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(C,e,$),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(C,r,$),w(C,a,$),g(a,f),g(f,u),g(f,c),S[d].m(f,null),_=!0,h||(b=Y(f,"submit",Qe(n[27])),h=!0)},p(C,$){(!_||$[0]&32)&&se(o,C[5]);let M=d;d=T(C),d===M?S[d].p(C,$):(ae(),L(S[M],1,1,()=>{S[M]=null}),fe(),m=S[d],m?m.p(C,$):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(f,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,b()}}}function tA(n){let e,t,i,s,l,o;e=new Ci({}),i=new kn({props:{$$slots:{default:[eA]},$$scope:{ctx:n}}});let r={};return l=new VD({props:r}),n[28](l),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,s,f),z(l,a,f),o=!0},p(a,f){const u={};f[0]&63|f[1]&2&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[28](null),H(l,a)}}}function nA(n,e,t){let i,s,l;Ke(n,Dt,K=>t(5,l=K));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];nn(Dt,l="Mail settings",l);let a,f={},u={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const K=await ue.settings.getAll()||{};h(K)}catch(K){ue.error(K)}t(2,c=!1)}async function _(){if(!(d||!s)){t(3,d=!0);try{const K=await ue.settings.update(V.filterRedactedProps(u));h(K),en({}),Ht("Successfully saved mail settings.")}catch(K){ue.error(K)}t(3,d=!1)}}function h(K={}){t(0,u={meta:(K==null?void 0:K.meta)||{},smtp:(K==null?void 0:K.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(10,f=JSON.parse(JSON.stringify(u)))}function b(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function y(){u.meta.senderName=this.value,t(0,u)}function S(){u.meta.senderAddress=this.value,t(0,u)}function T(K){n.$$.not_equal(u.meta.verificationTemplate,K)&&(u.meta.verificationTemplate=K,t(0,u))}function C(K){n.$$.not_equal(u.meta.resetPasswordTemplate,K)&&(u.meta.resetPasswordTemplate=K,t(0,u))}function $(K){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,K)&&(u.meta.confirmEmailChangeTemplate=K,t(0,u))}function M(){u.smtp.enabled=this.checked,t(0,u)}function E(){u.smtp.host=this.value,t(0,u)}function D(){u.smtp.port=pt(this.value),t(0,u)}function I(K){n.$$.not_equal(u.smtp.tls,K)&&(u.smtp.tls=K,t(0,u))}function P(K){n.$$.not_equal(u.smtp.authMethod,K)&&(u.smtp.authMethod=K,t(0,u))}function F(){u.smtp.username=this.value,t(0,u)}function R(K){n.$$.not_equal(u.smtp.password,K)&&(u.smtp.password=K,t(0,u))}const N=()=>b(),q=()=>_(),j=()=>a==null?void 0:a.show(),Z=()=>_();function X(K){te[K?"unshift":"push"](()=>{a=K,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(f)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(u))},[u,a,c,d,s,l,o,r,_,b,f,i,y,S,T,C,$,M,E,D,I,P,F,R,N,q,j,Z,X]}class iA extends ve{constructor(e){super(),be(this,e,nA,tA,me,{},null,[-1,-1])}}const sA=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),Ah=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function lA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(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&&se(l,f[4]),u&1048576&&o!==(o=f[20])&&p(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function Ih(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M;return i=new de({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[oA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[rA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[aA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),d=new de({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[fA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[uA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),S=new de({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[cA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=O(),l=v("div"),B(o.$$.fragment),r=O(),a=v("div"),B(f.$$.fragment),u=O(),c=v("div"),B(d.$$.fragment),m=O(),_=v("div"),B(h.$$.fragment),b=O(),y=v("div"),B(S.$$.fragment),T=O(),C=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(_,"class","col-lg-6"),p(y,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(E,D){w(E,e,D),g(e,t),z(i,t,null),g(e,s),g(e,l),z(o,l,null),g(e,r),g(e,a),z(f,a,null),g(e,u),g(e,c),z(d,c,null),g(e,m),g(e,_),z(h,_,null),g(e,b),g(e,y),z(S,y,null),g(e,T),g(e,C),M=!0},p(E,D){const I={};D&8&&(I.name=E[3]+".endpoint"),D&1081345&&(I.$$scope={dirty:D,ctx:E}),i.$set(I);const P={};D&8&&(P.name=E[3]+".bucket"),D&1081345&&(P.$$scope={dirty:D,ctx:E}),o.$set(P);const F={};D&8&&(F.name=E[3]+".region"),D&1081345&&(F.$$scope={dirty:D,ctx:E}),f.$set(F);const R={};D&8&&(R.name=E[3]+".accessKey"),D&1081345&&(R.$$scope={dirty:D,ctx:E}),d.$set(R);const N={};D&8&&(N.name=E[3]+".secret"),D&1081345&&(N.$$scope={dirty:D,ctx:E}),h.$set(N);const q={};D&8&&(q.name=E[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:E}),S.$set(q)},i(E){M||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(f.$$.fragment,E),A(d.$$.fragment,E),A(h.$$.fragment,E),A(S.$$.fragment,E),E&&Ge(()=>{M&&($||($=qe(e,st,{duration:150},!0)),$.run(1))}),M=!0)},o(E){L(i.$$.fragment,E),L(o.$$.fragment,E),L(f.$$.fragment,E),L(d.$$.fragment,E),L(h.$$.fragment,E),L(S.$$.fragment,E),E&&($||($=qe(e,st,{duration:150},!1)),$.run(0)),M=!1},d(E){E&&k(e),H(i),H(o),H(f),H(d),H(h),H(S),E&&$&&$.end()}}}function oA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=O(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].endpoint),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0].endpoint&&re(l,f[0].endpoint)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function rA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=O(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].bucket),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0].bucket&&re(l,f[0].bucket)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function aA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Region"),s=O(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].region),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0].region&&re(l,f[0].region)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function fA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Access key"),s=O(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[0].accessKey),r||(a=Y(l,"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(l,"id",o),u&1&&l.value!==f[0].accessKey&&re(l,f[0].accessKey)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function uA(n){let e,t,i,s,l,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),l=new rf({props:f}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Secret"),s=O(),B(l.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),g(e,t),w(u,s,c),z(l,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,he(()=>o=!1)),l.$set(d)},i(u){r||(A(l.$$.fragment,u),r=!0)},o(u){L(l.$$.fragment,u),r=!1},d(u){u&&k(e),u&&k(s),H(l,u)}}}function cA(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=O(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),f||(u=[Y(e,"change",n[14]),Te(Ve.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(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),f=!1,Ee(u)}}}function dA(n){let e,t,i,s,l;e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[lA,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],Ah);let a=n[0].enabled&&Ih(n);return{c(){B(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),s=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,s,u),l=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!l||u&32775)&&Ct(r,o,f,f[15],l?St(o,f[15],u,sA):Tt(f[15]),Ah),f[0].enabled?a?(a.p(f,u),u&1&&A(a,1)):(a=Ih(f),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(ae(),L(a,1,1,()=>{a=null}),fe())},i(f){l||(A(e.$$.fragment,f),A(r,f),A(a),l=!0)},o(f){L(e.$$.fragment,f),L(r,f),L(a),l=!1},d(f){H(e,f),f&&k(t),r&&r.d(f),f&&k(i),a&&a.d(f),f&&k(s)}}}const Fr="s3_test_request";function pA(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=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 _(E){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{h()},E)}async function h(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ue.cancelRequest(Fr),clearTimeout(d),d=setTimeout(()=>{ue.cancelRequest(Fr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let E;try{await ue.settings.testS3(f,{$cancelKey:Fr})}catch(D){E=D}return E!=null&&E.isAbort||(t(1,u=E),t(2,c=!1),clearTimeout(d)),u}Xt(()=>()=>{clearTimeout(d),clearTimeout(m)});function b(){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 C(){o.accessKey=this.value,t(0,o)}function $(E){n.$$.not_equal(o.secret,E)&&(o.secret=E,t(0,o))}function M(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=E=>{"originalConfig"in E&&t(5,l=E.originalConfig),"config"in E&&t(0,o=E.config),"configKey"in E&&t(3,r=E.configKey),"toggleLabel"in E&&t(4,a=E.toggleLabel),"testFilesystem"in E&&t(6,f=E.testFilesystem),"testError"in E&&t(1,u=E.testError),"isTesting"in E&&t(2,c=E.isTesting),"$$scope"in E&&t(15,s=E.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&_(100),n.$$.dirty&9&&(o.enabled||ai(r))},[o,u,c,r,a,l,f,i,b,y,S,T,C,$,M,s]}class b1 extends ve{constructor(e){super(),be(this,e,pA,dA,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function mA(n){var E;let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b;function y(D){n[11](D)}function S(D){n[12](D)}function T(D){n[13](D)}let C={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[_A]},$$scope:{ctx:n}};n[1].s3!==void 0&&(C.config=n[1].s3),n[4]!==void 0&&(C.isTesting=n[4]),n[5]!==void 0&&(C.testError=n[5]),e=new b1({props:C}),te.push(()=>ce(e,"config",y)),te.push(()=>ce(e,"isTesting",S)),te.push(()=>ce(e,"testError",T));let $=((E=n[1].s3)==null?void 0:E.enabled)&&!n[6]&&!n[3]&&Ph(n),M=n[6]&&Fh(n);return{c(){B(e.$$.fragment),l=O(),o=v("div"),r=v("div"),a=O(),$&&$.c(),f=O(),M&&M.c(),u=O(),c=v("button"),d=v("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],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,I){z(e,D,I),w(D,l,I),w(D,o,I),g(o,r),g(o,a),$&&$.m(o,null),g(o,f),M&&M.m(o,null),g(o,u),g(o,c),g(c,d),_=!0,h||(b=Y(c,"click",n[15]),h=!0)},p(D,I){var F;const P={};I&1&&(P.originalConfig=D[0].s3),I&524291&&(P.$$scope={dirty:I,ctx:D}),!t&&I&2&&(t=!0,P.config=D[1].s3,he(()=>t=!1)),!i&&I&16&&(i=!0,P.isTesting=D[4],he(()=>i=!1)),!s&&I&32&&(s=!0,P.testError=D[5],he(()=>s=!1)),e.$set(P),(F=D[1].s3)!=null&&F.enabled&&!D[6]&&!D[3]?$?$.p(D,I):($=Ph(D),$.c(),$.m(o,f)):$&&($.d(1),$=null),D[6]?M?M.p(D,I):(M=Fh(D),M.c(),M.m(o,u)):M&&(M.d(1),M=null),(!_||I&72&&m!==(m=!D[6]||D[3]))&&(c.disabled=m),(!_||I&8)&&Q(c,"btn-loading",D[3])},i(D){_||(A(e.$$.fragment,D),_=!0)},o(D){L(e.$$.fragment,D),_=!1},d(D){H(e,D),D&&k(l),D&&k(o),$&&$.d(),M&&M.d(),h=!1,b()}}}function hA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Lh(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,_,h,b,y,S,T,C,$,M,E,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=O(),l=v("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually + from the + `),r=v("strong"),f=U(a),u=U(` + to the + `),c=v("strong"),m=U(d),_=U(`. + `),h=v("br"),b=U(` + There are numerous command line tools that can help you, such as: + `),y=v("a"),y.textContent=`rclone + `,S=U(`, + `),T=v("a"),T.textContent=`s5cmd + `,C=U(", etc."),$=O(),M=v("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(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,F){w(P,e,F),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,f),g(l,u),g(l,c),g(c,m),g(l,_),g(l,h),g(l,b),g(l,y),g(l,S),g(l,T),g(l,C),g(e,$),g(e,M),D=!0},p(P,F){var R;(!D||F&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&se(f,a),(!D||F&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){D||(P&&Ge(()=>{D&&(E||(E=qe(e,st,{duration:150},!0)),E.run(1))}),D=!0)},o(P){P&&(E||(E=qe(e,st,{duration:150},!1)),E.run(0)),D=!1},d(P){P&&k(e),P&&E&&E.end()}}}function _A(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Lh(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=Lh(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ae(),L(t,1,1,()=>{t=null}),fe())},d(s){t&&t.d(s),s&&k(e)}}}function Ph(n){let e;function t(l,o){return l[4]?vA:l[5]?bA:gA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function gA(n){let e;return{c(){e=v("div"),e.innerHTML=` + S3 connected successfully`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=` + Failed to establish S3 connection`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=Ve.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function vA(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Fh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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(l,o){w(l,e,o),g(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function yA(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b;const y=[hA,mA],S=[];function T(C,$){return C[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[7]),r=O(),a=v("div"),f=v("form"),u=v("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(l,"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(C,e,$),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(C,r,$),w(C,a,$),g(a,f),g(f,u),g(f,c),S[d].m(f,null),_=!0,h||(b=Y(f,"submit",Qe(n[16])),h=!0)},p(C,$){(!_||$&128)&&se(o,C[7]);let M=d;d=T(C),d===M?S[d].p(C,$):(ae(),L(S[M],1,1,()=>{S[M]=null}),fe(),m=S[d],m?m.p(C,$):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(f,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,b()}}}function kA(n){let e,t,i,s;return e=new Ci({}),i=new kn({props:{$$slots:{default:[yA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}const wA="s3_test_request";function SA(n,e,t){let i,s,l;Ke(n,Dt,M=>t(7,l=M)),nn(Dt,l="Files storage",l);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await ue.settings.getAll()||{};_(M)}catch(M){ue.error(M)}t(2,a=!1)}async function m(){if(!(f||!s)){t(3,f=!0);try{ue.cancelRequest(wA);const M=await ue.settings.update(V.filterRedactedProps(r));en({}),await _(M),Ma(),c?ky("Successfully saved but failed to establish S3 connection."):Ht("Successfully saved files storage settings.")}catch(M){ue.error(M)}t(3,f=!1)}}async function _(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function b(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=()=>h(),C=()=>m(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,f,u,c,s,l,m,h,i,b,y,S,T,C,$]}class CA extends ve{constructor(e){super(),be(this,e,SA,kA,me,{})}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(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(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function $A(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("label"),t=U("Client ID"),s=O(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(u,c){w(u,e,c),g(e,t),w(u,s,c),w(u,l,c),re(l,n[1].clientId),a||(f=Y(l,"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(l,"id",o),c&2&&r!==(r=u[1].enabled)&&(l.required=r),c&2&&l.value!==u[1].clientId&&re(l,u[1].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),a=!1,f()}}}function MA(n){let e,t,i,s,l,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),l=new rf({props:f}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=O(),B(l.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),g(e,t),w(u,s,c),z(l,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,he(()=>o=!1)),l.$set(d)},i(u){r||(A(l.$$.fragment,u),r=!0)},o(u){L(l.$$.fragment,u),r=!1},d(u){u&&k(e),u&&k(s),H(l,u)}}}function Nh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let f={key:a[3].key};return a[1]!==void 0&&(f.config=a[1]),{props:f}}return o&&(t=Rt(o,r(n)),te.push(()=>ce(t,"config",l))),{c(){e=v("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(a,f){w(a,e,f),t&&z(t,e,null),s=!0},p(a,f){const u={};if(f&8&&(u.key=a[3].key),!i&&f&2&&(i=!0,u.config=a[1],he(()=>i=!1)),f&8&&o!==(o=a[3].optionsComponent)){if(t){ae();const c=t;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}o?(t=Rt(o,r(a)),te.push(()=>ce(t,"config",l)),B(t.$$.fragment),A(t.$$.fragment,1),z(t,e,null)):t=null}else o&&t.$set(u)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&L(t.$$.fragment,a),s=!1},d(a){a&&k(e),t&&H(t)}}}function EA(n){let e,t,i,s,l,o,r,a,f,u,c,d,m;i=new de({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[TA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[$A,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[MA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let _=n[3].optionsComponent&&Nh(n);return{c(){e=v("form"),t=v("div"),B(i.$$.fragment),s=O(),l=v("button"),l.innerHTML='Clear all fields',o=O(),B(r.$$.fragment),a=O(),B(f.$$.fragment),u=O(),_&&_.c(),p(l,"type","button"),p(l,"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(h,b){w(h,e,b),g(e,t),z(i,t,null),g(t,s),g(t,l),g(e,o),z(r,e,null),g(e,a),z(f,e,null),g(e,u),_&&_.m(e,null),c=!0,d||(m=[Y(l,"click",n[8]),Y(e,"submit",Qe(n[15]))],d=!0)},p(h,b){const y={};b&8&&(y.name=h[3].key+".enabled"),b&3145730&&(y.$$scope={dirty:b,ctx:h}),i.$set(y);const S={};b&2&&(S.class="form-field "+(h[1].enabled?"required":"")),b&8&&(S.name=h[3].key+".clientId"),b&3145730&&(S.$$scope={dirty:b,ctx:h}),r.$set(S);const T={};b&2&&(T.class="form-field "+(h[1].enabled?"required":"")),b&8&&(T.name=h[3].key+".clientSecret"),b&3145730&&(T.$$scope={dirty:b,ctx:h}),f.$set(T),h[3].optionsComponent?_?(_.p(h,b),b&8&&A(_,1)):(_=Nh(h),_.c(),A(_,1),_.m(e,null)):_&&(ae(),L(_,1,1,()=>{_=null}),fe())},i(h){c||(A(i.$$.fragment,h),A(r.$$.fragment,h),A(f.$$.fragment,h),A(_),c=!0)},o(h){L(i.$$.fragment,h),L(r.$$.fragment,h),L(f.$$.fragment,h),L(_),c=!1},d(h){h&&k(e),H(i),H(r),H(f),_&&_.d(),d=!1,Ee(m)}}}function OA(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=U(t),s=U(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),g(e,i),g(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&se(i,t)},d(l){l&&k(e)}}}function DA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Close"),i=O(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(f,u){w(f,e,u),g(e,t),w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(s.disabled=o),u&16&&Q(s,"btn-loading",f[4])},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function AA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[DA],header:[OA],default:[EA]},$$scope:{ctx:n}};return e=new sn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[16](null),H(e,s)}}}function IA(n,e,t){let i;const s=$t(),l="provider_popup_"+V.randomString(5);let o,r={},a={},f=!1,u="";function c(E,D){en({}),t(3,r=Object.assign({},E)),t(1,a=Object.assign({enabled:!0},D)),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 E={};E[r.key]=V.filterRedactedProps(a);const D=await ue.settings.update(E);en({}),Ht("Successfully updated provider settings."),s("submit",D),d()}catch(E){ue.error(E)}t(4,f=!1)}function _(){for(let E in a)t(1,a[E]="",a);t(1,a.enabled=!1,a)}function h(){a.enabled=this.checked,t(1,a)}function b(){a.clientId=this.value,t(1,a)}function y(E){n.$$.not_equal(a.clientSecret,E)&&(a.clientSecret=E,t(1,a))}function S(E){a=E,t(1,a)}const T=()=>m();function C(E){te[E?"unshift":"push"](()=>{o=E,t(2,o)})}function $(E){Fe.call(this,n,E)}function M(E){Fe.call(this,n,E)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,l,m,_,c,u,h,b,y,S,T,C,$,M]}class LA extends ve{constructor(e){super(),be(this,e,IA,AA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Rh(n){let e,t,i;return{c(){e=v("img"),hn(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!hn(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function qh(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function PA(n){let e,t,i,s,l=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,_,h,b,y,S,T,C,$=n[1].logo&&Rh(n),M=n[0].enabled&&qh(),E={};return y=new LA({props:E}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),$&&$.c(),i=O(),s=v("div"),o=U(l),r=O(),a=v("em"),f=U("("),c=U(u),d=U(")"),m=O(),M&&M.c(),_=O(),h=v("button"),h.innerHTML='',b=O(),B(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(h,"type","button"),p(h,"class","btn btn-circle btn-hint btn-transparent"),p(h,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,I){w(D,e,I),g(e,t),$&&$.m(t,null),g(e,i),g(e,s),g(s,o),g(e,r),g(e,a),g(a,f),g(a,c),g(a,d),g(e,m),M&&M.m(e,null),g(e,_),g(e,h),w(D,b,I),z(y,D,I),S=!0,T||(C=Y(h,"click",n[3]),T=!0)},p(D,[I]){D[1].logo?$?$.p(D,I):($=Rh(D),$.c(),$.m(t,null)):$&&($.d(1),$=null),(!S||I&2)&&l!==(l=D[1].title+"")&&se(o,l),(!S||I&2)&&u!==(u=D[1].key.slice(0,-4)+"")&&se(c,u),D[0].enabled?M||(M=qh(),M.c(),M.m(e,_)):M&&(M.d(1),M=null);const P={};y.$set(P)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){L(y.$$.fragment,D),S=!1},d(D){D&&k(e),$&&$.d(),M&&M.d(),D&&k(b),n[4](null),H(y,D),T=!1,C()}}}function FA(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(f){te[f?"unshift":"push"](()=>{l=f,t(2,l)})}const a=f=>{f.detail[i.key]&&t(0,s=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,s=f.config)},[s,i,l,o,r,a]}class v1 extends ve{constructor(e){super(),be(this,e,FA,PA,me,{provider:1,config:0})}}function jh(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Vh(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function NA(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,f,u=n[3];const c=h=>h[9].key;for(let h=0;h0&&n[2].length>0&&Hh(),m=n[2];const _=h=>h[9].key;for(let h=0;h0&&h[2].length>0?d||(d=Hh(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),b&5&&(m=h[2],ae(),r=bt(r,b,_,1,h,m,a,o,Ut,Bh,null,jh),fe())},i(h){if(!f){for(let b=0;bce(i,"config",r)),{key:n,first:null,c(){t=v("div"),B(i.$$.fragment),l=O(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),g(t,l),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!s&&u&9&&(s=!0,c.config=e[0][e[9].key],he(()=>s=!1)),i.$set(c)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),H(i)}}}function Hh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bh(n,e){let t,i,s,l,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 v1({props:a}),te.push(()=>ce(i,"config",r)),{key:n,first:null,c(){t=v("div"),B(i.$$.fragment),l=O(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),g(t,l),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!s&&u&5&&(s=!0,c.config=e[0][e[9].key],he(()=>s=!1)),i.$set(c)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),H(i)}}}function qA(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_;const h=[RA,NA],b=[];function y(S,T){return S[1]?0:1}return d=y(n),m=b[d]=h[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[4]),r=O(),a=v("div"),f=v("div"),u=v("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"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),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(S,r,T),w(S,a,T),g(a,f),g(f,u),g(f,c),b[d].m(f,null),_=!0},p(S,T){(!_||T&16)&&se(o,S[4]);let C=d;d=y(S),d===C?b[d].p(S,T):(ae(),L(b[C],1,1,()=>{b[C]=null}),fe(),m=b[d],m?m.p(S,T):(m=b[d]=h[d](S),m.c()),A(m,1),m.m(f,null))},i(S){_||(A(m),_=!0)},o(S){L(m),_=!1},d(S){S&&k(e),S&&k(r),S&&k(a),b[d].d()}}}function jA(n){let e,t,i,s;return e=new Ci({}),i=new kn({props:{$$slots:{default:[qA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function VA(n,e,t){let i,s,l;Ke(n,Dt,d=>t(4,l=d)),nn(Dt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ue.settings.getAll()||{};f(d)}catch(d){ue.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of fo)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=fo.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,s=fo.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,s,i,l,u,c]}class zA extends ve{constructor(e){super(),be(this,e,VA,jA,me,{})}}function HA(n){let e,t,i,s,l,o,r,a,f,u,c,d;return{c(){e=v("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=O(),o=v("input"),a=O(),f=v("div"),u=v("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),Q(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,_){w(m,e,_),g(e,t),g(e,i),w(m,l,_),w(m,o,_),re(o,n[0]),w(m,a,_),w(m,f,_),g(f,u),c||(d=[Y(o,"input",n[4]),Y(u,"click",n[5])],c=!0)},p(m,_){_&8&&se(t,m[3]),_&64&&s!==(s=m[6])&&p(e,"for",s),_&64&&r!==(r=m[6])&&p(o,"id",r),_&1&&pt(o.value)!==m[0]&&re(o,m[0]),_&2&&Q(u,"txt-success",!!m[1])},d(m){m&&k(e),m&&k(l),m&&k(o),m&&k(a),m&&k(f),c=!1,Ee(d)}}}function BA(n){let e,t;return e=new de({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[HA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=pt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomString(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,s=f.label),"duration"in f&&t(0,l=f.duration),"secret"in f&&t(1,o=f.secret)},[l,o,i,s,r,a]}class y1 extends ve{constructor(e){super(),be(this,e,UA,BA,me,{key:2,label:3,duration:0,secret:1})}}function Uh(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Wh(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function WA(n){let e,t,i=[],s=new Map,l,o,r,a,f,u=[],c=new Map,d,m,_,h,b,y,S,T,C,$,M,E=n[5];const D=R=>R[19].key;for(let R=0;RR[19].key;for(let R=0;Rce(i,"duration",r)),te.push(()=>ce(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,he(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,he(()=>l=!1)),i.$set(d)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),H(i,u)}}}function Kh(n,e){let t,i,s,l,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 y1({props:f}),te.push(()=>ce(i,"duration",r)),te.push(()=>ce(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,he(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,he(()=>l=!1)),i.$set(d)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),H(i,u)}}}function Jh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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(l,o){w(l,e,o),g(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function KA(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b;const y=[YA,WA],S=[];function T(C,$){return C[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[4]),r=O(),a=v("div"),f=v("form"),u=v("div"),u.innerHTML="

    Adjust common token options.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"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(C,e,$),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(C,r,$),w(C,a,$),g(a,f),g(f,u),g(f,c),S[d].m(f,null),_=!0,h||(b=Y(f,"submit",Qe(n[7])),h=!0)},p(C,$){(!_||$&16)&&se(o,C[4]);let M=d;d=T(C),d===M?S[d].p(C,$):(ae(),L(S[M],1,1,()=>{S[M]=null}),fe(),m=S[d],m?m.p(C,$):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(f,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,b()}}}function JA(n){let e,t,i,s;return e=new Ci({}),i=new kn({props:{$$slots:{default:[KA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function ZA(n,e,t){let i,s,l;Ke(n,Dt,M=>t(4,l=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"}];nn(Dt,l="Token options",l);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const M=await ue.settings.getAll()||{};_(M)}catch(M){ue.error(M)}t(1,u=!1)}async function m(){if(!(c||!s)){t(2,c=!0);try{const M=await ue.settings.update(V.filterRedactedProps(f));_(M),Ht("Successfully saved tokens options.")}catch(M){ue.error(M)}t(2,c=!1)}}function _(M){var D;M=M||{},t(0,f={});const E=o.concat(r);for(const I of E)t(0,f[I.key]={duration:((D=M[I.key])==null?void 0:D.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function h(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function b(M,E){n.$$.not_equal(f[E.key].duration,M)&&(f[E.key].duration=M,t(0,f))}function y(M,E){n.$$.not_equal(f[E.key].secret,M)&&(f[E.key].secret=M,t(0,f))}function S(M,E){n.$$.not_equal(f[E.key].duration,M)&&(f[E.key].duration=M,t(0,f))}function T(M,E){n.$$.not_equal(f[E.key].secret,M)&&(f[E.key].secret=M,t(0,f))}const C=()=>h(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(f))},[f,u,c,s,l,o,r,m,h,a,i,b,y,S,T,C,$]}class GA extends ve{constructor(e){super(),be(this,e,ZA,JA,me,{})}}function XA(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_;return o=new f1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

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

    `,t=O(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=O(),B(o.$$.fragment),r=O(),a=v("div"),f=v("div"),u=O(),c=v("button"),c.innerHTML=` + Download as JSON`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"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(h,b){w(h,e,b),w(h,t,b),w(h,i,b),g(i,s),g(i,l),z(o,i,null),n[8](i),w(h,r,b),w(h,a,b),g(a,f),g(a,u),g(a,c),d=!0,m||(_=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(h,b){const y={};b&4&&(y.content=h[2]),o.$set(y)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){L(o.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(t),h&&k(i),H(o),n[8](null),h&&k(r),h&&k(a),m=!1,Ee(_)}}}function QA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function xA(n){let e,t,i,s,l,o,r,a,f,u,c,d;const m=[QA,XA],_=[];function h(b,y){return b[1]?0:1}return u=h(n),c=_[u]=m[u](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[3]),r=O(),a=v("div"),f=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(b,r,y),w(b,a,y),g(a,f),_[u].m(f,null),d=!0},p(b,y){(!d||y&8)&&se(o,b[3]);let S=u;u=h(b),u===S?_[u].p(b,y):(ae(),L(_[S],1,1,()=>{_[S]=null}),fe(),c=_[u],c?c.p(b,y):(c=_[u]=m[u](b),c.c()),A(c,1),c.m(f,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),_[u].d()}}}function e8(n){let e,t,i,s;return e=new Ci({}),i=new kn({props:{$$slots:{default:[xA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function t8(n,e,t){let i,s;Ke(n,Dt,b=>t(3,s=b)),nn(Dt,s="Export collections",s);const l="export_"+V.randomString(5);let o,r=[],a=!1;f();async function f(){t(1,a=!0);try{t(6,r=await ue.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){ue.error(b)}t(1,a=!1)}function u(){V.downloadJson(r,"pb_schema")}function c(){V.copyToClipboard(i),_o("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(b){te[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},h=()=>u();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,u,c,r,d,m,_,h]}class n8 extends ve{constructor(e){super(),be(this,e,t8,e8,me,{})}}function Zh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Xh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function xh(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 t_(n,e,t){const i=n.slice();return i[30]=e[t],i}function i8(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&n_(),a=n[0].name!==n[1].name&&i_(n);return{c(){e=v("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(f,u){f[9]?r||(r=n_(),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&&l!==(l=f[1].name+"")&&se(o,l)},d(f){f&&k(e),r&&r.d(),a&&a.d()}}}function s8(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=O(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),g(i,l)},p(r,a){var f;a[0]&1&&s!==(s=((f=r[0])==null?void 0:f.name)+"")&&se(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function l8(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=O(),i=v("strong"),l=U(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),g(i,l)},p(r,a){var f;a[0]&2&&s!==(s=((f=r[1])==null?void 0:f.name)+"")&&se(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function n_(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function i_(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=O(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),g(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function s_(n){var b,y;let e,t,i,s=n[30]+"",l,o,r,a,f=n[12]((b=n[0])==null?void 0:b[n[30]])+"",u,c,d,m,_=n[12]((y=n[1])==null?void 0:y[n[30]])+"",h;return{c(){var S,T,C,$,M,E;e=v("tr"),t=v("td"),i=v("span"),l=U(s),o=O(),r=v("td"),a=v("pre"),u=U(f),c=O(),d=v("td"),m=v("pre"),h=U(_),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),Q(r,"changed-old-col",!n[10]&&bn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),Q(r,"changed-none-col",n[10]),p(m,"class","txt"),p(d,"class","svelte-lmkr38"),Q(d,"changed-new-col",!n[5]&&bn((C=n[0])==null?void 0:C[n[30]],($=n[1])==null?void 0:$[n[30]])),Q(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",bn((M=n[0])==null?void 0:M[n[30]],(E=n[1])==null?void 0:E[n[30]]))},m(S,T){w(S,e,T),g(e,t),g(t,i),g(i,l),g(e,o),g(e,r),g(r,a),g(a,u),g(e,c),g(e,d),g(d,m),g(m,h)},p(S,T){var C,$,M,E,D,I,P,F;T[0]&1&&f!==(f=S[12]((C=S[0])==null?void 0:C[S[30]])+"")&&se(u,f),T[0]&3075&&Q(r,"changed-old-col",!S[10]&&bn(($=S[0])==null?void 0:$[S[30]],(M=S[1])==null?void 0:M[S[30]])),T[0]&1024&&Q(r,"changed-none-col",S[10]),T[0]&2&&_!==(_=S[12]((E=S[1])==null?void 0:E[S[30]])+"")&&se(h,_),T[0]&2083&&Q(d,"changed-new-col",!S[5]&&bn((D=S[0])==null?void 0:D[S[30]],(I=S[1])==null?void 0:I[S[30]])),T[0]&32&&Q(d,"changed-none-col",S[5]),T[0]&2051&&Q(e,"txt-primary",bn((P=S[0])==null?void 0:P[S[30]],(F=S[1])==null?void 0:F[S[30]]))},d(S){S&&k(e)}}}function l_(n){let e,t=n[6],i=[];for(let s=0;sProps + Old + New`,l=O(),o=v("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=O(),h&&h.c(),a=O();for(let C=0;C!["schema","created","updated"].includes(y));function h(){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 b(y){return typeof y>"u"?"":V.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,s=!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")&&h(),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,l=V.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,l,s,_,b]}class a8 extends ve{constructor(e){super(),be(this,e,r8,o8,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function p_(n,e,t){const i=n.slice();return i[17]=e[t],i}function m_(n){let e,t;return e=new a8({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f8(n){let e,t,i=n[2],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{_()}):_()}async function _(){if(!f){t(4,f=!0);try{await ue.collections.import(o,a),Ht("Successfully imported collections configuration."),i("submit")}catch(C){ue.error(C)}t(4,f=!1),c()}}const h=()=>m(),b=()=>!f;function y(C){te[C?"unshift":"push"](()=>{s=C,t(1,s)})}function S(C){Fe.call(this,n,C)}function T(C){Fe.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,f,m,u,l,o,h,b,y,S,T]}class m8 extends ve{constructor(e){super(),be(this,e,p8,d8,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function h_(n,e,t){const i=n.slice();return i[32]=e[t],i}function __(n,e,t){const i=n.slice();return i[35]=e[t],i}function g_(n,e,t){const i=n.slice();return i[32]=e[t],i}function h8(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[g8,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&v_(),P=n[6]&&n[1].length&&n[7]&&y_(n),F=n[13].length&&A_(n),R=!!n[0]&&I_(n);return{c(){e=v("input"),t=O(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or + `),o=v("button"),o.innerHTML='Load from JSON file',r=O(),B(a.$$.fragment),f=O(),u=O(),I&&I.c(),c=O(),P&&P.c(),d=O(),F&&F.c(),m=O(),_=v("div"),R&&R.c(),h=O(),b=v("div"),y=O(),S=v("button"),T=v("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"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(T,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),g(i,s),g(s,l),g(s,o),w(N,r,q),z(a,N,q),w(N,f,q),w(N,u,q),I&&I.m(N,q),w(N,c,q),P&&P.m(N,q),w(N,d,q),F&&F.m(N,q),w(N,m,q),w(N,_,q),R&&R.m(_,null),g(_,h),g(_,b),g(_,y),g(_,S),g(S,T),$=!0,M||(E=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],M=!0)},p(N,q){(!$||q[0]&4096)&&Q(o,"btn-loading",N[12]);const j={};q[0]&64&&(j.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(j.$$scope={dirty:q,ctx:N}),a.$set(j),N[6]&&N[1].length&&!N[7]?I||(I=v_(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),N[6]&&N[1].length&&N[7]?P?P.p(N,q):(P=y_(N),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),N[13].length?F?F.p(N,q):(F=A_(N),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),N[0]?R?R.p(N,q):(R=I_(N),R.c(),R.m(_,h)):R&&(R.d(1),R=null),(!$||q[0]&16384&&C!==(C=!N[14]))&&(S.disabled=C)},i(N){$||(A(a.$$.fragment,N),A(D),$=!0)},o(N){L(a.$$.fragment,N),L(D),$=!1},d(N){N&&k(e),n[19](null),N&&k(t),N&&k(i),N&&k(r),H(a,N),N&&k(f),N&&k(u),I&&I.d(N),N&&k(c),P&&P.d(N),N&&k(d),F&&F.d(N),N&&k(m),N&&k(_),R&&R.d(),M=!1,Ee(E)}}}function _8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function b_(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function g8(n){let e,t,i,s,l,o,r,a,f,u,c=!!n[0]&&!n[6]&&b_();return{c(){e=v("label"),t=U("Collections"),s=O(),l=v("textarea"),r=O(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=Y(l,"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(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=b_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),f=!1,u()}}}function v_(n){let e;return{c(){e=v("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&&k(e)}}}function y_(n){let e,t,i,s,l,o=n[9].length&&k_(n),r=n[4].length&&C_(n),a=n[8].length&&E_(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=O(),i=v("div"),o&&o.c(),s=O(),r&&r.c(),l=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),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=k_(f),o.c(),o.m(i,s)):o&&(o.d(1),o=null),f[4].length?r?r.p(f,u):(r=C_(f),r.c(),r.m(i,l)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=E_(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&k(e),f&&k(t),f&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function k_(n){let e=[],t=new Map,i,s=n[9];const l=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(),s=v("div"),s.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.`,l=O(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"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),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(f){f&&k(e),r=!1,a()}}}function I_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function b8(n){let e,t,i,s,l,o,r,a,f,u,c,d;const m=[_8,h8],_=[];function h(b,y){return b[5]?0:1}return u=h(n),c=_[u]=m[u](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[15]),r=O(),a=v("div"),f=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(b,r,y),w(b,a,y),g(a,f),_[u].m(f,null),d=!0},p(b,y){(!d||y[0]&32768)&&se(o,b[15]);let S=u;u=h(b),u===S?_[u].p(b,y):(ae(),L(_[S],1,1,()=>{_[S]=null}),fe(),c=_[u],c?c.p(b,y):(c=_[u]=m[u](b),c.c()),A(c,1),c.m(f,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),_[u].d()}}}function v8(n){let e,t,i,s,l,o;e=new Ci({}),i=new kn({props:{$$slots:{default:[b8]},$$scope:{ctx:n}}});let r={};return l=new m8({props:r}),n[27](l),l.$on("submit",n[28]),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment),s=O(),B(l.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,s,f),z(l,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={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[27](null),H(l,a)}}}function y8(n,e,t){let i,s,l,o,r,a,f;Ke(n,Dt,J=>t(15,f=J)),nn(Dt,f="Import collections",f);let u,c,d="",m=!1,_=[],h=[],b=!0,y=[],S=!1;T();async function T(){t(5,S=!0);try{t(2,h=await ue.collections.getFullList(200));for(let J of h)delete J.created,delete J.updated}catch(J){ue.error(J)}t(5,S=!1)}function C(){if(t(4,y=[]),!!i)for(let J of _){const le=V.findByKey(h,"id",J.id);!(le!=null&&le.id)||!V.hasCollectionChanges(le,J,b)||y.push({new:J,old:le})}}function $(){t(1,_=[]);try{t(1,_=JSON.parse(d))}catch{}Array.isArray(_)?t(1,_=V.filterDuplicatesByKey(_)):t(1,_=[]);for(let J of _)delete J.created,delete J.updated,J.schema=V.filterDuplicatesByKey(J.schema)}function M(){var J,le;for(let ie of _){const ee=V.findByKey(h,"name",ie.name)||V.findByKey(h,"id",ie.id);if(!ee)continue;const $e=ie.id,Pe=ee.id;ie.id=Pe;const je=Array.isArray(ee.schema)?ee.schema:[],ze=Array.isArray(ie.schema)?ie.schema:[];for(const ke of ze){const Ce=V.findByKey(je,"name",ke.name);Ce&&Ce.id&&(ke.id=Ce.id)}for(let ke of _)if(Array.isArray(ke.schema))for(let Ce of ke.schema)(J=Ce.options)!=null&&J.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===$e&&(Ce.options.collectionId=Pe)}t(0,d=JSON.stringify(_,null,4))}function E(J){t(12,m=!0);const le=new FileReader;le.onload=async ie=>{t(12,m=!1),t(10,u.value="",u),t(0,d=ie.target.result),await fn(),_.length||(Ts("Invalid collections configuration."),D())},le.onerror=ie=>{console.warn(ie),Ts("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},le.readAsText(J)}function D(){t(0,d=""),t(10,u.value="",u),en({})}function I(J){te[J?"unshift":"push"](()=>{u=J,t(10,u)})}const P=()=>{u.files.length&&E(u.files[0])},F=()=>{u.click()};function R(){d=this.value,t(0,d)}function N(){b=this.checked,t(3,b)}const q=()=>M(),j=()=>D(),Z=()=>c==null?void 0:c.show(h,_,b);function X(J){te[J?"unshift":"push"](()=>{c=J,t(11,c)})}const K=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&_.length&&_.length===_.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=h.filter(J=>i&&b&&!V.findByKey(_,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=_.filter(J=>i&&!V.findByKey(h,"id",J.id))),n.$$.dirty[0]&10&&(typeof _<"u"||typeof b<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=_.filter(J=>{let le=V.findByKey(h,"name",J.name)||V.findByKey(h,"id",J.id);if(!le)return!1;if(le.id!=J.id)return!0;const ie=Array.isArray(le.schema)?le.schema:[],ee=Array.isArray(J.schema)?J.schema:[];for(const $e of ee){if(V.findByKey(ie,"id",$e.id))continue;const je=V.findByKey(ie,"name",$e.name);if(je&&$e.id!=je.id)return!0}return!1}))},[d,_,h,b,y,S,i,o,l,s,u,c,m,a,r,f,M,E,D,I,P,F,R,N,q,j,Z,X,K]}class k8 extends ve{constructor(e){super(),be(this,e,y8,v8,me,{},null,[-1,-1])}}function w8(n){let e,t,i,s,l,o,r,a,f,u;return{c(){e=v("label"),t=U("Backup name"),s=O(),l=v("input"),r=O(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[2]),w(c,r,d),w(c,a,d),f||(u=Y(l,"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(l,"id",o),d&4&&l.value!==c[2]&&re(l,c[2])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),f=!1,u()}}}function S8(n){let e,t,i,s,l,o,r;return s=new de({props:{class:"form-field m-0",name:"name",$$slots:{default:[w8,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("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=v("form"),B(s.$$.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),z(s,i,null),l=!0,o||(r=Y(i,"submit",Qe(n[5])),o=!0)},p(a,f){const u={};f&98308&&(u.$$scope={dirty:f,ctx:a}),s.$set(u)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&k(e),a&&k(t),a&&k(i),H(s),o=!1,r()}}}function C8(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function T8(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,f){w(a,e,f),g(e,t),w(a,i,f),w(a,s,f),g(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,f){f&8&&(e.disabled=a[3]),f&8&&(s.disabled=a[3]),f&8&&Q(s,"btn-loading",a[3])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,r()}}}function $8(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[T8],header:[C8],default:[S8]},$$scope:{ctx:n}};return e=new sn({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function M8(n,e,t){const i=$t(),s="backup_create_"+V.randomString(5);let l,o="",r=!1,a;function f(S){en({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function u(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{u()},1500);try{await ue.backups.create(o,{$cancelKey:s}),t(3,r=!1),u(),i("submit"),Ht("Successfully generated new backup.")}catch(S){S.isAbort||ue.error(S)}clearTimeout(a),t(3,r=!1)}}Fo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(_o("A backup has already been started, please wait."),!1):!0,_=()=>(r&&_o("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function b(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[u,l,o,r,s,c,f,d,m,_,h,b,y]}class E8 extends ve{constructor(e){super(),be(this,e,M8,$8,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function O8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=O(),l=v("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[2]),r||(a=Y(l,"input",n[9]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(l,"id",o),u&4&&l.value!==f[2]&&re(l,f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function D8(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b;return f=new Dl({props:{value:n[1]}}),m=new de({props:{class:"form-field required m-0",name:"name",$$slots:{default:[O8,({uniqueId:y})=>({14:y}),({uniqueId:y})=>y?16384:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`
    +

    Please proceed with caution.

    +

    The restore operation will replace your existing pb_data with the one from the backup + and will restart the application process!

    +

    Backup restore is still experimental and currently works only on UNIX based systems.

    `,t=O(),i=v("div"),s=U(`Type the backup name + `),l=v("div"),o=v("span"),r=U(n[1]),a=O(),B(f.$$.fragment),u=U(` + to confirm:`),c=O(),d=v("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"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),g(i,s),g(i,l),g(l,o),g(o,r),g(l,a),z(f,l,null),g(i,u),w(y,c,S),w(y,d,S),z(m,d,null),_=!0,h||(b=Y(d,"submit",Qe(n[7])),h=!0)},p(y,S){(!_||S&2)&&se(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const C={};S&49156&&(C.$$scope={dirty:S,ctx:y}),m.$set(C)},i(y){_||(A(f.$$.fragment,y),A(m.$$.fragment,y),_=!0)},o(y){L(f.$$.fragment,y),L(m.$$.fragment,y),_=!1},d(y){y&&k(e),y&&k(t),y&&k(i),H(f),y&&k(c),y&&k(d),H(m),h=!1,b()}}}function A8(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","center txt-break")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function I8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=O(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(f,u){w(f,e,u),g(e,t),w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(s.disabled=o),u&16&&Q(s,"btn-loading",f[4])},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function L8(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[I8],header:[A8],default:[D8]},$$scope:{ctx:n}};return e=new sn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&32822&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function P8(n,e,t){let i;const s="backup_restore_"+V.randomString(5);let l,o="",r="",a=!1;function f(y){en({}),t(2,r=""),t(1,o=y),t(4,a=!1),l==null||l.show()}function u(){return l==null?void 0:l.hide()}async function c(){var y;if(!(!i||a)){t(4,a=!0);try{await ue.backups.restore(o),setTimeout(()=>{window.location.reload()},1e3)}catch(S){S!=null&&S.isAbort||(t(4,a=!1),Ts(((y=S.response)==null?void 0:y.message)||S.message))}}}function d(){r=this.value,t(2,r)}const m=()=>!a;function _(y){te[y?"unshift":"push"](()=>{l=y,t(3,l)})}function h(y){Fe.call(this,n,y)}function b(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[u,o,r,l,a,i,s,c,f,d,m,_,h,b]}class F8 extends ve{constructor(e){super(),be(this,e,P8,L8,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function L_(n,e,t){const i=n.slice();return i[22]=e[t],i}function P_(n,e,t){const i=n.slice();return i[19]=e[t],i}function N8(n){let e=[],t=new Map,i,s,l=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:x,d(t){t&&k(e)}}}function N_(n,e){let t,i,s,l,o,r=e[22].key+"",a,f,u,c,d=V.formattedFileSize(e[22].size)+"",m,_,h,b,y,S,T,C,$,M,E,D,I,P,F,R,N,q,j,Z;function X(){return e[10](e[22])}function K(){return e[11](e[22])}function J(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=O(),l=v("div"),o=v("span"),a=U(r),f=O(),u=v("span"),c=U("("),m=U(d),_=U(")"),h=O(),b=v("div"),y=v("button"),S=v("i"),C=O(),$=v("button"),M=v("i"),D=O(),I=v("button"),P=v("i"),R=O(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(u,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(S,"class","ri-download-line"),p(y,"type","button"),p(y,"class","btn btn-sm btn-circle btn-hint btn-transparent"),y.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(y,"aria-label","Download"),Q(y,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p($,"type","button"),p($,"class","btn btn-sm btn-circle btn-hint btn-transparent"),$.disabled=E=e[6][e[22].key],p($,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(I,"type","button"),p(I,"class","btn btn-sm btn-circle btn-hint btn-transparent"),I.disabled=F=e[6][e[22].key],p(I,"aria-label","Delete"),Q(I,"btn-loading",e[6][e[22].key]),p(b,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(le,ie){w(le,t,ie),g(t,i),g(t,s),g(t,l),g(l,o),g(o,a),g(l,f),g(l,u),g(u,c),g(u,m),g(u,_),g(t,h),g(t,b),g(b,y),g(y,S),g(b,C),g(b,$),g($,M),g(b,D),g(b,I),g(I,P),g(t,R),q=!0,j||(Z=[Te(Ve.call(null,y,"Download")),Y(y,"click",Qe(X)),Te(Ve.call(null,$,"Restore")),Y($,"click",Qe(K)),Te(Ve.call(null,I,"Delete")),Y(I,"click",Qe(J))],j=!0)},p(le,ie){e=le,(!q||ie&8)&&r!==(r=e[22].key+"")&&se(a,r),(!q||ie&8)&&d!==(d=V.formattedFileSize(e[22].size)+"")&&se(m,d),(!q||ie&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(y.disabled=T),(!q||ie&40)&&Q(y,"btn-loading",e[5][e[22].key]),(!q||ie&72&&E!==(E=e[6][e[22].key]))&&($.disabled=E),(!q||ie&72&&F!==(F=e[6][e[22].key]))&&(I.disabled=F),(!q||ie&72)&&Q(I,"btn-loading",e[6][e[22].key])},i(le){q||(le&&Ge(()=>{q&&(N||(N=qe(t,st,{duration:150},!0)),N.run(1))}),q=!0)},o(le){le&&(N||(N=qe(t,st,{duration:150},!1)),N.run(0)),q=!1},d(le){le&&k(t),le&&N&&N.end(),j=!1,Ee(Z)}}}function R_(n){let e;return{c(){e=v("div"),e.innerHTML=` + `,p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function q8(n){let e,t,i;return{c(){e=v("span"),t=O(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function j8(n){let e,t,i;return{c(){e=v("i"),t=O(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function V8(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h;const b=[R8,N8],y=[];function S(D,I){return D[4]?0:1}i=S(n),s=y[i]=b[i](n);function T(D,I){return D[7]?j8:q8}let C=T(n),$=C(n),M={};u=new E8({props:M}),n[14](u),u.$on("submit",n[15]);let E={};return d=new F8({props:E}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=O(),o=v("div"),r=v("button"),$.c(),f=O(),B(u.$$.fragment),c=O(),B(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(D,I){w(D,e,I),g(e,t),y[i].m(t,null),g(e,l),g(e,o),g(o,r),$.m(r,null),w(D,f,I),z(u,D,I),w(D,c,I),z(d,D,I),m=!0,_||(h=Y(r,"click",n[13]),_=!0)},p(D,[I]){let P=i;i=S(D),i===P?y[i].p(D,I):(ae(),L(y[P],1,1,()=>{y[P]=null}),fe(),s=y[i],s?s.p(D,I):(s=y[i]=b[i](D),s.c()),A(s,1),s.m(t,null)),C!==(C=T(D))&&($.d(1),$=C(D),$&&($.c(),$.m(r,null))),(!m||I&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const F={};u.$set(F);const R={};d.$set(R)},i(D){m||(A(s),A(u.$$.fragment,D),A(d.$$.fragment,D),m=!0)},o(D){L(s),L(u.$$.fragment,D),L(d.$$.fragment,D),m=!1},d(D){D&&k(e),y[i].d(),$.d(),D&&k(f),n[14](null),H(u,D),D&&k(c),n[16](null),H(d,D),_=!1,h()}}}function z8(n,e,t){let i,s,l=[],o=!1,r={},a={},f=!0;u(),_();async function u(){t(4,o=!0);try{t(3,l=await ue.backups.getFullList()),l.sort((M,E)=>M.modifiedE.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(ue.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const E=await ue.getAdminFileToken(),D=ue.backups.getDownloadUrl(E,M);V.download(D)}catch(E){E.isAbort||ue.error(E)}delete r[M],t(5,r)}}function d(M){pn(`Do you really want to delete ${M}?`,()=>m(M))}async function m(M){if(!a[M]){t(6,a[M]=!0,a);try{await ue.backups.delete(M),V.removeByKey(l,"name",M),u(),Ht(`Successfully deleted ${M}.`)}catch(E){E.isAbort||ue.error(E)}delete a[M],t(6,a)}}async function _(){var M;try{const E=await ue.health.check({$autoCancel:!1}),D=f;t(7,f=((M=E==null?void 0:E.data)==null?void 0:M.canBackup)||!1),D!=f&&f&&u()}catch{}}Xt(()=>{let M=setInterval(()=>{_()},3e3);return()=>{clearInterval(M)}});const h=M=>c(M.key),b=M=>s.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function T(M){te[M?"unshift":"push"](()=>{i=M,t(1,i)})}const C=()=>{u()};function $(M){te[M?"unshift":"push"](()=>{s=M,t(2,s)})}return[u,i,s,l,o,r,a,f,c,d,h,b,y,S,T,C,$]}class H8 extends ve{constructor(e){super(),be(this,e,z8,V8,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function B8(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function U8(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function q_(n){var j,Z,X;let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E;t=new de({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[W8,({uniqueId:K})=>({32:K}),({uniqueId:K})=>[0,K?2:0]]},$$scope:{ctx:n}}});let D=n[2]&&j_(n);function I(K){n[25](K)}function P(K){n[26](K)}function F(K){n[27](K)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(j=n[0].backups)==null?void 0:j.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new b1({props:R}),te.push(()=>ce(r,"config",I)),te.push(()=>ce(r,"isTesting",P)),te.push(()=>ce(r,"testError",F));let N=((X=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&V_(n),q=n[9]&&z_(n);return{c(){e=v("form"),B(t.$$.fragment),i=O(),D&&D.c(),s=O(),l=v("div"),o=O(),B(r.$$.fragment),c=O(),d=v("div"),m=v("div"),_=O(),N&&N.c(),h=O(),q&&q.c(),b=O(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"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],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(K,J){w(K,e,J),z(t,e,null),g(e,i),D&&D.m(e,null),g(e,s),g(e,l),g(e,o),z(r,e,null),g(e,c),g(e,d),g(d,m),g(d,_),N&&N.m(d,null),g(d,h),q&&q.m(d,null),g(d,b),g(d,y),g(y,S),$=!0,M||(E=[Y(y,"click",n[29]),Y(e,"submit",Qe(n[11]))],M=!0)},p(K,J){var ee,$e,Pe;const le={};J[0]&4|J[1]&6&&(le.$$scope={dirty:J,ctx:K}),t.$set(le),K[2]?D?(D.p(K,J),J[0]&4&&A(D,1)):(D=j_(K),D.c(),A(D,1),D.m(e,s)):D&&(ae(),L(D,1,1,()=>{D=null}),fe());const ie={};J[0]&1&&(ie.originalConfig=(ee=K[0].backups)==null?void 0:ee.s3),!a&&J[0]&2&&(a=!0,ie.config=K[1].backups.s3,he(()=>a=!1)),!f&&J[0]&128&&(f=!0,ie.isTesting=K[7],he(()=>f=!1)),!u&&J[0]&256&&(u=!0,ie.testError=K[8],he(()=>u=!1)),r.$set(ie),(Pe=($e=K[1].backups)==null?void 0:$e.s3)!=null&&Pe.enabled&&!K[9]&&!K[5]?N?N.p(K,J):(N=V_(K),N.c(),N.m(d,h)):N&&(N.d(1),N=null),K[9]?q?q.p(K,J):(q=z_(K),q.c(),q.m(d,b)):q&&(q.d(1),q=null),(!$||J[0]&544&&T!==(T=!K[9]||K[5]))&&(y.disabled=T),(!$||J[0]&32)&&Q(y,"btn-loading",K[5])},i(K){$||(A(t.$$.fragment,K),A(D),A(r.$$.fragment,K),K&&Ge(()=>{$&&(C||(C=qe(e,st,{duration:150},!0)),C.run(1))}),$=!0)},o(K){L(t.$$.fragment,K),L(D),L(r.$$.fragment,K),K&&(C||(C=qe(e,st,{duration:150},!1)),C.run(0)),$=!1},d(K){K&&k(e),H(t),D&&D.d(),H(r),N&&N.d(),q&&q.d(),K&&C&&C.end(),M=!1,Ee(E)}}}function W8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[32]),e.required=!0,p(s,"for",o=n[32])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,s,u),g(s,l),r||(a=Y(e,"change",n[18]),r=!0)},p(f,u){u[1]&2&&t!==(t=f[32])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&2&&o!==(o=f[32])&&p(s,"for",o)},d(f){f&&k(e),f&&k(i),f&&k(s),r=!1,a()}}}function j_(n){let e,t,i,s,l,o,r,a,f;return s=new de({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[K8,({uniqueId:u})=>({32:u}),({uniqueId:u})=>[0,u?2:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[J8,({uniqueId:u})=>({32:u}),({uniqueId:u})=>[0,u?2:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=O(),o=v("div"),B(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),g(e,t),g(t,i),z(s,i,null),g(t,l),g(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&6&&(d.$$scope={dirty:c,ctx:u}),s.$set(d);const m={};c[0]&2|c[1]&6&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(A(s.$$.fragment,u),A(r.$$.fragment,u),u&&Ge(()=>{f&&(a||(a=qe(e,st,{duration:150},!0)),a.run(1))}),f=!0)},o(u){L(s.$$.fragment,u),L(r.$$.fragment,u),u&&(a||(a=qe(e,st,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&k(e),H(s),H(r),u&&a&&a.end()}}}function Y8(n){let e,t,i,s,l,o,r,a,f;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=O(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=O(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=O(),r=v("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(l,"type","button"),p(l,"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,s,c),w(u,l,c),w(u,o,c),w(u,r,c),a||(f=[Y(e,"click",n[20]),Y(i,"click",n[21]),Y(l,"click",n[22]),Y(r,"click",n[23])],a=!0)},p:x,d(u){u&&k(e),u&&k(t),u&&k(i),u&&k(s),u&&k(l),u&&k(o),u&&k(r),a=!1,Ee(f)}}}function K8(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C;return h=new Wn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[Y8]},$$scope:{ctx:n}}}),{c(){var $,M;e=v("label"),t=U("Cron expression"),s=O(),l=v("input"),a=O(),f=v("div"),u=v("button"),c=v("span"),c.textContent="Presets",d=O(),m=v("i"),_=O(),B(h.$$.fragment),b=O(),y=v("div"),y.innerHTML=`

    Supports numeric list, steps and ranges. The timezone is in + UTC.

    `,p(e,"for",i=n[32]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[32]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((M=($=n[0])==null?void 0:$.backups)!=null&&M.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(y,"class","help-block")},m($,M){var E,D;w($,e,M),g(e,t),w($,s,M),w($,l,M),re(l,n[1].backups.cron),w($,a,M),w($,f,M),g(f,u),g(u,c),g(u,d),g(u,m),g(u,_),z(h,u,null),w($,b,M),w($,y,M),S=!0,(D=(E=n[0])==null?void 0:E.backups)!=null&&D.cron||l.focus(),T||(C=Y(l,"input",n[19]),T=!0)},p($,M){var D,I;(!S||M[1]&2&&i!==(i=$[32]))&&p(e,"for",i),(!S||M[1]&2&&o!==(o=$[32]))&&p(l,"id",o),(!S||M[0]&1&&r!==(r=!((I=(D=$[0])==null?void 0:D.backups)!=null&&I.cron)))&&(l.autofocus=r),M[0]&2&&l.value!==$[1].backups.cron&&re(l,$[1].backups.cron);const E={};M[0]&2|M[1]&4&&(E.$$scope={dirty:M,ctx:$}),h.$set(E)},i($){S||(A(h.$$.fragment,$),S=!0)},o($){L(h.$$.fragment,$),S=!1},d($){$&&k(e),$&&k(s),$&&k(l),$&&k(a),$&&k(f),H(h),$&&k(b),$&&k(y),T=!1,C()}}}function J8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=O(),l=v("input"),p(e,"for",i=n[32]),p(l,"type","number"),p(l,"id",o=n[32]),p(l,"min","1")},m(f,u){w(f,e,u),g(e,t),w(f,s,u),w(f,l,u),re(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"input",n[24]),r=!0)},p(f,u){u[1]&2&&i!==(i=f[32])&&p(e,"for",i),u[1]&2&&o!==(o=f[32])&&p(l,"id",o),u[0]&2&&pt(l.value)!==f[1].backups.cronMaxKeep&&re(l,f[1].backups.cronMaxKeep)},d(f){f&&k(e),f&&k(s),f&&k(l),r=!1,a()}}}function V_(n){let e;function t(l,o){return l[7]?X8:l[8]?G8:Z8}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Z8(n){let e;return{c(){e=v("div"),e.innerHTML=` + S3 connected successfully`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function G8(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=` + Failed to establish S3 connection`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=Ve.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function X8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function z_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("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),g(e,t),s||(l=Y(e,"click",n[28]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function Q8(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S,T,C,$,M,E,D,I;m=new Wo({props:{class:"btn-sm",tooltip:"Reload backups list"}}),m.$on("refresh",n[15]);let P={};h=new H8({props:P}),n[16](h);function F(j,Z){return j[6]?U8:B8}let R=F(n),N=R(n),q=n[6]&&!n[4]&&q_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[10]),r=O(),a=v("div"),f=v("div"),u=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=O(),B(m.$$.fragment),_=O(),B(h.$$.fragment),b=O(),y=v("hr"),S=O(),T=v("button"),C=v("span"),C.textContent="Backups options",$=O(),N.c(),M=O(),q&&q.c(),p(i,"class","breadcrumb-item"),p(l,"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-5"),p(C,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-secondary"),T.disabled=n[4],Q(T,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(j,Z){w(j,e,Z),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(j,r,Z),w(j,a,Z),g(a,f),g(f,u),g(u,c),g(u,d),z(m,u,null),g(f,_),z(h,f,null),g(f,b),g(f,y),g(f,S),g(f,T),g(T,C),g(T,$),N.m(T,null),g(f,M),q&&q.m(f,null),E=!0,D||(I=[Y(T,"click",n[17]),Y(f,"submit",Qe(n[11]))],D=!0)},p(j,Z){(!E||Z[0]&1024)&&se(o,j[10]);const X={};h.$set(X),R!==(R=F(j))&&(N.d(1),N=R(j),N&&(N.c(),N.m(T,null))),(!E||Z[0]&16)&&(T.disabled=j[4]),(!E||Z[0]&16)&&Q(T,"btn-loading",j[4]),j[6]&&!j[4]?q?(q.p(j,Z),Z[0]&80&&A(q,1)):(q=q_(j),q.c(),A(q,1),q.m(f,null)):q&&(ae(),L(q,1,1,()=>{q=null}),fe())},i(j){E||(A(m.$$.fragment,j),A(h.$$.fragment,j),A(q),E=!0)},o(j){L(m.$$.fragment,j),L(h.$$.fragment,j),L(q),E=!1},d(j){j&&k(e),j&&k(r),j&&k(a),H(m),n[16](null),H(h),N.d(),q&&q.d(),D=!1,Ee(I)}}}function x8(n){let e,t,i,s;return e=new Ci({}),i=new kn({props:{$$slots:{default:[Q8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(l,o){z(e,l,o),w(l,t,o),z(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&4&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function eI(n,e,t){let i,s;Ke(n,Dt,J=>t(10,s=J)),nn(Dt,s="Backups",s);let l,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,_=null;h();async function h(){t(4,a=!0);try{const J=await ue.settings.getAll()||{};y(J)}catch(J){ue.error(J)}t(4,a=!1)}async function b(){if(!(f||!i)){t(5,f=!0);try{const J=await ue.settings.update(V.filterRedactedProps(r));await T(),y(J),Ht("Successfully saved application settings.")}catch(J){ue.error(J)}t(5,f=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.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(){await(l==null?void 0:l.loadBackups())}const C=()=>T();function $(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const M=()=>t(6,d=!d);function E(){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)},P=()=>{t(1,r.backups.cron="0 0 * * 0",r)},F=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},R=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=pt(this.value),t(1,r),t(2,c)}function q(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function j(J){m=J,t(7,m)}function Z(J){_=J,t(8,_)}const X=()=>S(),K=()=>b();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(ai("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,l,a,f,d,m,_,i,s,b,S,T,u,C,$,M,E,D,I,P,F,R,N,q,j,Z,X,K]}class tI extends ve{constructor(e){super(),be(this,e,eI,x8,me,{},null,[-1,-1])}}const zt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ri("/"):!0}],nI={"/login":Lt({component:fD,conditions:zt.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Lt({asyncComponent:()=>at(()=>import("./PageAdminRequestPasswordReset-147aa187.js"),[],import.meta.url),conditions:zt.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Lt({asyncComponent:()=>at(()=>import("./PageAdminConfirmPasswordReset-3e640056.js"),[],import.meta.url),conditions:zt.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Lt({component:LO,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Lt({component:$C,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Lt({component:vD,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Lt({component:iD,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Lt({component:iA,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Lt({component:CA,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Lt({component:zA,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Lt({component:GA,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Lt({component:n8,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Lt({component:k8,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Lt({component:tI,conditions:zt.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmPasswordReset-686cbfc4.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmPasswordReset-686cbfc4.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmVerification-b5a8f47c.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmVerification-b5a8f47c.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmEmailChange-b6d59150.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Lt({asyncComponent:()=>at(()=>import("./PageRecordConfirmEmailChange-b6d59150.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Lt({asyncComponent:()=>at(()=>import("./PageOAuth2Redirect-b0382fc8.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"*":Lt({component:Ky,userData:{showAppSidebar:!1}})};function iI(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.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=Bo}=i;return{delay:u,duration:jt(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,_)=>{const h=_*a,b=_*f,y=m+_*e.width/t.width,S=m+_*e.height/t.height;return`transform: ${l} translate(${h}px, ${b}px) scale(${y}, ${S});`}}}function H_(n,e,t){const i=n.slice();return i[2]=e[t],i}function sI(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function lI(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function oI(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rI(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function B_(n,e){let t,i,s,l,o=e[2].message+"",r,a,f,u,c,d,m,_=x,h,b,y;function S(M,E){return M[2].type==="info"?rI:M[2].type==="success"?oI:M[2].type==="warning"?lI:sI}let T=S(e),C=T(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),C.c(),s=O(),l=v("div"),r=U(o),a=O(),f=v("button"),f.innerHTML='',u=O(),p(i,"class","icon"),p(l,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,E){w(M,t,E),g(t,i),C.m(i,null),g(t,s),g(t,l),g(l,r),g(t,a),g(t,f),g(t,u),h=!0,b||(y=Y(f,"click",Qe($)),b=!0)},p(M,E){e=M,T!==(T=S(e))&&(C.d(1),C=T(e),C&&(C.c(),C.m(i,null))),(!h||E&1)&&o!==(o=e[2].message+"")&&se(r,o),(!h||E&1)&&Q(t,"alert-info",e[2].type=="info"),(!h||E&1)&&Q(t,"alert-success",e[2].type=="success"),(!h||E&1)&&Q(t,"alert-danger",e[2].type=="error"),(!h||E&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){H1(t),_(),Q_(t,m)},a(){_(),_=z1(t,m,iI,{duration:150})},i(M){h||(Ge(()=>{h&&(d&&d.end(1),c=tg(t,st,{duration:150}),c.start())}),h=!0)},o(M){c&&c.invalidate(),d=_a(t,Kr,{duration:150}),h=!1},d(M){M&&k(t),C.d(),M&&d&&d.end(),b=!1,y()}}}function aI(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>rb(l)]}class uI extends ve{constructor(e){super(),be(this,e,fI,aI,me,{})}}function cI(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=U(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),g(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&se(i,t)},d(l){l&&k(e)}}}function dI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=O(),s=v("button"),l=v("span"),l.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(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,f){w(a,e,f),g(e,t),w(a,i,f),w(a,s,f),g(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(s.disabled=a[2]),f&4&&Q(s,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Ee(r)}}}function pI(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:[dI],header:[cI]},$$scope:{ctx:n}};return e=new sn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function mI(n,e,t){let i;Ke(n,ef,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function f(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await fn(),t(3,o=!1),c1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,f,u]}class hI extends ve{constructor(e){super(),be(this,e,mI,pI,me,{})}}function U_(n){let e,t,i,s,l,o,r,a,f,u,c,d,m,_,h,b,y,S;return h=new Wn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[_I]},$$scope:{ctx:n}}}),{c(){var T;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=O(),s=v("nav"),l=v("a"),l.innerHTML='',o=O(),r=v("a"),r.innerHTML='',a=O(),f=v("a"),f.innerHTML='',u=O(),c=v("figure"),d=v("img"),_=O(),B(h.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"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(s,"class","main-menu"),hn(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,C){w(T,e,C),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,f),g(e,u),g(e,c),g(c,d),g(c,_),z(h,c,null),b=!0,y||(S=[Te(ln.call(null,t)),Te(ln.call(null,l)),Te(qn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Te(Ve.call(null,l,{text:"Collections",position:"right"})),Te(ln.call(null,r)),Te(qn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Te(Ve.call(null,r,{text:"Logs",position:"right"})),Te(ln.call(null,f)),Te(qn.call(null,f,{path:"/settings/?.*",className:"current-route"})),Te(Ve.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,C){var M;(!b||C&1&&!hn(d.src,m="./images/avatars/avatar"+(((M=T[0])==null?void 0:M.avatar)||0)+".svg"))&&p(d,"src",m);const $={};C&4096&&($.$$scope={dirty:C,ctx:T}),h.$set($)},i(T){b||(A(h.$$.fragment,T),b=!0)},o(T){L(h.$$.fragment,T),b=!1},d(T){T&&k(e),H(h),y=!1,Ee(S)}}}function _I(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=` + Manage admins`,t=O(),i=v("hr"),s=O(),l=v("button"),l.innerHTML=` + Logout`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,s,f),w(a,l,f),o||(r=[Te(ln.call(null,e)),Y(l,"click",n[7])],o=!0)},p:x,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Ee(r)}}}function W_(n){let e,t,i;return t=new of({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),z(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function gI(n){var b;let e,t,i,s,l,o,r,a,f,u,c,d,m;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&U_(n);o=new t0({props:{routes:nI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new uI({}),u=new hI({});let h=n[1]&&!n[2]&&W_(n);return{c(){t=O(),i=v("div"),_&&_.c(),s=O(),l=v("div"),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),B(u.$$.fragment),c=O(),h&&h.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),_&&_.m(i,null),g(i,s),g(i,l),z(o,l,null),g(l,r),z(a,l,null),w(y,f,S),z(u,y,S),w(y,c,S),h&&h.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=V.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?_?(_.p(y,S),S&3&&A(_,1)):(_=U_(y),_.c(),A(_,1),_.m(i,s)):_&&(ae(),L(_,1,1,()=>{_=null}),fe()),y[1]&&!y[2]?h?(h.p(y,S),S&6&&A(h,1)):(h=W_(y),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(ae(),L(h,1,1,()=>{h=null}),fe())},i(y){m||(A(_),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(h),m=!0)},o(y){L(_),L(o.$$.fragment,y),L(a.$$.fragment,y),L(u.$$.fragment,y),L(h),m=!1},d(y){y&&k(t),y&&k(i),_&&_.d(),H(o),H(a),y&&k(f),H(u,y),y&&k(c),h&&h.d(y),y&&k(d)}}}function bI(n,e,t){let i,s,l,o;Ke(n,$s,h=>t(10,i=h)),Ke(n,vo,h=>t(3,s=h)),Ke(n,Oa,h=>t(0,l=h)),Ke(n,Dt,h=>t(4,o=h));let r,a=!1,f=!1;function u(h){var b,y,S,T;((b=h==null?void 0:h.detail)==null?void 0:b.location)!==r&&(t(1,a=!!((S=(y=h==null?void 0:h.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=h==null?void 0:h.detail)==null?void 0:T.location,nn(Dt,o="",o),en({}),c1())}function c(){Ri("/")}async function d(){var h,b;if(l!=null&&l.id)try{const y=await ue.settings.getAll({$cancelKey:"initialAppSettings"});nn(vo,s=((h=y==null?void 0:y.meta)==null?void 0:h.appName)||"",s),nn($s,i=!!((b=y==null?void 0:y.meta)!=null&&b.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ue.logout()}const _=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,f,s,o,u,c,m,_]}class vI extends ve{constructor(e){super(),be(this,e,bI,gI,me,{})}}new vI({target:document.getElementById("app")});export{Ee as A,Ht as B,V as C,Ri as D,ye as E,fb as F,Ro as G,io as H,Xt as I,Ke as J,ui as K,$t as L,te as M,f1 as N,bt as O,ss as P,Ut as Q,ht as R,ve as S,Nr as T,L as a,O as b,B as c,H as d,v as e,p as f,w as g,g as h,be as i,Te as j,ae as k,ln as l,z as m,fe as n,k as o,ue as p,de as q,Q as r,me as s,A as t,Y as u,Qe as v,U as w,se as x,x as y,re as z}; diff --git a/ui/dist/assets/index-fd4289fb.js b/ui/dist/assets/index-eb24c20e.js similarity index 83% rename from ui/dist/assets/index-fd4289fb.js rename to ui/dist/assets/index-eb24c20e.js index 5b3c1571..ac58235b 100644 --- a/ui/dist/assets/index-fd4289fb.js +++ b/ui/dist/assets/index-eb24c20e.js @@ -1,13 +1,13 @@ class I{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ke.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Ke.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ri(this),r=new ri(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ri(this,e)}iterRange(e,t=this.length){return new rl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ol(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):Ke.from(G.split(e,[]))}}class G extends I{constructor(e,t=_h(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Jh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(vr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Ui(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=Ui(this.text,Ui(i.text,vr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):Ke.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class Ke extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new Ke(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ke))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Ke)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Ke.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ke(l,t)}}I.empty=new G([""],0);function _h(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Ui(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ri(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ol{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ri.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class Jh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Rt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Rt[e-1]<=n;return!1}function Cr(n){return n>=127462&&n<=127487}const Ar=8205;function fe(n,e,t=!0,i=!0){return(t?ll:Yh)(n,e,i)}function ll(n,e,t){if(e==n.length)return e;e&&al(n.charCodeAt(e))&&hl(n.charCodeAt(e-1))&&e--;let i=ne(n,e);for(e+=Oe(i);e=0&&Cr(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Yh(n,e,t){for(;e>0;){let i=ll(n,e-2,t);if(i=56320&&n<57344}function hl(n){return n>=55296&&n<56320}function ne(n,e){let t=n.charCodeAt(e);if(!hl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return al(i)?(t-55296<<10)+(i-56320)+65536:t}function Gs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Oe(n){return n<65536?1:2}const is=/\r\n?|\n/;var he=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(he||(he={}));class _e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=he.Simple&&h>=e&&(i==he.TrackDel&&se||i==he.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new _e(e)}static create(e){return new _e(e)}}class Z extends _e{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ns(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ss(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&nt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||is)):d:I.empty,m=p.length;if(f==u&&m==0)return;fo&&ae(s,f-o,-1),ae(s,u-f,m),nt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Z(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function nt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function ss(n,e,t,i=!1){let s=[],r=i?[]:null,o=new ai(n),l=new ai(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ae(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class ai{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class pt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new pt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new pt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>pt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function fl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _s=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=_s++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Js),!!e.static,e.enables)}of(e){return new Gi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Js(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Gi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=_s++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||rs(f,c)){let d=i(f);if(l?!Mr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=tn(u,p);if(this.dependencies.every(g=>g instanceof D?u.facet(g)===f.facet(g):g instanceof ye?u.field(g,!1)==f.field(g,!1):!0)||(l?Mr(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Mr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Dr.of({field:this,create:e})]}get extension(){return this}}const dt={lowest:4,low:3,default:2,high:1,highest:0};function Xt(n){return e=>new ul(e,n)}const vt={highest:Xt(dt.highest),high:Xt(dt.high),default:Xt(dt.default),low:Xt(dt.low),lowest:Xt(dt.lowest)};class ul{constructor(e,t){this.inner=e,this.prec=t}}class Cn{of(e){return new os(this,e)}reconfigure(e){return Cn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class os{constructor(e,t){this.compartment=e,this.inner=t}}class en{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Zh(e,t,o))u instanceof ye?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Js(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>Qh(g,p,d))}}let f=h.map(u=>u(l));return new en(e,o,f,l,a,r)}}function Zh(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof os&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof os){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ul)r(o.inner,o.prec);else if(o instanceof ye)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Gi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,dt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,dt.default),i.reduce((o,l)=>o.concat(l))}function oi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function tn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const dl=D.define(),pl=D.define({combine:n=>n.some(e=>e),static:!0}),gl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),ml=D.define(),yl=D.define(),bl=D.define(),wl=D.define({combine:n=>n.length?n[0]:!1});class Ze{constructor(e,t){this.type=e,this.value=t}static define(){return new ec}}class ec{of(e){return new Ze(this,e)}}class tc{constructor(e){this.map=e}of(e){return new E(this,e)}}class E{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new E(this.type,t)}is(e){return this.type==e}static define(e={}){return new tc(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}E.reconfigure=E.define();E.appendConfig=E.define();class ee{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&fl(i,t.newLength),r.some(l=>l.type==ee.time)||(this.annotations=r.concat(ee.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ee(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ee.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ee.time=Ze.define();ee.userEvent=Ze.define();ee.addToHistory=Ze.define();ee.remote=Ze.define();function ic(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof ee?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ee?n=r[0]:n=kl(e,Et(r),!1)}return n}function sc(n){let e=n.startState,t=e.facet(bl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=xl(i,ls(e,r,n.changes.newLength),!0))}return i==n?n:ee.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const rc=[];function Et(n){return n==null?rc:Array.isArray(n)?n:[n]}var q=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(q||(q={}));const oc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let as;try{as=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function lc(n){if(as)return as.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||oc.test(t)))return!0}return!1}function ac(n){return e=>{if(!/\S/.test(e))return q.Space;if(lc(e))return q.Word;for(let t=0;t-1)return q.Word;return q.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(E.reconfigure)?(t=null,i=o.value):o.is(E.appendConfig)&&(t=null,i=Et(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=en.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Et(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=en.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||is)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return fl(s,i.length),t.staticFacet(pl)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` -`}get readOnly(){return this.facet(wl)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(dl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return ac(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=fe(t,o,!1);if(r(t.slice(a,o))!=q.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=gl;N.readOnly=wl;N.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=dl;N.changeFilter=ml;N.transactionFilter=yl;N.transactionExtender=bl;Cn.reconfigure=E.define();function Ct(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class wt{eq(e){return this==e}range(e,t=e){return hs.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let hs=class Sl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sl(e,t,i)}};function cs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Xs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Xs(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(cs)),this.isEmpty)return t.length?j.of(t):this;let l=new vl(this,null,-1).goto(0),a=0,h=[],c=new xt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return hi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return hi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Or(o,l,i),h=new Yt(o,a,r),c=new Yt(l,a,r);i.iterGaps((f,u,d)=>Tr(h,f,c,u,d,s)),i.empty&&i.length==0&&Tr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Or(r,o),a=new Yt(r,l,0).goto(i),h=new Yt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!fs(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Yt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new xt;for(let s of e instanceof hs?[e]:t?hc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}j.empty=new j([],[],null,-1);function hc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(cs);e=i}return n}j.empty.nextLayer=j.empty;class xt{finishChunk(e){this.chunks.push(new Xs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new xt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Or(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new vl(o,t,i,r));return s.length==1?s[0]:new hi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Fn(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Fn(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Fn(this.heap,0)}}}function Fn(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Yt{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=hi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Mi(this.active,e),Mi(this.activeTo,e),Mi(this.activeRank,e),this.minActive=Br(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Mi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Tr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&fs(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!fs(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function fs(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Br(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=fe(n,s)}return i===!0?-1:n.length}const ds="ͼ",Pr=typeof Symbol>"u"?"__"+ds:Symbol.for(ds),ps=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ot{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ri(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ol{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ri.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class Jh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Et="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Et[e-1]<=n;return!1}function Cr(n){return n>=127462&&n<=127487}const Ar=8205;function ce(n,e,t=!0,i=!0){return(t?ll:Yh)(n,e,i)}function ll(n,e,t){if(e==n.length)return e;e&&al(n.charCodeAt(e))&&hl(n.charCodeAt(e-1))&&e--;let i=ne(n,e);for(e+=Oe(i);e=0&&Cr(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Yh(n,e,t){for(;e>0;){let i=ll(n,e-2,t);if(i=56320&&n<57344}function hl(n){return n>=55296&&n<56320}function ne(n,e){let t=n.charCodeAt(e);if(!hl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return al(i)?(t-55296<<10)+(i-56320)+65536:t}function Gs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Oe(n){return n<65536?1:2}const is=/\r\n?|\n/;var he=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(he||(he={}));class _e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=he.Simple&&h>=e&&(i==he.TrackDel&&se||i==he.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new _e(e)}static create(e){return new _e(e)}}class Z extends _e{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ns(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ss(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&nt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||is)):d:I.empty,m=p.length;if(f==u&&m==0)return;fo&&ae(s,f-o,-1),ae(s,u-f,m),nt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Z(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function nt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function ss(n,e,t,i=!1){let s=[],r=i?[]:null,o=new ai(n),l=new ai(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ae(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class ai{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class pt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new pt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new pt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>pt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function fl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _s=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=_s++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Js),!!e.static,e.enables)}of(e){return new Gi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Js(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Gi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=_s++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||rs(f,c)){let d=i(f);if(l?!Mr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=tn(u,p);if(this.dependencies.every(g=>g instanceof D?u.facet(g)===f.facet(g):g instanceof be?u.field(g,!1)==f.field(g,!1):!0)||(l?Mr(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Mr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Dr.of({field:this,create:e})]}get extension(){return this}}const dt={lowest:4,low:3,default:2,high:1,highest:0};function Xt(n){return e=>new ul(e,n)}const Ct={highest:Xt(dt.highest),high:Xt(dt.high),default:Xt(dt.default),low:Xt(dt.low),lowest:Xt(dt.lowest)};class ul{constructor(e,t){this.inner=e,this.prec=t}}class Cn{of(e){return new os(this,e)}reconfigure(e){return Cn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class os{constructor(e,t){this.compartment=e,this.inner=t}}class en{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Zh(e,t,o))u instanceof be?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Js(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>Qh(g,p,d))}}let f=h.map(u=>u(l));return new en(e,o,f,l,a,r)}}function Zh(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof os&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof os){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ul)r(o.inner,o.prec);else if(o instanceof be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Gi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,dt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,dt.default),i.reduce((o,l)=>o.concat(l))}function oi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function tn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const dl=D.define(),pl=D.define({combine:n=>n.some(e=>e),static:!0}),gl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),ml=D.define(),yl=D.define(),bl=D.define(),wl=D.define({combine:n=>n.length?n[0]:!1});class Ze{constructor(e,t){this.type=e,this.value=t}static define(){return new ec}}class ec{of(e){return new Ze(this,e)}}class tc{constructor(e){this.map=e}of(e){return new E(this,e)}}class E{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new E(this.type,t)}is(e){return this.type==e}static define(e={}){return new tc(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}E.reconfigure=E.define();E.appendConfig=E.define();class ee{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&fl(i,t.newLength),r.some(l=>l.type==ee.time)||(this.annotations=r.concat(ee.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ee(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ee.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ee.time=Ze.define();ee.userEvent=Ze.define();ee.addToHistory=Ze.define();ee.remote=Ze.define();function ic(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof ee?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ee?n=r[0]:n=kl(e,It(r),!1)}return n}function sc(n){let e=n.startState,t=e.facet(bl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=xl(i,ls(e,r,n.changes.newLength),!0))}return i==n?n:ee.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const rc=[];function It(n){return n==null?rc:Array.isArray(n)?n:[n]}var q=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(q||(q={}));const oc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let as;try{as=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function lc(n){if(as)return as.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||oc.test(t)))return!0}return!1}function ac(n){return e=>{if(!/\S/.test(e))return q.Space;if(lc(e))return q.Word;for(let t=0;t-1)return q.Word;return q.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(E.reconfigure)?(t=null,i=o.value):o.is(E.appendConfig)&&(t=null,i=It(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=en.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=It(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=en.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||is)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return fl(s,i.length),t.staticFacet(pl)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` +`}get readOnly(){return this.facet(wl)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(dl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return ac(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ce(t,o,!1);if(r(t.slice(a,o))!=q.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=gl;N.readOnly=wl;N.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=dl;N.changeFilter=ml;N.transactionFilter=yl;N.transactionExtender=bl;Cn.reconfigure=E.define();function At(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class wt{eq(e){return this==e}range(e,t=e){return hs.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let hs=class Sl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sl(e,t,i)}};function cs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Xs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Xs(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(cs)),this.isEmpty)return t.length?j.of(t):this;let l=new vl(this,null,-1).goto(0),a=0,h=[],c=new xt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return hi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return hi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Or(o,l,i),h=new Yt(o,a,r),c=new Yt(l,a,r);i.iterGaps((f,u,d)=>Tr(h,f,c,u,d,s)),i.empty&&i.length==0&&Tr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Or(r,o),a=new Yt(r,l,0).goto(i),h=new Yt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!fs(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Yt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new xt;for(let s of e instanceof hs?[e]:t?hc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}j.empty=new j([],[],null,-1);function hc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(cs);e=i}return n}j.empty.nextLayer=j.empty;class xt{finishChunk(e){this.chunks.push(new Xs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new xt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Or(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new vl(o,t,i,r));return s.length==1?s[0]:new hi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Fn(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Fn(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Fn(this.heap,0)}}}function Fn(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Yt{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=hi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Mi(this.active,e),Mi(this.activeTo,e),Mi(this.activeRank,e),this.minActive=Br(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Mi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Tr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&fs(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!fs(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function fs(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Br(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ce(n,s)}return i===!0?-1:n.length}const ds="ͼ",Pr=typeof Symbol>"u"?"__"+ds:Symbol.for(ds),ps=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ot{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=Lr[Pr]||1;return Lr[Pr]=e+1,ds+e.toString(36)}static mount(e,t){(e[ps]||new cc(e)).mount(Array.isArray(t)?t:[t])}}let Rr=new Map;class cc{constructor(e){let t=e.ownerDocument||e,i=t.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Rr.get(t);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[ps]=s;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Rr.set(t,this)}else{this.styleTag=t.createElement("style");let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[ps]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fc=typeof navigator<"u"&&/Mac/.test(navigator.platform),uc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var se=0;se<10;se++)lt[48+se]=lt[96+se]=String(se);for(var se=1;se<=24;se++)lt[se+111]="F"+se;for(var se=65;se<=90;se++)lt[se]=String.fromCharCode(se+32),ci[se]=String.fromCharCode(se);for(var Hn in lt)ci.hasOwnProperty(Hn)||(ci[Hn]=lt[Hn]);function dc(n){var e=fc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||uc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ci:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function nn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function gs(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function pc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function _i(n,e){if(!e.anchorNode)return!1;try{return gs(n,e.anchorNode)}catch{return!1}}function Wt(n){return n.nodeType==3?Vt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function sn(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function rn(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Er(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:at(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=rn(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?at(n):0}else return!1}}function at(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function An(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function gc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function mc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body;if(d)u=gc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();u={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let p=0,m=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+m&&(m=e.bottom-u.bottom+m+o)):e.bottom>u.bottom&&(m=e.bottom-u.bottom+o,t<0&&e.top-m0&&e.right>u.right+p&&(p=e.right-u.right+p+r)):e.right>u.right&&(p=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class bc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?at(t):0),i,Math.min(e.focusOffset,i?at(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Ot=null;function Cl(n){if(n.setActive)return n.setActive();if(Ot)return n.focus(Ot);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Ot==null?{get preventScroll(){return Ot={preventScroll:!0},!0}}:void 0),!Ot){Ot=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class ue{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new ue(e.parentNode,rn(e),t)}static after(e,t){return new ue(e.parentNode,rn(e)+1,t)}}const Ys=[];class W{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=W.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Nr(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Nr(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=at(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!W.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Ys){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ol(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(tr)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=W.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Fr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class Hr{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}let De=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ms=typeof document<"u"?document:{documentElement:{style:{}}};const ys=/Edge\/(\d+)/.exec(De.userAgent),Pl=/MSIE \d/.test(De.userAgent),bs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(De.userAgent),Mn=!!(Pl||bs||ys),Wr=!Mn&&/gecko\/(\d+)/i.test(De.userAgent),Wn=!Mn&&/Chrome\/(\d+)/.exec(De.userAgent),Vr="webkitFontSmoothing"in ms.documentElement.style,Ll=!Mn&&/Apple Computer/.test(De.vendor),zr=Ll&&(/Mobile\/\w+/.test(De.userAgent)||De.maxTouchPoints>2);var M={mac:zr||/Mac/.test(De.platform),windows:/Win/.test(De.platform),linux:/Linux|X11/.test(De.platform),ie:Mn,ie_version:Pl?ms.documentMode||6:bs?+bs[1]:ys?+ys[1]:0,gecko:Wr,gecko_version:Wr?+(/Firefox\/(\d+)/.exec(De.userAgent)||[0,0])[1]:0,chrome:!!Wn,chrome_version:Wn?+Wn[1]:0,ios:zr,android:/Android\b/.test(De.userAgent),webkit:Vr,safari:Ll,webkit_version:Vr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ms.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const kc=256;class Ye extends W{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Ye)||this.length-(t-e)+i.length>kc||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ye(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ue(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Sc(this.dom,e,t)}}class Qe extends W{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Al(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Qe&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Qe(this.mark,t,o)}domAtPos(e){return Rl(this,e)}coordsAt(e,t){return Il(this,e,t)}}function Sc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?An(a,o<0):a||null}class gt extends W{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new gt(e,t,i)}split(e){let t=gt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof gt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?ue.before(this.dom):ue.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?ue.before(this.dom):ue.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return I.empty}get isHidden(){return!0}}Ye.prototype.children=gt.prototype.children=zt.prototype.children=Ys;function Rl(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Qe&&s.length&&(i=s[s.length-1])instanceof Qe&&i.mark.eq(e.mark)?El(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Il(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function xs(n,e,t){let i=null;if(e)for(let s in e)t&&s in t||n.removeAttribute(i=s);if(t)for(let s in t)e&&e[s]==t[s]||n.setAttribute(i=s,t[s]);return!!i}function Cc(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ht(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Nl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new ht(e,i,s,t,e.widget||null,!0)}static line(e){return new ki(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=j.empty;class xi extends B{constructor(e){let{start:t,end:i}=Nl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof xi&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&Qs(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}xi.prototype.point=!1;class ki extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ki&&this.spec.class==e.spec.class&&Qs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ki.prototype.mapMode=he.TrackBefore;ki.prototype.point=!0;class ht extends B{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?he.TrackBefore:he.TrackAfter:he.TrackDel}get type(){return this.startSide=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ht&&Ac(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ht.prototype.point=!0;function Nl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Ac(n,e){return n==e||!!(n&&e&&n.compare(e))}function ks(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class ke extends W{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof ke))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Tl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new ke;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Qs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){El(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=ws(t,this.attrs||{})),i&&(this.attrs=ws({class:i},this.attrs||{}))}domAtPos(e){return Rl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Al(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(xs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&W.get(s)instanceof Qe;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=W.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof Ye))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Ye)||/[^ -~]/.test(i.text))return null;let s=Wt(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Il(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof ke)return r;if(o>t)break}s=o+r.breakAfter}return null}}class bt extends W{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof bt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Oi(new Ye(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ht){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof ht)if(i.block){let{type:a}=i;a==J.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new bt(i.widget||new Kr("div"),l,a))}else{let a=gt.create(i.widget||new Kr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Oi(new zt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Oi(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new li(e,t,i,r);return o.openEnd=j.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Oi(n,e){for(let t of e)n=new Qe(t,[n],n.length);return n}class Kr extends At{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Fl=D.define(),Hl=D.define(),Wl=D.define(),Vl=D.define(),Ss=D.define(),zl=D.define(),ql=D.define(),Kl=D.define({combine:n=>n.some(e=>e)}),$l=D.define({combine:n=>n.some(e=>e)});class on{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new on(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const $r=E.define({map:(n,e)=>n.map(e)});function Ie(n,e,t){let i=n.facet(Vl);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Dn=D.define({combine:n=>n.length?n[0]:!0});let Mc=0;const ti=D.define();class pe{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new pe(Mc++,e,i,o=>{let l=[ti.of(o)];return r&&l.push(fi.of(a=>{let h=a.plugin(o);return h?r(h):B.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return pe.define(i=>new e(i),t)}}class Vn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ie(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ie(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ie(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const jl=D.define(),Zs=D.define(),fi=D.define(),er=D.define(),Ul=D.define();function Gl(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Ul)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ii=D.define();class Le{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Le(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Le(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class ln{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Z.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Le(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new ln(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var _=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(_||(_={}));const vs=_.LTR,Dc=_.RTL;function _l(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const K=[];function Lc(n,e){let t=n.length,i=e==vs?1:2,s=e==vs?2:1;if(!n||i==1&&!Pc.test(n))return Jl(t);for(let o=0,l=i,a=i;o=0;u-=3)if(He[u+1]==-c){let d=He[u+2],p=d&2?i:d&4?d&1?s:i:0;p&&(K[o]=K[He[u]]=p),l=u;break}}else{if(He.length==189)break;He[l++]=o,He[l++]=h,He[l++]=a}else if((f=K[o])==2||f==1){let u=f==i;a=u?0:1;for(let d=l-3;d>=0;d-=3){let p=He[d+2];if(p&2)break;if(u)He[d+2]|=2;else{if(p&4)break;He[d+2]|=4}}}for(let o=0;ol;){let c=h,f=K[--h]!=2;for(;h>l&&f==(K[h-1]!=2);)h--;r.push(new Nt(h,c,f?2:1))}else r.push(new Nt(l,o,0))}else for(let o=0;o0&&t.length&&(t.every(({fromA:l,toA:a})=>athis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=this.view.inputState.composing<0?null:Ic(this.view,e.changes);if(this.hasComposition){this.markedForComposition.clear();let{from:l,to:a}=this.hasComposition;t=new Le(l,a,e.changes.mapPos(l,-1),e.changes.mapPos(a,1)).addToSet(t.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(M.ie||M.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,r=this.updateDeco(),o=Hc(s,r,e.changes);return t=Le.extendWithRanges(t,o),!(this.flags&7)&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=M.chrome||M.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let w=li.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),x=li.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=w.breakAtStart,p=w.openStart,m=x.openEnd;let S=this.compositionView(i);x.breakAtStart?S.breakAfter=1:x.content.length&&S.merge(S.length,S.length,x.content[0],!1,x.openStart,0)&&(S.breakAfter=x.content[0].breakAfter,x.content.shift()),w.content.length&&S.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),u=w.content.concat(S).concat(x.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=li.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:k,off:A}=r.findPos(a,-1);Ol(this,k,A,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new Ye(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Qe(s,[t],t.length);let i=new ke;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8,this.markedForComposition.add(o);let l=W.get(r);l!=o&&(l&&(l.dom=null),o.setDOM(r))},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&_i(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.domAtPos(l.anchor),h=l.empty?a:this.domAtPos(l.head);if(M.gecko&&l.empty&&!this.hasComposition&&Ec(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new ue(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!sn(a.node,a.offset,c.anchorNode,c.anchorOffset)||!sn(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(c.focusNode)&&Wc(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=nn(this.view.root);if(f)if(l.empty){if(M.gecko){let u=Nc(a.node,a.offset);if(u&&u!=3){let d=Ql(a.node,a.offset,u==1?1:-1);d&&(a=new ue(d,u==1?0:d.nodeValue.length))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&c.cursorBidiLevel!=null&&(c.cursorBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new ue(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new ue(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=nn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=ke.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}nearest(e){for(let t=e;t;){let i=W.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=J.WidgetBefore&&r.type!=J.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==J.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?Wt(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?_.RTL:_.LTR}measureTextSize(){for(let r of this.children)if(r instanceof ke){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Wt(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Dl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(B.replace({widget:new Ur(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(e)}updateDeco(){let e=this.view.state.facet(fi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Gl(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};mc(this.view.scrollDOM,o,t.head-1)return null;o+=f.text.length}if(l=l.parentNode,!l)return null;let a=W.get(l);if(a){s=r=a.posAtStart+o;break}}return{from:s,to:r,node:t}}function Ic(n,e){let t=Yl(n);if(!t)return null;let{from:i,to:s,node:r}=t,o=e.mapPos(i,-1),l=e.mapPos(s,1),a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(l-o!=a.length){let u=e.mapPos(i,1),d=e.mapPos(s,-1);if(d-u==a.length)o=u,l=d;else if(n.state.doc.sliceString(l-a.length,l)==a)o=l-a.length;else if(n.state.doc.sliceString(o,o+a.length)==a)l=o+a.length;else return null}let{main:h}=n.state.selection;if(n.state.doc.sliceString(o,l)!=a||o>h.head||l0)i=i.childNodes[s-1],s=at(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return i;if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function Nc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=fe(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function qc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function zn(n,e){return n.tope.top+1}function Gr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function As(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Wt(p);for(let g=0;gA||o==A&&r>k){i=p,s=y,r=k,o=A;let w=A?t0?g0)}k==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&zn(c,y)?c=_r(c,y.bottom):f&&zn(f,y)&&(f=Gr(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Jr(i,u,t);if(l&&i.contentEditable!="false")return As(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Jr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&Vt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Zl(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let w=n.viewState.heightOracle.textHeight/2,x=!1;a=n.elementAtHeight(u),a.type!=J.Text;)for(;u=i>0?a.bottom+w:a.top-w,!(u>=0&&u<=h);){if(x)return t?null:0;x=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Xr(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,k=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(c,f);w&&({offsetNode:y,offset:k}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(c,f);w&&({startContainer:y,startOffset:k}=w,(!n.contentDOM.contains(y)||M.safari&&Kc(y,k,c)||M.chrome&&$c(y,k,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let w=ke.find(n.docView,d);if(!w)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:k}=As(w.dom,c,f))}let A=n.docView.nearest(y);if(!A)return null;if(A.isWidget&&((r=A.dom)===null||r===void 0?void 0:r.nodeType)==1){let w=A.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+us(o,r,n.state.tabSize)}function Kc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Vt(n,i-1,i).getBoundingClientRect().left>t}function $c(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Vt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Ms(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==J.Text))return i}return t}function jc(n,e,t,i){let s=Ms(n,e.head),r=!i||s.type!=J.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==_.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function Yr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=Rc(s,r,o,l,t),c=Xl;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` -`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=b.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Uc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==q.Space&&(s=o),s==o}}function Gc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=Zl(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms))return b.cursor(m,e.assoc,void 0,o)}}function Ji(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,i{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in X){let s=X[i];e.contentDOM.addEventListener(i,r=>{Qr(e,r)&&t(s,r)},Ds[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{if(i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(X.mousedown,i),!i.defaultPrevented&&i.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),e.scrollDOM.addEventListener("drop",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(X.drop,i)}),M.chrome&&M.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{Qr(e,l)&&this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Ie(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Ie(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!t.ctrlKey||Jc.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,It(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const ea=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Jc="dthko",ta=[16,17,18,20,91,92,224,225],Ti=6;function Bi(n){return Math.max(0,n)*.7+8}function Xc(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Yc{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=yc(e.contentDOM),this.atoms=e.state.facet(er).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Qc(e,t),this.dragging=ef(e,t)&&ra(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Xc(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Gl(this.view);e.clientX-o.left<=r.left+Ti?i=-Bi(r.left-e.clientX):e.clientX+o.right>=r.right-Ti&&(i=Bi(e.clientX-r.right)),e.clientY-o.top<=r.top+Ti?s=-Bi(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ti&&(s=Bi(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function Qc(n,e){let t=n.state.facet(Fl);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function Zc(n,e){let t=n.state.facet(Hl);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function ef(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=nn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Qr(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=W.get(t))&&i.ignoreEvent(e))return!1;return!0}const X=Object.create(null),Ds=Object.create(null),ia=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function tf(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),na(n,t.value)},50)}function na(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Os!=null&&t.selection.ranges.every(a=>a.empty)&&Os==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}X.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now())};X.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};X.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ds.touchstart=Ds.touchmove={passive:!0};X.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let i of n.state.facet(Wl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=rf(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Yc(n,e,t,i)),i&&n.observer.ignore(()=>Cl(n.contentDOM)),n.inputState.mouseSelection&&n.inputState.mouseSelection.start(e)}};function Zr(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Vc(n.state,e,t);{let s=ke.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,eo=(n,e,t)=>sa(e,t)&&n>=t.left&&n<=t.right;function nf(n,e,t,i){let s=ke.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&eo(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&eo(t,i,l)?1:o&&sa(i,o)?-1:1}function to(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:nf(n,t,e.clientX,e.clientY)}}const sf=M.ie&&M.ie_version<=11;let io=null,no=0,so=0;function ra(n){if(!sf)return n.detail;let e=io,t=so;return io=n,so=Date.now(),no=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(no+1)%3:1}function rf(n,e){let t=to(n,e),i=ra(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=to(n,r),h,c=Zr(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=Zr(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=of(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function of(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}X.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function ro(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&Zc(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}X.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&ro(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else ro(n,e,e.dataTransfer.getData("Text"),!0)};X.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=ia?null:e.clipboardData;t?(na(n,t.getData("text/plain")||t.getData("text/uri-text")),e.preventDefault()):tf(n)};function lf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function af(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Os=null;X.copy=X.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=af(n.state);if(!t&&!s)return;Os=s?t:null;let r=ia?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):lf(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};const oa=Ze.define();function la(n,e){let t=[];for(let i of n.facet(ql)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:oa.of(!0)}):null}function aa(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=la(n.state,e);t?n.dispatch(t):n.update([])}},10)}X.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),aa(n)};X.blur=n=>{n.observer.clearSelectionRange(),aa(n)};X.compositionstart=X.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};X.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,M.chrome&&M.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};X.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};X.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=ea.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const oo=["pre-wrap","normal","pre-line","break-spaces"];class hf{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return oo.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Xi&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return de.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,z.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,z.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ae extends ha{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new $e(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ae||s instanceof ie&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ie?s=new Ae(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):de.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ie extends de{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new $e(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new $e(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==z.ByHeight)return this.blockAt(e,i,s,r);if(t==z.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new $e(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new $e(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new $e(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ie?i[i.length-1]=new ie(r.length+s):i.push(null,new ie(s-1))}if(e>0){let r=i[0];r instanceof ie?i[0]=new ie(e+r.length):i.unshift(new ie(e-1),null)}return de.of(i)}decomposeLeft(e,t){t.push(new ie(e-1),null)}decomposeRight(e,t){t.push(null,new ie(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ie(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=Xi&&(a=-2);let u=new Ae(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new ie(r-l).updateHeight(e,l));let h=de.of(o);return(a<0||Math.abs(h.height-this.height)>=Xi||Math.abs(a-this.heightMetrics(e,t).perLine)>=Xi)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ff extends de{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==z.ByPosNoHeight?z.ByPosNoHeight:z.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,z.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&lo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?de.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function lo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ie&&(i=n[e+1])instanceof ie&&n.splice(e-1,3,new ie(t.length+1+i.length))}const uf=5;class tr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=uf)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ie(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){var t;this.enterLine();let i=(t=e.deco)===null||t===void 0?void 0:t.type;i==J.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i!=J.WidgetBefore&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function mf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Kn{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new hf(t),this.stateDeco=e.facet(fi).filter(i=>typeof i!="function"),this.heightMap=de.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new Le(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Pi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?ho:new xf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:ni(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(fi).filter(c=>typeof c!="function");let s=e.changedRanges,r=Le.extendWithRanges(s,df(i,this.stateDeco,e?e.changes:Z.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet($l)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?_.RTL:_.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0,f=parseInt(i.paddingTop)||0,u=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8),this.scrollTop!=e.scrollDOM.scrollTop&&(this.scrollAnchorHeight=-1,this.scrollTop=e.scrollDOM.scrollTop),this.scrolledToBottom=Ml(e.scrollDOM);let d=(this.printing?mf:gf)(t,this.paddingTop),p=d.top-this.pixelViewport.top,m=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:x,textHeight:S}=e.docView.measureTextSize();o=w>0&&s.refresh(r,w,x,S,y/x,A),o&&(e.docView.minWidth=0,h|=8)}p>0&&m>0?c=Math.max(p,m):p<0&&m<0&&(c=Math.min(p,m)),s.heightChanged=!1;for(let w of this.viewports){let x=w.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?de.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle,[new Le(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new cf(w.from,x))}s.heightChanged&&(h|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Pi(s.lineAt(o-i*1e3,z.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,z.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,z.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=_.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(b.cursor(c),!1,!0).head;g>h&&(c=g)}m=new Kn(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ni(this.heightMap.lineAt(e,z.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ni(this.heightMap.lineAt(this.scaler.fromDOM(e),z.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ni(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Pi{constructor(e,t){this.from=e,this.to=t}}function bf(n,e,t){let i=[],s=n,r=0;return j.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Ri(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function wf(n,e){for(let t of n)if(e(t))return t}const ho={toDOM(n){return n},fromDOM(n){return n},scale:1};class xf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,z.ByPos,e,0,0).top,c=t.lineAt(a,z.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tni(s,e)):n._content)}const Ei=D.define({combine:n=>n.join(" ")}),Ts=D.define({combine:n=>n.indexOf(!0)>-1}),Bs=ot.newName(),ca=ot.newName(),fa=ot.newName(),ua={"&light":"."+ca,"&dark":"."+fa};function Ps(n,e,t){return new ot(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const kf=Ps("."+Bs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ua);class Sf{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:Cf(e),a=new Bl(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Af(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!gs(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!gs(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function da(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` - `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}),t){let o=n.state;if(M.ios&&n.inputState.flushIOSKey(n)||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&It(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengthc(n,t.from,t.to,l)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let a;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let c=s.fromt.to?o.sliceDoc(t.to,s.to):"";a=o.replaceSelection(n.state.toText(c+t.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let c=o.changes(t),f=i&&i.main.to<=c.newLength?i.main:void 0;if(o.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let u=n.state.sliceDoc(t.from,t.to),d=Yl(n)||n.state.doc.lineAt(s.head),p=s.to-t.to,m=s.to-s.from;a=o.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:f||g.map(c)};let y=g.to-p,k=y-u.length;if(g.to-g.from!=m||n.state.sliceDoc(k,y)!=u||d&&g.to>=d.from&&g.from<=d.to)return{range:g};let A=o.changes({from:k,to:y,insert:t.insert}),w=g.to-s.to;return{changes:A,range:f?b.range(Math.max(0,f.anchor+w),Math.max(0,f.head+w)):g.map(A)}})}else a={changes:c,selection:f&&o.selection.replaceRange(f)}}let h="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,h+=".compose",n.inputState.compositionFirstChange&&(h+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(a,{scrollIntoView:!0,userEvent:h}),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function vf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Cf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Hr(t,i)),(s!=t||r!=i)&&e.push(new Hr(s,r))),e}function Af(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Mf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},$n=M.ie&&M.ie_version<=11;class Df{constructor(e){this.view=e,this.active=!1,this.selectionRange=new bc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),$n&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Dn)?i.root.activeElement!=this.dom:!_i(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&sn(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&pc(this.dom.ownerDocument)==this.dom&&Of(this.view)||nn(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=_i(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&It(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&_i(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new Sf(this.view,e,t,i))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=da(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=co(t,e.previousSibling||e.target.previousSibling,-1),s=co(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function co(n,e,t){for(;e;){let i=W.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Of(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return sn(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class O{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||wc(e.parent)||document,this.viewState=new ao(e.state||N.create(e)),this.plugins=this.state.facet(ti).map(t=>new Vn(t));for(let t of this.plugins)t.update(this);this.observer=new Df(this),this.inputState=new _c(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new jr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){let t=e.length==1&&e[0]instanceof ee?e[0]:this.state.update(...e);this._dispatch(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(oa))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=la(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=ln.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new on(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($r)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=an.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ii)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Ei)!=s.state.facet(Ei)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Ss))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!da(this,c)&&h.force&&It(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new ao(e),this.plugins=e.facet(ti).map(i=>new Vn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new jr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ti),i=e.state.facet(ti);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Vn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,{scrollTop:s}=i,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;s!=this.viewState.scrollTop&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Ml(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ie(this.state,p),fo}}),f=ln.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=i.scrollTop=s+p,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ss))l(t)}get themeClasses(){return Bs+" "+(this.state.facet(Ts)?fa:ca)+" "+this.state.facet(Ei)}updateAttrs(){let e=uo(this,jl,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Dn)?"true":"false",class:"cm-content",style:`${M.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),uo(this,Zs,t);let i=this.observer.ignore(()=>{let s=xs(this.contentDOM,this.contentAttrs,t),r=xs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(O.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ii),ot.mount(this.root,this.styleModules.concat(kf).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return qn(this,e,Yr(this,e,t,i))}moveByGroup(e,t){return qn(this,e,Yr(this,e,t,i=>Uc(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return jc(this,e,t,i)}moveVertically(e,t,i){return qn(this,e,Gc(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Zl(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[Nt.find(r,e-s.from,-1,t)];return An(i,o.dir==_.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Kl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Tf)return Jl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=Lc(e.text,t);return this.bidiCache.push(new an(e.from,e.to,t,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Cl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return $r.of(new on(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return pe.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=ot.newName(),s=[Ei.of(i),ii.of(Ps(`.${i}`,e))];return t&&t.dark&&s.push(Ts.of(!0)),s}static baseTheme(e){return vt.lowest(ii.of(Ps("."+Bs,e,ua)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&W.get(i)||W.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}O.styleModule=ii;O.inputHandler=zl;O.focusChangeEffect=ql;O.perLineTextDirection=Kl;O.exceptionSink=Vl;O.updateListener=Ss;O.editable=Dn;O.mouseSelectionStyle=Wl;O.dragMovesSelection=Hl;O.clickAddsSelectionRange=Fl;O.decorations=fi;O.atomicRanges=er;O.scrollMargins=Ul;O.darkTheme=Ts;O.contentAttributes=Zs;O.editorAttributes=jl;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=E.define();const Tf=4096,fo={};class an{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:_.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&ws(o,t)}return t}const Bf=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function Pf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function Rf(n,e,t){return ga(pa(n.state),e,n,t)}let it=null;const Ef=4e3;function If(n,e=Bf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Pf(y,e));for(let y=1;y{let w=it={view:A,prefix:k,scope:o};return setTimeout(()=>{it==w&&(it=null)},Ef),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function ga(n,e,t,i){let s=dc(e),r=ne(s,0),o=Oe(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;it&&it.view==t&&it.scope==i&&(l=it.prefix+" ",ta.indexOf(e.keyCode)<0&&(h=!0,it=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Ii(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(p=lt[e.keyCode])&&p!=s?(u(d[l+Ii(p,e,!0)])||e.shiftKey&&(m=ci[e.keyCode])!=s&&m!=p&&u(d[l+Ii(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Ii(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Si{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=ma(e);return[new Si(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Nf(e,t,i)}}function ma(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==_.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function go(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:J.Text}}function Nf(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==_.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=ma(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Ms(n,i),p=Ms(n,s),m=d.type==J.Text?d:null,g=p.type==J.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=go(n,i,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=go(n,s,g)),m&&g&&m.from==g.from)return k(A(t.from,t.to,m));{let x=m?A(t.from,null,m):w(d,!1),S=g?A(null,t.to,g):w(p,!0),T=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&x.bottom+n.defaultLineHeight/2Y&&be.from=oe)break;Q>te&&V(Math.max(U,te),x==null&&U<=Y,Math.min(Q,oe),S==null&&Q>=re,we.dir)}if(te=Fe.to+1,te>=oe)break}return R.length==0&&V(Y,x==null,re,S==null,n.textDirection),{top:F,bottom:P,horizontal:R}}function w(x,S){let T=l.top+(S?x.top:x.bottom);return{top:T,bottom:T,horizontal:[]}}}function Ff(n,e){return n.constructor==e.constructor&&n.eq(e)}class Hf{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Yi)!=e.state.facet(Yi)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Yi);for(;t!Ff(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Yi=D.define();function ya(n){return[pe.define(e=>new Hf(e,n)),Yi.of(n)]}const ba=!M.ios,ui=D.define({combine(n){return Ct(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Tg(n={}){return[ui.of(n),Wf,Vf,zf,$l.of(!0)]}function wa(n){return n.startState.facet(ui)!=n.state.facet(ui)}const Wf=ya({above:!0,markers(n){let{state:e}=n,t=e.facet(ui),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||ba:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Si.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=wa(n);return t&&mo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){mo(e.state,n)},class:"cm-cursorLayer"});function mo(n,e){e.style.animationDuration=n.facet(ui).cursorBlinkRate+"ms"}const Vf=ya({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Si.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||wa(n)},class:"cm-selectionLayer"}),xa={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ba&&(xa[".cm-line"].caretColor="transparent !important");const zf=vt.highest(O.theme(xa)),ka=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),si=ye.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(ka)?i.value:t,n)}}),qf=pe.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(si);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(si)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(si),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(si)!=n&&this.view.dispatch({effects:ka.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Bg(){return[si,qf]}function yo(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Kf(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class $f{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new xt,i=t.add.bind(t);for(let{from:s,to:r}of Kf(e,this.maxLength))yo(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Ls=/x/.unicode!=null?"gu":"g",jf=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ls),Uf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let jn=null;function Gf(){var n;if(jn==null&&typeof document<"u"&&document.body){let e=document.body.style;jn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return jn||!1}const Qi=D.define({combine(n){let e=Ct(n,{render:null,specialChars:jf,addSpecialChars:null});return(e.replaceTabs=!Gf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ls)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ls)),e}});function Pg(n={}){return[Qi.of(n),_f()]}let bo=null;function _f(){return bo||(bo=pe.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Qi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new $f({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ne(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=wi(o.text,l,i-o.from);return B.replace({widget:new Qf((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new Yf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Qi);n.startState.facet(Qi)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Jf="•";function Xf(n){return n>=32?Jf:n==10?"␤":String.fromCharCode(9216+n)}class Yf extends At{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Xf(this.code),i=e.state.phrase("Control character")+" "+(Uf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Qf extends At{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Zf extends At{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?Wt(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=An(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Lg(n){return pe.fromClass(class{constructor(e){this.view=e,this.placeholder=n?B.set([B.widget({widget:new Zf(n),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Rs=2e3;function eu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Rs||t.off>Rs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=us(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=us(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function tu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function wo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Rs?-1:s==i.length?tu(n,e.clientX):wi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function iu(n,e){let t=wo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=wo(n,s);if(!l)return i;let a=eu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Rg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?iu(t,i):null)}const Ni="-10000px";class nu{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||su}}}),xo=new WeakMap,Sa=pe.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Un);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new nu(n,va,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Un);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Ni,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Un).tooltipSpace(this.view)}}writeMeasure(n){var e;let{editor:t,space:i}=n,s=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||h.rightMath.min(t.right,i.right)+.1){a.style.top=Ni;continue}let f=o.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=xo.get(l))!==null&&e!==void 0?e:c.bottom-c.top,m=l.offset||ou,g=this.view.textDirection==_.LTR,y=c.width>i.right-i.left?g?i.left:i.right-c.width:g?Math.min(h.left-(f?14:0)+m.x,i.right-d):Math.max(i.left,h.left-d+(f?14:0)-m.x),k=!!o.above;!o.strictSide&&(k?h.top-(c.bottom-c.top)-m.yi.bottom)&&k==i.bottom-h.bottom>h.top-i.top&&(k=!k);let A=(k?h.top-i.top:i.bottom-h.bottom)-u;if(Ay&&S.topw&&(w=k?S.top-p-2-u:S.bottom+u+2);this.position=="absolute"?(a.style.top=w-n.parent.top+"px",a.style.left=y-n.parent.left+"px"):(a.style.top=w+"px",a.style.left=y+"px"),f&&(f.style.left=`${h.left+(g?m.x:-m.x)-(y+14-7)}px`),l.overlap!==!0&&s.push({left:y,top:w,right:x,bottom:w+p}),a.classList.toggle("cm-tooltip-above",k),a.classList.toggle("cm-tooltip-below",!k),l.positioned&&l.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Ni}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),ru=O.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ou={x:0,y:0},va=D.define({enables:[Sa,ru]});function Ca(n,e){let t=n.plugin(Sa);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const ko=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function hn(n,e){let t=n.plugin(Aa),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Aa=pe.fromClass(class{constructor(n){this.input=n.state.facet(cn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(ko);this.top=new Fi(n,!0,e.topContainer),this.bottom=new Fi(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(ko);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Fi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Fi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(cn);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Fi{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=So(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=So(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function So(n){let e=n.nextSibling;return n.remove(),e}const cn=D.define({enables:Aa});class kt extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}kt.prototype.elementClass="";kt.prototype.toDOM=void 0;kt.prototype.mapMode=he.TrackBefore;kt.prototype.startSide=kt.prototype.endSide=-1;kt.prototype.point=!0;const lu=D.define(),au=new class extends kt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},hu=lu.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(au.range(s)))}return j.of(e)});function Eg(){return hu}const cu=1024;let fu=0;class Te{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=fu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ge.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class uu{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const du=Object.create(null);class ge{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):du,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ge(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ge.none=new ge("",Object.create(null),0,8);class nr{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|$.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:or(ge.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new H(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new H(ge.none,t,i,s)))}static build(e){return gu(e)}}H.empty=new H(ge.none,[],[],0);class sr{constructor(e,t){this.buffer=e,this.index=t}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]}get pos(){return this.index}next(){this.index-=4}fork(){return new sr(this.buffer,this.index)}}class Mt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ge.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Da(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function qt(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Ma(s,i,f,f+c.length)){if(c instanceof Mt){if(r&$.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new je(new pu(o,c,e,f),null,u)}else if(r&$.IncludeAnonymous||!c.type.isAnonymous||rr(c)){let u;if(!(r&$.IgnoreMounts)&&c.props&&(u=c.prop(L.mounted))&&!u.overlay)return new Re(u.tree,f,e,o);let d=new Re(c,f,e,o);return r&$.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&$.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&$.IgnoreOverlays)&&(s=this._tree.prop(L.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Re(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new di(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Da(this,e)}getChild(e,t=null,i=null){let s=fn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return fn(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return un(this,e)}}function fn(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function un(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class pu{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class je{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new je(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&$.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new je(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new je(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new je(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new di(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new H(this.type,e,t,this.to-this.from)}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Da(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=fn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return fn(this,e,t,i)}get node(){return this}matchContext(e){return un(this,e)}}class di{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Re)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Re?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&$.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&$.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&$.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&$.IncludeAnonymous||l instanceof Mt||!l.type.isAnonymous||rr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return un(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function rr(n){return n.children.some(e=>e instanceof Mt||!e.type.isAnonymous||rr(e))}function gu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=cu,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new sr(t,t.length):t,a=i.types,h=0,c=0;function f(w,x,S,T,F){let{id:P,start:R,end:V,size:Y}=l,re=c;for(;Y<0;)if(l.next(),Y==-1){let we=r[P];S.push(we),T.push(R-w);return}else if(Y==-3){h=P;return}else if(Y==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let be=a[P],te,oe,Fe=R-w;if(V-R<=s&&(oe=m(l.pos-x,F))){let we=new Uint16Array(oe.size-oe.skip),U=l.pos-oe.size,Q=we.length;for(;l.pos>U;)Q=g(oe.start,we,Q);te=new Mt(we,V-oe.start,i),Fe=oe.start-w}else{let we=l.pos-Y;l.next();let U=[],Q=[],ft=P>=o?P:-1,Dt=0,Ai=V;for(;l.pos>we;)ft>=0&&l.id==ft&&l.size>=0?(l.end<=Ai-s&&(d(U,Q,R,Dt,l.end,Ai,ft,re),Dt=U.length,Ai=l.end),l.next()):f(R,we,U,Q,ft);if(ft>=0&&Dt>0&&Dt-1&&Dt>0){let Sr=u(be);te=or(be,U,Q,0,U.length,0,V-R,Sr,Sr)}else te=p(be,U,Q,V-R,re-V)}S.push(te),T.push(Fe)}function u(w){return(x,S,T)=>{let F=0,P=x.length-1,R,V;if(P>=0&&(R=x[P])instanceof H){if(!P&&R.type==w&&R.length==T)return R;(V=R.prop(L.lookAhead))&&(F=S[P]+R.length+V)}return p(w,x,S,T,F)}}function d(w,x,S,T,F,P,R,V){let Y=[],re=[];for(;w.length>T;)Y.push(w.pop()),re.push(x.pop()+S-F);w.push(p(i.types[R],Y,re,P-F,V-P)),x.push(F-S)}function p(w,x,S,T,F=0,P){if(h){let R=[L.contextHash,h];P=P?[R].concat(P):[R]}if(F>25){let R=[L.lookAhead,F];P=P?[R].concat(P):[R]}return new H(w,x,S,T,P)}function m(w,x){let S=l.fork(),T=0,F=0,P=0,R=S.end-s,V={size:0,start:0,skip:0};e:for(let Y=S.pos-w;S.pos>Y;){let re=S.size;if(S.id==x&&re>=0){V.size=T,V.start=F,V.skip=P,P+=4,T+=4,S.next();continue}let be=S.pos-re;if(re<0||be=o?4:0,oe=S.start;for(S.next();S.pos>be;){if(S.size<0)if(S.size==-3)te+=4;else break e;else S.id>=o&&(te+=4);S.next()}F=oe,T+=re,P+=te}return(x<0||T==w)&&(V.size=T,V.start=F,V.skip=P),V.size>4?V:void 0}function g(w,x,S){let{id:T,start:F,end:P,size:R}=l;if(l.next(),R>=0&&T4){let Y=l.pos-(R-4);for(;l.pos>Y;)S=g(w,x,S)}x[--S]=V,x[--S]=P-w,x[--S]=F-w,x[--S]=T}else R==-3?h=T:R==-4&&(c=T);return S}let y=[],k=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,k,-1);let A=(e=n.length)!==null&&e!==void 0?e:y.length?k[0]+y[0].length:0;return new H(a[n.topID],y.reverse(),k.reverse(),A)}const Co=new WeakMap;function Zi(n,e){if(!n.isAnonymous||e instanceof Mt||e.type!=n)return 1;let t=Co.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof H)){t=1;break}t+=Zi(n,i)}Co.set(e,t)}return t}function or(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;S+=T}if(A==w+1){if(S>c){let T=p[w];d(T.children,T.positions,0,T.children.length,m[w]+k);continue}f.push(p[w])}else{let T=m[A-1]+p[A-1].length-x;f.push(or(n,p,m,w,A,x,T,null,a))}u.push(x+k-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Ig{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof je?this.setBuffer(e.context.buffer,e.index,t):e instanceof Re&&this.map.set(e.tree,t)}get(e){return e instanceof je?this.getBuffer(e.context.buffer,e.index):e instanceof Re?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xe{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Xe(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Xe(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Te(s.from,s.to)):[new Te(0,0)]:[new Te(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class mu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Ng(n){return(e,t,i,s)=>new bu(e,n,t,i,s)}class Ao{constructor(e,t,i,s,r){if(this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r,!r.length||r.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class yu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Es=new L({perNode:!0});class bu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new H(i.type,i.children,i.positions,i.length,i.propValues.concat([[Es,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[L.mounted.id]=new uu(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=wu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Te(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Te(s.from,s.to)),a.fromnew Te(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function wu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Mo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let m=[],g=[];Mo(o,h,p,m,g,u);let y=l[p+1],k=l[p+2],A=y+r==e.from&&k+r==e.to&&l[p]==e.type.id;return m.push(A?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],y,k-y)),g.push(y-u),Mo(o,l[p+3],c,m,g,u),new H(f,m,g,d)}s.children[i]=a(0,l.length,ge.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Do{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor($.IncludeAnonymous|$.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,$.IgnoreOverlays|$.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof H)t=t.children[0];else break}return!1}}class ku{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Es))!==null&&t!==void 0?t:i.to,this.inner=new Do(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Es))!==null&&e!==void 0?e:t.to,this.inner=new Do(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Oo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Te(l,a.to))):a.to>l?t[r--]=new Te(l,a.to):t.splice(r--,1))}}return i}function Su(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Te(u.from+i,u.to+i)),f=Su(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Xe(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Xe(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let vu=0;class qe{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=vu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new qe([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new dn;return t=>t.modified.indexOf(e)>-1?t:dn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Cu=0;class dn{constructor(){this.instances=[],this.id=Cu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Au(t,l.modified));if(i)return i;let s=[],r=new qe(s,e,t);for(let l of t)l.instances.push(r);let o=Mu(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(dn.get(l,a));return r}}function Au(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Mu(n){let e=[[]];for(let t=0;ti.length-t.length)}function Du(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new pn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Ta.add(e)}const Ta=new L;class pn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Ou(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Tu(n,e,t,i=0,s=n.length){let r=new Bu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Bu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Pu(e)||pn.empty,f=Ou(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let k=g=A||!e.nextSibling())););if(!k||A>i)break;y=k.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,k.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Pu(n){let e=n.type.prop(Ta);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const v=qe.define,Wi=v(),et=v(),Bo=v(et),Po=v(et),tt=v(),Vi=v(tt),Gn=v(tt),ze=v(),ut=v(ze),We=v(),Ve=v(),Is=v(),Qt=v(Is),zi=v(),C={comment:Wi,lineComment:v(Wi),blockComment:v(Wi),docComment:v(Wi),name:et,variableName:v(et),typeName:Bo,tagName:v(Bo),propertyName:Po,attributeName:v(Po),className:v(et),labelName:v(et),namespace:v(et),macroName:v(et),literal:tt,string:Vi,docString:v(Vi),character:v(Vi),attributeValue:v(Vi),number:Gn,integer:v(Gn),float:v(Gn),bool:v(tt),regexp:v(tt),escape:v(tt),color:v(tt),url:v(tt),keyword:We,self:v(We),null:v(We),atom:v(We),unit:v(We),modifier:v(We),operatorKeyword:v(We),controlKeyword:v(We),definitionKeyword:v(We),moduleKeyword:v(We),operator:Ve,derefOperator:v(Ve),arithmeticOperator:v(Ve),logicOperator:v(Ve),bitwiseOperator:v(Ve),compareOperator:v(Ve),updateOperator:v(Ve),definitionOperator:v(Ve),typeOperator:v(Ve),controlOperator:v(Ve),punctuation:Is,separator:v(Is),bracket:Qt,angleBracket:v(Qt),squareBracket:v(Qt),paren:v(Qt),brace:v(Qt),content:ze,heading:ut,heading1:v(ut),heading2:v(ut),heading3:v(ut),heading4:v(ut),heading5:v(ut),heading6:v(ut),contentSeparator:v(ze),list:v(ze),quote:v(ze),emphasis:v(ze),strong:v(ze),link:v(ze),monospace:v(ze),strikethrough:v(ze),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:zi,documentMeta:v(zi),annotation:v(zi),processingInstruction:v(zi),definition:qe.defineModifier(),constant:qe.defineModifier(),function:qe.defineModifier(),standard:qe.defineModifier(),local:qe.defineModifier(),special:qe.defineModifier()};Ba([{tag:C.link,class:"tok-link"},{tag:C.heading,class:"tok-heading"},{tag:C.emphasis,class:"tok-emphasis"},{tag:C.strong,class:"tok-strong"},{tag:C.keyword,class:"tok-keyword"},{tag:C.atom,class:"tok-atom"},{tag:C.bool,class:"tok-bool"},{tag:C.url,class:"tok-url"},{tag:C.labelName,class:"tok-labelName"},{tag:C.inserted,class:"tok-inserted"},{tag:C.deleted,class:"tok-deleted"},{tag:C.literal,class:"tok-literal"},{tag:C.string,class:"tok-string"},{tag:C.number,class:"tok-number"},{tag:[C.regexp,C.escape,C.special(C.string)],class:"tok-string2"},{tag:C.variableName,class:"tok-variableName"},{tag:C.local(C.variableName),class:"tok-variableName tok-local"},{tag:C.definition(C.variableName),class:"tok-variableName tok-definition"},{tag:C.special(C.variableName),class:"tok-variableName2"},{tag:C.definition(C.propertyName),class:"tok-propertyName tok-definition"},{tag:C.typeName,class:"tok-typeName"},{tag:C.namespace,class:"tok-namespace"},{tag:C.className,class:"tok-className"},{tag:C.macroName,class:"tok-macroName"},{tag:C.propertyName,class:"tok-propertyName"},{tag:C.operator,class:"tok-operator"},{tag:C.comment,class:"tok-comment"},{tag:C.meta,class:"tok-meta"},{tag:C.invalid,class:"tok-invalid"},{tag:C.punctuation,class:"tok-punctuation"}]);var _n;const mt=new L;function Pa(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Lu=new L;class Be{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return me(this)}}),this.parser=t,this.extension=[jt.of(this),N.languageData.of((r,o,l)=>{let a=Lo(r,o,l),h=a.type.prop(mt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Lu);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Lo(e,t,i).type.prop(mt)==this.data}findRegions(e){let t=e.facet(jt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(mt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(mt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ns(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function me(n){let e=n.field(Be.state,!1);return e?e.tree:H.empty}class Ru{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Zt=null;class Kt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Kt(e,t,[],H.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Ru(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=H.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Xe.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Zt;Zt=this;try{return e()}finally{Zt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ro(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Xe.applyChanges(i,a),s=H.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Ro(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Oa{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Zt;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new H(ge.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Zt}}function Ro(n,e,t){return Xe.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class $t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new $t(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Kt.create(e.facet(jt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new $t(i)}}Be.state=ye.define({create:$t.init,update(n,e){for(let t of e.effects)if(t.is(Be.setState))return t.value;return e.startState.facet(jt)!=e.state.facet(jt)?$t.init(e.state):n.apply(e)}});let La=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(La=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Jn=typeof navigator<"u"&&(!((_n=navigator.scheduling)===null||_n===void 0)&&_n.isInputPending)?()=>navigator.scheduling.isInputPending():null,Eu=pe.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=La(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Jn&&Jn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Be.setState.of(new $t(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ie(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),jt=D.define({combine(n){return n.length?n[0]:null},enables:n=>[Be.state,Eu,O.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Hg{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Ra=D.define(),On=D.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function St(n){let e=n.facet(On);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function gn(n,e){let t="",i=n.tabSize,s=n.facet(On)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return wi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Iu=new L;function Nu(n,e,t){return Ia(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function Fu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Hu(n){let e=n.type.prop(Iu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Na(o,!0,1,void 0,r&&!Fu(o)?s.from:void 0)}return n.parent==null?Wu:null}function Ia(n,e,t){for(;n;n=n.parent){let i=Hu(n);if(i)return i(lr.create(t,e,n))}return null}function Wu(){return 0}class lr extends Tn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new lr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Vu(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){let e=this.node.parent;return e?Ia(e,this.pos,this.base):0}}function Vu(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function zu(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromNa(i,e,t,n)}function Na(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?zu(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Vg=n=>n.baseIndent;function zg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const qg=new L;function Kg(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(mt)==o.data:o?l=>l==o:void 0,this.style=Ba(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ot(i):null,this.themeType=t.themeType}static define(e,t){return new Bn(e,t||{})}}const Fs=D.define(),Fa=D.define({combine(n){return n.length?[n[0]]:null}});function Xn(n){let e=n.facet(Fs);return e.length?e:n.facet(Fa)}function $g(n,e){let t=[Ku],i;return n instanceof Bn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Fa.of(n)):i?t.push(Fs.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Fs.of(n)),t}class qu{constructor(e){this.markCache=Object.create(null),this.tree=me(e.state),this.decorations=this.buildDeco(e,Xn(e.state))}update(e){let t=me(e.state),i=Xn(e.state),s=i!=Xn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},s,r);return i.finish()}}const Ku=vt.high(pe.fromClass(qu,{decorations:n=>n.decorations})),jg=Bn.define([{tag:C.meta,color:"#404740"},{tag:C.link,textDecoration:"underline"},{tag:C.heading,textDecoration:"underline",fontWeight:"bold"},{tag:C.emphasis,fontStyle:"italic"},{tag:C.strong,fontWeight:"bold"},{tag:C.strikethrough,textDecoration:"line-through"},{tag:C.keyword,color:"#708"},{tag:[C.atom,C.bool,C.url,C.contentSeparator,C.labelName],color:"#219"},{tag:[C.literal,C.inserted],color:"#164"},{tag:[C.string,C.deleted],color:"#a11"},{tag:[C.regexp,C.escape,C.special(C.string)],color:"#e40"},{tag:C.definition(C.variableName),color:"#00f"},{tag:C.local(C.variableName),color:"#30a"},{tag:[C.typeName,C.namespace],color:"#085"},{tag:C.className,color:"#167"},{tag:[C.special(C.variableName),C.macroName],color:"#256"},{tag:C.definition(C.propertyName),color:"#00c"},{tag:C.comment,color:"#940"},{tag:C.invalid,color:"#f00"}]),$u=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ha=1e4,Wa="()[]{}",Va=D.define({combine(n){return Ct(n,{afterCursor:!0,brackets:Wa,maxScanDistance:Ha,renderMatch:Gu})}}),ju=B.mark({class:"cm-matchingBracket"}),Uu=B.mark({class:"cm-nonmatchingBracket"});function Gu(n){let e=[],t=n.matched?ju:Uu;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const _u=ye.define({create(){return B.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Va);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=Ue(e.state,s.head,-1,i)||s.head>0&&Ue(e.state,s.head-1,1,i)||i.afterCursor&&(Ue(e.state,s.head,1,i)||s.headO.decorations.from(n)}),Ju=[_u,$u];function Ug(n={}){return[Va.of(n),Ju]}const Xu=new L;function Hs(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Ws(n){let e=n.type.prop(Xu);return e?e(n.node):n}function Ue(n,e,t,i={}){let s=i.maxScanDistance||Ha,r=i.brackets||Wa,o=me(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Hs(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Yu(n,e,t,a,c,h,r)}}return Qu(n,e,t,o,l.type,s,r)}function Yu(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Eo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Zu(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||ed,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||hr}}function ed(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Io=new WeakMap;class qa extends Be{constructor(e){let t=Pa(e.languageData),i=Zu(e),s,r=new class extends Oa{createParse(o,l,a){return new id(s,o,l,a)}};super(t,r,[Ra.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=rd(t),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new Ua(i.tokenTable):sd}static define(e){return new qa(e)}getIndent(e,t){let i=me(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Io.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof H&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&ar(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Ka(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?St(i):4),tree:H.empty}}class id{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Kt.get(),o=s[0].from,{state:l,tree:a}=td(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`;this.styleTag.textContent=r}}}var lt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ci={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fc=typeof navigator<"u"&&/Mac/.test(navigator.platform),uc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var se=0;se<10;se++)lt[48+se]=lt[96+se]=String(se);for(var se=1;se<=24;se++)lt[se+111]="F"+se;for(var se=65;se<=90;se++)lt[se]=String.fromCharCode(se+32),ci[se]=String.fromCharCode(se);for(var Hn in lt)ci.hasOwnProperty(Hn)||(ci[Hn]=lt[Hn]);function dc(n){var e=fc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||uc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ci:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function nn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function gs(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function pc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function _i(n,e){if(!e.anchorNode)return!1;try{return gs(n,e.anchorNode)}catch{return!1}}function Vt(n){return n.nodeType==3?kt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function sn(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function rn(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Er(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:at(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=rn(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?at(n):0}else return!1}}function at(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function An(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function gc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function mc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body;if(d)u=gc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();u={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let p=0,m=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+m&&(m=e.bottom-u.bottom+m+o)):e.bottom>u.bottom&&(m=e.bottom-u.bottom+o,t<0&&e.top-m0&&e.right>u.right+p&&(p=e.right-u.right+p+r)):e.right>u.right&&(p=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class bc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?at(t):0),i,Math.min(e.focusOffset,i?at(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Tt=null;function Cl(n){if(n.setActive)return n.setActive();if(Tt)return n.focus(Tt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Tt==null?{get preventScroll(){return Tt={preventScroll:!0},!0}}:void 0),!Tt){Tt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class de{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new de(e.parentNode,rn(e),t)}static after(e,t){return new de(e.parentNode,rn(e)+1,t)}}const Ys=[];class W{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=W.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Nr(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Nr(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=at(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!W.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Ys){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ol(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(tr)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=W.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Fr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class Hr{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}let De=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ms=typeof document<"u"?document:{documentElement:{style:{}}};const ys=/Edge\/(\d+)/.exec(De.userAgent),Pl=/MSIE \d/.test(De.userAgent),bs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(De.userAgent),Mn=!!(Pl||bs||ys),Wr=!Mn&&/gecko\/(\d+)/i.test(De.userAgent),Wn=!Mn&&/Chrome\/(\d+)/.exec(De.userAgent),Vr="webkitFontSmoothing"in ms.documentElement.style,Ll=!Mn&&/Apple Computer/.test(De.vendor),zr=Ll&&(/Mobile\/\w+/.test(De.userAgent)||De.maxTouchPoints>2);var M={mac:zr||/Mac/.test(De.platform),windows:/Win/.test(De.platform),linux:/Linux|X11/.test(De.platform),ie:Mn,ie_version:Pl?ms.documentMode||6:bs?+bs[1]:ys?+ys[1]:0,gecko:Wr,gecko_version:Wr?+(/Firefox\/(\d+)/.exec(De.userAgent)||[0,0])[1]:0,chrome:!!Wn,chrome_version:Wn?+Wn[1]:0,ios:zr,android:/Android\b/.test(De.userAgent),webkit:Vr,safari:Ll,webkit_version:Vr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ms.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const kc=256;class Je extends W{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Je)||this.length-(t-e)+i.length>kc||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Je(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new de(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Sc(this.dom,e,t)}}class Qe extends W{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Al(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Qe&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Qe(this.mark,t,o)}domAtPos(e){return Rl(this,e)}coordsAt(e,t){return Il(this,e,t)}}function Sc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?An(a,o<0):a||null}class gt extends W{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new gt(e,t,i)}split(e){let t=gt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof gt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?de.before(this.dom):de.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?de.before(this.dom):de.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return I.empty}get isHidden(){return!0}}Je.prototype.children=gt.prototype.children=zt.prototype.children=Ys;function Rl(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Qe&&s.length&&(i=s[s.length-1])instanceof Qe&&i.mark.eq(e.mark)?El(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Il(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function xs(n,e,t){let i=null;if(e)for(let s in e)t&&s in t||n.removeAttribute(i=s);if(t)for(let s in t)e&&e[s]==t[s]||n.setAttribute(i=s,t[s]);return!!i}function Cc(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ht(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Nl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new ht(e,i,s,t,e.widget||null,!0)}static line(e){return new ki(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=j.empty;class xi extends B{constructor(e){let{start:t,end:i}=Nl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof xi&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&Qs(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}xi.prototype.point=!1;class ki extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ki&&this.spec.class==e.spec.class&&Qs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ki.prototype.mapMode=he.TrackBefore;ki.prototype.point=!0;class ht extends B{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?he.TrackBefore:he.TrackAfter:he.TrackDel}get type(){return this.startSide=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ht&&Ac(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ht.prototype.point=!0;function Nl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Ac(n,e){return n==e||!!(n&&e&&n.compare(e))}function ks(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class ue extends W{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof ue))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Tl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new ue;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Qs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){El(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=ws(t,this.attrs||{})),i&&(this.attrs=ws({class:i},this.attrs||{}))}domAtPos(e){return Rl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Al(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(xs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&W.get(s)instanceof Qe;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=W.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof Je))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Je)||/[^ -~]/.test(i.text))return null;let s=Vt(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Il(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof ue)return r;if(o>t)break}s=o+r.breakAfter}return null}}class bt extends W{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof bt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Oi(new Je(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ht){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof ht)if(i.block){let{type:a}=i;a==J.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new bt(i.widget||new Kr("div"),l,a))}else{let a=gt.create(i.widget||new Kr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Oi(new zt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Oi(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new li(e,t,i,r);return o.openEnd=j.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Oi(n,e){for(let t of e)n=new Qe(t,[n],n.length);return n}class Kr extends Mt{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Fl=D.define(),Hl=D.define(),Wl=D.define(),Vl=D.define(),Ss=D.define(),zl=D.define(),ql=D.define(),Kl=D.define({combine:n=>n.some(e=>e)}),$l=D.define({combine:n=>n.some(e=>e)});class on{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new on(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const $r=E.define({map:(n,e)=>n.map(e)});function Ie(n,e,t){let i=n.facet(Vl);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Dn=D.define({combine:n=>n.length?n[0]:!0});let Mc=0;const ti=D.define();class ge{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new ge(Mc++,e,i,o=>{let l=[ti.of(o)];return r&&l.push(fi.of(a=>{let h=a.plugin(o);return h?r(h):B.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return ge.define(i=>new e(i),t)}}class Vn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ie(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ie(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ie(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const jl=D.define(),Zs=D.define(),fi=D.define(),er=D.define(),Ul=D.define();function Gl(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Ul)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ii=D.define();class Le{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Le(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Le(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class ln{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Z.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Le(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new ln(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var _=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(_||(_={}));const vs=_.LTR,Dc=_.RTL;function _l(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const K=[];function Lc(n,e){let t=n.length,i=e==vs?1:2,s=e==vs?2:1;if(!n||i==1&&!Pc.test(n))return Jl(t);for(let o=0,l=i,a=i;o=0;u-=3)if(He[u+1]==-c){let d=He[u+2],p=d&2?i:d&4?d&1?s:i:0;p&&(K[o]=K[He[u]]=p),l=u;break}}else{if(He.length==189)break;He[l++]=o,He[l++]=h,He[l++]=a}else if((f=K[o])==2||f==1){let u=f==i;a=u?0:1;for(let d=l-3;d>=0;d-=3){let p=He[d+2];if(p&2)break;if(u)He[d+2]|=2;else{if(p&4)break;He[d+2]|=4}}}for(let o=0;ol;){let c=h,f=K[--h]!=2;for(;h>l&&f==(K[h-1]!=2);)h--;r.push(new Ft(h,c,f?2:1))}else r.push(new Ft(l,o,0))}else for(let o=0;o0&&t.length&&(t.every(({fromA:l,toA:a})=>athis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=this.view.inputState.composing<0?null:Ic(this.view,e.changes);if(this.hasComposition){this.markedForComposition.clear();let{from:l,to:a}=this.hasComposition;t=new Le(l,a,e.changes.mapPos(l,-1),e.changes.mapPos(a,1)).addToSet(t.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(M.ie||M.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,r=this.updateDeco(),o=Hc(s,r,e.changes);return t=Le.extendWithRanges(t,o),!(this.flags&7)&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=M.chrome||M.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let w=li.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),x=li.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=w.breakAtStart,p=w.openStart,m=x.openEnd;let S=this.compositionView(i);x.breakAtStart?S.breakAfter=1:x.content.length&&S.merge(S.length,S.length,x.content[0],!1,x.openStart,0)&&(S.breakAfter=x.content[0].breakAfter,x.content.shift()),w.content.length&&S.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),u=w.content.concat(S).concat(x.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=li.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:k,off:A}=r.findPos(a,-1);Ol(this,k,A,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new Je(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Qe(s,[t],t.length);let i=new ue;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8,this.markedForComposition.add(o);let l=W.get(r);l!=o&&(l&&(l.dom=null),o.setDOM(r))},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&_i(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.domAtPos(l.anchor),h=l.empty?a:this.domAtPos(l.head);if(M.gecko&&l.empty&&!this.hasComposition&&Ec(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new de(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!sn(a.node,a.offset,c.anchorNode,c.anchorOffset)||!sn(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(c.focusNode)&&Wc(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=nn(this.view.root);if(f)if(l.empty){if(M.gecko){let u=Nc(a.node,a.offset);if(u&&u!=3){let d=Ql(a.node,a.offset,u==1?1:-1);d&&(a=new de(d,u==1?0:d.nodeValue.length))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&c.cursorBidiLevel!=null&&(c.cursorBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new de(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new de(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=nn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=ue.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}nearest(e){for(let t=e;t;){let i=W.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=J.WidgetBefore&&r.type!=J.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==J.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof ue))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Je))return null;let r=ce(s.text,i);if(r==i)return null;let o=kt(s.dom,i,r).getClientRects();return!o.length||o[0].top>=o[0].bottom?null:o[0]}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?Vt(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?_.RTL:_.LTR}measureTextSize(){for(let r of this.children)if(r instanceof ue){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Vt(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Dl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(B.replace({widget:new Ur(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(e)}updateDeco(){let e=this.view.state.facet(fi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Gl(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};mc(this.view.scrollDOM,o,t.head-1)return null;o+=f.text.length}if(l=l.parentNode,!l)return null;let a=W.get(l);if(a){s=r=a.posAtStart+o;break}}return{from:s,to:r,node:t}}function Ic(n,e){let t=Yl(n);if(!t)return null;let{from:i,to:s,node:r}=t,o=e.mapPos(i,-1),l=e.mapPos(s,1),a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(l-o!=a.length){let u=e.mapPos(i,1),d=e.mapPos(s,-1);if(d-u==a.length)o=u,l=d;else if(n.state.doc.sliceString(l-a.length,l)==a)o=l-a.length;else if(n.state.doc.sliceString(o,o+a.length)==a)l=o+a.length;else return null}let{main:h}=n.state.selection;if(n.state.doc.sliceString(o,l)!=a||o>h.head||l0)i=i.childNodes[s-1],s=at(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return i;if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function Nc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=ce(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function qc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function zn(n,e){return n.tope.top+1}function Gr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function As(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Vt(p);for(let g=0;gA||o==A&&r>k){i=p,s=y,r=k,o=A;let w=A?t0?g0)}k==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&zn(c,y)?c=_r(c,y.bottom):f&&zn(f,y)&&(f=Gr(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Jr(i,u,t);if(l&&i.contentEditable!="false")return As(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Jr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&kt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Zl(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let w=n.viewState.heightOracle.textHeight/2,x=!1;a=n.elementAtHeight(u),a.type!=J.Text;)for(;u=i>0?a.bottom+w:a.top-w,!(u>=0&&u<=h);){if(x)return t?null:0;x=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Xr(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,k=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(c,f);w&&({offsetNode:y,offset:k}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(c,f);w&&({startContainer:y,startOffset:k}=w,(!n.contentDOM.contains(y)||M.safari&&Kc(y,k,c)||M.chrome&&$c(y,k,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let w=ue.find(n.docView,d);if(!w)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:k}=As(w.dom,c,f))}let A=n.docView.nearest(y);if(!A)return null;if(A.isWidget&&((r=A.dom)===null||r===void 0?void 0:r.nodeType)==1){let w=A.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+us(o,r,n.state.tabSize)}function Kc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return kt(n,i-1,i).getBoundingClientRect().left>t}function $c(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():kt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Ms(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==J.Text))return i}return t}function jc(n,e,t,i){let s=Ms(n,e.head),r=!i||s.type!=J.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==_.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function Yr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=Rc(s,r,o,l,t),c=Xl;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` +`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=b.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Uc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==q.Space&&(s=o),s==o}}function Gc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=Zl(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms))return b.cursor(m,e.assoc,void 0,o)}}function Ji(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,i{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in X){let s=X[i];e.contentDOM.addEventListener(i,r=>{Qr(e,r)&&t(s,r)},Ds[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{if(i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(X.mousedown,i),!i.defaultPrevented&&i.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),e.scrollDOM.addEventListener("drop",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(X.drop,i)}),M.chrome&&M.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{Qr(e,l)&&this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Ie(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Ie(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!t.ctrlKey||Jc.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Nt(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const ea=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Jc="dthko",ta=[16,17,18,20,91,92,224,225],Ti=6;function Bi(n){return Math.max(0,n)*.7+8}function Xc(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Yc{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=yc(e.contentDOM),this.atoms=e.state.facet(er).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Qc(e,t),this.dragging=ef(e,t)&&ra(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Xc(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Gl(this.view);e.clientX-o.left<=r.left+Ti?i=-Bi(r.left-e.clientX):e.clientX+o.right>=r.right-Ti&&(i=Bi(e.clientX-r.right)),e.clientY-o.top<=r.top+Ti?s=-Bi(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ti&&(s=Bi(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function Qc(n,e){let t=n.state.facet(Fl);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function Zc(n,e){let t=n.state.facet(Hl);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function ef(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=nn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Qr(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=W.get(t))&&i.ignoreEvent(e))return!1;return!0}const X=Object.create(null),Ds=Object.create(null),ia=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function tf(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),na(n,t.value)},50)}function na(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Os!=null&&t.selection.ranges.every(a=>a.empty)&&Os==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}X.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now())};X.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};X.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ds.touchstart=Ds.touchmove={passive:!0};X.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let i of n.state.facet(Wl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=rf(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Yc(n,e,t,i)),i&&n.observer.ignore(()=>Cl(n.contentDOM)),n.inputState.mouseSelection&&n.inputState.mouseSelection.start(e)}};function Zr(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Vc(n.state,e,t);{let s=ue.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,eo=(n,e,t)=>sa(e,t)&&n>=t.left&&n<=t.right;function nf(n,e,t,i){let s=ue.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&eo(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&eo(t,i,l)?1:o&&sa(i,o)?-1:1}function to(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:nf(n,t,e.clientX,e.clientY)}}const sf=M.ie&&M.ie_version<=11;let io=null,no=0,so=0;function ra(n){if(!sf)return n.detail;let e=io,t=so;return io=n,so=Date.now(),no=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(no+1)%3:1}function rf(n,e){let t=to(n,e),i=ra(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=to(n,r),h,c=Zr(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=Zr(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=of(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function of(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}X.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function ro(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&Zc(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}X.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&ro(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else ro(n,e,e.dataTransfer.getData("Text"),!0)};X.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=ia?null:e.clipboardData;t?(na(n,t.getData("text/plain")||t.getData("text/uri-text")),e.preventDefault()):tf(n)};function lf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function af(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Os=null;X.copy=X.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=af(n.state);if(!t&&!s)return;Os=s?t:null;let r=ia?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):lf(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};const oa=Ze.define();function la(n,e){let t=[];for(let i of n.facet(ql)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:oa.of(!0)}):null}function aa(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=la(n.state,e);t?n.dispatch(t):n.update([])}},10)}X.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),aa(n)};X.blur=n=>{n.observer.clearSelectionRange(),aa(n)};X.compositionstart=X.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};X.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,M.chrome&&M.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};X.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};X.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=ea.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const oo=["pre-wrap","normal","pre-line","break-spaces"];class hf{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return oo.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Xi&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return pe.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,z.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,z.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ae extends ha{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new $e(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ae||s instanceof ie&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ie?s=new Ae(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pe.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ie extends pe{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new $e(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new $e(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==z.ByHeight)return this.blockAt(e,i,s,r);if(t==z.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new $e(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new $e(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new $e(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ie?i[i.length-1]=new ie(r.length+s):i.push(null,new ie(s-1))}if(e>0){let r=i[0];r instanceof ie?i[0]=new ie(e+r.length):i.unshift(new ie(e-1),null)}return pe.of(i)}decomposeLeft(e,t){t.push(new ie(e-1),null)}decomposeRight(e,t){t.push(null,new ie(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ie(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=Xi&&(a=-2);let u=new Ae(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new ie(r-l).updateHeight(e,l));let h=pe.of(o);return(a<0||Math.abs(h.height-this.height)>=Xi||Math.abs(a-this.heightMetrics(e,t).perLine)>=Xi)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ff extends pe{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==z.ByPosNoHeight?z.ByPosNoHeight:z.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,z.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&lo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?pe.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function lo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ie&&(i=n[e+1])instanceof ie&&n.splice(e-1,3,new ie(t.length+1+i.length))}const uf=5;class tr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=uf)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ie(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){var t;this.enterLine();let i=(t=e.deco)===null||t===void 0?void 0:t.type;i==J.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i!=J.WidgetBefore&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function mf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Kn{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new hf(t),this.stateDeco=e.facet(fi).filter(i=>typeof i!="function"),this.heightMap=pe.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new Le(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Pi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?ho:new xf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:ni(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(fi).filter(c=>typeof c!="function");let s=e.changedRanges,r=Le.extendWithRanges(s,df(i,this.stateDeco,e?e.changes:Z.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet($l)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?_.RTL:_.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0,f=parseInt(i.paddingTop)||0,u=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8),this.scrollTop!=e.scrollDOM.scrollTop&&(this.scrollAnchorHeight=-1,this.scrollTop=e.scrollDOM.scrollTop),this.scrolledToBottom=Ml(e.scrollDOM);let d=(this.printing?mf:gf)(t,this.paddingTop),p=d.top-this.pixelViewport.top,m=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:x,textHeight:S}=e.docView.measureTextSize();o=w>0&&s.refresh(r,w,x,S,y/x,A),o&&(e.docView.minWidth=0,h|=8)}p>0&&m>0?c=Math.max(p,m):p<0&&m<0&&(c=Math.min(p,m)),s.heightChanged=!1;for(let w of this.viewports){let x=w.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?pe.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle,[new Le(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new cf(w.from,x))}s.heightChanged&&(h|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Pi(s.lineAt(o-i*1e3,z.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,z.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,z.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=_.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(b.cursor(c),!1,!0).head;g>h&&(c=g)}m=new Kn(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ni(this.heightMap.lineAt(e,z.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ni(this.heightMap.lineAt(this.scaler.fromDOM(e),z.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ni(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Pi{constructor(e,t){this.from=e,this.to=t}}function bf(n,e,t){let i=[],s=n,r=0;return j.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Ri(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function wf(n,e){for(let t of n)if(e(t))return t}const ho={toDOM(n){return n},fromDOM(n){return n},scale:1};class xf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,z.ByPos,e,0,0).top,c=t.lineAt(a,z.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tni(s,e)):n._content)}const Ei=D.define({combine:n=>n.join(" ")}),Ts=D.define({combine:n=>n.indexOf(!0)>-1}),Bs=ot.newName(),ca=ot.newName(),fa=ot.newName(),ua={"&light":"."+ca,"&dark":"."+fa};function Ps(n,e,t){return new ot(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const kf=Ps("."+Bs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ua);class Sf{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:Cf(e),a=new Bl(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Af(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!gs(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!gs(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function da(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}),t){let o=n.state;if(M.ios&&n.inputState.flushIOSKey(n)||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Nt(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengthc(n,t.from,t.to,l)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let a;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let c=s.fromt.to?o.sliceDoc(t.to,s.to):"";a=o.replaceSelection(n.state.toText(c+t.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let c=o.changes(t),f=i&&i.main.to<=c.newLength?i.main:void 0;if(o.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let u=n.state.sliceDoc(t.from,t.to),d=Yl(n)||n.state.doc.lineAt(s.head),p=s.to-t.to,m=s.to-s.from;a=o.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:f||g.map(c)};let y=g.to-p,k=y-u.length;if(g.to-g.from!=m||n.state.sliceDoc(k,y)!=u||d&&g.to>=d.from&&g.from<=d.to)return{range:g};let A=o.changes({from:k,to:y,insert:t.insert}),w=g.to-s.to;return{changes:A,range:f?b.range(Math.max(0,f.anchor+w),Math.max(0,f.head+w)):g.map(A)}})}else a={changes:c,selection:f&&o.selection.replaceRange(f)}}let h="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,h+=".compose",n.inputState.compositionFirstChange&&(h+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(a,{scrollIntoView:!0,userEvent:h}),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function vf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Cf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Hr(t,i)),(s!=t||r!=i)&&e.push(new Hr(s,r))),e}function Af(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Mf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},$n=M.ie&&M.ie_version<=11;class Df{constructor(e){this.view=e,this.active=!1,this.selectionRange=new bc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),$n&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Dn)?i.root.activeElement!=this.dom:!_i(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&sn(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&pc(this.dom.ownerDocument)==this.dom&&Of(this.view)||nn(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=_i(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Nt(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&_i(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new Sf(this.view,e,t,i))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=da(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=co(t,e.previousSibling||e.target.previousSibling,-1),s=co(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function co(n,e,t){for(;e;){let i=W.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Of(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return sn(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class O{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||wc(e.parent)||document,this.viewState=new ao(e.state||N.create(e)),this.plugins=this.state.facet(ti).map(t=>new Vn(t));for(let t of this.plugins)t.update(this);this.observer=new Df(this),this.inputState=new _c(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new jr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){let t=e.length==1&&e[0]instanceof ee?e[0]:this.state.update(...e);this._dispatch(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(oa))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=la(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=ln.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new on(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($r)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=an.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ii)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Ei)!=s.state.facet(Ei)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Ss))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!da(this,c)&&h.force&&Nt(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new ao(e),this.plugins=e.facet(ti).map(i=>new Vn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new jr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ti),i=e.state.facet(ti);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Vn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,{scrollTop:s}=i,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;s!=this.viewState.scrollTop&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Ml(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ie(this.state,p),fo}}),f=ln.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=i.scrollTop=s+p,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ss))l(t)}get themeClasses(){return Bs+" "+(this.state.facet(Ts)?fa:ca)+" "+this.state.facet(Ei)}updateAttrs(){let e=uo(this,jl,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Dn)?"true":"false",class:"cm-content",style:`${M.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),uo(this,Zs,t);let i=this.observer.ignore(()=>{let s=xs(this.contentDOM,this.contentAttrs,t),r=xs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(O.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ii),ot.mount(this.root,this.styleModules.concat(kf).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return qn(this,e,Yr(this,e,t,i))}moveByGroup(e,t){return qn(this,e,Yr(this,e,t,i=>Uc(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return jc(this,e,t,i)}moveVertically(e,t,i){return qn(this,e,Gc(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Zl(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[Ft.find(r,e-s.from,-1,t)];return An(i,o.dir==_.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Kl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Tf)return Jl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=Lc(e.text,t);return this.bidiCache.push(new an(e.from,e.to,t,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Cl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return $r.of(new on(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ge.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=ot.newName(),s=[Ei.of(i),ii.of(Ps(`.${i}`,e))];return t&&t.dark&&s.push(Ts.of(!0)),s}static baseTheme(e){return Ct.lowest(ii.of(Ps("."+Bs,e,ua)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&W.get(i)||W.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}O.styleModule=ii;O.inputHandler=zl;O.focusChangeEffect=ql;O.perLineTextDirection=Kl;O.exceptionSink=Vl;O.updateListener=Ss;O.editable=Dn;O.mouseSelectionStyle=Wl;O.dragMovesSelection=Hl;O.clickAddsSelectionRange=Fl;O.decorations=fi;O.atomicRanges=er;O.scrollMargins=Ul;O.darkTheme=Ts;O.contentAttributes=Zs;O.editorAttributes=jl;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=E.define();const Tf=4096,fo={};class an{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:_.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&ws(o,t)}return t}const Bf=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function Pf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function Rf(n,e,t){return ga(pa(n.state),e,n,t)}let it=null;const Ef=4e3;function If(n,e=Bf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Pf(y,e));for(let y=1;y{let w=it={view:A,prefix:k,scope:o};return setTimeout(()=>{it==w&&(it=null)},Ef),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function ga(n,e,t,i){let s=dc(e),r=ne(s,0),o=Oe(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;it&&it.view==t&&it.scope==i&&(l=it.prefix+" ",ta.indexOf(e.keyCode)<0&&(h=!0,it=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Ii(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(p=lt[e.keyCode])&&p!=s?(u(d[l+Ii(p,e,!0)])||e.shiftKey&&(m=ci[e.keyCode])!=s&&m!=p&&u(d[l+Ii(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Ii(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Si{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=ma(e);return[new Si(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Nf(e,t,i)}}function ma(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==_.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function go(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:J.Text}}function Nf(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==_.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=ma(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Ms(n,i),p=Ms(n,s),m=d.type==J.Text?d:null,g=p.type==J.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=go(n,i,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=go(n,s,g)),m&&g&&m.from==g.from)return k(A(t.from,t.to,m));{let x=m?A(t.from,null,m):w(d,!1),S=g?A(null,t.to,g):w(p,!0),T=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&x.bottom+n.defaultLineHeight/2Y&&we.from=oe)break;Q>te&&V(Math.max(U,te),x==null&&U<=Y,Math.min(Q,oe),S==null&&Q>=re,xe.dir)}if(te=Fe.to+1,te>=oe)break}return R.length==0&&V(Y,x==null,re,S==null,n.textDirection),{top:F,bottom:P,horizontal:R}}function w(x,S){let T=l.top+(S?x.top:x.bottom);return{top:T,bottom:T,horizontal:[]}}}function Ff(n,e){return n.constructor==e.constructor&&n.eq(e)}class Hf{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Yi)!=e.state.facet(Yi)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Yi);for(;t!Ff(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Yi=D.define();function ya(n){return[ge.define(e=>new Hf(e,n)),Yi.of(n)]}const ba=!M.ios,ui=D.define({combine(n){return At(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Tg(n={}){return[ui.of(n),Wf,Vf,zf,$l.of(!0)]}function wa(n){return n.startState.facet(ui)!=n.state.facet(ui)}const Wf=ya({above:!0,markers(n){let{state:e}=n,t=e.facet(ui),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||ba:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Si.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=wa(n);return t&&mo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){mo(e.state,n)},class:"cm-cursorLayer"});function mo(n,e){e.style.animationDuration=n.facet(ui).cursorBlinkRate+"ms"}const Vf=ya({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Si.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||wa(n)},class:"cm-selectionLayer"}),xa={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ba&&(xa[".cm-line"].caretColor="transparent !important");const zf=Ct.highest(O.theme(xa)),ka=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),si=be.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(ka)?i.value:t,n)}}),qf=ge.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(si);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(si)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(si),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(si)!=n&&this.view.dispatch({effects:ka.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Bg(){return[si,qf]}function yo(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Kf(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class $f{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new xt,i=t.add.bind(t);for(let{from:s,to:r}of Kf(e,this.maxLength))yo(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Ls=/x/.unicode!=null?"gu":"g",jf=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ls),Uf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let jn=null;function Gf(){var n;if(jn==null&&typeof document<"u"&&document.body){let e=document.body.style;jn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return jn||!1}const Qi=D.define({combine(n){let e=At(n,{render:null,specialChars:jf,addSpecialChars:null});return(e.replaceTabs=!Gf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ls)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ls)),e}});function Pg(n={}){return[Qi.of(n),_f()]}let bo=null;function _f(){return bo||(bo=ge.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Qi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new $f({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ne(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=wi(o.text,l,i-o.from);return B.replace({widget:new Qf((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new Yf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Qi);n.startState.facet(Qi)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Jf="•";function Xf(n){return n>=32?Jf:n==10?"␤":String.fromCharCode(9216+n)}class Yf extends Mt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Xf(this.code),i=e.state.phrase("Control character")+" "+(Uf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Qf extends Mt{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Zf extends Mt{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?Vt(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=An(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Lg(n){return ge.fromClass(class{constructor(e){this.view=e,this.placeholder=n?B.set([B.widget({widget:new Zf(n),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Rs=2e3;function eu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Rs||t.off>Rs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=us(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=us(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function tu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function wo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Rs?-1:s==i.length?tu(n,e.clientX):wi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function iu(n,e){let t=wo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=wo(n,s);if(!l)return i;let a=eu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Rg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?iu(t,i):null)}const Ni="-10000px";class nu{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||su}}}),xo=new WeakMap,Sa=ge.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Un);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new nu(n,va,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Un);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Ni,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Un).tooltipSpace(this.view)}}writeMeasure(n){var e;let{editor:t,space:i}=n,s=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||h.rightMath.min(t.right,i.right)+.1){a.style.top=Ni;continue}let f=o.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=xo.get(l))!==null&&e!==void 0?e:c.bottom-c.top,m=l.offset||ou,g=this.view.textDirection==_.LTR,y=c.width>i.right-i.left?g?i.left:i.right-c.width:g?Math.min(h.left-(f?14:0)+m.x,i.right-d):Math.max(i.left,h.left-d+(f?14:0)-m.x),k=!!o.above;!o.strictSide&&(k?h.top-(c.bottom-c.top)-m.yi.bottom)&&k==i.bottom-h.bottom>h.top-i.top&&(k=!k);let A=(k?h.top-i.top:i.bottom-h.bottom)-u;if(Ay&&S.topw&&(w=k?S.top-p-2-u:S.bottom+u+2);this.position=="absolute"?(a.style.top=w-n.parent.top+"px",a.style.left=y-n.parent.left+"px"):(a.style.top=w+"px",a.style.left=y+"px"),f&&(f.style.left=`${h.left+(g?m.x:-m.x)-(y+14-7)}px`),l.overlap!==!0&&s.push({left:y,top:w,right:x,bottom:w+p}),a.classList.toggle("cm-tooltip-above",k),a.classList.toggle("cm-tooltip-below",!k),l.positioned&&l.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Ni}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),ru=O.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ou={x:0,y:0},va=D.define({enables:[Sa,ru]});function Ca(n,e){let t=n.plugin(Sa);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const ko=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function hn(n,e){let t=n.plugin(Aa),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Aa=ge.fromClass(class{constructor(n){this.input=n.state.facet(cn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(ko);this.top=new Fi(n,!0,e.topContainer),this.bottom=new Fi(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(ko);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Fi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Fi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(cn);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Fi{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=So(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=So(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function So(n){let e=n.nextSibling;return n.remove(),e}const cn=D.define({enables:Aa});class St extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}St.prototype.elementClass="";St.prototype.toDOM=void 0;St.prototype.mapMode=he.TrackBefore;St.prototype.startSide=St.prototype.endSide=-1;St.prototype.point=!0;const lu=D.define(),au=new class extends St{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},hu=lu.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(au.range(s)))}return j.of(e)});function Eg(){return hu}const cu=1024;let fu=0;class Te{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=fu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=me.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class uu{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const du=Object.create(null);class me{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):du,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new me(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}me.none=new me("",Object.create(null),0,8);class nr{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|$.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:or(me.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new H(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new H(me.none,t,i,s)))}static build(e){return gu(e)}}H.empty=new H(me.none,[],[],0);class sr{constructor(e,t){this.buffer=e,this.index=t}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]}get pos(){return this.index}next(){this.index-=4}fork(){return new sr(this.buffer,this.index)}}class Dt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return me.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Da(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function qt(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Ma(s,i,f,f+c.length)){if(c instanceof Dt){if(r&$.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new je(new pu(o,c,e,f),null,u)}else if(r&$.IncludeAnonymous||!c.type.isAnonymous||rr(c)){let u;if(!(r&$.IgnoreMounts)&&c.props&&(u=c.prop(L.mounted))&&!u.overlay)return new Re(u.tree,f,e,o);let d=new Re(c,f,e,o);return r&$.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&$.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&$.IgnoreOverlays)&&(s=this._tree.prop(L.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Re(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new di(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Da(this,e)}getChild(e,t=null,i=null){let s=fn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return fn(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return un(this,e)}}function fn(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function un(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class pu{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class je{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new je(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&$.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new je(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new je(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new je(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new di(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new H(this.type,e,t,this.to-this.from)}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Da(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=fn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return fn(this,e,t,i)}get node(){return this}matchContext(e){return un(this,e)}}class di{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Re)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Re?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&$.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&$.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&$.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&$.IncludeAnonymous||l instanceof Dt||!l.type.isAnonymous||rr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return un(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function rr(n){return n.children.some(e=>e instanceof Dt||!e.type.isAnonymous||rr(e))}function gu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=cu,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new sr(t,t.length):t,a=i.types,h=0,c=0;function f(w,x,S,T,F){let{id:P,start:R,end:V,size:Y}=l,re=c;for(;Y<0;)if(l.next(),Y==-1){let xe=r[P];S.push(xe),T.push(R-w);return}else if(Y==-3){h=P;return}else if(Y==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let we=a[P],te,oe,Fe=R-w;if(V-R<=s&&(oe=m(l.pos-x,F))){let xe=new Uint16Array(oe.size-oe.skip),U=l.pos-oe.size,Q=xe.length;for(;l.pos>U;)Q=g(oe.start,xe,Q);te=new Dt(xe,V-oe.start,i),Fe=oe.start-w}else{let xe=l.pos-Y;l.next();let U=[],Q=[],ft=P>=o?P:-1,Ot=0,Ai=V;for(;l.pos>xe;)ft>=0&&l.id==ft&&l.size>=0?(l.end<=Ai-s&&(d(U,Q,R,Ot,l.end,Ai,ft,re),Ot=U.length,Ai=l.end),l.next()):f(R,xe,U,Q,ft);if(ft>=0&&Ot>0&&Ot-1&&Ot>0){let Sr=u(we);te=or(we,U,Q,0,U.length,0,V-R,Sr,Sr)}else te=p(we,U,Q,V-R,re-V)}S.push(te),T.push(Fe)}function u(w){return(x,S,T)=>{let F=0,P=x.length-1,R,V;if(P>=0&&(R=x[P])instanceof H){if(!P&&R.type==w&&R.length==T)return R;(V=R.prop(L.lookAhead))&&(F=S[P]+R.length+V)}return p(w,x,S,T,F)}}function d(w,x,S,T,F,P,R,V){let Y=[],re=[];for(;w.length>T;)Y.push(w.pop()),re.push(x.pop()+S-F);w.push(p(i.types[R],Y,re,P-F,V-P)),x.push(F-S)}function p(w,x,S,T,F=0,P){if(h){let R=[L.contextHash,h];P=P?[R].concat(P):[R]}if(F>25){let R=[L.lookAhead,F];P=P?[R].concat(P):[R]}return new H(w,x,S,T,P)}function m(w,x){let S=l.fork(),T=0,F=0,P=0,R=S.end-s,V={size:0,start:0,skip:0};e:for(let Y=S.pos-w;S.pos>Y;){let re=S.size;if(S.id==x&&re>=0){V.size=T,V.start=F,V.skip=P,P+=4,T+=4,S.next();continue}let we=S.pos-re;if(re<0||we=o?4:0,oe=S.start;for(S.next();S.pos>we;){if(S.size<0)if(S.size==-3)te+=4;else break e;else S.id>=o&&(te+=4);S.next()}F=oe,T+=re,P+=te}return(x<0||T==w)&&(V.size=T,V.start=F,V.skip=P),V.size>4?V:void 0}function g(w,x,S){let{id:T,start:F,end:P,size:R}=l;if(l.next(),R>=0&&T4){let Y=l.pos-(R-4);for(;l.pos>Y;)S=g(w,x,S)}x[--S]=V,x[--S]=P-w,x[--S]=F-w,x[--S]=T}else R==-3?h=T:R==-4&&(c=T);return S}let y=[],k=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,k,-1);let A=(e=n.length)!==null&&e!==void 0?e:y.length?k[0]+y[0].length:0;return new H(a[n.topID],y.reverse(),k.reverse(),A)}const Co=new WeakMap;function Zi(n,e){if(!n.isAnonymous||e instanceof Dt||e.type!=n)return 1;let t=Co.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof H)){t=1;break}t+=Zi(n,i)}Co.set(e,t)}return t}function or(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;S+=T}if(A==w+1){if(S>c){let T=p[w];d(T.children,T.positions,0,T.children.length,m[w]+k);continue}f.push(p[w])}else{let T=m[A-1]+p[A-1].length-x;f.push(or(n,p,m,w,A,x,T,null,a))}u.push(x+k-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Ig{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof je?this.setBuffer(e.context.buffer,e.index,t):e instanceof Re&&this.map.set(e.tree,t)}get(e){return e instanceof je?this.getBuffer(e.context.buffer,e.index):e instanceof Re?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ye{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Ye(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ye(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Te(s.from,s.to)):[new Te(0,0)]:[new Te(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class mu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Ng(n){return(e,t,i,s)=>new bu(e,n,t,i,s)}class Ao{constructor(e,t,i,s,r){if(this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r,!r.length||r.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class yu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Es=new L({perNode:!0});class bu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new H(i.type,i.children,i.positions,i.length,i.propValues.concat([[Es,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[L.mounted.id]=new uu(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=wu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Te(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Te(s.from,s.to)),a.fromnew Te(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function wu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Mo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let m=[],g=[];Mo(o,h,p,m,g,u);let y=l[p+1],k=l[p+2],A=y+r==e.from&&k+r==e.to&&l[p]==e.type.id;return m.push(A?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],y,k-y)),g.push(y-u),Mo(o,l[p+3],c,m,g,u),new H(f,m,g,d)}s.children[i]=a(0,l.length,me.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Do{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor($.IncludeAnonymous|$.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,$.IgnoreOverlays|$.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof H)t=t.children[0];else break}return!1}}class ku{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Es))!==null&&t!==void 0?t:i.to,this.inner=new Do(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Es))!==null&&e!==void 0?e:t.to,this.inner=new Do(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Oo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Te(l,a.to))):a.to>l?t[r--]=new Te(l,a.to):t.splice(r--,1))}}return i}function Su(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Te(u.from+i,u.to+i)),f=Su(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Ye(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ye(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let vu=0;class qe{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=vu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new qe([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new dn;return t=>t.modified.indexOf(e)>-1?t:dn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Cu=0;class dn{constructor(){this.instances=[],this.id=Cu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Au(t,l.modified));if(i)return i;let s=[],r=new qe(s,e,t);for(let l of t)l.instances.push(r);let o=Mu(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(dn.get(l,a));return r}}function Au(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Mu(n){let e=[[]];for(let t=0;ti.length-t.length)}function Du(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new pn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Ta.add(e)}const Ta=new L;class pn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Ou(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Tu(n,e,t,i=0,s=n.length){let r=new Bu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Bu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Pu(e)||pn.empty,f=Ou(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let k=g=A||!e.nextSibling())););if(!k||A>i)break;y=k.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,k.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Pu(n){let e=n.type.prop(Ta);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const v=qe.define,Wi=v(),et=v(),Bo=v(et),Po=v(et),tt=v(),Vi=v(tt),Gn=v(tt),ze=v(),ut=v(ze),We=v(),Ve=v(),Is=v(),Qt=v(Is),zi=v(),C={comment:Wi,lineComment:v(Wi),blockComment:v(Wi),docComment:v(Wi),name:et,variableName:v(et),typeName:Bo,tagName:v(Bo),propertyName:Po,attributeName:v(Po),className:v(et),labelName:v(et),namespace:v(et),macroName:v(et),literal:tt,string:Vi,docString:v(Vi),character:v(Vi),attributeValue:v(Vi),number:Gn,integer:v(Gn),float:v(Gn),bool:v(tt),regexp:v(tt),escape:v(tt),color:v(tt),url:v(tt),keyword:We,self:v(We),null:v(We),atom:v(We),unit:v(We),modifier:v(We),operatorKeyword:v(We),controlKeyword:v(We),definitionKeyword:v(We),moduleKeyword:v(We),operator:Ve,derefOperator:v(Ve),arithmeticOperator:v(Ve),logicOperator:v(Ve),bitwiseOperator:v(Ve),compareOperator:v(Ve),updateOperator:v(Ve),definitionOperator:v(Ve),typeOperator:v(Ve),controlOperator:v(Ve),punctuation:Is,separator:v(Is),bracket:Qt,angleBracket:v(Qt),squareBracket:v(Qt),paren:v(Qt),brace:v(Qt),content:ze,heading:ut,heading1:v(ut),heading2:v(ut),heading3:v(ut),heading4:v(ut),heading5:v(ut),heading6:v(ut),contentSeparator:v(ze),list:v(ze),quote:v(ze),emphasis:v(ze),strong:v(ze),link:v(ze),monospace:v(ze),strikethrough:v(ze),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:zi,documentMeta:v(zi),annotation:v(zi),processingInstruction:v(zi),definition:qe.defineModifier(),constant:qe.defineModifier(),function:qe.defineModifier(),standard:qe.defineModifier(),local:qe.defineModifier(),special:qe.defineModifier()};Ba([{tag:C.link,class:"tok-link"},{tag:C.heading,class:"tok-heading"},{tag:C.emphasis,class:"tok-emphasis"},{tag:C.strong,class:"tok-strong"},{tag:C.keyword,class:"tok-keyword"},{tag:C.atom,class:"tok-atom"},{tag:C.bool,class:"tok-bool"},{tag:C.url,class:"tok-url"},{tag:C.labelName,class:"tok-labelName"},{tag:C.inserted,class:"tok-inserted"},{tag:C.deleted,class:"tok-deleted"},{tag:C.literal,class:"tok-literal"},{tag:C.string,class:"tok-string"},{tag:C.number,class:"tok-number"},{tag:[C.regexp,C.escape,C.special(C.string)],class:"tok-string2"},{tag:C.variableName,class:"tok-variableName"},{tag:C.local(C.variableName),class:"tok-variableName tok-local"},{tag:C.definition(C.variableName),class:"tok-variableName tok-definition"},{tag:C.special(C.variableName),class:"tok-variableName2"},{tag:C.definition(C.propertyName),class:"tok-propertyName tok-definition"},{tag:C.typeName,class:"tok-typeName"},{tag:C.namespace,class:"tok-namespace"},{tag:C.className,class:"tok-className"},{tag:C.macroName,class:"tok-macroName"},{tag:C.propertyName,class:"tok-propertyName"},{tag:C.operator,class:"tok-operator"},{tag:C.comment,class:"tok-comment"},{tag:C.meta,class:"tok-meta"},{tag:C.invalid,class:"tok-invalid"},{tag:C.punctuation,class:"tok-punctuation"}]);var _n;const mt=new L;function Pa(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Lu=new L;class Be{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return ye(this)}}),this.parser=t,this.extension=[jt.of(this),N.languageData.of((r,o,l)=>{let a=Lo(r,o,l),h=a.type.prop(mt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Lu);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Lo(e,t,i).type.prop(mt)==this.data}findRegions(e){let t=e.facet(jt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(mt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(mt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ns(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ye(n){let e=n.field(Be.state,!1);return e?e.tree:H.empty}class Ru{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Zt=null;class Kt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Kt(e,t,[],H.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Ru(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=H.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ye.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Zt;Zt=this;try{return e()}finally{Zt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ro(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ye.applyChanges(i,a),s=H.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Ro(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Oa{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Zt;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new H(me.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Zt}}function Ro(n,e,t){return Ye.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class $t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new $t(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Kt.create(e.facet(jt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new $t(i)}}Be.state=be.define({create:$t.init,update(n,e){for(let t of e.effects)if(t.is(Be.setState))return t.value;return e.startState.facet(jt)!=e.state.facet(jt)?$t.init(e.state):n.apply(e)}});let La=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(La=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Jn=typeof navigator<"u"&&(!((_n=navigator.scheduling)===null||_n===void 0)&&_n.isInputPending)?()=>navigator.scheduling.isInputPending():null,Eu=ge.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=La(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Jn&&Jn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Be.setState.of(new $t(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ie(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),jt=D.define({combine(n){return n.length?n[0]:null},enables:n=>[Be.state,Eu,O.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Hg{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Ra=D.define(),On=D.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function vt(n){let e=n.facet(On);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function gn(n,e){let t="",i=n.tabSize,s=n.facet(On)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return wi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Iu=new L;function Nu(n,e,t){return Ia(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function Fu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Hu(n){let e=n.type.prop(Iu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Na(o,!0,1,void 0,r&&!Fu(o)?s.from:void 0)}return n.parent==null?Wu:null}function Ia(n,e,t){for(;n;n=n.parent){let i=Hu(n);if(i)return i(lr.create(t,e,n))}return null}function Wu(){return 0}class lr extends Tn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new lr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Vu(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){let e=this.node.parent;return e?Ia(e,this.pos,this.base):0}}function Vu(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function zu(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromNa(i,e,t,n)}function Na(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?zu(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Vg=n=>n.baseIndent;function zg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const qg=new L;function Kg(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(mt)==o.data:o?l=>l==o:void 0,this.style=Ba(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ot(i):null,this.themeType=t.themeType}static define(e,t){return new Bn(e,t||{})}}const Fs=D.define(),Fa=D.define({combine(n){return n.length?[n[0]]:null}});function Xn(n){let e=n.facet(Fs);return e.length?e:n.facet(Fa)}function $g(n,e){let t=[Ku],i;return n instanceof Bn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Fa.of(n)):i?t.push(Fs.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Fs.of(n)),t}class qu{constructor(e){this.markCache=Object.create(null),this.tree=ye(e.state),this.decorations=this.buildDeco(e,Xn(e.state))}update(e){let t=ye(e.state),i=Xn(e.state),s=i!=Xn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},s,r);return i.finish()}}const Ku=Ct.high(ge.fromClass(qu,{decorations:n=>n.decorations})),jg=Bn.define([{tag:C.meta,color:"#404740"},{tag:C.link,textDecoration:"underline"},{tag:C.heading,textDecoration:"underline",fontWeight:"bold"},{tag:C.emphasis,fontStyle:"italic"},{tag:C.strong,fontWeight:"bold"},{tag:C.strikethrough,textDecoration:"line-through"},{tag:C.keyword,color:"#708"},{tag:[C.atom,C.bool,C.url,C.contentSeparator,C.labelName],color:"#219"},{tag:[C.literal,C.inserted],color:"#164"},{tag:[C.string,C.deleted],color:"#a11"},{tag:[C.regexp,C.escape,C.special(C.string)],color:"#e40"},{tag:C.definition(C.variableName),color:"#00f"},{tag:C.local(C.variableName),color:"#30a"},{tag:[C.typeName,C.namespace],color:"#085"},{tag:C.className,color:"#167"},{tag:[C.special(C.variableName),C.macroName],color:"#256"},{tag:C.definition(C.propertyName),color:"#00c"},{tag:C.comment,color:"#940"},{tag:C.invalid,color:"#f00"}]),$u=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ha=1e4,Wa="()[]{}",Va=D.define({combine(n){return At(n,{afterCursor:!0,brackets:Wa,maxScanDistance:Ha,renderMatch:Gu})}}),ju=B.mark({class:"cm-matchingBracket"}),Uu=B.mark({class:"cm-nonmatchingBracket"});function Gu(n){let e=[],t=n.matched?ju:Uu;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const _u=be.define({create(){return B.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Va);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=Ue(e.state,s.head,-1,i)||s.head>0&&Ue(e.state,s.head-1,1,i)||i.afterCursor&&(Ue(e.state,s.head,1,i)||s.headO.decorations.from(n)}),Ju=[_u,$u];function Ug(n={}){return[Va.of(n),Ju]}const Xu=new L;function Hs(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Ws(n){let e=n.type.prop(Xu);return e?e(n.node):n}function Ue(n,e,t,i={}){let s=i.maxScanDistance||Ha,r=i.brackets||Wa,o=ye(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Hs(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Yu(n,e,t,a,c,h,r)}}return Qu(n,e,t,o,l.type,s,r)}function Yu(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Eo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Zu(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||ed,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||hr}}function ed(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Io=new WeakMap;class qa extends Be{constructor(e){let t=Pa(e.languageData),i=Zu(e),s,r=new class extends Oa{createParse(o,l,a){return new id(s,o,l,a)}};super(t,r,[Ra.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=rd(t),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new Ua(i.tokenTable):sd}static define(e){return new qa(e)}getIndent(e,t){let i=ye(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Io.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof H&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&ar(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Ka(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?vt(i):4),tree:H.empty}}class id{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Kt.get(),o=s[0].from,{state:l,tree:a}=td(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` `&&(t="");else{let i=t.indexOf(` -`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new za(t,e?e.state.tabSize:4,e?St(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=$a(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const hr=Object.create(null),pi=[ge.none],nd=new nr(pi),No=[],ja=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ja[n]=Ga(hr,e);class Ua{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),ja)}resolve(e){return e?this.table[e]||(this.table[e]=Ga(this.extra,e)):0}}const sd=new Ua(hr);function Yn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Ga(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||C[r];o?typeof o=="function"?t?t=o(t):Yn(r,`Modifier ${r} used at start of tag`):t?Yn(r,`Tag ${r} used as modifier`):t=o:Yn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ge.define({id:pi.length,name:i,props:[Du({[i]:t})]});return pi.push(s),s.id}function rd(n){let e=ge.define({id:pi.length,name:"Document",props:[mt.add(()=>n)]});return pi.push(e),e}const od=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=fr(n.state,t.from);return i.line?ld(n):i.block?hd(n):!1};function cr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const ld=cr(ud,0),ad=cr(_a,0),hd=cr((n,e)=>_a(n,e,fd(e)),0);function fr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ei=50;function cd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-ei,i),o=n.sliceDoc(s,s+ei),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*ei?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+ei),f=n.sliceDoc(s-ei,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function fd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function _a(n,e,t=e.selection.ranges){let i=t.map(r=>fr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>cd(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Vs=Ze.define(),dd=Ze.define(),pd=D.define(),Ja=D.define({combine(n){return Ct(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function gd(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const Xa=ye.define({create(){return Ge.empty},update(n,e){let t=e.state.facet(Ja),i=e.annotation(Vs);if(i){let a=e.docChanged?b.single(gd(e.changes)):void 0,h=Se.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=mn(f,f.length,t.minDepth,h):f=Za(f,e.startState.selection),new Ge(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(dd);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(ee.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Se.fromTransaction(e),o=e.annotation(ee.time),l=e.annotation(ee.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ge(n.done.map(Se.fromJSON),n.undone.map(Se.fromJSON))}});function Gg(n={}){return[Xa,Ja.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Ya:e.inputType=="historyRedo"?zs:null;return i?(e.preventDefault(),i(t)):!1}})]}function Pn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Xa,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Ya=Pn(0,!1),zs=Pn(1,!1),md=Pn(0,!0),yd=Pn(1,!0);class Se{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Se(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Se(e.changes&&Z.fromJSON(e.changes),[],e.mapped&&_e.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Pe;for(let s of e.startState.facet(pd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Se(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new Se(void 0,Pe,void 0,void 0,e)}}function mn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function bd(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function wd(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Qa(n,e){return n.length?e.length?n.concat(e):n:e}const Pe=[],xd=200;function Za(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-xd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),mn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Se.selection([e])]}function kd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Qn(n,e){if(!n.length)return n;let t=n.length,i=Pe;for(;t;){let s=Sd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Se.selection(i)]:Pe}function Sd(n,e,t){let i=Qa(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Pe,t);if(!n.changes)return Se.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Se(s,E.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const vd=/^(input\.type|delete)($|\.)/;class Ge{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ge(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||vd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Ln(t,e))}function ce(n){return n.textDirectionAt(n.state.selection.main.head)==_.LTR}const th=n=>eh(n,!ce(n)),ih=n=>eh(n,ce(n));function nh(n,e){return Ne(n,t=>t.empty?n.moveByGroup(t,e):Ln(t,e))}const Cd=n=>nh(n,!ce(n)),Ad=n=>nh(n,ce(n));function Md(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Rn(n,e,t){let i=me(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Md(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Ue(n,i.from,1):Ue(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const Dd=n=>Ne(n,e=>Rn(n.state,e,!ce(n))),Od=n=>Ne(n,e=>Rn(n.state,e,ce(n)));function sh(n,e){return Ne(n,t=>{if(!t.empty)return Ln(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const rh=n=>sh(n,!1),oh=n=>sh(n,!0);function lh(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Ln(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomah(n,!1),qs=n=>ah(n,!0);function ct(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Td=n=>Ne(n,e=>ct(n,e,!0)),Bd=n=>Ne(n,e=>ct(n,e,!1)),Pd=n=>Ne(n,e=>ct(n,e,!ce(n))),Ld=n=>Ne(n,e=>ct(n,e,ce(n))),Rd=n=>Ne(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Ed=n=>Ne(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function Id(n,e,t){let i=!1,s=Gt(n.selection,r=>{let o=Ue(n,r.head,-1)||Ue(n,r.head,1)||r.head>0&&Ue(n,r.head-1,1)||r.headId(n,e,!1);function Ee(n,e){let t=Gt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Je(n.state,t)),!0)}function hh(n,e){return Ee(n,t=>n.moveByChar(t,e))}const ch=n=>hh(n,!ce(n)),fh=n=>hh(n,ce(n));function uh(n,e){return Ee(n,t=>n.moveByGroup(t,e))}const Fd=n=>uh(n,!ce(n)),Hd=n=>uh(n,ce(n)),Wd=n=>Ee(n,e=>Rn(n.state,e,!ce(n))),Vd=n=>Ee(n,e=>Rn(n.state,e,ce(n)));function dh(n,e){return Ee(n,t=>n.moveVertically(t,e))}const ph=n=>dh(n,!1),gh=n=>dh(n,!0);function mh(n,e){return Ee(n,t=>n.moveVertically(t,e,lh(n).height))}const Ho=n=>mh(n,!1),Wo=n=>mh(n,!0),zd=n=>Ee(n,e=>ct(n,e,!0)),qd=n=>Ee(n,e=>ct(n,e,!1)),Kd=n=>Ee(n,e=>ct(n,e,!ce(n))),$d=n=>Ee(n,e=>ct(n,e,ce(n))),jd=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).from)),Ud=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Vo=({state:n,dispatch:e})=>(e(Je(n,{anchor:0})),!0),zo=({state:n,dispatch:e})=>(e(Je(n,{anchor:n.doc.length})),!0),qo=({state:n,dispatch:e})=>(e(Je(n,{anchor:n.selection.main.anchor,head:0})),!0),Ko=({state:n,dispatch:e})=>(e(Je(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Gd=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),_d=({state:n,dispatch:e})=>{let t=In(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},Jd=({state:n,dispatch:e})=>{let t=Gt(n.selection,i=>{var s;let r=me(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return b.range(r.to,r.from)});return e(Je(n,t)),!0},Xd=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Je(n,i)),!0):!1};function En(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(o);ao&&(t="delete.forward",a=qi(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=qi(n,o,!1),l=qi(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?O.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function qi(n,e,t){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const yh=(n,e)=>En(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tyh(n,!1),bh=n=>yh(n,!0),wh=(n,e)=>En(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=fe(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t)&&(l=c),i=a}return i}),xh=n=>wh(n,!1),Yd=n=>wh(n,!0),kh=n=>En(n,e=>{let t=n.lineBlockAt(e).to;return eEn(n,e=>{let t=n.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),Zd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ep=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:fe(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:fe(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function In(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Sh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of In(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const tp=({state:n,dispatch:e})=>Sh(n,e,!1),ip=({state:n,dispatch:e})=>Sh(n,e,!0);function vh(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of In(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const np=({state:n,dispatch:e})=>vh(n,e,!1),sp=({state:n,dispatch:e})=>vh(n,e,!0),rp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(In(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function op(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=me(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const lp=Ch(!1),ap=Ch(!0);function Ch(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&op(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Tn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Ea(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const hp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Tn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=ur(n,(r,o,l)=>{let a=Ea(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=gn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(ur(n,(t,i)=>{i.push({from:t.from,insert:n.facet(On)})}),{userEvent:"input.indent"})),!0),fp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ur(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=wi(s,n.tabSize),o=0,l=gn(n,Math.max(0,r-St(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),Jg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Dd,shift:Wd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Od,shift:Vd},{key:"Alt-ArrowUp",run:tp},{key:"Shift-Alt-ArrowUp",run:np},{key:"Alt-ArrowDown",run:ip},{key:"Shift-Alt-ArrowDown",run:sp},{key:"Escape",run:Xd},{key:"Mod-Enter",run:ap},{key:"Alt-l",mac:"Ctrl-l",run:_d},{key:"Mod-i",run:Jd,preventDefault:!0},{key:"Mod-[",run:fp},{key:"Mod-]",run:cp},{key:"Mod-Alt-\\",run:hp},{key:"Shift-Mod-k",run:rp},{key:"Shift-Mod-\\",run:Nd},{key:"Mod-/",run:od},{key:"Alt-A",run:ad}].concat(dp);function le(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Ut{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r($o(l)):$o,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ne(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Gs(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Oe(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(a)return this.value=a,this;if(r==s.length-1)break;o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=yn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Ft(t,e.sliceString(t,i));return Zn.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=yn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ft.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Dh.prototype[Symbol.iterator]=Oh.prototype[Symbol.iterator]=function(){return this});function pp(n){try{return new RegExp(n,dr),!0}catch{return!1}}function yn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function $s(n){let e=le("input",{class:"cm-textfield",name:"line"}),t=le("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:bn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},le("label",n.state.phrase("Go to line"),": ",e)," ",le("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,h,c]=s,f=h?+h.slice(1):0,u=a?+a:o.number;if(a&&c){let p=u/100;l&&(p=p*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*p)}else a&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));n.dispatch({effects:bn.of(!1),selection:b.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const bn=E.define(),jo=ye.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(bn)&&(n=t.value);return n},provide:n=>cn.from(n,e=>e?$s:null)}),gp=n=>{let e=hn(n,$s);if(!e){let t=[bn.of(!0)];n.state.field(jo,!1)==null&&t.push(E.appendConfig.of([jo,mp])),n.dispatch({effects:t}),e=hn(n,$s)}return e&&e.dom.querySelector("input").focus(),!0},mp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),yp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Th=D.define({combine(n){return Ct(n,yp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Xg(n){let e=[Sp,kp];return n&&e.push(Th.of(n)),e}const bp=B.mark({class:"cm-selectionMatch"}),wp=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Uo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=q.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=q.Word)}function xp(n,e,t,i){return n(e.sliceDoc(t,t+1))==q.Word&&n(e.sliceDoc(i-1,i))==q.Word}const kp=pe.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Th),{state:t}=n,i=t.selection;if(i.ranges.length>1)return B.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return B.none;let a=t.wordAt(s.head);if(!a)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return B.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Uo(o,t,s.from,s.to)&&xp(o,t,s.from,s.to)))return B.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return B.none}let l=[];for(let a of n.visibleRanges){let h=new Ut(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Uo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(wp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(bp.range(c,f)),l.length>e.maxMatches))return B.none}}return B.set(l)}},{decorations:n=>n.decorations}),Sp=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),vp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Cp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Ut(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Ut(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Ap=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return vp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Cp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},_t=D.define({combine(n){return Ct(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Np(e),scrollToMatch:e=>O.scrollIntoView(e)})}});class Bh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||pp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Tp(this):new Dp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Bt(this,s,t,i):Tt(this,s,t,i)}}class Ph{constructor(e){this.spec=e}}function Tt(n,e,t,i){return new Ut(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Mp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Mp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Bt(n,e,t,i){return new Dh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function wn(n,e){return n.slice(fe(n,e,!1),e)}function xn(n,e){return n.slice(e,fe(n,e))}function Op(n){return(e,t,i)=>!i[0].length||(n(wn(i.input,i.index))!=q.Word||n(xn(i.input,i.index))!=q.Word)&&(n(xn(i.input,i.index+i[0].length))!=q.Word||n(wn(i.input,i.index+i[0].length))!=q.Word)}class Tp extends Ph{nextMatch(e,t,i){let s=Bt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Bt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Bt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Bt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const gi=E.define(),pr=E.define(),st=ye.define({create(n){return new es(js(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new es(t.value.create(),n.panel):t.is(pr)&&(n=new es(n.query,t.value?gr:null));return n},provide:n=>cn.from(n,e=>e.panel)});class es{constructor(e,t){this.query=e,this.panel=t}}const Bp=B.mark({class:"cm-searchMatch"}),Pp=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Lp=pe.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return B.none;let{view:t}=this,i=new xt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Pp:Bp)})}return i.finish()}},{decorations:n=>n.decorations});function vi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):Eh(e)}}const kn=vi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(_t);return n.dispatch({selection:s,effects:[mr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Rh(n),!0}),Sn=vi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(_t);return n.dispatch({selection:r,effects:[mr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Rh(n),!0}),Rp=vi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ep=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Ut(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Go=vi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-c,r.to-c),h.push(mr(n,r)),h.push(t.facet(_t).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),Ip=vi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function gr(n){return n.state.facet(_t).createPanel(n)}function js(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(_t);return new Bh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Lh(n){let e=hn(n,gr);return e&&e.dom.querySelector("[main-field]")}function Rh(n){let e=Lh(n);e&&e==n.root.activeElement&&e.select()}const Eh=n=>{let e=n.state.field(st,!1);if(e&&e.panel){let t=Lh(n);if(t&&t!=n.root.activeElement){let i=js(n.state,e.query.spec);i.valid&&n.dispatch({effects:gi.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[pr.of(!0),e?gi.of(js(n.state,e.query.spec)):E.appendConfig.of(Hp)]});return!0},Ih=n=>{let e=n.state.field(st,!1);if(!e||!e.panel)return!1;let t=hn(n,gr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:pr.of(!1)}),!0},Yg=[{key:"Mod-f",run:Eh,scope:"editor search-panel"},{key:"F3",run:kn,shift:Sn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:kn,shift:Sn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Ih,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ep},{key:"Alt-g",run:gp},{key:"Mod-d",run:Ap,preventDefault:!0}];class Np{constructor(e){this.view=e;let t=this.query=e.state.field(st).query.spec;this.commit=this.commit.bind(this),this.searchField=le("input",{value:t.search,placeholder:Ce(e,"Find"),"aria-label":Ce(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=le("input",{value:t.replace,placeholder:Ce(e,"Replace"),"aria-label":Ce(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=le("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=le("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=le("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return le("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=le("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>kn(e),[Ce(e,"next")]),i("prev",()=>Sn(e),[Ce(e,"previous")]),i("select",()=>Rp(e),[Ce(e,"all")]),le("label",null,[this.caseField,Ce(e,"match case")]),le("label",null,[this.reField,Ce(e,"regexp")]),le("label",null,[this.wordField,Ce(e,"by word")]),...e.state.readOnly?[]:[le("br"),this.replaceField,i("replace",()=>Go(e),[Ce(e,"replace")]),i("replaceAll",()=>Ip(e),[Ce(e,"replace all")])],le("button",{name:"close",onclick:()=>Ih(e),"aria-label":Ce(e,"close"),type:"button"},["×"])])}commit(){let e=new Bh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:gi.of(e)}))}keydown(e){Rf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Sn:kn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Go(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(gi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(_t).top}}function Ce(n,e){return n.state.phrase(e)}const Ki=30,$i=/[\s\.,:;?!]/;function mr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Ki),o=Math.min(s,t+Ki),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Ki;a--)if(!$i.test(l[a-1])&&$i.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Fp=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Hp=[st,vt.lowest(Lp),Fp];class Nh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=me(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Fh(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function _o(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Wp(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Wp(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Qg(n,e){return t=>{for(let i=me(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class Jo{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function rt(n){return n.selection.main.from}function Fh(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Hh=Ze.define();function zp(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:b.cursor(l.from+r+e.length)})),{userEvent:"input.complete"})}const Xo=new WeakMap;function qp(n){if(!Array.isArray(n))return n;let e=Xo.get(n);return e||Xo.set(n,e=Vp(n)),e}const yr=E.define(),mi=E.define();class Kp{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(S=Gs(x))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!k||T==1&&g||w==0&&T!=0)&&(t[f]==x||i[f]==x&&(u=!0)?o[f++]=k:o.length&&(y=!1)),w=T,k+=Oe(x)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Oe(ne(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const ve=D.define({combine(n){return Ct(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:$p,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Yo(e(i),t(i)),optionClass:(e,t)=>i=>Yo(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function Yo(n,e){return n?e?n+" "+e:n:e}function $p(n,e,t,i,s){let r=n.textDirection==_.RTL,o=r,l=!1,a="top",h,c,f=e.left-s.left,u=s.right-e.right,d=i.right-i.left,p=i.bottom-i.top;if(o&&f=p||m>e.top?h=t.bottom-e.top:(a="bottom",h=e.bottom-t.top)}return{style:`${a}: ${h}px; max-width: ${c}px`,class:"cm-completionInfo-"+(l?r?"left-narrow":"right-narrow":o?"left":"right")}}function jp(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function Qo(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class Up{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ve);this.optionContent=jp(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Qo(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ve).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:mi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(r,s.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Qo(t.options.length,t.selected,this.view.state.facet(ve).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Ie(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&_p(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew Up(t,n,e)}function _p(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function Zo(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Jp(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new Jo(c,a.source,h?h(c):[],1e9-t.length));else{let c=new Kp(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new Jo(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):Zo(a.completion)>Zo(o)&&(r[r.length-1]=a),o=a.completion}return r}class Lt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Lt(this.options,el(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=Jp(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Lt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(ve).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:Gp(Me,zh),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Lt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class vn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new vn(Qp,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ve),r=(i.override||t.languageDataAt("autocomplete",rt(t)).map(qp)).map(l=>(this.active.find(h=>h.source==l)||new xe(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!Xp(r,this.active)?o=Lt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new xe(l.source,0):l));for(let l of e.effects)l.is(Vh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Yp}}function Xp(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Qp=[];function Us(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class xe{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Us(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new xe(s.source,0));for(let r of e.effects)if(r.is(yr))s=new xe(s.source,1,r.value?rt(e.state):-1);else if(r.is(mi))s=new xe(s.source,0);else if(r.is(Wh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new xe(this.source,1)}handleChange(e){return e.changes.touchesRange(rt(e.startState))?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new xe(this.source,this.state,e.mapPos(this.explicitPos))}}class Ht extends xe{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=rt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&rt(e.startState)==this.from)return new xe(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return Zp(this.result.validFor,e.state,r,o)?new Ht(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Nh(e.state,l,a>=0)))?new Ht(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:rt(e.state)):new xe(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Ht(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Zp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Fh(n,!0).test(s)}const Wh=E.define({map(n,e){return n.map(t=>t.map(e))}}),Vh=E.define(),Me=ye.define({create(){return vn.start()},update(n,e){return n.update(e)},provide:n=>[va.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]});function zh(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Me).active.find(s=>s.source==e.source);return i instanceof Ht?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},zp(n.state,t,i.from,i.to)),{annotations:Hh.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function ji(n,e="option"){return t=>{let i=t.state.field(Me,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Vh.of(l)}),!0}}const eg=n=>{let e=n.state.field(Me,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Me,!1)?(n.dispatch({effects:yr.of(!0)}),!0):!1,ig=n=>{let e=n.state.field(Me,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:mi.of(null)}),!0)};class ng{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tl=50,sg=50,rg=1e3,og=pe.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Me).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Me);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Me)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Us(i));for(let i=0;isg&&Date.now()-s.time>rg){for(let r of s.context.abortListeners)try{r()}catch(o){Ie(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),tl):-1,this.composing!=0)for(let i of n.transactions)Us(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Me);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=rt(e),i=new Nh(e,t,n.explicitPos==t),s=new ng(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:mi.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),tl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ve);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new xe(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Wh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Me,!1);if(e&&e.tooltip&&this.view.state.facet(ve).closeOnBlur){let t=e.open&&Ca(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:mi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:yr.of(!1)}),20),this.composing=0}}}),qh=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class lg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class br{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new br(this.field,t,i)}}class wr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew br(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new lg(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new wr(i,s)}}let ag=B.widget({widget:new class extends At{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),hg=B.mark({class:"cm-snippetField"});class Jt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?ag:hg).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Jt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Ci=E.define({map(n,e){return n&&n.map(e)}}),cg=E.define(),yi=ye.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Ci))return t.value;if(t.is(cg)&&n)return new Jt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>O.decorations.from(n,e=>e?e.deco:B.none)});function xr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function fg(n){let e=wr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0,annotations:i?Hh.of(i):void 0};if(l.length&&(a.selection=xr(l,0)),l.length>1){let h=new Jt(l,0),c=a.effects=[Ci.of(h)];t.state.field(yi,!1)===void 0&&c.push(E.appendConfig.of([yi,mg,yg,qh]))}t.dispatch(t.state.update(a))}}function Kh(n){return({state:e,dispatch:t})=>{let i=e.field(yi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:xr(i.ranges,s),effects:Ci.of(r?null:new Jt(i.ranges,s))})),!0}}const ug=({state:n,dispatch:e})=>n.field(yi,!1)?(e(n.update({effects:Ci.of(null)})),!0):!1,dg=Kh(1),pg=Kh(-1),gg=[{key:"Tab",run:dg,shift:pg},{key:"Escape",run:ug}],il=D.define({combine(n){return n.length?n[0]:gg}}),mg=vt.highest(ir.compute([il],n=>n.facet(il)));function Zg(n,e){return Object.assign(Object.assign({},e),{apply:fg(n)})}const yg=O.domEventHandlers({mousedown(n,e){let t=e.state.field(yi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:xr(t.ranges,s.field),effects:Ci.of(t.ranges.some(r=>r.field>s.field)?new Jt(t.ranges,s.field):null)}),!0)}}),bi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yt=E.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),kr=new class extends wt{};kr.startSide=1;kr.endSide=-1;const $h=ye.define({create(){return j.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=j.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(yt)&&(n=n.update({add:[kr.range(t.value,t.value+1)]}));return n}});function em(){return[wg,$h]}const ts="()[]{}<>";function jh(n){for(let e=0;e{if((bg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Oe(ne(i,0))==1||e!=s.from||t!=s.to)return!1;let r=kg(n.state,i);return r?(n.dispatch(r),!0):!1}),xg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Uh(n,n.selection.main.head).brackets||bi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Sg(n.doc,o.head);for(let a of i)if(a==l&&Nn(n.doc,o.head)==jh(ne(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},tm=[{key:"Backspace",run:xg}];function kg(n,e){let t=Uh(n,n.selection.main.head),i=t.brackets||bi.brackets;for(let s of i){let r=jh(ne(s,0));if(e==s)return r==s?Ag(n,s,i.indexOf(s+s+s)>-1,t):vg(n,s,r,t.before||bi.before);if(e==r&&Gh(n,n.selection.main.from))return Cg(n,s,r)}return null}function Gh(n,e){let t=!1;return n.field($h).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Nn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Oe(ne(t,0)))}function Sg(n,e){let t=n.sliceString(e-2,e);return Oe(ne(t,0))==t.length?t:t.slice(1)}function vg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:yt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Nn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:yt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Cg(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Nn(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ag(n,e,t,i){let s=i.stringPrefixes||bi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:yt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Nn(n.doc,a),c;if(h==e){if(nl(n,a))return{changes:{insert:e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)};if(Gh(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=sl(n,a-2*e.length,s))>-1&&nl(n,c))return{changes:{insert:e+e+e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=q.Word&&sl(n,a,s)>-1&&!Mg(n,a,e,s))return{changes:{insert:e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function nl(n,e){let t=me(n).resolveInner(e+1);return t.parent&&t.from==e}function Mg(n,e,t,i){let s=me(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function sl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=q.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=q.Word)return r}return-1}function im(n={}){return[Me,ve.of(n),og,Og,qh]}const Dg=[{key:"Ctrl-Space",run:tg},{key:"Escape",run:ig},{key:"ArrowDown",run:ji(!0)},{key:"ArrowUp",run:ji(!1)},{key:"PageDown",run:ji(!0,"page")},{key:"PageUp",run:ji(!1,"page")},{key:"Enter",run:eg}],Og=vt.highest(ir.computeN([ve],n=>n.facet(ve).defaultKeymap?[Dg]:[]));export{zg as A,qg as B,Cn as C,cu as D,O as E,Kg as F,Hg as G,me as H,$ as I,Ig as J,Qg as K,Ns as L,Vp as M,nr as N,b as O,Oa as P,Vg as Q,Wg as R,qa as S,H as T,Lu as U,Zg as V,Pa as W,Xu as X,N as a,Pg as b,Gg as c,Tg as d,Bg as e,Ug as f,em as g,Eg as h,Xg as i,tm as j,ir as k,Jg as l,Yg as m,_g as n,Dg as o,im as p,Lg as q,Rg as r,$g as s,jg as t,ge as u,L as v,Du as w,C as x,Ng as y,Iu as z}; +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new za(t,e?e.state.tabSize:4,e?vt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=$a(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const hr=Object.create(null),pi=[me.none],nd=new nr(pi),No=[],ja=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ja[n]=Ga(hr,e);class Ua{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),ja)}resolve(e){return e?this.table[e]||(this.table[e]=Ga(this.extra,e)):0}}const sd=new Ua(hr);function Yn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Ga(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||C[r];o?typeof o=="function"?t?t=o(t):Yn(r,`Modifier ${r} used at start of tag`):t?Yn(r,`Tag ${r} used as modifier`):t=o:Yn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:pi.length,name:i,props:[Du({[i]:t})]});return pi.push(s),s.id}function rd(n){let e=me.define({id:pi.length,name:"Document",props:[mt.add(()=>n)]});return pi.push(e),e}const od=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=fr(n.state,t.from);return i.line?ld(n):i.block?hd(n):!1};function cr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const ld=cr(ud,0),ad=cr(_a,0),hd=cr((n,e)=>_a(n,e,fd(e)),0);function fr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ei=50;function cd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-ei,i),o=n.sliceDoc(s,s+ei),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*ei?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+ei),f=n.sliceDoc(s-ei,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function fd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function _a(n,e,t=e.selection.ranges){let i=t.map(r=>fr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>cd(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Vs=Ze.define(),dd=Ze.define(),pd=D.define(),Ja=D.define({combine(n){return At(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function gd(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const Xa=be.define({create(){return Ge.empty},update(n,e){let t=e.state.facet(Ja),i=e.annotation(Vs);if(i){let a=e.docChanged?b.single(gd(e.changes)):void 0,h=Se.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=mn(f,f.length,t.minDepth,h):f=Za(f,e.startState.selection),new Ge(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(dd);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(ee.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Se.fromTransaction(e),o=e.annotation(ee.time),l=e.annotation(ee.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ge(n.done.map(Se.fromJSON),n.undone.map(Se.fromJSON))}});function Gg(n={}){return[Xa,Ja.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Ya:e.inputType=="historyRedo"?zs:null;return i?(e.preventDefault(),i(t)):!1}})]}function Pn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Xa,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Ya=Pn(0,!1),zs=Pn(1,!1),md=Pn(0,!0),yd=Pn(1,!0);class Se{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Se(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Se(e.changes&&Z.fromJSON(e.changes),[],e.mapped&&_e.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Pe;for(let s of e.startState.facet(pd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Se(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new Se(void 0,Pe,void 0,void 0,e)}}function mn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function bd(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function wd(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Qa(n,e){return n.length?e.length?n.concat(e):n:e}const Pe=[],xd=200;function Za(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-xd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),mn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Se.selection([e])]}function kd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Qn(n,e){if(!n.length)return n;let t=n.length,i=Pe;for(;t;){let s=Sd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Se.selection(i)]:Pe}function Sd(n,e,t){let i=Qa(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Pe,t);if(!n.changes)return Se.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Se(s,E.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const vd=/^(input\.type|delete)($|\.)/;class Ge{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ge(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||vd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Ln(t,e))}function fe(n){return n.textDirectionAt(n.state.selection.main.head)==_.LTR}const th=n=>eh(n,!fe(n)),ih=n=>eh(n,fe(n));function nh(n,e){return Ne(n,t=>t.empty?n.moveByGroup(t,e):Ln(t,e))}const Cd=n=>nh(n,!fe(n)),Ad=n=>nh(n,fe(n));function Md(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Rn(n,e,t){let i=ye(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Md(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Ue(n,i.from,1):Ue(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const Dd=n=>Ne(n,e=>Rn(n.state,e,!fe(n))),Od=n=>Ne(n,e=>Rn(n.state,e,fe(n)));function sh(n,e){return Ne(n,t=>{if(!t.empty)return Ln(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const rh=n=>sh(n,!1),oh=n=>sh(n,!0);function lh(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Ln(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomah(n,!1),qs=n=>ah(n,!0);function ct(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Td=n=>Ne(n,e=>ct(n,e,!0)),Bd=n=>Ne(n,e=>ct(n,e,!1)),Pd=n=>Ne(n,e=>ct(n,e,!fe(n))),Ld=n=>Ne(n,e=>ct(n,e,fe(n))),Rd=n=>Ne(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Ed=n=>Ne(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function Id(n,e,t){let i=!1,s=Gt(n.selection,r=>{let o=Ue(n,r.head,-1)||Ue(n,r.head,1)||r.head>0&&Ue(n,r.head-1,1)||r.headId(n,e,!1);function Ee(n,e){let t=Gt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Xe(n.state,t)),!0)}function hh(n,e){return Ee(n,t=>n.moveByChar(t,e))}const ch=n=>hh(n,!fe(n)),fh=n=>hh(n,fe(n));function uh(n,e){return Ee(n,t=>n.moveByGroup(t,e))}const Fd=n=>uh(n,!fe(n)),Hd=n=>uh(n,fe(n)),Wd=n=>Ee(n,e=>Rn(n.state,e,!fe(n))),Vd=n=>Ee(n,e=>Rn(n.state,e,fe(n)));function dh(n,e){return Ee(n,t=>n.moveVertically(t,e))}const ph=n=>dh(n,!1),gh=n=>dh(n,!0);function mh(n,e){return Ee(n,t=>n.moveVertically(t,e,lh(n).height))}const Ho=n=>mh(n,!1),Wo=n=>mh(n,!0),zd=n=>Ee(n,e=>ct(n,e,!0)),qd=n=>Ee(n,e=>ct(n,e,!1)),Kd=n=>Ee(n,e=>ct(n,e,!fe(n))),$d=n=>Ee(n,e=>ct(n,e,fe(n))),jd=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).from)),Ud=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Vo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:0})),!0),zo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.doc.length})),!0),qo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:0})),!0),Ko=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Gd=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),_d=({state:n,dispatch:e})=>{let t=In(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},Jd=({state:n,dispatch:e})=>{let t=Gt(n.selection,i=>{var s;let r=ye(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return b.range(r.to,r.from)});return e(Xe(n,t)),!0},Xd=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Xe(n,i)),!0):!1};function En(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(o);ao&&(t="delete.forward",a=qi(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=qi(n,o,!1),l=qi(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?O.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function qi(n,e,t){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const yh=(n,e)=>En(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tyh(n,!1),bh=n=>yh(n,!0),wh=(n,e)=>En(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ce(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t)&&(l=c),i=a}return i}),xh=n=>wh(n,!1),Yd=n=>wh(n,!0),kh=n=>En(n,e=>{let t=n.lineBlockAt(e).to;return eEn(n,e=>{let t=n.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),Zd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ep=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ce(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ce(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function In(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Sh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of In(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const tp=({state:n,dispatch:e})=>Sh(n,e,!1),ip=({state:n,dispatch:e})=>Sh(n,e,!0);function vh(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of In(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const np=({state:n,dispatch:e})=>vh(n,e,!1),sp=({state:n,dispatch:e})=>vh(n,e,!0),rp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(In(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function op(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ye(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const lp=Ch(!1),ap=Ch(!0);function Ch(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&op(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Tn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Ea(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const hp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Tn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=ur(n,(r,o,l)=>{let a=Ea(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=gn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(ur(n,(t,i)=>{i.push({from:t.from,insert:n.facet(On)})}),{userEvent:"input.indent"})),!0),fp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ur(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=wi(s,n.tabSize),o=0,l=gn(n,Math.max(0,r-vt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),Jg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Dd,shift:Wd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Od,shift:Vd},{key:"Alt-ArrowUp",run:tp},{key:"Shift-Alt-ArrowUp",run:np},{key:"Alt-ArrowDown",run:ip},{key:"Shift-Alt-ArrowDown",run:sp},{key:"Escape",run:Xd},{key:"Mod-Enter",run:ap},{key:"Alt-l",mac:"Ctrl-l",run:_d},{key:"Mod-i",run:Jd,preventDefault:!0},{key:"Mod-[",run:fp},{key:"Mod-]",run:cp},{key:"Mod-Alt-\\",run:hp},{key:"Shift-Mod-k",run:rp},{key:"Shift-Mod-\\",run:Nd},{key:"Mod-/",run:od},{key:"Alt-A",run:ad}].concat(dp);function le(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Ut{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r($o(l)):$o,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ne(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Gs(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Oe(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=yn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Ht(t,e.sliceString(t,i));return Zn.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=yn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ht.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Dh.prototype[Symbol.iterator]=Oh.prototype[Symbol.iterator]=function(){return this});function pp(n){try{return new RegExp(n,dr),!0}catch{return!1}}function yn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function $s(n){let e=le("input",{class:"cm-textfield",name:"line"}),t=le("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:bn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},le("label",n.state.phrase("Go to line"),": ",e)," ",le("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,h,c]=s,f=h?+h.slice(1):0,u=a?+a:o.number;if(a&&c){let m=u/100;l&&(m=m*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*m)}else a&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),p=b.cursor(d.from+Math.max(0,Math.min(f,d.length)));n.dispatch({effects:[bn.of(!1),O.scrollIntoView(p.from,{y:"center"})],selection:p}),n.focus()}return{dom:t}}const bn=E.define(),jo=be.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(bn)&&(n=t.value);return n},provide:n=>cn.from(n,e=>e?$s:null)}),gp=n=>{let e=hn(n,$s);if(!e){let t=[bn.of(!0)];n.state.field(jo,!1)==null&&t.push(E.appendConfig.of([jo,mp])),n.dispatch({effects:t}),e=hn(n,$s)}return e&&e.dom.querySelector("input").focus(),!0},mp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),yp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Th=D.define({combine(n){return At(n,yp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Xg(n){let e=[Sp,kp];return n&&e.push(Th.of(n)),e}const bp=B.mark({class:"cm-selectionMatch"}),wp=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Uo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=q.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=q.Word)}function xp(n,e,t,i){return n(e.sliceDoc(t,t+1))==q.Word&&n(e.sliceDoc(i-1,i))==q.Word}const kp=ge.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Th),{state:t}=n,i=t.selection;if(i.ranges.length>1)return B.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return B.none;let a=t.wordAt(s.head);if(!a)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return B.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Uo(o,t,s.from,s.to)&&xp(o,t,s.from,s.to)))return B.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return B.none}let l=[];for(let a of n.visibleRanges){let h=new Ut(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Uo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(wp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(bp.range(c,f)),l.length>e.maxMatches))return B.none}}return B.set(l)}},{decorations:n=>n.decorations}),Sp=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),vp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Cp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Ut(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Ut(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Ap=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return vp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Cp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},_t=D.define({combine(n){return At(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Np(e),scrollToMatch:e=>O.scrollIntoView(e)})}});class Bh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||pp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Tp(this):new Dp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Pt(this,s,t,i):Bt(this,s,t,i)}}class Ph{constructor(e){this.spec=e}}function Bt(n,e,t,i){return new Ut(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Mp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Mp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Bt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Pt(n,e,t,i){return new Dh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function wn(n,e){return n.slice(ce(n,e,!1),e)}function xn(n,e){return n.slice(e,ce(n,e))}function Op(n){return(e,t,i)=>!i[0].length||(n(wn(i.input,i.index))!=q.Word||n(xn(i.input,i.index))!=q.Word)&&(n(xn(i.input,i.index+i[0].length))!=q.Word||n(wn(i.input,i.index+i[0].length))!=q.Word)}class Tp extends Ph{nextMatch(e,t,i){let s=Pt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Pt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Pt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Pt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const gi=E.define(),pr=E.define(),st=be.define({create(n){return new es(js(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new es(t.value.create(),n.panel):t.is(pr)&&(n=new es(n.query,t.value?gr:null));return n},provide:n=>cn.from(n,e=>e.panel)});class es{constructor(e,t){this.query=e,this.panel=t}}const Bp=B.mark({class:"cm-searchMatch"}),Pp=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Lp=ge.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return B.none;let{view:t}=this,i=new xt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Pp:Bp)})}return i.finish()}},{decorations:n=>n.decorations});function vi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):Eh(e)}}const kn=vi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(_t);return n.dispatch({selection:s,effects:[mr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Rh(n),!0}),Sn=vi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(_t);return n.dispatch({selection:r,effects:[mr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Rh(n),!0}),Rp=vi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ep=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Ut(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Go=vi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-c,r.to-c),h.push(mr(n,r)),h.push(t.facet(_t).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),Ip=vi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function gr(n){return n.state.facet(_t).createPanel(n)}function js(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(_t);return new Bh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Lh(n){let e=hn(n,gr);return e&&e.dom.querySelector("[main-field]")}function Rh(n){let e=Lh(n);e&&e==n.root.activeElement&&e.select()}const Eh=n=>{let e=n.state.field(st,!1);if(e&&e.panel){let t=Lh(n);if(t&&t!=n.root.activeElement){let i=js(n.state,e.query.spec);i.valid&&n.dispatch({effects:gi.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[pr.of(!0),e?gi.of(js(n.state,e.query.spec)):E.appendConfig.of(Hp)]});return!0},Ih=n=>{let e=n.state.field(st,!1);if(!e||!e.panel)return!1;let t=hn(n,gr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:pr.of(!1)}),!0},Yg=[{key:"Mod-f",run:Eh,scope:"editor search-panel"},{key:"F3",run:kn,shift:Sn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:kn,shift:Sn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Ih,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ep},{key:"Alt-g",run:gp},{key:"Mod-d",run:Ap,preventDefault:!0}];class Np{constructor(e){this.view=e;let t=this.query=e.state.field(st).query.spec;this.commit=this.commit.bind(this),this.searchField=le("input",{value:t.search,placeholder:Ce(e,"Find"),"aria-label":Ce(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=le("input",{value:t.replace,placeholder:Ce(e,"Replace"),"aria-label":Ce(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=le("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=le("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=le("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return le("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=le("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>kn(e),[Ce(e,"next")]),i("prev",()=>Sn(e),[Ce(e,"previous")]),i("select",()=>Rp(e),[Ce(e,"all")]),le("label",null,[this.caseField,Ce(e,"match case")]),le("label",null,[this.reField,Ce(e,"regexp")]),le("label",null,[this.wordField,Ce(e,"by word")]),...e.state.readOnly?[]:[le("br"),this.replaceField,i("replace",()=>Go(e),[Ce(e,"replace")]),i("replaceAll",()=>Ip(e),[Ce(e,"replace all")])],le("button",{name:"close",onclick:()=>Ih(e),"aria-label":Ce(e,"close"),type:"button"},["×"])])}commit(){let e=new Bh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:gi.of(e)}))}keydown(e){Rf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Sn:kn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Go(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(gi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(_t).top}}function Ce(n,e){return n.state.phrase(e)}const Ki=30,$i=/[\s\.,:;?!]/;function mr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Ki),o=Math.min(s,t+Ki),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Ki;a--)if(!$i.test(l[a-1])&&$i.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Fp=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Hp=[st,Ct.lowest(Lp),Fp];class Nh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ye(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Fh(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function _o(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Wp(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Wp(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Qg(n,e){return t=>{for(let i=ye(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class Jo{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function rt(n){return n.selection.main.from}function Fh(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Hh=Ze.define();function zp(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:b.cursor(l.from+r+e.length)})),{userEvent:"input.complete"})}const Xo=new WeakMap;function qp(n){if(!Array.isArray(n))return n;let e=Xo.get(n);return e||Xo.set(n,e=Vp(n)),e}const yr=E.define(),mi=E.define();class Kp{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(S=Gs(x))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!k||T==1&&g||w==0&&T!=0)&&(t[f]==x||i[f]==x&&(u=!0)?o[f++]=k:o.length&&(y=!1)),w=T,k+=Oe(x)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Oe(ne(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const ve=D.define({combine(n){return At(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:$p,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Yo(e(i),t(i)),optionClass:(e,t)=>i=>Yo(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function Yo(n,e){return n?e?n+" "+e:n:e}function $p(n,e,t,i,s){let r=n.textDirection==_.RTL,o=r,l=!1,a="top",h,c,f=e.left-s.left,u=s.right-e.right,d=i.right-i.left,p=i.bottom-i.top;if(o&&f=p||m>e.top?h=t.bottom-e.top:(a="bottom",h=e.bottom-t.top)}return{style:`${a}: ${h}px; max-width: ${c}px`,class:"cm-completionInfo-"+(l?r?"left-narrow":"right-narrow":o?"left":"right")}}function jp(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function Qo(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class Up{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ve);this.optionContent=jp(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Qo(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ve).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:mi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(r,s.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Qo(t.options.length,t.selected,this.view.state.facet(ve).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Ie(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&_p(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew Up(t,n,e)}function _p(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function Zo(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Jp(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new Jo(c,a.source,h?h(c):[],1e9-t.length));else{let c=new Kp(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new Jo(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):Zo(a.completion)>Zo(o)&&(r[r.length-1]=a),o=a.completion}return r}class Rt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Rt(this.options,el(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=Jp(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Rt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(ve).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:Gp(Me,zh),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Rt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class vn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new vn(Qp,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ve),r=(i.override||t.languageDataAt("autocomplete",rt(t)).map(qp)).map(l=>(this.active.find(h=>h.source==l)||new ke(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!Xp(r,this.active)?o=Rt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new ke(l.source,0):l));for(let l of e.effects)l.is(Vh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Yp}}function Xp(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Qp=[];function Us(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ke{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Us(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new ke(s.source,0));for(let r of e.effects)if(r.is(yr))s=new ke(s.source,1,r.value?rt(e.state):-1);else if(r.is(mi))s=new ke(s.source,0);else if(r.is(Wh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new ke(this.source,1)}handleChange(e){return e.changes.touchesRange(rt(e.startState))?new ke(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ke(this.source,this.state,e.mapPos(this.explicitPos))}}class Wt extends ke{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=rt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&rt(e.startState)==this.from)return new ke(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return Zp(this.result.validFor,e.state,r,o)?new Wt(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Nh(e.state,l,a>=0)))?new Wt(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:rt(e.state)):new ke(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ke(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Wt(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Zp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Fh(n,!0).test(s)}const Wh=E.define({map(n,e){return n.map(t=>t.map(e))}}),Vh=E.define(),Me=be.define({create(){return vn.start()},update(n,e){return n.update(e)},provide:n=>[va.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]});function zh(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Me).active.find(s=>s.source==e.source);return i instanceof Wt?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},zp(n.state,t,i.from,i.to)),{annotations:Hh.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function ji(n,e="option"){return t=>{let i=t.state.field(Me,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Vh.of(l)}),!0}}const eg=n=>{let e=n.state.field(Me,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Me,!1)?(n.dispatch({effects:yr.of(!0)}),!0):!1,ig=n=>{let e=n.state.field(Me,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:mi.of(null)}),!0)};class ng{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tl=50,sg=50,rg=1e3,og=ge.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Me).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Me);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Me)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Us(i));for(let i=0;isg&&Date.now()-s.time>rg){for(let r of s.context.abortListeners)try{r()}catch(o){Ie(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),tl):-1,this.composing!=0)for(let i of n.transactions)Us(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Me);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=rt(e),i=new Nh(e,t,n.explicitPos==t),s=new ng(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:mi.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),tl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ve);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new ke(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Wh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Me,!1);if(e&&e.tooltip&&this.view.state.facet(ve).closeOnBlur){let t=e.open&&Ca(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:mi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:yr.of(!1)}),20),this.composing=0}}}),qh=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class lg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class br{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new br(this.field,t,i)}}class wr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew br(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new lg(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new wr(i,s)}}let ag=B.widget({widget:new class extends Mt{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),hg=B.mark({class:"cm-snippetField"});class Jt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?ag:hg).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Jt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Ci=E.define({map(n,e){return n&&n.map(e)}}),cg=E.define(),yi=be.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Ci))return t.value;if(t.is(cg)&&n)return new Jt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>O.decorations.from(n,e=>e?e.deco:B.none)});function xr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function fg(n){let e=wr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0,annotations:i?Hh.of(i):void 0};if(l.length&&(a.selection=xr(l,0)),l.length>1){let h=new Jt(l,0),c=a.effects=[Ci.of(h)];t.state.field(yi,!1)===void 0&&c.push(E.appendConfig.of([yi,mg,yg,qh]))}t.dispatch(t.state.update(a))}}function Kh(n){return({state:e,dispatch:t})=>{let i=e.field(yi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:xr(i.ranges,s),effects:Ci.of(r?null:new Jt(i.ranges,s))})),!0}}const ug=({state:n,dispatch:e})=>n.field(yi,!1)?(e(n.update({effects:Ci.of(null)})),!0):!1,dg=Kh(1),pg=Kh(-1),gg=[{key:"Tab",run:dg,shift:pg},{key:"Escape",run:ug}],il=D.define({combine(n){return n.length?n[0]:gg}}),mg=Ct.highest(ir.compute([il],n=>n.facet(il)));function Zg(n,e){return Object.assign(Object.assign({},e),{apply:fg(n)})}const yg=O.domEventHandlers({mousedown(n,e){let t=e.state.field(yi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:xr(t.ranges,s.field),effects:Ci.of(t.ranges.some(r=>r.field>s.field)?new Jt(t.ranges,s.field):null)}),!0)}}),bi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yt=E.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),kr=new class extends wt{};kr.startSide=1;kr.endSide=-1;const $h=be.define({create(){return j.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=j.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(yt)&&(n=n.update({add:[kr.range(t.value,t.value+1)]}));return n}});function em(){return[wg,$h]}const ts="()[]{}<>";function jh(n){for(let e=0;e{if((bg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Oe(ne(i,0))==1||e!=s.from||t!=s.to)return!1;let r=kg(n.state,i);return r?(n.dispatch(r),!0):!1}),xg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Uh(n,n.selection.main.head).brackets||bi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Sg(n.doc,o.head);for(let a of i)if(a==l&&Nn(n.doc,o.head)==jh(ne(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},tm=[{key:"Backspace",run:xg}];function kg(n,e){let t=Uh(n,n.selection.main.head),i=t.brackets||bi.brackets;for(let s of i){let r=jh(ne(s,0));if(e==s)return r==s?Ag(n,s,i.indexOf(s+s+s)>-1,t):vg(n,s,r,t.before||bi.before);if(e==r&&Gh(n,n.selection.main.from))return Cg(n,s,r)}return null}function Gh(n,e){let t=!1;return n.field($h).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Nn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Oe(ne(t,0)))}function Sg(n,e){let t=n.sliceString(e-2,e);return Oe(ne(t,0))==t.length?t:t.slice(1)}function vg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:yt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Nn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:yt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Cg(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Nn(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ag(n,e,t,i){let s=i.stringPrefixes||bi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:yt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Nn(n.doc,a),c;if(h==e){if(nl(n,a))return{changes:{insert:e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)};if(Gh(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=sl(n,a-2*e.length,s))>-1&&nl(n,c))return{changes:{insert:e+e+e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=q.Word&&sl(n,a,s)>-1&&!Mg(n,a,e,s))return{changes:{insert:e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function nl(n,e){let t=ye(n).resolveInner(e+1);return t.parent&&t.from==e}function Mg(n,e,t,i){let s=ye(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function sl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=q.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=q.Word)return r}return-1}function im(n={}){return[Me,ve.of(n),og,Og,qh]}const Dg=[{key:"Ctrl-Space",run:tg},{key:"Escape",run:ig},{key:"ArrowDown",run:ji(!0)},{key:"ArrowUp",run:ji(!1)},{key:"PageDown",run:ji(!0,"page")},{key:"PageUp",run:ji(!1,"page")},{key:"Enter",run:eg}],Og=Ct.highest(ir.computeN([ve],n=>n.facet(ve).defaultKeymap?[Dg]:[]));export{zg as A,qg as B,Cn as C,cu as D,O as E,Kg as F,Hg as G,ye as H,$ as I,Ig as J,Qg as K,Ns as L,Vp as M,nr as N,b as O,Oa as P,Vg as Q,Wg as R,qa as S,H as T,Lu as U,Zg as V,Pa as W,Xu as X,N as a,Pg as b,Gg as c,Tg as d,Bg as e,Ug as f,em as g,Eg as h,Xg as i,tm as j,ir as k,Jg as l,Yg as m,_g as n,Dg as o,im as p,Lg as q,Rg as r,$g as s,jg as t,me as u,L as v,Du as w,C as x,Ng as y,Iu as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index b38e1e81..65cde6d0 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -45,7 +45,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/package-lock.json b/ui/package-lock.json index 9e77a10d..3cccee92 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -21,7 +21,7 @@ "chart.js": "^3.7.1", "chartjs-adapter-luxon": "^1.2.0", "luxon": "^2.3.2", - "pocketbase": "^0.16.0", + "pocketbase": "0.17.0-rc1", "prismjs": "^1.28.0", "sass": "^1.45.0", "svelte": "^3.44.0", @@ -61,9 +61,9 @@ } }, "node_modules/@codemirror/lang-css": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.2.0.tgz", - "integrity": "sha512-oyIdJM29AyRPM3+PPq1I2oIk8NpUfEN3kAM05XWDDs6o3gSneIKaVJifT2P+fqONLou2uIgXynFyMUDQvo/szA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.2.1.tgz", + "integrity": "sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==", "dev": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", @@ -106,9 +106,9 @@ } }, "node_modules/@codemirror/lang-sql": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.5.2.tgz", - "integrity": "sha512-VYiCbApDDRUVx3k0jtZ+b5h2hMkMKZpPR9tx+VgVA3Euuf2MVjVsjx/S2+4AlJjKjS5J6z9+4bEvtponK96e4A==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.5.4.tgz", + "integrity": "sha512-5Gq7fYtT/5HbNyIG7a8vYaqOYQU3JbgtBe3+derkrFUXRVcjkf8WVgz++PIbMFAQsOFMDdDR+uiNM8ZRRuXH+w==", "dev": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", @@ -153,9 +153,9 @@ } }, "node_modules/@codemirror/search": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.0.tgz", - "integrity": "sha512-64/M40YeJPToKvGO6p3fijo2vwUEj4nACEAXElCaYQ50HrXSvRaK+NHEhSh73WFBGdvIdhrV+lL9PdJy2RfCYA==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.1.tgz", + "integrity": "sha512-4jupk4JwkeVbrN2pStY74q6OJEYqwosB4koA66nyLeVedadtX9MHI38j2vbYmnfDGurDApP3OZO46MrWalcjiQ==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", @@ -170,9 +170,9 @@ "dev": true }, "node_modules/@codemirror/view": { - "version": "6.15.3", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.15.3.tgz", - "integrity": "sha512-chNgR8H7Ipx7AZUt0+Kknk7BCow/ron3mHd1VZdM7hQXiI79+UlWqcxpCiexTxZQ+iSkqndk3HHAclJOcjSuog==", + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.16.0.tgz", + "integrity": "sha512-1Z2HkvkC3KR/oEZVuW9Ivmp8TWLzGEd8T8TA04TTwPvqogfkHBdYSlflytDOqmkUxM2d1ywTg7X2dU5mC+SXvg==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", @@ -181,9 +181,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.17.tgz", - "integrity": "sha512-wHsmJG/dnL3OkpAcwbgoBTTMHVi4Uyou3F5mf58ZtmUyIKfcdA7TROav/6tCzET4A3QW2Q2FC+eFneMU+iyOxg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], @@ -197,9 +197,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.17.tgz", - "integrity": "sha512-9np+YYdNDed5+Jgr1TdWBsozZ85U1Oa3xW0c7TWqH0y2aGghXtZsuT8nYRbzOMcl0bXZXjOGbksoTtVOlWrRZg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], @@ -213,9 +213,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.17.tgz", - "integrity": "sha512-O+FeWB/+xya0aLg23hHEM2E3hbfwZzjqumKMSIqcHbNvDa+dza2D0yLuymRBQQnC34CWrsJUXyH2MG5VnLd6uw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], @@ -229,9 +229,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.17.tgz", - "integrity": "sha512-M9uJ9VSB1oli2BE/dJs3zVr9kcCBBsE883prage1NWz6pBS++1oNn/7soPNS3+1DGj0FrkSvnED4Bmlu1VAE9g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -245,9 +245,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.17.tgz", - "integrity": "sha512-XDre+J5YeIJDMfp3n0279DFNrGCXlxOuGsWIkRb1NThMZ0BsrWXoTg23Jer7fEXQ9Ye5QjrvXpxnhzl3bHtk0g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], @@ -261,9 +261,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.17.tgz", - "integrity": "sha512-cjTzGa3QlNfERa0+ptykyxs5A6FEUQQF0MuilYXYBGdBxD3vxJcKnzDlhDCa1VAJCmAxed6mYhA2KaJIbtiNuQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], @@ -277,9 +277,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.17.tgz", - "integrity": "sha512-sOxEvR8d7V7Kw8QqzxWc7bFfnWnGdaFBut1dRUYtu+EIRXefBc/eIsiUiShnW0hM3FmQ5Zf27suDuHsKgZ5QrA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], @@ -293,9 +293,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.17.tgz", - "integrity": "sha512-2d3Lw6wkwgSLC2fIvXKoMNGVaeY8qdN0IC3rfuVxJp89CRfA3e3VqWifGDfuakPmp90+ZirmTfye1n4ncjv2lg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], @@ -309,9 +309,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.17.tgz", - "integrity": "sha512-c9w3tE7qA3CYWjT+M3BMbwMt+0JYOp3vCMKgVBrCl1nwjAlOMYzEo+gG7QaZ9AtqZFj5MbUc885wuBBmu6aADQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], @@ -325,9 +325,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.17.tgz", - "integrity": "sha512-1DS9F966pn5pPnqXYz16dQqWIB0dmDfAQZd6jSSpiT9eX1NzKh07J6VKR3AoXXXEk6CqZMojiVDSZi1SlmKVdg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], @@ -341,9 +341,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.17.tgz", - "integrity": "sha512-EvLsxCk6ZF0fpCB6w6eOI2Fc8KW5N6sHlIovNe8uOFObL2O+Mr0bflPHyHwLT6rwMg9r77WOAWb2FqCQrVnwFg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], @@ -357,9 +357,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.17.tgz", - "integrity": "sha512-e0bIdHA5p6l+lwqTE36NAW5hHtw2tNRmHlGBygZC14QObsA3bD4C6sXLJjvnDIjSKhW1/0S3eDy+QmX/uZWEYQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], @@ -373,9 +373,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.17.tgz", - "integrity": "sha512-BAAilJ0M5O2uMxHYGjFKn4nJKF6fNCdP1E0o5t5fvMYYzeIqy2JdAP88Az5LHt9qBoUa4tDaRpfWt21ep5/WqQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], @@ -389,9 +389,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.17.tgz", - "integrity": "sha512-Wh/HW2MPnC3b8BqRSIme/9Zhab36PPH+3zam5pqGRH4pE+4xTrVLx2+XdGp6fVS3L2x+DrsIcsbMleex8fbE6g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], @@ -405,9 +405,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.17.tgz", - "integrity": "sha512-j/34jAl3ul3PNcK3pfI0NSlBANduT2UO5kZ7FCaK33XFv3chDhICLY8wJJWIhiQ+YNdQ9dxqQctRg2bvrMlYgg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], @@ -421,9 +421,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.17.tgz", - "integrity": "sha512-QM50vJ/y+8I60qEmFxMoxIx4de03pGo2HwxdBeFd4nMh364X6TIBZ6VQ5UQmPbQWUVWHWws5MmJXlHAXvJEmpQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -437,9 +437,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.17.tgz", - "integrity": "sha512-/jGlhWR7Sj9JPZHzXyyMZ1RFMkNPjC6QIAan0sDOtIo2TYk3tZn5UDrkE0XgsTQCxWTTOcMPf9p6Rh2hXtl5TQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], @@ -453,9 +453,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.17.tgz", - "integrity": "sha512-rSEeYaGgyGGf4qZM2NonMhMOP/5EHp4u9ehFiBrg7stH6BYEEjlkVREuDEcQ0LfIl53OXLxNbfuIj7mr5m29TA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], @@ -469,9 +469,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.17.tgz", - "integrity": "sha512-Y7ZBbkLqlSgn4+zot4KUNYst0bFoO68tRgI6mY2FIM+b7ZbyNVtNbDP5y8qlu4/knZZ73fgJDlXID+ohY5zt5g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], @@ -485,9 +485,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.17.tgz", - "integrity": "sha512-bwPmTJsEQcbZk26oYpc4c/8PvTY3J5/QK8jM19DVlEsAB41M39aWovWoHtNm78sd6ip6prilxeHosPADXtEJFw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], @@ -501,9 +501,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.17.tgz", - "integrity": "sha512-H/XaPtPKli2MhW+3CQueo6Ni3Avggi6hP/YvgkEe1aSaxw+AeO8MFjq8DlgfTd9Iz4Yih3QCZI6YLMoyccnPRg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], @@ -517,9 +517,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz", - "integrity": "sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], @@ -594,17 +594,17 @@ } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.3.tgz", - "integrity": "sha512-NY2h+B54KHZO3kDURTdARqthn6D4YSIebtfW75NvZ/fwyk4G+AJw3V/i0OBjyN4406Ht9yZcnNWMuRUFnDNNiA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.5.tgz", + "integrity": "sha512-UJKsFNwhzCVuiZd06jM/psscyNJNDwjQC+qIeb7GBJK9iWeQCcIyfcPWDvbCudfcJggY9jtxJeeaZH7uny93FQ==", "dev": true, "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^1.0.3", "debug": "^4.3.4", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.1", - "svelte-hmr": "^0.15.2", + "magic-string": "^0.30.2", + "svelte-hmr": "^0.15.3", "vitefu": "^0.2.4" }, "engines": { @@ -751,9 +751,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.17.tgz", - "integrity": "sha512-1GJtYnUxsJreHYA0Y+iQz2UEykonY66HNWOb0yXYZi9/kNrORUEHVg87eQsCtqh59PEJ5YVZJO98JHznMJSWjg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { @@ -763,28 +763,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.17", - "@esbuild/android-arm64": "0.18.17", - "@esbuild/android-x64": "0.18.17", - "@esbuild/darwin-arm64": "0.18.17", - "@esbuild/darwin-x64": "0.18.17", - "@esbuild/freebsd-arm64": "0.18.17", - "@esbuild/freebsd-x64": "0.18.17", - "@esbuild/linux-arm": "0.18.17", - "@esbuild/linux-arm64": "0.18.17", - "@esbuild/linux-ia32": "0.18.17", - "@esbuild/linux-loong64": "0.18.17", - "@esbuild/linux-mips64el": "0.18.17", - "@esbuild/linux-ppc64": "0.18.17", - "@esbuild/linux-riscv64": "0.18.17", - "@esbuild/linux-s390x": "0.18.17", - "@esbuild/linux-x64": "0.18.17", - "@esbuild/netbsd-x64": "0.18.17", - "@esbuild/openbsd-x64": "0.18.17", - "@esbuild/sunos-x64": "0.18.17", - "@esbuild/win32-arm64": "0.18.17", - "@esbuild/win32-ia32": "0.18.17", - "@esbuild/win32-x64": "0.18.17" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/fill-range": { @@ -832,9 +832,9 @@ } }, "node_modules/immutable": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.1.tgz", - "integrity": "sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.2.tgz", + "integrity": "sha512-oGXzbEDem9OOpDWZu88jGiYCvIsLHMvGw+8OXlpsvTFvIQplQbjg1B1cvKg8f7Hoch6+NGjpPsH1Fr+Mc2D1aA==", "dev": true }, "node_modules/is-binary-path": { @@ -961,15 +961,15 @@ } }, "node_modules/pocketbase": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.16.0.tgz", - "integrity": "sha512-sndPu4Mbu1Y2VefvO2gIa/No5aIdP6E5br9HUGomvDYSfkmGfBxJNkivJSSKlr9KwWnaF8otf14304UUeFGOrA==", + "version": "0.17.0-rc1", + "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.17.0-rc1.tgz", + "integrity": "sha512-38HMPak9Fgx/rG4tq0/eiBw7WTZ3+Vwk/8FIm1BWhCSP+CDskkpZPRSnHoIND+/tMJb/Wnxl+3IMXf/IaGjtjw==", "dev": true }, "node_modules/postcss": { - "version": "8.4.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", - "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", + "version": "8.4.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", + "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", "dev": true, "funding": [ { @@ -1025,9 +1025,9 @@ } }, "node_modules/rollup": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.27.0.tgz", - "integrity": "sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", + "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -1047,9 +1047,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.64.1.tgz", - "integrity": "sha512-16rRACSOFEE8VN7SCgBu1MpYCyN7urj9At898tyzdXFhC+a+yOX5dXwAR7L8/IdPJ1NB8OYoXmD55DM30B2kEQ==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.65.1.tgz", + "integrity": "sha512-9DINwtHmA41SEd36eVPQ9BJKpn7eKDQmUHmpI0y5Zv2Rcorrh0zS+cFrt050hdNbmmCNKTW3hV5mWfuegNRsEA==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -1100,15 +1100,15 @@ } }, "node_modules/svelte-hmr": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.2.tgz", - "integrity": "sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==", + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", + "integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==", "dev": true, "engines": { "node": "^12.20 || ^14.13.1 || >= 16" }, "peerDependencies": { - "svelte": "^3.19.0 || ^4.0.0-next.0" + "svelte": "^3.19.0 || ^4.0.0" } }, "node_modules/svelte-spa-router": { @@ -1136,14 +1136,14 @@ } }, "node_modules/vite": { - "version": "4.4.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz", - "integrity": "sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==", + "version": "4.4.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", + "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", "dev": true, "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.26", - "rollup": "^3.25.2" + "postcss": "^8.4.27", + "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" @@ -1237,9 +1237,9 @@ } }, "@codemirror/lang-css": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.2.0.tgz", - "integrity": "sha512-oyIdJM29AyRPM3+PPq1I2oIk8NpUfEN3kAM05XWDDs6o3gSneIKaVJifT2P+fqONLou2uIgXynFyMUDQvo/szA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.2.1.tgz", + "integrity": "sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==", "dev": true, "requires": { "@codemirror/autocomplete": "^6.0.0", @@ -1282,9 +1282,9 @@ } }, "@codemirror/lang-sql": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.5.2.tgz", - "integrity": "sha512-VYiCbApDDRUVx3k0jtZ+b5h2hMkMKZpPR9tx+VgVA3Euuf2MVjVsjx/S2+4AlJjKjS5J6z9+4bEvtponK96e4A==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.5.4.tgz", + "integrity": "sha512-5Gq7fYtT/5HbNyIG7a8vYaqOYQU3JbgtBe3+derkrFUXRVcjkf8WVgz++PIbMFAQsOFMDdDR+uiNM8ZRRuXH+w==", "dev": true, "requires": { "@codemirror/autocomplete": "^6.0.0", @@ -1329,9 +1329,9 @@ } }, "@codemirror/search": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.0.tgz", - "integrity": "sha512-64/M40YeJPToKvGO6p3fijo2vwUEj4nACEAXElCaYQ50HrXSvRaK+NHEhSh73WFBGdvIdhrV+lL9PdJy2RfCYA==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.1.tgz", + "integrity": "sha512-4jupk4JwkeVbrN2pStY74q6OJEYqwosB4koA66nyLeVedadtX9MHI38j2vbYmnfDGurDApP3OZO46MrWalcjiQ==", "dev": true, "requires": { "@codemirror/state": "^6.0.0", @@ -1346,9 +1346,9 @@ "dev": true }, "@codemirror/view": { - "version": "6.15.3", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.15.3.tgz", - "integrity": "sha512-chNgR8H7Ipx7AZUt0+Kknk7BCow/ron3mHd1VZdM7hQXiI79+UlWqcxpCiexTxZQ+iSkqndk3HHAclJOcjSuog==", + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.16.0.tgz", + "integrity": "sha512-1Z2HkvkC3KR/oEZVuW9Ivmp8TWLzGEd8T8TA04TTwPvqogfkHBdYSlflytDOqmkUxM2d1ywTg7X2dU5mC+SXvg==", "dev": true, "requires": { "@codemirror/state": "^6.1.4", @@ -1357,156 +1357,156 @@ } }, "@esbuild/android-arm": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.17.tgz", - "integrity": "sha512-wHsmJG/dnL3OkpAcwbgoBTTMHVi4Uyou3F5mf58ZtmUyIKfcdA7TROav/6tCzET4A3QW2Q2FC+eFneMU+iyOxg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.17.tgz", - "integrity": "sha512-9np+YYdNDed5+Jgr1TdWBsozZ85U1Oa3xW0c7TWqH0y2aGghXtZsuT8nYRbzOMcl0bXZXjOGbksoTtVOlWrRZg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.17.tgz", - "integrity": "sha512-O+FeWB/+xya0aLg23hHEM2E3hbfwZzjqumKMSIqcHbNvDa+dza2D0yLuymRBQQnC34CWrsJUXyH2MG5VnLd6uw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.17.tgz", - "integrity": "sha512-M9uJ9VSB1oli2BE/dJs3zVr9kcCBBsE883prage1NWz6pBS++1oNn/7soPNS3+1DGj0FrkSvnED4Bmlu1VAE9g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.17.tgz", - "integrity": "sha512-XDre+J5YeIJDMfp3n0279DFNrGCXlxOuGsWIkRb1NThMZ0BsrWXoTg23Jer7fEXQ9Ye5QjrvXpxnhzl3bHtk0g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.17.tgz", - "integrity": "sha512-cjTzGa3QlNfERa0+ptykyxs5A6FEUQQF0MuilYXYBGdBxD3vxJcKnzDlhDCa1VAJCmAxed6mYhA2KaJIbtiNuQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.17.tgz", - "integrity": "sha512-sOxEvR8d7V7Kw8QqzxWc7bFfnWnGdaFBut1dRUYtu+EIRXefBc/eIsiUiShnW0hM3FmQ5Zf27suDuHsKgZ5QrA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.17.tgz", - "integrity": "sha512-2d3Lw6wkwgSLC2fIvXKoMNGVaeY8qdN0IC3rfuVxJp89CRfA3e3VqWifGDfuakPmp90+ZirmTfye1n4ncjv2lg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.17.tgz", - "integrity": "sha512-c9w3tE7qA3CYWjT+M3BMbwMt+0JYOp3vCMKgVBrCl1nwjAlOMYzEo+gG7QaZ9AtqZFj5MbUc885wuBBmu6aADQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.17.tgz", - "integrity": "sha512-1DS9F966pn5pPnqXYz16dQqWIB0dmDfAQZd6jSSpiT9eX1NzKh07J6VKR3AoXXXEk6CqZMojiVDSZi1SlmKVdg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.17.tgz", - "integrity": "sha512-EvLsxCk6ZF0fpCB6w6eOI2Fc8KW5N6sHlIovNe8uOFObL2O+Mr0bflPHyHwLT6rwMg9r77WOAWb2FqCQrVnwFg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.17.tgz", - "integrity": "sha512-e0bIdHA5p6l+lwqTE36NAW5hHtw2tNRmHlGBygZC14QObsA3bD4C6sXLJjvnDIjSKhW1/0S3eDy+QmX/uZWEYQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.17.tgz", - "integrity": "sha512-BAAilJ0M5O2uMxHYGjFKn4nJKF6fNCdP1E0o5t5fvMYYzeIqy2JdAP88Az5LHt9qBoUa4tDaRpfWt21ep5/WqQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.17.tgz", - "integrity": "sha512-Wh/HW2MPnC3b8BqRSIme/9Zhab36PPH+3zam5pqGRH4pE+4xTrVLx2+XdGp6fVS3L2x+DrsIcsbMleex8fbE6g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.17.tgz", - "integrity": "sha512-j/34jAl3ul3PNcK3pfI0NSlBANduT2UO5kZ7FCaK33XFv3chDhICLY8wJJWIhiQ+YNdQ9dxqQctRg2bvrMlYgg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.17.tgz", - "integrity": "sha512-QM50vJ/y+8I60qEmFxMoxIx4de03pGo2HwxdBeFd4nMh364X6TIBZ6VQ5UQmPbQWUVWHWws5MmJXlHAXvJEmpQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.17.tgz", - "integrity": "sha512-/jGlhWR7Sj9JPZHzXyyMZ1RFMkNPjC6QIAan0sDOtIo2TYk3tZn5UDrkE0XgsTQCxWTTOcMPf9p6Rh2hXtl5TQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.17.tgz", - "integrity": "sha512-rSEeYaGgyGGf4qZM2NonMhMOP/5EHp4u9ehFiBrg7stH6BYEEjlkVREuDEcQ0LfIl53OXLxNbfuIj7mr5m29TA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.17.tgz", - "integrity": "sha512-Y7ZBbkLqlSgn4+zot4KUNYst0bFoO68tRgI6mY2FIM+b7ZbyNVtNbDP5y8qlu4/knZZ73fgJDlXID+ohY5zt5g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.17.tgz", - "integrity": "sha512-bwPmTJsEQcbZk26oYpc4c/8PvTY3J5/QK8jM19DVlEsAB41M39aWovWoHtNm78sd6ip6prilxeHosPADXtEJFw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.17.tgz", - "integrity": "sha512-H/XaPtPKli2MhW+3CQueo6Ni3Avggi6hP/YvgkEe1aSaxw+AeO8MFjq8DlgfTd9Iz4Yih3QCZI6YLMoyccnPRg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz", - "integrity": "sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "dev": true, "optional": true }, @@ -1572,17 +1572,17 @@ } }, "@sveltejs/vite-plugin-svelte": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.3.tgz", - "integrity": "sha512-NY2h+B54KHZO3kDURTdARqthn6D4YSIebtfW75NvZ/fwyk4G+AJw3V/i0OBjyN4406Ht9yZcnNWMuRUFnDNNiA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.5.tgz", + "integrity": "sha512-UJKsFNwhzCVuiZd06jM/psscyNJNDwjQC+qIeb7GBJK9iWeQCcIyfcPWDvbCudfcJggY9jtxJeeaZH7uny93FQ==", "dev": true, "requires": { "@sveltejs/vite-plugin-svelte-inspector": "^1.0.3", "debug": "^4.3.4", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.1", - "svelte-hmr": "^0.15.2", + "magic-string": "^0.30.2", + "svelte-hmr": "^0.15.3", "vitefu": "^0.2.4" } }, @@ -1680,33 +1680,33 @@ "dev": true }, "esbuild": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.17.tgz", - "integrity": "sha512-1GJtYnUxsJreHYA0Y+iQz2UEykonY66HNWOb0yXYZi9/kNrORUEHVg87eQsCtqh59PEJ5YVZJO98JHznMJSWjg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "requires": { - "@esbuild/android-arm": "0.18.17", - "@esbuild/android-arm64": "0.18.17", - "@esbuild/android-x64": "0.18.17", - "@esbuild/darwin-arm64": "0.18.17", - "@esbuild/darwin-x64": "0.18.17", - "@esbuild/freebsd-arm64": "0.18.17", - "@esbuild/freebsd-x64": "0.18.17", - "@esbuild/linux-arm": "0.18.17", - "@esbuild/linux-arm64": "0.18.17", - "@esbuild/linux-ia32": "0.18.17", - "@esbuild/linux-loong64": "0.18.17", - "@esbuild/linux-mips64el": "0.18.17", - "@esbuild/linux-ppc64": "0.18.17", - "@esbuild/linux-riscv64": "0.18.17", - "@esbuild/linux-s390x": "0.18.17", - "@esbuild/linux-x64": "0.18.17", - "@esbuild/netbsd-x64": "0.18.17", - "@esbuild/openbsd-x64": "0.18.17", - "@esbuild/sunos-x64": "0.18.17", - "@esbuild/win32-arm64": "0.18.17", - "@esbuild/win32-ia32": "0.18.17", - "@esbuild/win32-x64": "0.18.17" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "fill-range": { @@ -1741,9 +1741,9 @@ } }, "immutable": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.1.tgz", - "integrity": "sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.2.tgz", + "integrity": "sha512-oGXzbEDem9OOpDWZu88jGiYCvIsLHMvGw+8OXlpsvTFvIQplQbjg1B1cvKg8f7Hoch6+NGjpPsH1Fr+Mc2D1aA==", "dev": true }, "is-binary-path": { @@ -1828,15 +1828,15 @@ "dev": true }, "pocketbase": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.16.0.tgz", - "integrity": "sha512-sndPu4Mbu1Y2VefvO2gIa/No5aIdP6E5br9HUGomvDYSfkmGfBxJNkivJSSKlr9KwWnaF8otf14304UUeFGOrA==", + "version": "0.17.0-rc1", + "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.17.0-rc1.tgz", + "integrity": "sha512-38HMPak9Fgx/rG4tq0/eiBw7WTZ3+Vwk/8FIm1BWhCSP+CDskkpZPRSnHoIND+/tMJb/Wnxl+3IMXf/IaGjtjw==", "dev": true }, "postcss": { - "version": "8.4.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", - "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", + "version": "8.4.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", + "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", "dev": true, "requires": { "nanoid": "^3.3.6", @@ -1866,9 +1866,9 @@ "dev": true }, "rollup": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.27.0.tgz", - "integrity": "sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", + "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -1881,9 +1881,9 @@ "dev": true }, "sass": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.64.1.tgz", - "integrity": "sha512-16rRACSOFEE8VN7SCgBu1MpYCyN7urj9At898tyzdXFhC+a+yOX5dXwAR7L8/IdPJ1NB8OYoXmD55DM30B2kEQ==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.65.1.tgz", + "integrity": "sha512-9DINwtHmA41SEd36eVPQ9BJKpn7eKDQmUHmpI0y5Zv2Rcorrh0zS+cFrt050hdNbmmCNKTW3hV5mWfuegNRsEA==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", @@ -1919,9 +1919,9 @@ } }, "svelte-hmr": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.2.tgz", - "integrity": "sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==", + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", + "integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==", "dev": true, "requires": {} }, @@ -1944,15 +1944,15 @@ } }, "vite": { - "version": "4.4.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz", - "integrity": "sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==", + "version": "4.4.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", + "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", "dev": true, "requires": { "esbuild": "^0.18.10", "fsevents": "~2.3.2", - "postcss": "^8.4.26", - "rollup": "^3.25.2" + "postcss": "^8.4.27", + "rollup": "^3.27.1" } }, "vitefu": { diff --git a/ui/package.json b/ui/package.json index afcb9b11..1b12a16e 100644 --- a/ui/package.json +++ b/ui/package.json @@ -28,7 +28,7 @@ "chart.js": "^3.7.1", "chartjs-adapter-luxon": "^1.2.0", "luxon": "^2.3.2", - "pocketbase": "^0.16.0", + "pocketbase": "0.17.0-rc1", "prismjs": "^1.28.0", "sass": "^1.45.0", "svelte": "^3.44.0",