diff --git a/ui/.env b/ui/.env index d9924b44..57f34659 100644 --- a/ui/.env +++ b/ui/.env @@ -1,9 +1,8 @@ # all environments should start with 'PB_' prefix PB_BACKEND_URL = "../" PB_INSTALLER_PARAM = "pbinstal" -PB_MFA_DOCS = "https://pocketbase.io/docs/@todo" -PB_RATE_LIMIT_DOCS = "https://pocketbase.io/docs/@todo" -PB_OAUTH2_EXAMPLE = "https://pocketbase.io/docs/authentication/#oauth2-integration" +PB_MFA_DOCS = "https://pocketbase.io/docs/authentication/#multi-factor-authentication" +PB_OAUTH2_EXAMPLE = "https://pocketbase.io/docs/authentication/#authenticate-with-oauth2" PB_RULES_SYNTAX_DOCS = "https://pocketbase.io/docs/api-rules-and-filters/" PB_FILE_UPLOAD_DOCS = "https://pocketbase.io/docs/files-handling/" PB_PROTECTED_FILE_DOCS = "https://pocketbase.io/docs/files-handling/#protected-files" diff --git a/ui/dist/assets/AuthMethodsDocs-3arq40Jt.js b/ui/dist/assets/AuthMethodsDocs-DHqR-_Zg.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-3arq40Jt.js rename to ui/dist/assets/AuthMethodsDocs-DHqR-_Zg.js index c137a685..19f874ec 100644 --- a/ui/dist/assets/AuthMethodsDocs-3arq40Jt.js +++ b/ui/dist/assets/AuthMethodsDocs-DHqR-_Zg.js @@ -1,4 +1,4 @@ -import{S as Ce,i as Be,s as Te,Q as Le,T as G,e as c,w as $,b as k,c as ae,f as h,g as d,h as a,m as ne,x as I,U as ye,V as Re,k as Se,W as Ue,n as Qe,t as J,a as N,o as u,d as ie,p as oe,C as je,r as O,u as qe,R as De}from"./index-D5-_lkfc.js";import{F as Ee}from"./FieldsQueryParam-D8rkBfEn.js";function $e(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=$(o),b=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(v,w){d(v,l,w),a(l,p),a(l,b),i||(f=qe(l,"click",m),i=!0)},p(v,w){s=v,w&4&&o!==(o=s[8].code+"")&&I(p,o),w&6&&O(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new De({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&O(l,"active",s[1]===s[8].code)},i(i){b||(J(o.$$.fragment,i),b=!0)},o(i){N(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,w,g=n[0].name+"",V,ce,W,M,z,L,K,A,D,re,E,R,de,X,F=n[0].name+"",Y,ue,Z,S,x,P,ee,fe,te,T,le,U,se,C,Q,y=[],me=new Map,pe,j,_=[],be=new Map,B;M=new Le({props:{js:` +import{S as Ce,i as Be,s as Te,Q as Le,T as G,e as c,w as $,b as k,c as ae,f as h,g as d,h as a,m as ne,x as I,U as ye,V as Re,k as Se,W as Ue,n as Qe,t as J,a as N,o as u,d as ie,p as oe,C as je,r as O,u as qe,R as De}from"./index-B2Vo3yiW.js";import{F as Ee}from"./FieldsQueryParam-B57e0MbD.js";function $e(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=$(o),b=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(v,w){d(v,l,w),a(l,p),a(l,b),i||(f=qe(l,"click",m),i=!0)},p(v,w){s=v,w&4&&o!==(o=s[8].code+"")&&I(p,o),w&6&&O(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new De({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&O(l,"active",s[1]===s[8].code)},i(i){b||(J(o.$$.fragment,i),b=!0)},o(i){N(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,w,g=n[0].name+"",V,ce,W,M,z,L,K,A,D,re,E,R,de,X,F=n[0].name+"",Y,ue,Z,S,x,P,ee,fe,te,T,le,U,se,C,Q,y=[],me=new Map,pe,j,_=[],be=new Map,B;M=new Le({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-Dl355FHl.js b/ui/dist/assets/AuthRefreshDocs-Bw_1qlVd.js similarity index 98% rename from ui/dist/assets/AuthRefreshDocs-Dl355FHl.js rename to ui/dist/assets/AuthRefreshDocs-Bw_1qlVd.js index 84e6766d..4572572c 100644 --- a/ui/dist/assets/AuthRefreshDocs-Dl355FHl.js +++ b/ui/dist/assets/AuthRefreshDocs-Bw_1qlVd.js @@ -1,4 +1,4 @@ -import{S as Qe,i as je,s as Je,Q as Ke,R as Ne,T as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as W,x as de,U as Oe,V as We,k as Ie,W as Ge,n as Xe,t as E,a as U,o as u,d as I,C as Ve,p as Ye,r as G,u as Ze}from"./index-D5-_lkfc.js";import{F as et}from"./FieldsQueryParam-D8rkBfEn.js";function Ee(r,a,l){const n=r.slice();return n[5]=a[l],n}function Ue(r,a,l){const n=r.slice();return n[5]=a[l],n}function xe(r,a){let l,n=a[5].code+"",m,_,i,h;function g(){return a[4](a[5])}return{key:r,first:null,c(){l=s("button"),m=k(n),_=p(),b(l,"class","tab-item"),G(l,"active",a[1]===a[5].code),this.first=l},m(v,w){d(v,l,w),o(l,m),o(l,_),i||(h=Ze(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&G(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function ze(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),K(n.$$.fragment),m=p(),b(l,"class","tab-item"),G(l,"active",a[1]===a[5].code),this.first=l},m(i,h){d(i,l,h),W(n,l,null),o(l,m),_=!0},p(i,h){a=i;const g={};h&4&&(g.content=a[5].body),n.$set(g),(!_||h&6)&&G(l,"active",a[1]===a[5].code)},i(i){_||(E(n.$$.fragment,i),_=!0)},o(i){U(n.$$.fragment,i),_=!1},d(i){i&&u(l),I(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,N=r[0].name+"",Z,he,fe,Q,ee,D,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,A,ie,H,ce,R,L,y=[],Pe=new Map,Ae,O,$=[],Be=new Map,B;v=new Ke({props:{js:` +import{S as Qe,i as je,s as Je,Q as Ke,R as Ne,T as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as W,x as de,U as Oe,V as We,k as Ie,W as Ge,n as Xe,t as E,a as U,o as u,d as I,C as Ve,p as Ye,r as G,u as Ze}from"./index-B2Vo3yiW.js";import{F as et}from"./FieldsQueryParam-B57e0MbD.js";function Ee(r,a,l){const n=r.slice();return n[5]=a[l],n}function Ue(r,a,l){const n=r.slice();return n[5]=a[l],n}function xe(r,a){let l,n=a[5].code+"",m,_,i,h;function g(){return a[4](a[5])}return{key:r,first:null,c(){l=s("button"),m=k(n),_=p(),b(l,"class","tab-item"),G(l,"active",a[1]===a[5].code),this.first=l},m(v,w){d(v,l,w),o(l,m),o(l,_),i||(h=Ze(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&G(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function ze(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),K(n.$$.fragment),m=p(),b(l,"class","tab-item"),G(l,"active",a[1]===a[5].code),this.first=l},m(i,h){d(i,l,h),W(n,l,null),o(l,m),_=!0},p(i,h){a=i;const g={};h&4&&(g.content=a[5].body),n.$set(g),(!_||h&6)&&G(l,"active",a[1]===a[5].code)},i(i){_||(E(n.$$.fragment,i),_=!0)},o(i){U(n.$$.fragment,i),_=!1},d(i){i&&u(l),I(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,N=r[0].name+"",Z,he,fe,Q,ee,D,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,A,ie,H,ce,R,L,y=[],Pe=new Map,Ae,O,$=[],Be=new Map,B;v=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-QI0g6yCp.js b/ui/dist/assets/AuthWithOAuth2Docs-DBDNpjcn.js similarity index 97% rename from ui/dist/assets/AuthWithOAuth2Docs-QI0g6yCp.js rename to ui/dist/assets/AuthWithOAuth2Docs-DBDNpjcn.js index 55ddb0db..7b667aaa 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-QI0g6yCp.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-DBDNpjcn.js @@ -1,4 +1,4 @@ -import{S as xe,i as Ee,s as Je,Q as Qe,R as je,T as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,U as Ue,V as Ne,k as ze,W as Ie,n as Ke,t as j,a as x,o as c,d as G,C as Be,p as Ge,r as X,u as Xe}from"./index-D5-_lkfc.js";import{F as Ye}from"./FieldsQueryParam-D8rkBfEn.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Xe(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new je({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(j(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,D,Y,A,E,be,J,P,me,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,L,$=[],Re=new Map,De,H,w=[],Pe=new Map,R;v=new Qe({props:{js:` +import{S as xe,i as Ee,s as Je,Q as Qe,R as je,T as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,U as Ue,V as Ne,k as ze,W as Ie,n as Ke,t as j,a as x,o as c,d as G,C as Be,p as Ge,r as X,u as Xe}from"./index-B2Vo3yiW.js";import{F as Ye}from"./FieldsQueryParam-B57e0MbD.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Xe(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new je({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(j(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,D,Y,A,E,be,J,P,me,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,L,$=[],Re=new Map,De,H,w=[],Pe=new Map,R;v=new Qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); @@ -46,7 +46,7 @@ import{S as xe,i as Ee,s as Je,Q as Qe,R as je,T as z,e as o,w as k,b as h,c as // "logout" pb.authStore.clear(); `}}),C=new je({props:{content:"?expand=relField1,relField2.subRelField"}}),q=new Ye({props:{prefix:"record."}});let N=z(s[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthenticate with an OAuth2 provider and returns a new auth token and record data.

For more details please check the - OAuth2 integration documentation + OAuth2 integration documentation .

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

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

The created auth record must comply with the same requirements and validations in the regular create action.
The data can only be in json, aka. multipart/form-data and files diff --git a/ui/dist/assets/AuthWithOtpDocs-BauQ25ER.js b/ui/dist/assets/AuthWithOtpDocs-B3SiNTsQ.js similarity index 99% rename from ui/dist/assets/AuthWithOtpDocs-BauQ25ER.js rename to ui/dist/assets/AuthWithOtpDocs-B3SiNTsQ.js index d392181f..2f7fde78 100644 --- a/ui/dist/assets/AuthWithOtpDocs-BauQ25ER.js +++ b/ui/dist/assets/AuthWithOtpDocs-B3SiNTsQ.js @@ -1,4 +1,4 @@ -import{S as ee,i as te,s as le,T as U,e as p,b as S,w as V,f as g,g as b,h,x as z,U as G,V as ge,k as Z,W as ke,n as x,t as L,a as N,o as _,C as oe,r as Y,u as ae,R as we,c as K,m as Q,d as X,Q as $e,X as se,p as Te,Y as ne}from"./index-D5-_lkfc.js";function ie(s,t,e){const a=s.slice();return a[4]=t[e],a}function ce(s,t,e){const a=s.slice();return a[4]=t[e],a}function re(s,t){let e,a=t[4].code+"",d,c,r,n;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=p("button"),d=V(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,q){b(m,e,q),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,q){t=m,q&4&&a!==(a=t[4].code+"")&&z(d,a),q&6&&Y(e,"active",t[1]===t[4].code)},d(m){m&&_(e),r=!1,n()}}}function de(s,t){let e,a,d,c;return a=new we({props:{content:t[4].body}}),{key:s,first:null,c(){e=p("div"),K(a.$$.fragment),d=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(r,n){b(r,e,n),Q(a,e,null),h(e,d),c=!0},p(r,n){t=r;const u={};n&4&&(u.content=t[4].body),a.$set(u),(!c||n&6)&&Y(e,"active",t[1]===t[4].code)},i(r){c||(L(a.$$.fragment,r),c=!0)},o(r){N(a.$$.fragment,r),c=!1},d(r){r&&_(e),X(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,q,M,C,B,A,H,R,W,y,P,w=[],$=new Map,E,D,k=[],J=new Map,I,i=U(s[2]);const v=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description

Required otpId
String The id of the OTP request.
Required password
String The one-time password.',H=S(),R=p("div"),R.textContent="Responses",W=S(),y=p("div"),P=p("div");for(let l=0;le(1,d=n.code);return s.$$set=n=>{"collection"in n&&e(0,a=n.collection)},s.$$.update=()=>{s.$$.dirty&1&&e(2,c=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:oe.dummyCollectionRecord(a)},null,2)},{code:400,body:` +import{S as ee,i as te,s as le,T as U,e as p,b as S,w as V,f as g,g as b,h,x as z,U as G,V as ge,k as Z,W as ke,n as x,t as L,a as N,o as _,C as oe,r as Y,u as ae,R as we,c as K,m as Q,d as X,Q as $e,X as se,p as Te,Y as ne}from"./index-B2Vo3yiW.js";function ie(s,t,e){const a=s.slice();return a[4]=t[e],a}function ce(s,t,e){const a=s.slice();return a[4]=t[e],a}function re(s,t){let e,a=t[4].code+"",d,c,r,n;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=p("button"),d=V(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,q){b(m,e,q),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,q){t=m,q&4&&a!==(a=t[4].code+"")&&z(d,a),q&6&&Y(e,"active",t[1]===t[4].code)},d(m){m&&_(e),r=!1,n()}}}function de(s,t){let e,a,d,c;return a=new we({props:{content:t[4].body}}),{key:s,first:null,c(){e=p("div"),K(a.$$.fragment),d=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(r,n){b(r,e,n),Q(a,e,null),h(e,d),c=!0},p(r,n){t=r;const u={};n&4&&(u.content=t[4].body),a.$set(u),(!c||n&6)&&Y(e,"active",t[1]===t[4].code)},i(r){c||(L(a.$$.fragment,r),c=!0)},o(r){N(a.$$.fragment,r),c=!1},d(r){r&&_(e),X(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,q,M,C,B,A,H,R,W,y,P,w=[],$=new Map,E,D,k=[],J=new Map,I,i=U(s[2]);const v=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',H=S(),R=p("div"),R.textContent="Responses",W=S(),y=p("div"),P=p("div");for(let l=0;le(1,d=n.code);return s.$$set=n=>{"collection"in n&&e(0,a=n.collection)},s.$$.update=()=>{s.$$.dirty&1&&e(2,c=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:oe.dummyCollectionRecord(a)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/AuthWithPasswordDocs-TxLWhk-X.js b/ui/dist/assets/AuthWithPasswordDocs-jAqVZfEu.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-TxLWhk-X.js rename to ui/dist/assets/AuthWithPasswordDocs-jAqVZfEu.js index f207fb4e..d84a69a2 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-TxLWhk-X.js +++ b/ui/dist/assets/AuthWithPasswordDocs-jAqVZfEu.js @@ -1,4 +1,4 @@ -import{S as kt,i as gt,s as vt,Q as St,T as L,R as _t,e as s,w as f,b as u,c as ae,f as k,g as c,h as t,m as oe,x as G,U as ct,V as wt,k as yt,W as $t,n as Pt,t as X,a as z,o as d,d as se,X as Rt,C as dt,p as Ct,r as ne,u as Tt}from"./index-D5-_lkfc.js";import{F as Ot}from"./FieldsQueryParam-D8rkBfEn.js";function pt(i,o,a){const n=i.slice();return n[7]=o[a],n}function ut(i,o,a){const n=i.slice();return n[7]=o[a],n}function ht(i,o,a){const n=i.slice();return n[12]=o[a],n[14]=a,n}function At(i){let o;return{c(){o=f("or")},m(a,n){c(a,o,n)},d(a){a&&d(o)}}}function bt(i){let o,a,n=i[12]+"",m,b=i[14]>0&&At();return{c(){b&&b.c(),o=u(),a=s("strong"),m=f(n)},m(r,h){b&&b.m(r,h),c(r,o,h),c(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&G(m,n)},d(r){r&&(d(o),d(a)),b&&b.d(r)}}}function ft(i,o){let a,n=o[7].code+"",m,b,r,h;function g(){return o[6](o[7])}return{key:i,first:null,c(){a=s("button"),m=f(n),b=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m($,_){c($,a,_),t(a,m),t(a,b),r||(h=Tt(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&G(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&d(a),r=!1,h()}}}function mt(i,o){let a,n,m,b;return n=new _t({props:{content:o[7].body}}),{key:i,first:null,c(){a=s("div"),ae(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){c(r,a,h),oe(n,a,null),t(a,m),b=!0},p(r,h){o=r;const g={};h&8&&(g.content=o[7].body),n.$set(g),(!b||h&12)&&ne(a,"active",o[2]===o[7].code)},i(r){b||(X(n.$$.fragment,r),b=!0)},o(r){z(n.$$.fragment,r),b=!1},d(r){r&&d(a),se(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,Z=i[1].join("/")+"",ie,De,re,We,ce,R,de,q,pe,C,x,Ue,ee,H,Fe,ue,te=i[0].name+"",he,Me,be,j,fe,T,me,Be,V,O,_e,Le,ke,qe,Y,ge,He,ve,Se,E,we,A,ye,je,N,D,$e,Ve,Pe,Ye,v,Ee,F,Ne,Qe,Ie,Re,Je,Ce,Ke,Xe,ze,Te,Ge,Ze,M,Oe,Q,Ae,W,I,P=[],xe=new Map,et,J,w=[],tt=new Map,U;R=new St({props:{js:` +import{S as kt,i as gt,s as vt,Q as St,T as L,R as _t,e as s,w as f,b as u,c as ae,f as k,g as c,h as t,m as oe,x as G,U as ct,V as wt,k as yt,W as $t,n as Pt,t as X,a as z,o as d,d as se,X as Rt,C as dt,p as Ct,r as ne,u as Tt}from"./index-B2Vo3yiW.js";import{F as Ot}from"./FieldsQueryParam-B57e0MbD.js";function pt(i,o,a){const n=i.slice();return n[7]=o[a],n}function ut(i,o,a){const n=i.slice();return n[7]=o[a],n}function ht(i,o,a){const n=i.slice();return n[12]=o[a],n[14]=a,n}function At(i){let o;return{c(){o=f("or")},m(a,n){c(a,o,n)},d(a){a&&d(o)}}}function bt(i){let o,a,n=i[12]+"",m,b=i[14]>0&&At();return{c(){b&&b.c(),o=u(),a=s("strong"),m=f(n)},m(r,h){b&&b.m(r,h),c(r,o,h),c(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&G(m,n)},d(r){r&&(d(o),d(a)),b&&b.d(r)}}}function ft(i,o){let a,n=o[7].code+"",m,b,r,h;function g(){return o[6](o[7])}return{key:i,first:null,c(){a=s("button"),m=f(n),b=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m($,_){c($,a,_),t(a,m),t(a,b),r||(h=Tt(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&G(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&d(a),r=!1,h()}}}function mt(i,o){let a,n,m,b;return n=new _t({props:{content:o[7].body}}),{key:i,first:null,c(){a=s("div"),ae(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){c(r,a,h),oe(n,a,null),t(a,m),b=!0},p(r,h){o=r;const g={};h&8&&(g.content=o[7].body),n.$set(g),(!b||h&12)&&ne(a,"active",o[2]===o[7].code)},i(r){b||(X(n.$$.fragment,r),b=!0)},o(r){z(n.$$.fragment,r),b=!1},d(r){r&&d(a),se(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,Z=i[1].join("/")+"",ie,De,re,We,ce,R,de,q,pe,C,x,Ue,ee,H,Fe,ue,te=i[0].name+"",he,Me,be,j,fe,T,me,Be,V,O,_e,Le,ke,qe,Y,ge,He,ve,Se,E,we,A,ye,je,N,D,$e,Ve,Pe,Ye,v,Ee,F,Ne,Qe,Ie,Re,Je,Ce,Ke,Xe,ze,Te,Ge,Ze,M,Oe,Q,Ae,W,I,P=[],xe=new Map,et,J,w=[],tt=new Map,U;R=new St({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[5]}'); diff --git a/ui/dist/assets/BatchApiDocs-nZcx7pNm.js b/ui/dist/assets/BatchApiDocs-CvuDJe84.js similarity index 99% rename from ui/dist/assets/BatchApiDocs-nZcx7pNm.js rename to ui/dist/assets/BatchApiDocs-CvuDJe84.js index 6c9ae748..d4defd5c 100644 --- a/ui/dist/assets/BatchApiDocs-nZcx7pNm.js +++ b/ui/dist/assets/BatchApiDocs-CvuDJe84.js @@ -1,4 +1,4 @@ -import{S as It,i as Lt,s as jt,Q as At,R as Ht,T as Y,e as o,w as _,b as i,c as Re,f as b,g as d,h as t,m as Te,j as Mt,l as Nt,x as Ut,U as Pt,V as zt,k as Jt,W as Wt,n as Kt,t as Z,a as x,o as u,d as Pe,C as Ft,p as Gt,r as ee,u as Qt}from"./index-D5-_lkfc.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s){let n,c,y;function h(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,f){d(r,n,f),c||(y=Qt(n,"click",h),c=!0)},p(r,f){s=r,f&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function St(a,s){let n,c,y,h;return c=new Ht({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,f){d(r,n,f),Te(c,n,null),t(n,y),h=!0},p(r,f){s=r,(!h||f&10)&&ee(n,"active",s[1]===s[6].code)},i(r){h||(Z(c.$$.fragment,r),h=!0)},o(r){x(c.$$.fragment,r),h=!1},d(r){r&&u(n),Pe(c)}}}function Vt(a){var pt,mt,bt,ft,ht,_t,yt,kt;let s,n,c=a[0].name+"",y,h,r,f,F,g,U,Fe,P,B,Be,O,Oe,Ee,te,le,w,oe,E,ae,S,se,H,ne,z,ie,q,ce,Se,re,I,J,He,k,W,Ie,de,Le,D,K,je,ue,Ae,G,Me,pe,Ne,v,Ue,me,ze,Je,We,Q,Ke,V,Ge,be,Qe,fe,Ve,he,Xe,p,_e,Ye,ye,Ze,ke,xe,$e,et,ge,tt,Ce,lt,ot,at,De,st,R,ve,L,we,T,j,C=[],nt=new Map,it,A,$=[],ct=new Map,M,qe,rt;w=new At({props:{js:` +import{S as It,i as Lt,s as jt,Q as At,R as Ht,T as Y,e as o,w as _,b as i,c as Re,f as b,g as d,h as t,m as Te,j as Mt,l as Nt,x as Ut,U as Pt,V as zt,k as Jt,W as Wt,n as Kt,t as Z,a as x,o as u,d as Pe,C as Ft,p as Gt,r as ee,u as Qt}from"./index-B2Vo3yiW.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s){let n,c,y;function h(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,f){d(r,n,f),c||(y=Qt(n,"click",h),c=!0)},p(r,f){s=r,f&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function St(a,s){let n,c,y,h;return c=new Ht({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,f){d(r,n,f),Te(c,n,null),t(n,y),h=!0},p(r,f){s=r,(!h||f&10)&&ee(n,"active",s[1]===s[6].code)},i(r){h||(Z(c.$$.fragment,r),h=!0)},o(r){x(c.$$.fragment,r),h=!1},d(r){r&&u(n),Pe(c)}}}function Vt(a){var pt,mt,bt,ft,ht,_t,yt,kt;let s,n,c=a[0].name+"",y,h,r,f,F,g,U,Fe,P,B,Be,O,Oe,Ee,te,le,w,oe,E,ae,S,se,H,ne,z,ie,q,ce,Se,re,I,J,He,k,W,Ie,de,Le,D,K,je,ue,Ae,G,Me,pe,Ne,v,Ue,me,ze,Je,We,Q,Ke,V,Ge,be,Qe,fe,Ve,he,Xe,p,_e,Ye,ye,Ze,ke,xe,$e,et,ge,tt,Ce,lt,ot,at,De,st,R,ve,L,we,T,j,C=[],nt=new Map,it,A,$=[],ct=new Map,M,qe,rt;w=new At({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[2]}'); diff --git a/ui/dist/assets/CodeEditor-DKQxSBo9.js b/ui/dist/assets/CodeEditor-pEpUQJ5v.js similarity index 99% rename from ui/dist/assets/CodeEditor-DKQxSBo9.js rename to ui/dist/assets/CodeEditor-pEpUQJ5v.js index 54829901..a1463053 100644 --- a/ui/dist/assets/CodeEditor-DKQxSBo9.js +++ b/ui/dist/assets/CodeEditor-pEpUQJ5v.js @@ -1,4 +1,4 @@ -import{S as wt,i as Rt,s as Yt,e as Tt,f as Wt,Z as OO,g as _t,y as BO,o as qt,J as vt,N as Ut,O as zt,L as Vt,C as jt,P as Gt}from"./index-D5-_lkfc.js";import{P as Ct,N as At,w as Et,D as Nt,x as qO,T as tO,I as vO,y as B,z as l,A as Mt,L as J,B as L,F as v,G as K,H as UO,J as F,v as G,K as _e,M as It,O as Dt,Q as qe,R as ve,U as Ue,E as q,V as ze,W as S,X as Bt,Y as Jt,b as C,e as Lt,f as Kt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as oa,c as la,d as na,s as ca,h as Qa,a as ha,p as ua,q as JO,C as eO}from"./index-B5ReTu-C.js";var LO={};class sO{constructor(O,a,t,r,s,i,o,n,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=o,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new sO(O,[],a,t,t,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let o=!1;for(let n=i;n>0&&this.buffer[n-2]>t;n-=4)if(this.buffer[n-1]>=0){o=!0;break}if(o)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-s;if(o>1){let n=i&65535,Q=this.stack.length-o*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return o<<19|65536|n}}else{let o=t(i,s+1);if(o!=null)return o}})};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:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class oO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new oO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.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 oO(this.stack,this.pos,this.index)}}function N(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,o=!0),s+=n,o)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class da{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,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(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,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(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class z{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ve(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?N(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ve(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ve(e,O,a,t,r,s){let i=0,o=1<0){let d=e[h];if(n.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let u=O.next,c=0,f=e[i+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535){i=e[Q+f*3-1];continue O}for(;c>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u=m)c=h+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function fa(e,O,a,t){let r=HO(a,t,O);return r<0||HO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class $a{constructor(O,a){this.fragments=O,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 O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new aO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),o=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new aO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new aO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(o>>1)){o&1?O.extended=o>>1:O.value=o>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let s=0;sO.bufferLength*4?new $a(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(o);else{if(this.advanceStack(o,t,O))continue;{r||(r=[],s=[]),r.push(o);let n=this.tokens.getMainToken(o);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,n)=>n.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((o.score-Q.score||o.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(qO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let o=s.stateSlot(O.state,4);if(o>0)return O.reduce(o),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?a.push(d):t.push(d)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return ee(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Z&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let c=o.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of o.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>o.pos?(Q==o.pos&&(Q++,n=0),o.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(n)})`),ee(o,t)):(!r||r.scoree;class je{constructor(O){this.start=O.start,this.shift=O.shift||dO,this.reduce=O.reduce||dO,this.reuse=O.reuse||dO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ct{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;oO.topRules[o][1]),r=[];for(let o=0;o=0)s(u,n,o[Q++]);else{let c=o[Q+-u];for(let f=-u;f>0;f--)s(o[Q++],n,c);Q++}}}this.nodeSet=new At(a.map((o,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:o,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Nt;let i=N(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new z(i,o):o),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new ma(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],o=i&1,n=r[s++];if(o&&t)return n;for(let Q=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=R(this.data,s+2);else break;r=a(R(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=R(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(o=>o.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=te(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const Za=54,ba=1,ka=55,xa=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ge=7,Ce=8,Ae=9,Ee=10,Ra=11,Ya=12,Ta=13,fO=57,Wa=14,re=58,Ne=20,_a=22,Me=23,qa=24,XO=26,Ie=27,va=28,Ua=31,za=34,Va=36,ja=37,Ga=0,Ca=1,Aa={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},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={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 Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,oe=null,le=0;function yO(e,O){let a=e.pos+O;if(le==a&&oe==e)return se;let t=e.peek(O);for(;De(t);)t=e.peek(++O);let r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return oe=e,le=a,se=r?r.toLowerCase():t==Ma||t==Ia?void 0:null}const Be=60,cO=62,zO=47,Ma=63,Ia=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ba=[nO,Ee,Ge,Ce,Ae],Ja=new je({start:null,shift(e,O,a,t){return Ba.indexOf(O)>-1?new ne(yO(t,1)||"",e):e},reduce(e,O){return O==Ne&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==nO||r==Va?new ne(yO(t,1)||"",e):e},strict:!1}),La=new k((e,O)=>{if(e.next!=Be){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==zO;a&&e.advance();let t=yO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Wa:nO);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ra);if(r&&Ea[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ga))return e.acceptToken(Ya);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(Ta)}else{if(t=="script")return e.acceptToken(Ge);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(t))return e.acceptToken(Ee);r&&ie[r]&&ie[r][t]?e.acceptToken(fO,-1):e.acceptToken(nO)}},{contextual:!0}),Ka=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){a>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new k((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let a=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(a?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function VO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(O);break}if(s==0&&r.next==Be||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=VO("script",Za,ba),er=VO("style",ka,xa),tr=VO("textarea",Xa,ya),ar=B({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),rr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~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|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~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!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~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{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!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"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],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=o.type.id;if(Q==va)return $O(o,n,a);if(Q==Ua)return $O(o,n,t);if(Q==za)return $O(o,n,r);if(Q==Ne&&s.length){let u=o.node,c=u.firstChild,f=c&&ce(c,n),h;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(h||(h=Je(c,n))))){let P=u.lastChild,m=P.type.id==ja?P.from:u.to;if(m>c.to)return{parser:d.parser,overlay:[{from:c.to,to:m}]}}}}if(i&&Q==Me){let u=o.node,c;if(c=u.firstChild){let f=i[n.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let d=u.lastChild;if(d.type.id==XO){let P=d.from+1,m=d.lastChild,x=d.to-(m&&m.isError?0:1);if(x>P)return{parser:h.parser,overlay:[{from:P,to:x}]}}else if(d.type.id==Ie)return{parser:h.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,Qe=1,sr=100,or=101,he=2,Ke=[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],lr=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,dr=92,fr=10;function M(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new k((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=e;if(M(s)||s==rO||s==Fe||a&&He(s))!a&&(s!=rO||r>0)&&(a=!0),t===r&&s==rO&&t++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),a=!0;else{a&&e.acceptToken(s==nr?sr:t==2&&O.canShift(he)?he:or);break}}}),Pr=new k(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(M(O)||O==Fe||O==hr||O==Qr||O==cr||O==lr&&M(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),mr=new k(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),M(O)){do e.advance();while(M(e.next)||He(e.next));e.acceptToken(Qe)}}}),gr=B({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,KeyframeRangeName:l.operatorKeyword,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ColorLiteral:l.color,"ParenthesizedContent StringLiteral":l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),Sr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},kr=T.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,mr,$r,1,2,3,4,new lO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>Sr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function mO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));PO=O.sort().map(t=>({type:"property",label:t}))}return PO||[]}const ue=["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(e=>({type:"class",label:e})),pe=["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(e=>({type:"keyword",label:e})).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(e=>({type:"constant",label:e}))),xr=["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(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const de=new _e,Rr=["Declaration"];function Yr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,a){if(O.to-O.from>4096){let t=de.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(vO.IncludeAnonymous);if(i.firstChild())do for(let o of Ot(e,i.node,a))s.has(o.label)||(s.add(o.label),r.push(o));while(i.nextSibling());return de.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Rr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let o=e.sliceString(s.from,s.to);r.has(o)||(r.add(o),t.push({label:o,type:"variable"}))}}),t}}const Tr=e=>O=>{let{state:a,pos:t}=O,r=G(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,a.doc))return{from:e(r)||s?r.from:t,options:Ot(a.doc,Yr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:w};return{from:r.from,options:xr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(t),o=i.childBefore(t);return o&&o.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:ue,validFor:w}:o&&o.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:w}:null},Wr=Tr(e=>e.name=="VariableName"),QO=J.define({name:"css",parser:kr.configure({props:[L.add({Declaration:v()}),K.add({"Block KeyframeList":UO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _r(){return new F(QO,QO.data.of({autocomplete:Wr}))}const qr=312,fe=1,vr=2,Ur=3,zr=4,Vr=313,jr=315,Gr=316,Cr=5,Ar=6,Er=0,wO=[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],et=125,Nr=59,RO=47,Mr=42,Ir=43,Dr=45,Br=60,Jr=44,Lr=63,Kr=46,Fr=new je({start:!1,shift(e,O){return O==Cr||O==Ar||O==jr?e:O==Gr},strict:!1}),Hr=new k((e,O)=>{let{next:a}=e;(a==et||a==-1||O.context)&&e.acceptToken(Vr)},{contextual:!0,fallback:!0}),Oi=new k((e,O)=>{let{next:a}=e,t;wO.indexOf(a)>-1||a==RO&&((t=e.peek(1))==RO||t==Mr)||a!=et&&a!=Nr&&a!=-1&&!O.context&&e.acceptToken(qr)},{contextual:!0}),ei=new k((e,O)=>{let{next:a}=e;if(a==Ir||a==Dr){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift(fe);e.acceptToken(t?fe:vr)}}else a==Lr&&e.peek(1)==Kr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Ur))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ti=new k((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Er)||(e.advance(),e.next==RO))return;let a=0;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==Jr)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(zr,-a)}),ai=B({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const using function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,"LineComment Hashbang":l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),ri={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},ii={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},si={__proto__:null,"<":187},oi=T.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < 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 : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < 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 InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression 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:376,context:Fr,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[ai],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!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$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(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(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%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%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%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)3p/x`$h&j!m),Q(Rp(U!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(KW1V`#u(Ch$h&j(Rp(U!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(KW2d_#u(Ch$h&j(Rp(U!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'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%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'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!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)[#Jv_al$h&j(Rp(U!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%Z04f#LS^h#)`#O-ri[e]||-1},{term:338,get:e=>ii[e]||-1},{term:92,get:e=>si[e]||-1}],tokenPrec:14749}),tt=[S("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),S("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),S("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),S("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),S("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),S(`try { +import{S as wt,i as Rt,s as Yt,e as Tt,f as Wt,Z as OO,g as _t,y as BO,o as qt,J as vt,N as Ut,O as zt,L as Vt,C as jt,P as Gt}from"./index-B2Vo3yiW.js";import{P as Ct,N as At,w as Et,D as Nt,x as qO,T as tO,I as vO,y as B,z as l,A as Mt,L as J,B as L,F as v,G as K,H as UO,J as F,v as G,K as _e,M as It,O as Dt,Q as qe,R as ve,U as Ue,E as q,V as ze,W as S,X as Bt,Y as Jt,b as C,e as Lt,f as Kt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as oa,c as la,d as na,s as ca,h as Qa,a as ha,p as ua,q as JO,C as eO}from"./index-B5ReTu-C.js";var LO={};class sO{constructor(O,a,t,r,s,i,o,n,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=o,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new sO(O,[],a,t,t,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let o=!1;for(let n=i;n>0&&this.buffer[n-2]>t;n-=4)if(this.buffer[n-1]>=0){o=!0;break}if(o)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-s;if(o>1){let n=i&65535,Q=this.stack.length-o*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return o<<19|65536|n}}else{let o=t(i,s+1);if(o!=null)return o}})};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:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class oO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new oO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.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 oO(this.stack,this.pos,this.index)}}function N(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,o=!0),s+=n,o)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class da{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,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(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,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(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class z{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ve(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?N(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ve(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ve(e,O,a,t,r,s){let i=0,o=1<0){let d=e[h];if(n.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let u=O.next,c=0,f=e[i+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535){i=e[Q+f*3-1];continue O}for(;c>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u=m)c=h+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function fa(e,O,a,t){let r=HO(a,t,O);return r<0||HO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class $a{constructor(O,a){this.fragments=O,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 O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new aO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),o=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new aO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new aO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(o>>1)){o&1?O.extended=o>>1:O.value=o>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let s=0;sO.bufferLength*4?new $a(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(o);else{if(this.advanceStack(o,t,O))continue;{r||(r=[],s=[]),r.push(o);let n=this.tokens.getMainToken(o);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,n)=>n.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((o.score-Q.score||o.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(qO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let o=s.stateSlot(O.state,4);if(o>0)return O.reduce(o),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?a.push(d):t.push(d)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return ee(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Z&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let c=o.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of o.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>o.pos?(Q==o.pos&&(Q++,n=0),o.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(n)})`),ee(o,t)):(!r||r.scoree;class je{constructor(O){this.start=O.start,this.shift=O.shift||dO,this.reduce=O.reduce||dO,this.reuse=O.reuse||dO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ct{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;oO.topRules[o][1]),r=[];for(let o=0;o=0)s(u,n,o[Q++]);else{let c=o[Q+-u];for(let f=-u;f>0;f--)s(o[Q++],n,c);Q++}}}this.nodeSet=new At(a.map((o,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:o,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Nt;let i=N(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new z(i,o):o),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new ma(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],o=i&1,n=r[s++];if(o&&t)return n;for(let Q=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=R(this.data,s+2);else break;r=a(R(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=R(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(o=>o.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=te(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const Za=54,ba=1,ka=55,xa=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ge=7,Ce=8,Ae=9,Ee=10,Ra=11,Ya=12,Ta=13,fO=57,Wa=14,re=58,Ne=20,_a=22,Me=23,qa=24,XO=26,Ie=27,va=28,Ua=31,za=34,Va=36,ja=37,Ga=0,Ca=1,Aa={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},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={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 Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,oe=null,le=0;function yO(e,O){let a=e.pos+O;if(le==a&&oe==e)return se;let t=e.peek(O);for(;De(t);)t=e.peek(++O);let r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return oe=e,le=a,se=r?r.toLowerCase():t==Ma||t==Ia?void 0:null}const Be=60,cO=62,zO=47,Ma=63,Ia=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ba=[nO,Ee,Ge,Ce,Ae],Ja=new je({start:null,shift(e,O,a,t){return Ba.indexOf(O)>-1?new ne(yO(t,1)||"",e):e},reduce(e,O){return O==Ne&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==nO||r==Va?new ne(yO(t,1)||"",e):e},strict:!1}),La=new k((e,O)=>{if(e.next!=Be){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==zO;a&&e.advance();let t=yO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Wa:nO);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ra);if(r&&Ea[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ga))return e.acceptToken(Ya);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(Ta)}else{if(t=="script")return e.acceptToken(Ge);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(t))return e.acceptToken(Ee);r&&ie[r]&&ie[r][t]?e.acceptToken(fO,-1):e.acceptToken(nO)}},{contextual:!0}),Ka=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){a>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new k((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let a=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(a?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function VO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(O);break}if(s==0&&r.next==Be||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=VO("script",Za,ba),er=VO("style",ka,xa),tr=VO("textarea",Xa,ya),ar=B({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),rr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~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|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~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!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~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{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!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"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],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=o.type.id;if(Q==va)return $O(o,n,a);if(Q==Ua)return $O(o,n,t);if(Q==za)return $O(o,n,r);if(Q==Ne&&s.length){let u=o.node,c=u.firstChild,f=c&&ce(c,n),h;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(h||(h=Je(c,n))))){let P=u.lastChild,m=P.type.id==ja?P.from:u.to;if(m>c.to)return{parser:d.parser,overlay:[{from:c.to,to:m}]}}}}if(i&&Q==Me){let u=o.node,c;if(c=u.firstChild){let f=i[n.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let d=u.lastChild;if(d.type.id==XO){let P=d.from+1,m=d.lastChild,x=d.to-(m&&m.isError?0:1);if(x>P)return{parser:h.parser,overlay:[{from:P,to:x}]}}else if(d.type.id==Ie)return{parser:h.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,Qe=1,sr=100,or=101,he=2,Ke=[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],lr=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,dr=92,fr=10;function M(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new k((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=e;if(M(s)||s==rO||s==Fe||a&&He(s))!a&&(s!=rO||r>0)&&(a=!0),t===r&&s==rO&&t++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),a=!0;else{a&&e.acceptToken(s==nr?sr:t==2&&O.canShift(he)?he:or);break}}}),Pr=new k(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(M(O)||O==Fe||O==hr||O==Qr||O==cr||O==lr&&M(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),mr=new k(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),M(O)){do e.advance();while(M(e.next)||He(e.next));e.acceptToken(Qe)}}}),gr=B({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,KeyframeRangeName:l.operatorKeyword,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ColorLiteral:l.color,"ParenthesizedContent StringLiteral":l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),Sr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},kr=T.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,mr,$r,1,2,3,4,new lO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>Sr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function mO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));PO=O.sort().map(t=>({type:"property",label:t}))}return PO||[]}const ue=["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(e=>({type:"class",label:e})),pe=["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(e=>({type:"keyword",label:e})).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(e=>({type:"constant",label:e}))),xr=["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(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const de=new _e,Rr=["Declaration"];function Yr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,a){if(O.to-O.from>4096){let t=de.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(vO.IncludeAnonymous);if(i.firstChild())do for(let o of Ot(e,i.node,a))s.has(o.label)||(s.add(o.label),r.push(o));while(i.nextSibling());return de.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Rr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let o=e.sliceString(s.from,s.to);r.has(o)||(r.add(o),t.push({label:o,type:"variable"}))}}),t}}const Tr=e=>O=>{let{state:a,pos:t}=O,r=G(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,a.doc))return{from:e(r)||s?r.from:t,options:Ot(a.doc,Yr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:w};return{from:r.from,options:xr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(t),o=i.childBefore(t);return o&&o.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:ue,validFor:w}:o&&o.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:w}:null},Wr=Tr(e=>e.name=="VariableName"),QO=J.define({name:"css",parser:kr.configure({props:[L.add({Declaration:v()}),K.add({"Block KeyframeList":UO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _r(){return new F(QO,QO.data.of({autocomplete:Wr}))}const qr=312,fe=1,vr=2,Ur=3,zr=4,Vr=313,jr=315,Gr=316,Cr=5,Ar=6,Er=0,wO=[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],et=125,Nr=59,RO=47,Mr=42,Ir=43,Dr=45,Br=60,Jr=44,Lr=63,Kr=46,Fr=new je({start:!1,shift(e,O){return O==Cr||O==Ar||O==jr?e:O==Gr},strict:!1}),Hr=new k((e,O)=>{let{next:a}=e;(a==et||a==-1||O.context)&&e.acceptToken(Vr)},{contextual:!0,fallback:!0}),Oi=new k((e,O)=>{let{next:a}=e,t;wO.indexOf(a)>-1||a==RO&&((t=e.peek(1))==RO||t==Mr)||a!=et&&a!=Nr&&a!=-1&&!O.context&&e.acceptToken(qr)},{contextual:!0}),ei=new k((e,O)=>{let{next:a}=e;if(a==Ir||a==Dr){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift(fe);e.acceptToken(t?fe:vr)}}else a==Lr&&e.peek(1)==Kr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Ur))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ti=new k((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Er)||(e.advance(),e.next==RO))return;let a=0;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==Jr)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(zr,-a)}),ai=B({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const using function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,"LineComment Hashbang":l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),ri={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},ii={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},si={__proto__:null,"<":187},oi=T.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < 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 : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < 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 InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression 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:376,context:Fr,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[ai],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!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$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(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(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%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%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%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)3p/x`$h&j!m),Q(Rp(U!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(KW1V`#u(Ch$h&j(Rp(U!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(KW2d_#u(Ch$h&j(Rp(U!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'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%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'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!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)[#Jv_al$h&j(Rp(U!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%Z04f#LS^h#)`#O-ri[e]||-1},{term:338,get:e=>ii[e]||-1},{term:92,get:e=>si[e]||-1}],tokenPrec:14749}),tt=[S("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),S("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),S("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),S("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),S("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),S(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/CreateApiDocs-D8M_3QcG.js b/ui/dist/assets/CreateApiDocs-BNp07xea.js similarity index 99% rename from ui/dist/assets/CreateApiDocs-D8M_3QcG.js rename to ui/dist/assets/CreateApiDocs-BNp07xea.js index c63ae2e6..66433741 100644 --- a/ui/dist/assets/CreateApiDocs-D8M_3QcG.js +++ b/ui/dist/assets/CreateApiDocs-BNp07xea.js @@ -1,4 +1,4 @@ -import{S as $t,i as qt,s as Tt,Q as St,C as ee,T as ue,R as Ct,e as s,w as _,b as p,c as $e,f as w,g as r,h as i,m as qe,x as oe,U as Ve,V as pt,k as Ot,W as Mt,n as Pt,t as ye,a as ve,o as d,d as Te,p as Ft,r as Se,u as Lt,y as we,E as Ht}from"./index-D5-_lkfc.js";import{F as Rt}from"./FieldsQueryParam-D8rkBfEn.js";function mt(a,e,t){const l=a.slice();return l[10]=e[t],l}function bt(a,e,t){const l=a.slice();return l[10]=e[t],l}function _t(a,e,t){const l=a.slice();return l[15]=e[t],l}function kt(a){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function ht(a){let e,t,l,u,c,f,b,m,$,h,g,B,S,O,R,M,U,J,T,W,P,q,k,F,te,K,I,re,Y,x,G;function fe(y,C){var V,z,H;return C&1&&(f=null),f==null&&(f=!!((H=(z=(V=y[0])==null?void 0:V.fields)==null?void 0:z.find(xt))!=null&&H.required)),f?Bt:At}let le=fe(a,-1),E=le(a);function X(y,C){var V,z,H;return C&1&&(U=null),U==null&&(U=!!((H=(z=(V=y[0])==null?void 0:V.fields)==null?void 0:z.find(Yt))!=null&&H.required)),U?Vt:jt}let Z=X(a,-1),L=Z(a);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=p(),l=s("tr"),u=s("td"),c=s("div"),E.c(),b=p(),m=s("span"),m.textContent="email",$=p(),h=s("td"),h.innerHTML='String',g=p(),B=s("td"),B.textContent="Auth record email address.",S=p(),O=s("tr"),R=s("td"),M=s("div"),L.c(),J=p(),T=s("span"),T.textContent="emailVisibility",W=p(),P=s("td"),P.innerHTML='Boolean',q=p(),k=s("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",F=p(),te=s("tr"),te.innerHTML='
Required password
String Auth record password.',K=p(),I=s("tr"),I.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',re=p(),Y=s("tr"),Y.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not. +import{S as $t,i as qt,s as Tt,Q as St,C as ee,T as ue,R as Ct,e as s,w as _,b as p,c as $e,f as w,g as r,h as i,m as qe,x as oe,U as Ve,V as pt,k as Ot,W as Mt,n as Pt,t as ye,a as ve,o as d,d as Te,p as Ft,r as Se,u as Lt,y as we,E as Ht}from"./index-B2Vo3yiW.js";import{F as Rt}from"./FieldsQueryParam-B57e0MbD.js";function mt(a,e,t){const l=a.slice();return l[10]=e[t],l}function bt(a,e,t){const l=a.slice();return l[10]=e[t],l}function _t(a,e,t){const l=a.slice();return l[15]=e[t],l}function kt(a){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function ht(a){let e,t,l,u,c,f,b,m,$,h,g,B,S,O,R,M,U,J,T,W,P,q,k,F,te,K,I,re,Y,x,G;function fe(y,C){var V,z,H;return C&1&&(f=null),f==null&&(f=!!((H=(z=(V=y[0])==null?void 0:V.fields)==null?void 0:z.find(xt))!=null&&H.required)),f?Bt:At}let le=fe(a,-1),E=le(a);function X(y,C){var V,z,H;return C&1&&(U=null),U==null&&(U=!!((H=(z=(V=y[0])==null?void 0:V.fields)==null?void 0:z.find(Yt))!=null&&H.required)),U?Vt:jt}let Z=X(a,-1),L=Z(a);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=p(),l=s("tr"),u=s("td"),c=s("div"),E.c(),b=p(),m=s("span"),m.textContent="email",$=p(),h=s("td"),h.innerHTML='String',g=p(),B=s("td"),B.textContent="Auth record email address.",S=p(),O=s("tr"),R=s("td"),M=s("div"),L.c(),J=p(),T=s("span"),T.textContent="emailVisibility",W=p(),P=s("td"),P.innerHTML='Boolean',q=p(),k=s("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",F=p(),te=s("tr"),te.innerHTML='
Required password
String Auth record password.',K=p(),I=s("tr"),I.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',re=p(),Y=s("tr"),Y.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
This field can be set only by superusers or auth records with "Manage" access.`,x=p(),G=s("tr"),G.innerHTML='Other fields',w(c,"class","inline-flex"),w(M,"class","inline-flex")},m(y,C){r(y,e,C),r(y,t,C),r(y,l,C),i(l,u),i(u,c),E.m(c,null),i(c,b),i(c,m),i(l,$),i(l,h),i(l,g),i(l,B),r(y,S,C),r(y,O,C),i(O,R),i(R,M),L.m(M,null),i(M,J),i(M,T),i(O,W),i(O,P),i(O,q),i(O,k),r(y,F,C),r(y,te,C),r(y,K,C),r(y,I,C),r(y,re,C),r(y,Y,C),r(y,x,C),r(y,G,C)},p(y,C){le!==(le=fe(y,C))&&(E.d(1),E=le(y),E&&(E.c(),E.m(c,b))),Z!==(Z=X(y,C))&&(L.d(1),L=Z(y),L&&(L.c(),L.m(M,J)))},d(y){y&&(d(e),d(t),d(l),d(S),d(O),d(F),d(te),d(K),d(I),d(re),d(Y),d(x),d(G)),E.d(),L.d()}}}function At(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Bt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function jt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Vt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Nt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Dt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Jt(a){let e,t=a[15].maxSelect===1?"id":"ids",l,u;return{c(){e=_("Relation record "),l=_(t),u=_(".")},m(c,f){r(c,e,f),r(c,l,f),r(c,u,f)},p(c,f){f&64&&t!==(t=c[15].maxSelect===1?"id":"ids")&&oe(l,t)},d(c){c&&(d(e),d(l),d(u))}}}function Et(a){let e,t,l,u,c,f,b,m,$;return{c(){e=_("File object."),t=s("br"),l=_(` Set to empty value (`),u=s("code"),u.textContent="null",c=_(", "),f=s("code"),f.textContent='""',b=_(" or "),m=s("code"),m.textContent="[]",$=_(`) to delete diff --git a/ui/dist/assets/DeleteApiDocs-Be4u5GI8.js b/ui/dist/assets/DeleteApiDocs-CU3e4BJK.js similarity index 98% rename from ui/dist/assets/DeleteApiDocs-Be4u5GI8.js rename to ui/dist/assets/DeleteApiDocs-CU3e4BJK.js index 21e279c9..7903cffc 100644 --- a/ui/dist/assets/DeleteApiDocs-Be4u5GI8.js +++ b/ui/dist/assets/DeleteApiDocs-CU3e4BJK.js @@ -1,4 +1,4 @@ -import{S as Re,i as Ee,s as Pe,Q as Te,T as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,U as he,V as Be,k as Oe,W as Ie,n as Ae,t as te,a as le,o as f,d as we,C as Me,p as qe,r as z,u as Le,R as Se}from"./index-D5-_lkfc.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&f(l)}}}function ye(a,l){let s,o,h;function r(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),o||(h=Le(s,"click",r),o=!0)},p(n,d){l=n,d&20&&z(s,"active",l[2]===l[6].code)},d(n){n&&f(s),o=!1,h()}}}function $e(a,l){let s,o,h,r;return o=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),Ce(o,s,null),i(s,h),r=!0},p(n,d){l=n,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(n){r||(te(o.$$.fragment,n),r=!0)},o(n){le(o.$$.fragment,n),r=!1},d(n){n&&f(s),we(o)}}}function Ue(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,q=a[0].name+"",K,se,N,C,Q,P,V,g,L,ae,S,E,oe,W,U=a[0].name+"",G,ne,J,ie,X,T,Y,B,Z,O,x,w,I,v=[],ce=new Map,re,A,b=[],de=new Map,R;C=new Te({props:{js:` +import{S as Re,i as Ee,s as Pe,Q as Te,T as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,U as he,V as Be,k as Oe,W as Ie,n as Ae,t as te,a as le,o as f,d as we,C as Me,p as qe,r as z,u as Le,R as Se}from"./index-B2Vo3yiW.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&f(l)}}}function ye(a,l){let s,o,h;function r(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),o||(h=Le(s,"click",r),o=!0)},p(n,d){l=n,d&20&&z(s,"active",l[2]===l[6].code)},d(n){n&&f(s),o=!1,h()}}}function $e(a,l){let s,o,h,r;return o=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),Ce(o,s,null),i(s,h),r=!0},p(n,d){l=n,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(n){r||(te(o.$$.fragment,n),r=!0)},o(n){le(o.$$.fragment,n),r=!1},d(n){n&&f(s),we(o)}}}function Ue(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,q=a[0].name+"",K,se,N,C,Q,P,V,g,L,ae,S,E,oe,W,U=a[0].name+"",G,ne,J,ie,X,T,Y,B,Z,O,x,w,I,v=[],ce=new Map,re,A,b=[],de=new Map,R;C=new Te({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/EmailChangeDocs-DZGm4aOE.js b/ui/dist/assets/EmailChangeDocs-BFlX8O9s.js similarity index 99% rename from ui/dist/assets/EmailChangeDocs-DZGm4aOE.js rename to ui/dist/assets/EmailChangeDocs-BFlX8O9s.js index 7d812cab..571ec108 100644 --- a/ui/dist/assets/EmailChangeDocs-DZGm4aOE.js +++ b/ui/dist/assets/EmailChangeDocs-BFlX8O9s.js @@ -1,4 +1,4 @@ -import{S as se,i as oe,s as ie,T as K,e as p,b as y,w as U,f as b,g,h as u,x as J,U as le,V as Re,k as ne,W as Se,n as ae,t as V,a as X,o as v,r as Y,u as ce,R as Oe,c as x,m as ee,d as te,Q as Me,X as _e,C as Be,p as De,Y as be}from"./index-D5-_lkfc.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&J(d,l),A&6&&Y(t,"active",e[1]===e[4].code)},d(k){k&&v(t),r=!1,a()}}}function $e(n,e){let t,l,d,i;return l=new Oe({props:{content:e[4].body}}),{key:n,first:null,c(){t=p("div"),x(l.$$.fragment),d=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(r,a){g(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&Y(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function Ne(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,G,H,Q,L,z,B,D,S,N,T=[],O=new Map,P,j,q=[],W=new Map,w,E=K(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=F(f);W.set(s,q[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=y(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),G=y(),H=p("div"),H.textContent="Body Parameters",Q=y(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=y(),B=p("div"),B.textContent="Responses",D=y(),S=p("div"),N=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as oe,s as ie,T as K,e as p,b as y,w as U,f as b,g,h as u,x as J,U as le,V as Re,k as ne,W as Se,n as ae,t as V,a as X,o as v,r as Y,u as ce,R as Oe,c as x,m as ee,d as te,Q as Me,X as _e,C as Be,p as De,Y as be}from"./index-B2Vo3yiW.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&J(d,l),A&6&&Y(t,"active",e[1]===e[4].code)},d(k){k&&v(t),r=!1,a()}}}function $e(n,e){let t,l,d,i;return l=new Oe({props:{content:e[4].body}}),{key:n,first:null,c(){t=p("div"),x(l.$$.fragment),d=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(r,a){g(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&Y(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function Ne(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,G,H,Q,L,z,B,D,S,N,T=[],O=new Map,P,j,q=[],W=new Map,w,E=K(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=F(f);W.set(s,q[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=y(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),G=y(),H=p("div"),H.textContent="Body Parameters",Q=y(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=y(),B=p("div"),B.textContent="Responses",D=y(),S=p("div"),N=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/FieldsQueryParam-D8rkBfEn.js b/ui/dist/assets/FieldsQueryParam-B57e0MbD.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-D8rkBfEn.js rename to ui/dist/assets/FieldsQueryParam-B57e0MbD.js index 1854f694..c2540feb 100644 --- a/ui/dist/assets/FieldsQueryParam-D8rkBfEn.js +++ b/ui/dist/assets/FieldsQueryParam-B57e0MbD.js @@ -1,4 +1,4 @@ -import{S as J,i as N,s as O,R as P,e as t,b as c,w as i,c as Q,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-D5-_lkfc.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,R,m,T,k,B,x;return r=new P({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as N,s as O,R as P,e as t,b as c,w as i,c as Q,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-B2Vo3yiW.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,R,m,T,k,B,x;return r=new P({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),h=t("em"),h.textContent="(by default returns all fields)",y=i(`. Ex.: `),Q(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-B-j6H3tq.js b/ui/dist/assets/FilterAutocompleteInput-SHg3tCmR.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-B-j6H3tq.js rename to ui/dist/assets/FilterAutocompleteInput-SHg3tCmR.js index 19b10d31..59d91af4 100644 --- a/ui/dist/assets/FilterAutocompleteInput-B-j6H3tq.js +++ b/ui/dist/assets/FilterAutocompleteInput-SHg3tCmR.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,e as ne,f as re,g as ie,y as D,o as ae,J as oe,N as le,O as se,L as de,C as u,P as ce}from"./index-D5-_lkfc.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as G,C as R,S as qe,t as ve,u as Oe,v as We}from"./index-B5ReTu-C.js";function _e(e){return new Worker(""+new URL("autocomplete.worker-Br7MPIGR.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){V(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],a=e[h],i=0;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,I=new R,J=new R,M=new R,A=new R,v=new _e,B=[],H=[],T=[],C="",O="";function W(){d==null||d.focus()}let _=null;v.onmessage=n=>{T=n.data.baseKeys||[],B=n.data.requestKeys||[],H=n.data.collectionJoinKeys||[]};function j(){clearTimeout(_),_=setTimeout(()=>{v.postMessage({baseCollection:s,collections:z(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function z(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function P(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",W)}function U(){if(!f)return;P();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",W)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(T||[]),n&&(l=l.concat(B||[])),c&&(l=l.concat(H||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=We(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",a)}};U();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(Oe,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(G(o)),J.of(E.editable.of(!i)),M.of(S.readOnly.of(i)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Te(s)),e.$$.dirty[0]&25352&&!i&&(O!=C||b!==-1||m!==-1)&&(t(14,O=C),j()),e.$$.dirty[0]&4&&f&&U(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!i)),M.reconfigure(S.readOnly.of(i))]}),t(12,q=i),F()),e.$$.dirty[0]&2050&&d&&a!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:a}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(G(o))]})},[p,a,f,i,o,s,y,L,b,m,W,d,q,C,O,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,He,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; +import{S as $,i as ee,s as te,e as ne,f as re,g as ie,y as D,o as ae,J as oe,N as le,O as se,L as de,C as u,P as ce}from"./index-B2Vo3yiW.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as G,C as R,S as qe,t as ve,u as Oe,v as We}from"./index-B5ReTu-C.js";function _e(e){return new Worker(""+new URL("autocomplete.worker-Br7MPIGR.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){V(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],a=e[h],i=0;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,I=new R,J=new R,M=new R,A=new R,v=new _e,B=[],H=[],T=[],C="",O="";function W(){d==null||d.focus()}let _=null;v.onmessage=n=>{T=n.data.baseKeys||[],B=n.data.requestKeys||[],H=n.data.collectionJoinKeys||[]};function j(){clearTimeout(_),_=setTimeout(()=>{v.postMessage({baseCollection:s,collections:z(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function z(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function P(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",W)}function U(){if(!f)return;P();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",W)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(T||[]),n&&(l=l.concat(B||[])),c&&(l=l.concat(H||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=We(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",a)}};U();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(Oe,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(G(o)),J.of(E.editable.of(!i)),M.of(S.readOnly.of(i)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Te(s)),e.$$.dirty[0]&25352&&!i&&(O!=C||b!==-1||m!==-1)&&(t(14,O=C),j()),e.$$.dirty[0]&4&&f&&U(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!i)),M.reconfigure(S.readOnly.of(i))]}),t(12,q=i),F()),e.$$.dirty[0]&2050&&d&&a!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:a}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(G(o))]})},[p,a,f,i,o,s,y,L,b,m,W,d,q,C,O,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,He,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; diff --git a/ui/dist/assets/ListApiDocs-BMqVRxIN.js b/ui/dist/assets/ListApiDocs-DE6L15a5.js similarity index 99% rename from ui/dist/assets/ListApiDocs-BMqVRxIN.js rename to ui/dist/assets/ListApiDocs-DE6L15a5.js index c3b7b70c..2a15db16 100644 --- a/ui/dist/assets/ListApiDocs-BMqVRxIN.js +++ b/ui/dist/assets/ListApiDocs-DE6L15a5.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as m,u as ll,y as Ue,o as h,w as g,h as t,Q as nl,R as ve,T as se,c as Ut,m as jt,x as ke,U as je,V as ol,k as al,W as il,n as rl,t as $t,a as Ct,d as Qt,X as cl,C as Le,p as dl,r as Fe}from"./index-D5-_lkfc.js";import{F as pl}from"./FieldsQueryParam-D8rkBfEn.js";function fl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function ul(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Qe(r){let n,o,i,f,b,p,u,C,_,$,d,tt,kt,zt,S,Kt,H,rt,R,et,ne,U,j,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,Q,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,Et,O,mt,ce,z,St,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,E,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as m,u as ll,y as Ue,o as h,w as g,h as t,Q as nl,R as ve,T as se,c as Ut,m as jt,x as ke,U as je,V as ol,k as al,W as il,n as rl,t as $t,a as Ct,d as Qt,X as cl,C as Le,p as dl,r as Fe}from"./index-B2Vo3yiW.js";import{F as pl}from"./FieldsQueryParam-B57e0MbD.js";function fl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function ul(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Qe(r){let n,o,i,f,b,p,u,C,_,$,d,tt,kt,zt,S,Kt,H,rt,R,et,ne,U,j,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,Q,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,Et,O,mt,ce,z,St,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,E,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,b=s(),p=e("li"),u=e("code"),u.textContent="OPERATOR",C=g(` - is one of: `),_=e("br"),$=s(),d=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),S=e("span"),S.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),U=e("li"),j=e("code"),j.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",Q=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/PageOAuth2RedirectFailure-XymI0BiX.js b/ui/dist/assets/PageOAuth2RedirectFailure-Bg1XyXEO.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectFailure-XymI0BiX.js rename to ui/dist/assets/PageOAuth2RedirectFailure-Bg1XyXEO.js index dda04c15..be49fbb6 100644 --- a/ui/dist/assets/PageOAuth2RedirectFailure-XymI0BiX.js +++ b/ui/dist/assets/PageOAuth2RedirectFailure-Bg1XyXEO.js @@ -1 +1 @@ -import{S as r,i as c,s as l,e as u,f as p,g as h,y as n,o as d,J as f,K as m,L as g,M as o}from"./index-D5-_lkfc.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='

Auth failed.

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

Auth failed.

You can close this window and go back to the app to try again.
',p(t,"class","content txt-hint txt-center p-base")},m(e,a){h(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function b(s,t,e){let a;return f(s,o,i=>e(0,a=i)),m(o,a="OAuth2 auth failed",a),g(()=>{window.close()}),[]}class v extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{v as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-C3IPDfGd.js b/ui/dist/assets/PageOAuth2RedirectSuccess-RWTsYqU5.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectSuccess-C3IPDfGd.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-RWTsYqU5.js index 9a8f9f3e..c70e6b03 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-C3IPDfGd.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-RWTsYqU5.js @@ -1 +1 @@ -import{S as i,i as r,s as u,e as l,f as p,g as h,y as n,o as d,J as m,K as f,L as g,M as o}from"./index-D5-_lkfc.js";function _(a){let t;return{c(){t=l("div"),t.innerHTML='

Auth completed.

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

Auth completed.

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

Successfully changed the user email address.

You can now sign in with your new email address.

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

Successfully changed the user password.

You can now sign in with your new password.

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

Invalid or expired verification token.

',l=v(),c.c(),n=g(),f(e,"class","alert alert-danger")},m(i,d){r(i,e,d),r(i,l,d),c.m(i,d),r(i,n,d)},p(i,d){s===(s=t(i))&&c?c.p(i,d):(c.d(1),c=s(i),c&&(c.c(),c.m(n.parentNode,n)))},d(i){i&&(a(e),a(l),a(n)),c.d(i)}}}function A(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

',l=v(),n=u("button"),n.textContent="Close",f(e,"class","alert alert-success"),f(n,"type","button"),f(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[8]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",f(e,"class","alert alert-success"),f(n,"type","button"),f(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[7]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function D(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',f(e,"class","txt-center")},m(l,n){r(l,e,n)},p:m,d(l){l&&a(e)}}}function J(o){let e,l,n;return{c(){e=u("button"),e.textContent="Close",f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(t,s){r(t,e,s),l||(n=k(e,"click",o[9]),l=!0)},p:m,d(t){t&&a(e),l=!1,n()}}}function K(o){let e,l,n,t;return{c(){e=u("button"),l=u("span"),l.textContent="Resend",f(l,"class","txt"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),j(e,l),n||(t=k(e,"click",o[5]),n=!0)},p(s,c){c&8&&(e.disabled=s[3]),c&8&&C(e,"btn-loading",s[3])},d(s){s&&a(e),n=!1,t()}}}function O(o){let e;function l(s,c){return s[1]?D:s[0]?B:s[2]?A:z}let n=l(o),t=n(o);return{c(){t.c(),e=g()},m(s,c){t.m(s,c),r(s,e,c)},p(s,c){n===(n=l(s))&&t?t.p(s,c):(t.d(1),t=n(s),t&&(t.c(),t.m(e.parentNode,e)))},d(s){s&&a(e),t.d(s)}}}function Q(o){let e,l;return e=new M({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){S(e.$$.fragment)},m(n,t){V(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(q(e.$$.fragment,n),l=!0)},o(n){E(e.$$.fragment,n),l=!1},d(n){F(e,n)}}}function U(o,e,l){let n,{params:t}=e,s=!1,c=!1,i=!1,d=!1;x();async function x(){if(c)return;l(1,c=!0);const b=new w("../");try{const p=y(t==null?void 0:t.token);await b.collection(p.collectionId).confirmVerification(t==null?void 0:t.token),l(0,s=!0)}catch{l(0,s=!1)}l(1,c=!1)}async function T(){const b=y(t==null?void 0:t.token);if(d||!b.collectionId||!b.email)return;l(3,d=!0);const p=new w("../");try{const _=y(t==null?void 0:t.token);await p.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){G.error(_),l(2,i=!1)}l(3,d=!1)}const h=()=>window.close(),H=()=>window.close(),I=()=>window.close();return o.$$set=b=>{"params"in b&&l(6,t=b.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&N(t.token))},[s,c,i,d,n,T,t,h,H,I]}class X extends P{constructor(e){super(),R(this,e,U,Q,L,{params:6})}}export{X as default}; +import{S as P,i as R,s as L,F as M,c as S,m as V,t as q,a as E,d as F,G as w,H as y,I as N,E as g,g as r,o as a,p as G,e as u,b as v,f,u as k,y as m,r as C,h as j}from"./index-B2Vo3yiW.js";function z(o){let e,l,n;function t(i,d){return i[4]?K:J}let s=t(o),c=s(o);return{c(){e=u("div"),e.innerHTML='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),f(e,"class","alert alert-danger")},m(i,d){r(i,e,d),r(i,l,d),c.m(i,d),r(i,n,d)},p(i,d){s===(s=t(i))&&c?c.p(i,d):(c.d(1),c=s(i),c&&(c.c(),c.m(n.parentNode,n)))},d(i){i&&(a(e),a(l),a(n)),c.d(i)}}}function A(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

',l=v(),n=u("button"),n.textContent="Close",f(e,"class","alert alert-success"),f(n,"type","button"),f(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[8]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",f(e,"class","alert alert-success"),f(n,"type","button"),f(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[7]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function D(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',f(e,"class","txt-center")},m(l,n){r(l,e,n)},p:m,d(l){l&&a(e)}}}function J(o){let e,l,n;return{c(){e=u("button"),e.textContent="Close",f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(t,s){r(t,e,s),l||(n=k(e,"click",o[9]),l=!0)},p:m,d(t){t&&a(e),l=!1,n()}}}function K(o){let e,l,n,t;return{c(){e=u("button"),l=u("span"),l.textContent="Resend",f(l,"class","txt"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),j(e,l),n||(t=k(e,"click",o[5]),n=!0)},p(s,c){c&8&&(e.disabled=s[3]),c&8&&C(e,"btn-loading",s[3])},d(s){s&&a(e),n=!1,t()}}}function O(o){let e;function l(s,c){return s[1]?D:s[0]?B:s[2]?A:z}let n=l(o),t=n(o);return{c(){t.c(),e=g()},m(s,c){t.m(s,c),r(s,e,c)},p(s,c){n===(n=l(s))&&t?t.p(s,c):(t.d(1),t=n(s),t&&(t.c(),t.m(e.parentNode,e)))},d(s){s&&a(e),t.d(s)}}}function Q(o){let e,l;return e=new M({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){S(e.$$.fragment)},m(n,t){V(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(q(e.$$.fragment,n),l=!0)},o(n){E(e.$$.fragment,n),l=!1},d(n){F(e,n)}}}function U(o,e,l){let n,{params:t}=e,s=!1,c=!1,i=!1,d=!1;x();async function x(){if(c)return;l(1,c=!0);const b=new w("../");try{const p=y(t==null?void 0:t.token);await b.collection(p.collectionId).confirmVerification(t==null?void 0:t.token),l(0,s=!0)}catch{l(0,s=!1)}l(1,c=!1)}async function T(){const b=y(t==null?void 0:t.token);if(d||!b.collectionId||!b.email)return;l(3,d=!0);const p=new w("../");try{const _=y(t==null?void 0:t.token);await p.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){G.error(_),l(2,i=!1)}l(3,d=!1)}const h=()=>window.close(),H=()=>window.close(),I=()=>window.close();return o.$$set=b=>{"params"in b&&l(6,t=b.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&N(t.token))},[s,c,i,d,n,T,t,h,H,I]}class X extends P{constructor(e){super(),R(this,e,U,Q,L,{params:6})}}export{X as default}; diff --git a/ui/dist/assets/PageSuperuserConfirmPasswordReset-DbcUga_c.js b/ui/dist/assets/PageSuperuserConfirmPasswordReset-Dz1f_KSq.js similarity index 98% rename from ui/dist/assets/PageSuperuserConfirmPasswordReset-DbcUga_c.js rename to ui/dist/assets/PageSuperuserConfirmPasswordReset-Dz1f_KSq.js index ccead344..e44f9b70 100644 --- a/ui/dist/assets/PageSuperuserConfirmPasswordReset-DbcUga_c.js +++ b/ui/dist/assets/PageSuperuserConfirmPasswordReset-Dz1f_KSq.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as B,t as N,a as T,d as j,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as z,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-D5-_lkfc.js";function y(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0,t.autofocus=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[0]),t.focus(),p||(d=z(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[1]),p||(d=z(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,h,F,A,m=r[3]&&y(r);return i=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your superuser password +import{S as E,i as G,s as I,F as K,c as R,m as B,t as N,a as T,d as j,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as z,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-B2Vo3yiW.js";function y(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0,t.autofocus=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[0]),t.focus(),p||(d=z(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[1]),p||(d=z(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,h,F,A,m=r[3]&&y(r);return i=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your superuser password `),m&&m.c(),t=k(),R(i.$$.fragment),p=k(),R(d.$$.fragment),u=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=r[2],L(a,"btn-loading",r[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),B(i,e,null),c(e,p),B(d,e,null),c(e,u),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(A=[z(e,"submit",O(r[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),i.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(N(i.$$.fragment,o),N(d.$$.fragment,o),h=!0)},o(o){T(i.$$.fragment,o),T(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),j(i),j(d),F=!1,V(A)}}}function se(r){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){R(e.$$.fragment)},m(s,l){B(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(N(e.$$.fragment,s),n=!0)},o(s){T(e.$$.fragment,s),n=!1},d(s){j(e,s)}}}function le(r,e,n){let s,{params:l}=e,t="",i="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.collection("_superusers").confirmPasswordReset(l==null?void 0:l.token,t,i),X("Successfully set a new superuser password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function u(){t=this.value,n(0,t)}function a(){i=this.value,n(1,i)}return r.$$set=g=>{"params"in g&&n(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,i,p,s,d,l,u,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageSuperuserRequestPasswordReset-Bpn-_-HR.js b/ui/dist/assets/PageSuperuserRequestPasswordReset-a0MuXZH3.js similarity index 98% rename from ui/dist/assets/PageSuperuserRequestPasswordReset-Bpn-_-HR.js rename to ui/dist/assets/PageSuperuserRequestPasswordReset-a0MuXZH3.js index 7deb98bf..0ae753d9 100644 --- a/ui/dist/assets/PageSuperuserRequestPasswordReset-Bpn-_-HR.js +++ b/ui/dist/assets/PageSuperuserRequestPasswordReset-a0MuXZH3.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as L,m as R,t as w,a as y,d as E,b as v,e as m,f as p,g,h as d,j as B,l as N,k as A,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as S}from"./index-D5-_lkfc.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=m("form"),s=m("div"),s.innerHTML='

Forgotten superuser password

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

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

Forgotten superuser password

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

',n=v(),L(l.$$.fragment),t=v(),r=m("button"),c=m("i"),_=v(),i=m("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(i,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block"),r.disabled=u[1],F(r,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){g(o,e,$),d(e,s),d(e,n),R(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(o,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:o}),l.$set(q),(!a||$&2)&&(r.disabled=o[1]),(!a||$&2)&&F(r,"btn-loading",o[1])},i(o){a||(w(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,r,c,_,i;return{c(){e=m("div"),s=m("div"),s.innerHTML='',n=v(),l=m("div"),t=m("p"),r=h("Check "),c=m("strong"),_=h(u[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,r),d(t,c),d(c,_),d(t,i)},p(a,b){b&1&&J(_,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,r,c,_;return{c(){e=m("label"),s=h("Email"),l=v(),t=m("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",r=u[5]),t.required=!0,t.autofocus=!0},m(i,a){g(i,e,a),d(e,s),g(i,l,a),g(i,t,a),S(t,u[0]),t.focus(),c||(_=H(t,"input",u[4]),c=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&r!==(r=i[5])&&p(t,"id",r),a&1&&t.value!==i[0]&&S(t,i[0])},d(i){i&&(k(e),k(l),k(t)),c=!1,_()}}}function U(u){let e,s,n,l,t,r,c,_;const i=[O,K],a=[];function b(f,o){return f[2]?0:1}return e=b(u),s=a[e]=i[e](u),{c(){s.c(),n=v(),l=m("div"),t=m("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,o){a[e].m(f,o),g(f,n,o),g(f,l,o),d(l,t),r=!0,c||(_=B(N.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(A(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,o):(s=a[e]=i[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){r||(w(s),r=!0)},o(f){y(s),r=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,_()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){L(e.$$.fragment)},m(n,l){R(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function r(){if(!l){s(1,l=!0);try{await C.collection("_superusers").requestPasswordReset(n),s(2,t=!0)}catch(_){C.error(_)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,r,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PasswordResetDocs-DhK7YTwM.js b/ui/dist/assets/PasswordResetDocs-8lWAqSSD.js similarity index 99% rename from ui/dist/assets/PasswordResetDocs-DhK7YTwM.js rename to ui/dist/assets/PasswordResetDocs-8lWAqSSD.js index 0b524827..eeb42d9d 100644 --- a/ui/dist/assets/PasswordResetDocs-DhK7YTwM.js +++ b/ui/dist/assets/PasswordResetDocs-8lWAqSSD.js @@ -1,4 +1,4 @@ -import{S as se,i as ne,s as oe,T as U,e as p,b as S,w as D,f as g,g as b,h as u,x as z,U as ee,V as ye,k as te,W as Te,n as le,t as V,a as X,o as v,r as H,u as ae,R as Ee,c as J,m as Z,d as x,Q as Ce,X as fe,C as qe,p as Oe,Y as pe}from"./index-D5-_lkfc.js";function me(o,t,e){const n=o.slice();return n[4]=t[e],n}function _e(o,t,e){const n=o.slice();return n[4]=t[e],n}function he(o,t){let e,n=t[4].code+"",d,c,r,a;function f(){return t[3](t[4])}return{key:o,first:null,c(){e=p("button"),d=D(n),c=S(),g(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(k,y){b(k,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(k,y){t=k,y&4&&n!==(n=t[4].code+"")&&z(d,n),y&6&&H(e,"active",t[1]===t[4].code)},d(k){k&&v(e),r=!1,a()}}}function be(o,t){let e,n,d,c;return n=new Ee({props:{content:t[4].body}}),{key:o,first:null,c(){e=p("div"),J(n.$$.fragment),d=S(),g(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(n,e,null),u(e,d),c=!0},p(r,a){t=r;const f={};a&4&&(f.content=t[4].body),n.$set(f),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(V(n.$$.fragment,r),c=!0)},o(r){X(n.$$.fragment,r),c=!1},d(r){r&&v(e),x(n)}}}function We(o){let t,e,n,d,c,r,a,f=o[0].name+"",k,y,F,q,Q,A,L,O,W,T,C,R=[],M=new Map,j,N,h=[],K=new Map,E,P=U(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),C=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as ne,s as oe,T as U,e as p,b as S,w as D,f as g,g as b,h as u,x as z,U as ee,V as ye,k as te,W as Te,n as le,t as V,a as X,o as v,r as H,u as ae,R as Ee,c as J,m as Z,d as x,Q as Ce,X as fe,C as qe,p as Oe,Y as pe}from"./index-B2Vo3yiW.js";function me(o,t,e){const n=o.slice();return n[4]=t[e],n}function _e(o,t,e){const n=o.slice();return n[4]=t[e],n}function he(o,t){let e,n=t[4].code+"",d,c,r,a;function f(){return t[3](t[4])}return{key:o,first:null,c(){e=p("button"),d=D(n),c=S(),g(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(k,y){b(k,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(k,y){t=k,y&4&&n!==(n=t[4].code+"")&&z(d,n),y&6&&H(e,"active",t[1]===t[4].code)},d(k){k&&v(e),r=!1,a()}}}function be(o,t){let e,n,d,c;return n=new Ee({props:{content:t[4].body}}),{key:o,first:null,c(){e=p("div"),J(n.$$.fragment),d=S(),g(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(n,e,null),u(e,d),c=!0},p(r,a){t=r;const f={};a&4&&(f.content=t[4].body),n.$set(f),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(V(n.$$.fragment,r),c=!0)},o(r){X(n.$$.fragment,r),c=!1},d(r){r&&v(e),x(n)}}}function We(o){let t,e,n,d,c,r,a,f=o[0].name+"",k,y,F,q,Q,A,L,O,W,T,C,R=[],M=new Map,j,N,h=[],K=new Map,E,P=U(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),C=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/RealtimeApiDocs-BY_VlCDF.js b/ui/dist/assets/RealtimeApiDocs-B2eRrxRi.js similarity index 99% rename from ui/dist/assets/RealtimeApiDocs-BY_VlCDF.js rename to ui/dist/assets/RealtimeApiDocs-B2eRrxRi.js index e755a418..19be38f8 100644 --- a/ui/dist/assets/RealtimeApiDocs-BY_VlCDF.js +++ b/ui/dist/assets/RealtimeApiDocs-B2eRrxRi.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,Q as pe,R as ue,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as me,t as ie,a as ce,o as n,d as le,p as de}from"./index-D5-_lkfc.js";function he(o){var B,U,W,L,A,H,T,q,M,j,J,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,C,$,S,g,w,v,E,r,R;return l=new pe({props:{js:` +import{S as re,i as ae,s as be,Q as pe,R as ue,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as me,t as ie,a as ce,o as n,d as le,p as de}from"./index-B2Vo3yiW.js";function he(o){var B,U,W,L,A,H,T,q,M,j,J,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,C,$,S,g,w,v,E,r,R;return l=new pe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[1]}'); diff --git a/ui/dist/assets/UpdateApiDocs-BpylGSeY.js b/ui/dist/assets/UpdateApiDocs-20v7DmgS.js similarity index 99% rename from ui/dist/assets/UpdateApiDocs-BpylGSeY.js rename to ui/dist/assets/UpdateApiDocs-20v7DmgS.js index bb67412d..d7a45871 100644 --- a/ui/dist/assets/UpdateApiDocs-BpylGSeY.js +++ b/ui/dist/assets/UpdateApiDocs-20v7DmgS.js @@ -1,4 +1,4 @@ -import{S as Ot,i as St,s as Mt,Q as $t,C as x,T as ie,R as Tt,e as i,w as h,b as f,c as we,f as k,g as o,h as n,m as ve,x as te,U as Ie,V as bt,k as qt,W as Rt,n as Dt,t as he,a as ye,o as r,d as Ce,p as Ht,r as Te,u as Lt,y as de}from"./index-D5-_lkfc.js";import{F as Pt}from"./FieldsQueryParam-D8rkBfEn.js";function mt(d,e,t){const a=d.slice();return a[10]=e[t],a}function _t(d,e,t){const a=d.slice();return a[10]=e[t],a}function ht(d,e,t){const a=d.slice();return a[15]=e[t],a}function yt(d){let e;return{c(){e=i("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as Ot,i as St,s as Mt,Q as $t,C as x,T as ie,R as Tt,e as i,w as h,b as f,c as we,f as k,g as o,h as n,m as ve,x as te,U as Ie,V as bt,k as qt,W as Rt,n as Dt,t as he,a as ye,o as r,d as Ce,p as Ht,r as Te,u as Lt,y as de}from"./index-B2Vo3yiW.js";import{F as Pt}from"./FieldsQueryParam-B57e0MbD.js";function mt(d,e,t){const a=d.slice();return a[10]=e[t],a}function _t(d,e,t){const a=d.slice();return a[10]=e[t],a}function ht(d,e,t){const a=d.slice();return a[15]=e[t],a}function yt(d){let e;return{c(){e=i("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,a){o(t,e,a)},d(t){t&&r(e)}}}function kt(d){let e;return{c(){e=i("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",k(e,"class","txt-hint txt-sm txt-right")},m(t,a){o(t,e,a)},d(t){t&&r(e)}}}function gt(d){let e,t,a,m,p,c,u,b,O,T,M,D,S,E,q,H,I,U,$,R,L,g,w,v;function Q(_,C){var le,z,ne;return C&1&&(b=null),b==null&&(b=!!((ne=(z=(le=_[0])==null?void 0:le.fields)==null?void 0:z.find(Wt))!=null&&ne.required)),b?Bt:Ft}let W=Q(d,-1),F=W(d);return{c(){e=i("tr"),e.innerHTML='Auth specific fields',t=f(),a=i("tr"),a.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/VerificationDocs-Btf-LIzb.js b/ui/dist/assets/VerificationDocs-CpJrwVE8.js similarity index 99% rename from ui/dist/assets/VerificationDocs-Btf-LIzb.js rename to ui/dist/assets/VerificationDocs-CpJrwVE8.js index d48ba097..be4da328 100644 --- a/ui/dist/assets/VerificationDocs-Btf-LIzb.js +++ b/ui/dist/assets/VerificationDocs-CpJrwVE8.js @@ -1,4 +1,4 @@ -import{S as le,i as ne,s as ie,T as F,e as m,b as T,w as M,f as v,g as b,h as d,x as Y,U as x,V as ye,k as ee,W as Ce,n as te,t as L,a as j,o as h,r as K,u as oe,R as qe,c as G,m as J,d as Z,Q as Ve,X as fe,C as Ae,p as Ie,Y as de}from"./index-D5-_lkfc.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=T(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(g,C){b(g,e,C),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,C){t=g,C&4&&o!==(o=t[4].code+"")&&Y(f,o),C&6&&K(e,"active",t[1]===t[4].code)},d(g){g&&h(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new qe({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),G(o.$$.fragment),f=T(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),J(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&K(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){j(o.$$.fragment,r),c=!1},d(r){r&&h(e),Z(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,C,D,P,H,R,B,O,N,q,V,$=[],Q=new Map,U,I,p=[],y=new Map,A,_=F(s[2]);const X=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=X(i);Q.set(n,$[l]=pe(n,i))}let E=F(s[2]);const W=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=T(),O=m("div"),O.textContent="Responses",N=T(),q=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();U=T(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as le,i as ne,s as ie,T as F,e as m,b as T,w as M,f as v,g as b,h as d,x as Y,U as x,V as ye,k as ee,W as Ce,n as te,t as L,a as j,o as h,r as K,u as oe,R as qe,c as G,m as J,d as Z,Q as Ve,X as fe,C as Ae,p as Ie,Y as de}from"./index-B2Vo3yiW.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=T(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(g,C){b(g,e,C),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,C){t=g,C&4&&o!==(o=t[4].code+"")&&Y(f,o),C&6&&K(e,"active",t[1]===t[4].code)},d(g){g&&h(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new qe({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),G(o.$$.fragment),f=T(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),J(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&K(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){j(o.$$.fragment,r),c=!1},d(r){r&&h(e),Z(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,C,D,P,H,R,B,O,N,q,V,$=[],Q=new Map,U,I,p=[],y=new Map,A,_=F(s[2]);const X=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=X(i);Q.set(n,$[l]=pe(n,i))}let E=F(s[2]);const W=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=T(),O=m("div"),O.textContent="Responses",N=T(),q=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();U=T(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/ViewApiDocs-CKC6to1U.js b/ui/dist/assets/ViewApiDocs-C8kal0o6.js similarity index 98% rename from ui/dist/assets/ViewApiDocs-CKC6to1U.js rename to ui/dist/assets/ViewApiDocs-C8kal0o6.js index 0082c58f..e4e63d87 100644 --- a/ui/dist/assets/ViewApiDocs-CKC6to1U.js +++ b/ui/dist/assets/ViewApiDocs-C8kal0o6.js @@ -1,4 +1,4 @@ -import{S as lt,i as st,s as nt,Q as ot,R as tt,T as K,e as o,w as _,b,c as W,f as m,g as r,h as l,m as X,x as ve,U as Je,V as at,k as it,W as rt,n as dt,t as Q,a as V,o as d,d as Y,C as Ke,p as ct,r as Z,u as pt}from"./index-D5-_lkfc.js";import{F as ut}from"./FieldsQueryParam-D8rkBfEn.js";function We(a,s,n){const i=a.slice();return i[6]=s[n],i}function Xe(a,s,n){const i=a.slice();return i[6]=s[n],i}function Ye(a){let s;return{c(){s=o("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){r(n,s,i)},d(n){n&&d(s)}}}function Ze(a,s){let n,i,v;function p(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Z(n,"active",s[2]===s[6].code)},d(c){c&&d(n),i=!1,v()}}}function et(a,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),W(i.$$.fragment),v=b(),m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Z(n,"active",s[2]===s[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var je,Ne;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,se,B,ne,$,N,ye,z,P,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,S,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,be,Te,h,De,E,Pe,Ee,xe,me,Be,_e,Se,Ae,Ie,he,Me,qe,x,ke,q,ge,T,H,y=[],He=new Map,Le,L,k=[],Ue=new Map,D;F=new ot({props:{js:` +import{S as lt,i as st,s as nt,Q as ot,R as tt,T as K,e as o,w as _,b,c as W,f as m,g as r,h as l,m as X,x as ve,U as Je,V as at,k as it,W as rt,n as dt,t as Q,a as V,o as d,d as Y,C as Ke,p as ct,r as Z,u as pt}from"./index-B2Vo3yiW.js";import{F as ut}from"./FieldsQueryParam-B57e0MbD.js";function We(a,s,n){const i=a.slice();return i[6]=s[n],i}function Xe(a,s,n){const i=a.slice();return i[6]=s[n],i}function Ye(a){let s;return{c(){s=o("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){r(n,s,i)},d(n){n&&d(s)}}}function Ze(a,s){let n,i,v;function p(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Z(n,"active",s[2]===s[6].code)},d(c){c&&d(n),i=!1,v()}}}function et(a,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),W(i.$$.fragment),v=b(),m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Z(n,"active",s[2]===s[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var je,Ne;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,se,B,ne,$,N,ye,z,P,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,S,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,be,Te,h,De,E,Pe,Ee,xe,me,Be,_e,Se,Ae,Ie,he,Me,qe,x,ke,q,ge,T,H,y=[],He=new Map,Le,L,k=[],Ue=new Map,D;F=new ot({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-D5-_lkfc.js b/ui/dist/assets/index-B2Vo3yiW.js similarity index 70% rename from ui/dist/assets/index-D5-_lkfc.js rename to ui/dist/assets/index-B2Vo3yiW.js index f5529ec9..d114403a 100644 --- a/ui/dist/assets/index-D5-_lkfc.js +++ b/ui/dist/assets/index-B2Vo3yiW.js @@ -1,126 +1,126 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-B-j6H3tq.js","./index-B5ReTu-C.js","./ListApiDocs-BMqVRxIN.js","./FieldsQueryParam-D8rkBfEn.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-CKC6to1U.js","./CreateApiDocs-D8M_3QcG.js","./UpdateApiDocs-BpylGSeY.js","./AuthMethodsDocs-3arq40Jt.js","./AuthWithPasswordDocs-TxLWhk-X.js","./AuthWithOAuth2Docs-QI0g6yCp.js","./AuthRefreshDocs-Dl355FHl.js","./CodeEditor-DKQxSBo9.js"])))=>i.map(i=>d[i]); -var bv=Object.defineProperty;var kv=(n,e,t)=>e in n?bv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ct=(n,e,t)=>kv(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function te(){}const so=n=>n;function ze(n,e){for(const t in e)n[t]=e[t];return n}function vv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ib(n){return n()}function df(){return Object.create(null)}function Ie(n){n.forEach(Ib)}function Nt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let To;function kn(n,e){return n===e?!0:(To||(To=document.createElement("a")),To.href=e,n===To.href)}function yv(n){return Object.keys(n).length===0}function uu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Lb(n){let e;return uu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(uu(e,t))}function It(n,e,t,i){if(n){const l=Ab(n,e,t,i);return n[0](l)}}function Ab(n,e,t,i){return n[1]&&i?ze(t.ctx.slice(),n[1](i(e))):t.ctx}function Lt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),fu=Pb?n=>requestAnimationFrame(n):te;const Zl=new Set;function Nb(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&fu(Nb)}function Er(n){let e;return Zl.size===0&&fu(Nb),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Rb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function wv(n){const e=b("style");return e.textContent="/* empty */",Sv(Rb(n),e),e.sheet}function Sv(n,e){return w(n.head||n,e),e.sheet}function y(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function pt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function et(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 Tv=["width","height"];function xn(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&&Tv.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function $v(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 gt(n){return n===""?null:+n}function Cv(n){return Array.from(n.childNodes)}function re(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function Ov(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function Fb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function jt(n,e){return new n(e)}const cr=new Map;let dr=0;function Ev(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Mv(n,e){const t={stylesheet:wv(e),rules:{}};return cr.set(n,t),t}function Us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-SHg3tCmR.js","./index-B5ReTu-C.js","./ListApiDocs-DE6L15a5.js","./FieldsQueryParam-B57e0MbD.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-C8kal0o6.js","./CreateApiDocs-BNp07xea.js","./UpdateApiDocs-20v7DmgS.js","./AuthMethodsDocs-DHqR-_Zg.js","./AuthWithPasswordDocs-jAqVZfEu.js","./AuthWithOAuth2Docs-DBDNpjcn.js","./AuthRefreshDocs-Bw_1qlVd.js","./CodeEditor-pEpUQJ5v.js"])))=>i.map(i=>d[i]); +var vv=Object.defineProperty;var yv=(n,e,t)=>e in n?vv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ct=(n,e,t)=>yv(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function te(){}const so=n=>n;function ze(n,e){for(const t in e)n[t]=e[t];return n}function wv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ab(n){return n()}function df(){return Object.create(null)}function Ie(n){n.forEach(Ab)}function Nt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let To;function kn(n,e){return n===e?!0:(To||(To=document.createElement("a")),To.href=e,n===To.href)}function Sv(n){return Object.keys(n).length===0}function uu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Pb(n){let e;return uu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(uu(e,t))}function It(n,e,t,i){if(n){const l=Nb(n,e,t,i);return n[0](l)}}function Nb(n,e,t,i){return n[1]&&i?ze(t.ctx.slice(),n[1](i(e))):t.ctx}function Lt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),fu=Rb?n=>requestAnimationFrame(n):te;const Zl=new Set;function Fb(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&fu(Fb)}function Er(n){let e;return Zl.size===0&&fu(Fb),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function qb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Tv(n){const e=b("style");return e.textContent="/* empty */",$v(qb(n),e),e.sheet}function $v(n,e){return w(n.head||n,e),e.sheet}function y(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function et(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 Cv=["width","height"];function xn(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&&Cv.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function Ov(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 gt(n){return n===""?null:+n}function Ev(n){return Array.from(n.childNodes)}function re(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function Mv(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function Hb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function jt(n,e){return new n(e)}const cr=new Map;let dr=0;function Dv(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Iv(n,e){const t={stylesheet:Tv(e),rules:{}};return cr.set(n,t),t}function Us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ `;for(let g=0;g<=1;g+=a){const k=e+(t-e)*s(g);u+=g*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${Ev(f)}_${r}`,d=Rb(n),{stylesheet:m,rules:h}=cr.get(d)||Mv(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,dr+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),dr-=l,dr||Dv())}function Dv(){fu(()=>{dr||(cr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),cr.clear())})}function Iv(n,e,t,i){if(!e)return te;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return te;const{delay:s=0,duration:o=300,easing:r=so,start:a=Or()+s,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=Us(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&Vs(n,h),d=!1}return Er(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),g()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),_(),f(0,1),g}function Lv(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,qb(n,l)}}function qb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function Fi(n){Bs=n}function oo(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function Zt(n){oo().$$.on_mount.push(n)}function Av(n){oo().$$.after_update.push(n)}function ro(n){oo().$$.on_destroy.push(n)}function bt(){const n=oo();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Fb(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ne(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Yl=[],ie=[];let Gl=[];const Pa=[],Hb=Promise.resolve();let Na=!1;function jb(){Na||(Na=!0,Hb.then(cu))}function un(){return jb(),Hb}function tt(n){Gl.push(n)}function Te(n){Pa.push(n)}const Zr=new Set;let jl=0;function cu(){if(jl!==0)return;const n=Bs;do{try{for(;jln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let bs;function du(){return bs||(bs=Promise.resolve(),bs.then(()=>{bs=null})),bs}function Ol(n,e,t){n.dispatchEvent(Fb(`${e?"intro":"outro"}${t}`))}const Qo=new Set;let Si;function ae(){Si={r:0,c:[],p:Si}}function ue(){Si.r||Ie(Si.c),Si=Si.p}function E(n,e){n&&n.i&&(Qo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Qo.has(n))return;Qo.add(n),Si.c.push(()=>{Qo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pu={duration:0};function zb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=so,tick:_=te,css:g}=l||pu;g&&(o=Us(n,0,1,m,d,h,g,a++)),_(0,1);const k=Or()+d,S=k+m;r&&r.abort(),s=!0,tt(()=>Ol(n,!0,"start")),r=Er($=>{if(s){if($>=S)return _(1,0),Ol(n,!0,"end"),u(),s=!1;if($>=k){const T=h(($-k)/m);_(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),Nt(l)?(l=l(i),du().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function mu(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=Si;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=so,tick:m=te,css:h}=l||pu;h&&(o=Us(n,1,0,c,f,d,h));const _=Or()+f,g=_+c;tt(()=>Ol(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Er(k=>{if(s){if(k>=g)return m(0,1),Ol(n,!1,"end"),--r.r||Ie(r.c),!1;if(k>=_){const S=d((k-_)/c);m(1-S,S)}}return s})}return Nt(l)?du().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&Vs(n,o),s=!1)}}}function je(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:k=so,tick:S=te,css:$}=s||pu,T={start:Or()+_,b:h};h||(T.group=Si,Si.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Us(n,o,h,g,_,k,$)),h&&S(0,1),r=d(T,g),tt(()=>Ol(n,h,"start")),Er(O=>{if(a&&O>a.start&&(r=d(a,g),a=null,Ol(n,r.b,"start"),$&&(c(),u=Us(n,o,r.b,r.duration,0,k,s.css))),r){if(O>=r.end)S(o=r.b,1-o),Ol(n,r.b,"end"),a||(r.b?c():--r.group.r||Ie(r.group.c)),r=null;else if(O>=r.start){const M=O-r.start;o=r.a+r.d*k(M/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Nt(s)?du().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function mf(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(ae(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ue())}):e.block.d(1),u.c(),E(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&cu()}if(vv(n)){const l=oo();if(n.then(s=>{Fi(l),i(e.then,1,e.value,s),Fi(null)},s=>{if(Fi(l),i(e.catch,2,e.error,s),Fi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function Rv(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function pi(n,e){n.d(1),e.delete(n.key)}function zt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Fv(n,e){n.f(),zt(n,e)}function yt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],k=new Map,S=new Map,$=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?$.push(()=>A.p(L,e)):(A=u(I,L),A.c()),k.set(I,g[h]=A),I in _&&S.set(I,Math.abs(h-_[I]))}const T=new Set,O=new Set;function M(L){E(L,1),L.m(r,f),o.set(L.key,L),f=L.first,m--}for(;d&&m;){const L=g[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):k.has(P)?!o.has(A)||T.has(A)?M(L):O.has(P)?d--:S.get(A)>S.get(P)?(O.add(A),M(L)):(T.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];k.has(L.key)||a(L,o)}for(;m;)M(g[m-1]);return Ie($),g}function wt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Rt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function j(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),tt(()=>{const s=n.$$.on_mount.map(Ib).filter(Nt);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ie(s),n.$$.on_mount=[]}),l.forEach(tt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Nv(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function qv(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),jb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&qv(n,c)),d}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Cv(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&E(n.$$.fragment),q(n,e.target,e.anchor),cu()}Fi(a)}class we{constructor(){ct(this,"$$");ct(this,"$$set")}$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!Nt(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!yv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Hv="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Hv);class Pl extends Error{}class jv extends Pl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class zv extends Pl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Uv extends Pl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Pl{}class Ub extends Pl{constructor(e){super(`Invalid unit ${e}`)}}class hn extends Pl{}class Wi extends Pl{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ci="short",Bn="long",pr={year:Ue,month:Ue,day:Ue},Vb={year:Ue,month:ci,day:Ue},Vv={year:Ue,month:ci,day:Ue,weekday:ci},Bb={year:Ue,month:Bn,day:Ue},Wb={year:Ue,month:Bn,day:Ue,weekday:Bn},Yb={hour:Ue,minute:Ue},Kb={hour:Ue,minute:Ue,second:Ue},Jb={hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},Zb={hour:Ue,minute:Ue,second:Ue,timeZoneName:Bn},Gb={hour:Ue,minute:Ue,hourCycle:"h23"},Xb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},Qb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ci},xb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Bn},e0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},t0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},n0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue},i0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue,second:Ue},Bv={year:Ue,month:ci,day:Ue,weekday:ci,hour:Ue,minute:Ue},l0={year:Ue,month:Bn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ci},s0={year:Ue,month:Bn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},o0={year:Ue,month:Bn,day:Ue,weekday:Bn,hour:Ue,minute:Ue,timeZoneName:Bn},r0={year:Ue,month:Bn,day:Ue,weekday:Bn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Bn};class ao{get type(){throw new Wi}get name(){throw new Wi}get ianaName(){return this.name}get isUniversal(){throw new Wi}offsetName(e,t){throw new Wi}formatOffset(e,t){throw new Wi}offset(e){throw new Wi}equals(e){throw new Wi}get isValid(){throw new Wi}}let Gr=null;class Mr extends ao{static get instance(){return Gr===null&&(Gr=new Mr),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return _0(e,t,i)}formatOffset(e,t){return Ds(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let xo={};function Wv(n){return xo[n]||(xo[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"})),xo[n]}const Yv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function Jv(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let hf={};function Zv(n,e={}){const t=JSON.stringify([n,e]);let i=hf[t];return i||(i=new Intl.ListFormat(n,e),hf[t]=i),i}let Ra={};function Fa(n,e={}){const t=JSON.stringify([n,e]);let i=Ra[t];return i||(i=new Intl.DateTimeFormat(n,e),Ra[t]=i),i}let qa={};function Gv(n,e={}){const t=JSON.stringify([n,e]);let i=qa[t];return i||(i=new Intl.NumberFormat(n,e),qa[t]=i),i}let Ha={};function Xv(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Ha[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Ha[l]=s),s}let $s=null;function Qv(){return $s||($s=new Intl.DateTimeFormat().resolvedOptions().locale,$s)}let _f={};function xv(n){let e=_f[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,_f[n]=e}return e}function ey(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Fa(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Fa(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function ty(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function ny(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function iy(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function Co(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function ly(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 sy{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Gv(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):ku(e,3);return Qt(t,this.padTo)}}}class oy{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Hi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Fa(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ry{constructor(e,t,i){this.opts={style:"long",...i},!t&&m0()&&(this.rtf=Xv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Dy(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ay={firstDay:1,minimalDays:4,weekend:[6,7]};class Et{static fromOpts(e){return Et.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Wt.defaultLocale,r=o||(s?"en-US":Qv()),a=t||Wt.defaultNumberingSystem,u=i||Wt.defaultOutputCalendar,f=ja(l)||Wt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){$s=null,Ra={},qa={},Ha={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return Et.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=ey(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=ty(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=ly(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:Et.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ja(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Co(this,e,k0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=ny(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Co(this,e,w0,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=iy(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Co(this,void 0,()=>S0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Co(this,e,T0,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Xe.utc(-40,1,1),Xe.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new sy(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new oy(e,this.intl,t)}relFormatter(e={}){return new ry(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Zv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:h0()?xv(this.locale):ay}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Xr=null;class Cn extends ao{static get utcInstance(){return Xr===null&&(Xr=new Cn(0)),Xr}static instance(e){return e===0?Cn.utcInstance:new Cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Cn(Lr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ds(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ds(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Ds(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 uy extends ao{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 Gi(n,e){if(it(n)||n===null)return e;if(n instanceof ao)return n;if(hy(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?Cn.utcInstance:Cn.parseSpecifier(t)||Hi.create(n)}else return el(n)?Cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new uy(n)}const hu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},gf={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]},fy=hu.hanidec.replace(/[\[|\]]/g,"").split("");function cy(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function dy(){Kl={}}function si({numberingSystem:n},e=""){const t=n||"latn";return Kl[t]||(Kl[t]={}),Kl[t][e]||(Kl[t][e]=new RegExp(`${hu[t]}${e}`)),Kl[t][e]}let bf=()=>Date.now(),kf="system",vf=null,yf=null,wf=null,Sf=60,Tf,$f=null;class Wt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){kf=e}static get defaultZone(){return Gi(kf,Mr.instance)}static get defaultLocale(){return vf}static set defaultLocale(e){vf=e}static get defaultNumberingSystem(){return yf}static set defaultNumberingSystem(e){yf=e}static get defaultOutputCalendar(){return wf}static set defaultOutputCalendar(e){wf=e}static get defaultWeekSettings(){return $f}static set defaultWeekSettings(e){$f=ja(e)}static get twoDigitCutoffYear(){return Sf}static set twoDigitCutoffYear(e){Sf=e%100}static get throwOnInvalid(){return Tf}static set throwOnInvalid(e){Tf=e}static resetCaches(){Et.resetCache(),Hi.resetCache(),Xe.resetCache(),dy()}}class ri{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const a0=[0,31,59,90,120,151,181,212,243,273,304,334],u0=[0,31,60,91,121,152,182,213,244,274,305,335];function Xn(n,e){return new ri("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function _u(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function f0(n,e,t){return t+(uo(n)?u0:a0)[e-1]}function c0(n,e){const t=uo(n)?u0:a0,i=t.findIndex(s=>sWs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Ar(n)}}function Cf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=gu(_u(i,1,e),t),r=Xl(i);let a=l*7+s-o-7+e,u;a<1?(u=i-1,a+=Xl(u)):a>r?(u=i+1,a-=Xl(i)):u=i;const{month:f,day:c}=c0(u,a);return{year:u,month:f,day:c,...Ar(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=f0(e,t,i);return{year:e,ordinal:l,...Ar(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=c0(e,t);return{year:e,month:i,day:l,...Ar(n)}}function Ef(n,e){if(!it(n.localWeekday)||!it(n.localWeekNumber)||!it(n.localWeekYear)){if(!it(n.weekday)||!it(n.weekNumber)||!it(n.weekYear))throw new Jl("Cannot mix locale-based week fields with ISO-based week fields");return it(n.localWeekday)||(n.weekday=n.localWeekday),it(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),it(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function py(n,e=4,t=1){const i=Dr(n.weekYear),l=Qn(n.weekNumber,1,Ws(n.weekYear,e,t)),s=Qn(n.weekday,1,7);return i?l?s?!1:Xn("weekday",n.weekday):Xn("week",n.weekNumber):Xn("weekYear",n.weekYear)}function my(n){const e=Dr(n.year),t=Qn(n.ordinal,1,Xl(n.year));return e?t?!1:Xn("ordinal",n.ordinal):Xn("year",n.year)}function d0(n){const e=Dr(n.year),t=Qn(n.month,1,12),i=Qn(n.day,1,hr(n.year,n.month));return e?t?i?!1:Xn("day",n.day):Xn("month",n.month):Xn("year",n.year)}function p0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Qn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Qn(t,0,59),r=Qn(i,0,59),a=Qn(l,0,999);return s?o?r?a?!1:Xn("millisecond",l):Xn("second",i):Xn("minute",t):Xn("hour",e)}function it(n){return typeof n>"u"}function el(n){return typeof n=="number"}function Dr(n){return typeof n=="number"&&n%1===0}function hy(n){return typeof n=="string"}function _y(n){return Object.prototype.toString.call(n)==="[object Date]"}function m0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function h0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function gy(n){return Array.isArray(n)?n:[n]}function Mf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function by(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ja(n){if(n==null)return null;if(typeof n!="object")throw new hn("Week settings must be an object");if(!Qn(n.firstDay,1,7)||!Qn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Qn(e,1,7)))throw new hn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Qn(n,e,t){return Dr(n)&&n>=e&&n<=t}function ky(n,e){return n-e*Math.floor(n/e)}function Qt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ji(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function hl(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function bu(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ku(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function uo(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return uo(n)?366:365}function hr(n,e){const t=ky(e-1,12)+1,i=n+(e-t)/12;return t===2?uo(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ir(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Df(n,e,t){return-gu(_u(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=Df(n,e,t),l=Df(n+1,e,t);return(Xl(n)-i+l)/7}function za(n){return n>99?n:n>Wt.twoDigitCutoffYear?1900+n:2e3+n}function _0(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Lr(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function g0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new hn(`Invalid unit value ${n}`);return e}function _r(n,e){const t={};for(const i in n)if(ns(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=g0(l)}return t}function Ds(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Qt(t,2)}:${Qt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Qt(t,2)}${Qt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ar(n){return by(n,["hour","minute","second","millisecond"])}const vy=["January","February","March","April","May","June","July","August","September","October","November","December"],b0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yy=["J","F","M","A","M","J","J","A","S","O","N","D"];function k0(n){switch(n){case"narrow":return[...yy];case"short":return[...b0];case"long":return[...vy];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 v0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],y0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],wy=["M","T","W","T","F","S","S"];function w0(n){switch(n){case"narrow":return[...wy];case"short":return[...y0];case"long":return[...v0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const S0=["AM","PM"],Sy=["Before Christ","Anno Domini"],Ty=["BC","AD"],$y=["B","A"];function T0(n){switch(n){case"narrow":return[...$y];case"short":return[...Ty];case"long":return[...Sy];default:return null}}function Cy(n){return S0[n.hour<12?0:1]}function Oy(n,e){return w0(e)[n.weekday-1]}function Ey(n,e){return k0(e)[n.month-1]}function My(n,e){return T0(e)[n.year<0?0:1]}function Dy(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function If(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Iy={D:pr,DD:Vb,DDD:Bb,DDDD:Wb,t:Yb,tt:Kb,ttt:Jb,tttt:Zb,T:Gb,TT:Xb,TTT:Qb,TTTT:xb,f:e0,ff:n0,fff:l0,ffff:o0,F:t0,FF:i0,FFF:s0,FFFF:r0};class gn{static create(e,t={}){return new gn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Iy[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Qt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Cy(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Ey(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Oy(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=gn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?My(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return 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 l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return If(gn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=gn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return If(s,l(r))}}const $0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function os(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function rs(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function as(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function C0(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&f)?-m:m;return[{years:d(hl(t)),months:d(hl(i)),weeks:d(hl(l)),days:d(hl(s)),hours:d(hl(o)),minutes:d(hl(r)),seconds:d(hl(a),a==="-0"),milliseconds:d(bu(u),c)}]}const By={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 wu(n,e,t,i,l,s,o){const r={year:e.length===2?za(Ji(e)):Ji(e),month:b0.indexOf(t)+1,day:Ji(i),hour:Ji(l),minute:Ji(s)};return o&&(r.second=Ji(o)),n&&(r.weekday=n.length>3?v0.indexOf(n)+1:y0.indexOf(n)+1),r}const Wy=/^(?:(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 Yy(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=wu(e,l,i,t,s,o,r);let m;return a?m=By[a]:u?m=0:m=Lr(f,c),[d,new Cn(m)]}function Ky(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Jy=/^(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$/,Zy=/^(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$/,Gy=/^(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 Lf(n){const[,e,t,i,l,s,o,r]=n;return[wu(e,l,i,t,s,o,r),Cn.utcInstance]}function Xy(n){const[,e,t,i,l,s,o,r]=n;return[wu(e,r,t,i,l,s,o),Cn.utcInstance]}const Qy=os(Ay,yu),xy=os(Py,yu),e2=os(Ny,yu),t2=os(E0),D0=rs(jy,us,fo,co),n2=rs(Ry,us,fo,co),i2=rs(Fy,us,fo,co),l2=rs(us,fo,co);function s2(n){return as(n,[Qy,D0],[xy,n2],[e2,i2],[t2,l2])}function o2(n){return as(Ky(n),[Wy,Yy])}function r2(n){return as(n,[Jy,Lf],[Zy,Lf],[Gy,Xy])}function a2(n){return as(n,[Uy,Vy])}const u2=rs(us);function f2(n){return as(n,[zy,u2])}const c2=os(qy,Hy),d2=os(M0),p2=rs(us,fo,co);function m2(n){return as(n,[c2,D0],[d2,p2])}const Af="Invalid Duration",I0={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}},h2={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},...I0},Kn=146097/400,zl=146097/4800,_2={years:{quarters:4,months:12,weeks:Kn/7,days:Kn,hours:Kn*24,minutes:Kn*24*60,seconds:Kn*24*60*60,milliseconds:Kn*24*60*60*1e3},quarters:{months:3,weeks:Kn/28,days:Kn/4,hours:Kn*24/4,minutes:Kn*24*60/4,seconds:Kn*24*60*60/4,milliseconds:Kn*24*60*60*1e3/4},months:{weeks:zl/7,days:zl,hours:zl*24,minutes:zl*24*60,seconds:zl*24*60*60,milliseconds:zl*24*60*60*1e3},...I0},Tl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],g2=Tl.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function L0(n,e){let t=e.milliseconds??0;for(const i of g2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=L0(n,e)<0?-1:1;Tl.reduceRight((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Tl.reduce((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function b2(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class St{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?_2:h2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Et.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return St.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new hn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new St({values:_r(e,St.normalizeUnit),loc:Et.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(el(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new hn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=a2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=f2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the Duration is invalid");const i=e instanceof ri?e:new ri(e,t);if(Wt.throwOnInvalid)throw new Uv(i);return new St({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 Ub(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?gn.create(this.loc,i).formatDurationFromString(this,e):Af}toHuman(e={}){if(!this.isValid)return Af;const t=Tl.map(i=>{const l=this.values[i];return it(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ku(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Xe.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?L0(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e),i={};for(const l of Tl)(ns(t.values,l)||ns(this.values,l))&&(i[l]=t.get(l)+this.get(l));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=St.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]=g0(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,..._r(e,St.normalizeUnit)};return Yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return Yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pf(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=b2(this.normalize().shiftToAll().toObject());return Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>St.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Tl)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;el(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else el(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Pf(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Tl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ul="Invalid Interval";function k2(n,e){return!n||!n.isValid?Bt.invalid("missing or invalid start"):!e||!e.isValid?Bt.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?Bt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ks).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Bt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=St.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Bt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Bt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Bt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,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&&l.push(Bt.fromDateTimes(t,a.time)),t=null);return Bt.merge(l)}difference(...e){return Bt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ul}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=pr,t={}){return this.isValid?gn.create(this.s.loc.clone(t),e).formatInterval(this):Ul}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ul}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ul}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ul}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ul}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):St.invalid(this.invalidReason)}mapEndpoints(e){return Bt.fromDateTimes(e(this.s),e(this.e))}}class Oo{static hasDST(e=Wt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Hi.isValidZone(e)}static normalizeZone(e){return Gi(e,Wt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Et.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Et.create(t,null,"gregory").eras(e)}static features(){return{relative:m0(),localeWeek:h0()}}}function Nf(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(St.fromMillis(i).as("days"))}function v2(n,e,t){const i=[["years",(a,u)=>u.year-a.year],["quarters",(a,u)=>u.quarter-a.quarter+(u.year-a.year)*4],["months",(a,u)=>u.month-a.month+(u.year-a.year)*12],["weeks",(a,u)=>{const f=Nf(a,u);return(f-f%7)/7}],["days",Nf]],l={},s=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,l[a]=u(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function y2(n,e,t,i){let[l,s,o,r]=v2(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?St.fromMillis(a,i).shiftTo(...u).plus(f):f}const w2="missing Intl.DateTimeFormat.formatToParts support";function Tt(n,e=t=>t){return{regex:n,deser:([t])=>e(cy(t))}}const S2=" ",A0=`[ ${S2}]`,P0=new RegExp(A0,"g");function T2(n){return n.replace(/\./g,"\\.?").replace(P0,A0)}function Rf(n){return n.replace(/\./g,"").replace(P0," ").toLowerCase()}function oi(n,e){return n===null?null:{regex:RegExp(n.map(T2).join("|")),deser:([t])=>n.findIndex(i=>Rf(t)===Rf(i))+e}}function Ff(n,e){return{regex:n,deser:([,t,i])=>Lr(t,i),groups:e}}function Eo(n){return{regex:n,deser:([e])=>e}}function $2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function C2(n,e){const t=si(e),i=si(e,"{2}"),l=si(e,"{3}"),s=si(e,"{4}"),o=si(e,"{6}"),r=si(e,"{1,2}"),a=si(e,"{1,3}"),u=si(e,"{1,6}"),f=si(e,"{1,9}"),c=si(e,"{2,4}"),d=si(e,"{4,6}"),m=g=>({regex:RegExp($2(g.val)),deser:([k])=>k,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return oi(e.eras("short"),0);case"GG":return oi(e.eras("long"),0);case"y":return Tt(u);case"yy":return Tt(c,za);case"yyyy":return Tt(s);case"yyyyy":return Tt(d);case"yyyyyy":return Tt(o);case"M":return Tt(r);case"MM":return Tt(i);case"MMM":return oi(e.months("short",!0),1);case"MMMM":return oi(e.months("long",!0),1);case"L":return Tt(r);case"LL":return Tt(i);case"LLL":return oi(e.months("short",!1),1);case"LLLL":return oi(e.months("long",!1),1);case"d":return Tt(r);case"dd":return Tt(i);case"o":return Tt(a);case"ooo":return Tt(l);case"HH":return Tt(i);case"H":return Tt(r);case"hh":return Tt(i);case"h":return Tt(r);case"mm":return Tt(i);case"m":return Tt(r);case"q":return Tt(r);case"qq":return Tt(i);case"s":return Tt(r);case"ss":return Tt(i);case"S":return Tt(a);case"SSS":return Tt(l);case"u":return Eo(f);case"uu":return Eo(r);case"uuu":return Tt(t);case"a":return oi(e.meridiems(),0);case"kkkk":return Tt(s);case"kk":return Tt(c,za);case"W":return Tt(r);case"WW":return Tt(i);case"E":case"c":return Tt(t);case"EEE":return oi(e.weekdays("short",!1),1);case"EEEE":return oi(e.weekdays("long",!1),1);case"ccc":return oi(e.weekdays("short",!0),1);case"cccc":return oi(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ff(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ff(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Eo(/[a-z_+-/]{1,256}?/i);case" ":return Eo(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:w2};return _.token=n,_}const O2={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function E2(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=O2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function M2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function D2(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(ns(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function I2(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return it(n.z)||(t=Hi.create(n.z)),it(n.Z)||(t||(t=new Cn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(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),it(n.u)||(n.S=bu(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let xr=null;function L2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function A2(n,e){if(n.literal)return n;const t=gn.macroTokenToFormatOpts(n.val),i=q0(t,e);return i==null||i.includes(void 0)?n:i}function N0(n,e){return Array.prototype.concat(...n.map(t=>A2(t,e)))}class R0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=N0(gn.parseFormat(t),e),this.units=this.tokens.map(i=>C2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=M2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=D2(e,this.regex,this.handlers),[l,s,o]=i?I2(i):[null,null,void 0];if(ns(i,"a")&&ns(i,"H"))throw new Jl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function F0(n,e,t){return new R0(n,t).explainFromTokens(e)}function P2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=F0(n,e,t);return[i,l,s,o]}function q0(n,e){if(!n)return null;const i=gn.create(e,n).dtFormatter(L2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>E2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function Cs(n){return new ri("unsupported zone",`the zone "${n.name}" is not supported`)}function ta(n){return n.weekData===null&&(n.weekData=mr(n.c)),n.weekData}function na(n){return n.localWeekData===null&&(n.localWeekData=mr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function _l(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function H0(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Mo(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 er(n,e,t){return H0(Ir(n),e,t)}function Hf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,hr(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=St.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=Ir(s);let[a,u]=H0(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return Xe.invalid(new ri("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Do(n,e,t=!0){return n.isValid?gn.create(Et.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ia(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Qt(n.c.year,t?6:4),e?(i+="-",i+=Qt(n.c.month),i+="-",i+=Qt(n.c.day)):(i+=Qt(n.c.month),i+=Qt(n.c.day)),i}function jf(n,e,t,i,l,s){let o=Qt(n.c.hour);return e?(o+=":",o+=Qt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Qt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Qt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Qt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Qt(Math.trunc(-n.o/60)),o+=":",o+=Qt(Math.trunc(-n.o%60))):(o+="+",o+=Qt(Math.trunc(n.o/60)),o+=":",o+=Qt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const j0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},N2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},R2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},z0=["year","month","day","hour","minute","second","millisecond"],F2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],q2=["year","ordinal","hour","minute","second","millisecond"];function H2(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 Ub(n);return e}function zf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return H2(n)}}function j2(n){return nr[n]||(tr===void 0&&(tr=Wt.now()),nr[n]=n.offset(tr)),nr[n]}function Uf(n,e){const t=Gi(e.zone,Wt.defaultZone);if(!t.isValid)return Xe.invalid(Cs(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Wt.now();else{for(const a of z0)it(n[a])&&(n[a]=j0[a]);const o=d0(n)||p0(n);if(o)return Xe.invalid(o);const r=j2(t);[l,s]=er(n,r,t)}return new Xe({ts:l,zone:t,loc:i,o:s})}function Vf(n,e,t){const i=it(t.round)?!0:t.round,l=(o,r)=>(o=ku(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Bf(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]}let tr,nr={};class Xe{constructor(e){const t=e.zone||Wt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ri("invalid input"):null)||(t.isValid?null:Cs(t));this.ts=it(e.ts)?Wt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=el(e.o)&&!e.old?e.o:t.offset(this.ts);l=Mo(this.ts,r),i=Number.isNaN(l.year)?new ri("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||Et.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return e.zone=Cn.utcInstance,Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=_y(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Gi(t.zone,Wt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid(Cs(l))}static fromMillis(e,t={}){if(el(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Gi(t.zone,Wt.defaultZone),loc:Et.fromObject(t)});throw new hn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(el(e))return new Xe({ts:e*1e3,zone:Gi(t.zone,Wt.defaultZone),loc:Et.fromObject(t)});throw new hn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Gi(t.zone,Wt.defaultZone);if(!i.isValid)return Xe.invalid(Cs(i));const l=Et.fromObject(t),s=_r(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Ef(s,l),a=Wt.now(),u=it(t.specificOffset)?i.offset(a):t.specificOffset,f=!it(s.ordinal),c=!it(s.year),d=!it(s.month)||!it(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||f)&&h)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Jl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,k,S=Mo(a,u);_?(g=F2,k=N2,S=mr(S,o,r)):f?(g=q2,k=R2,S=Qr(S)):(g=z0,k=j0);let $=!1;for(const P of g){const N=s[P];it(N)?$?s[P]=k[P]:s[P]=S[P]:$=!0}const T=_?py(s,o,r):f?my(s):d0(s),O=T||p0(s);if(O)return Xe.invalid(O);const M=_?Cf(s,o,r):f?Of(s):s,[L,I]=er(M,u,i),A=new Xe({ts:L,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,l]=s2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=o2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=r2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new hn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=P2(o,e,t);return f?Xe.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=m2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the DateTime is invalid");const i=e instanceof ri?e:new ri(e,t);if(Wt.throwOnInvalid)throw new jv(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=q0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return N0(gn.parseFormat(e),Et.fromObject(t)).map(l=>l.val).join("")}static resetCache(){tr=void 0,nr={}}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?ta(this).weekYear:NaN}get weekNumber(){return this.isValid?ta(this).weekNumber:NaN}get weekday(){return this.isValid?ta(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?na(this).weekday:NaN}get localWeekNumber(){return this.isValid?na(this).weekNumber:NaN}get localWeekYear(){return this.isValid?na(this).weekYear:NaN}get ordinal(){return this.isValid?Qr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Oo.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Oo.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Oo.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Oo.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Ir(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Mo(a,o),c=Mo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[_l(this,{ts:a}),_l(this,{ts:u})]:[this]}get isInLeapYear(){return uo(this.year)}get daysInMonth(){return hr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(Cn.instance(e),t)}toLocal(){return this.setZone(Wt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Gi(e,Wt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=er(o,s,e)}return _l(this,{ts:l,zone:e})}else return Xe.invalid(Cs(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return _l(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_r(e,zf),{minDaysInFirstWeek:i,startOfWeek:l}=Ef(t,this.loc),s=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),o=!it(t.ordinal),r=!it(t.year),a=!it(t.month)||!it(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Jl("Can't mix ordinal dates with month/day");let c;s?c=Cf({...mr(this.c,i,l),...t},i,l):it(t.ordinal)?(c={...this.toObject(),...t},it(t.day)&&(c.day=Math.min(hr(c.year,c.month),c.day))):c=Of({...Qr(this.c),...t});const[d,m]=er(c,this.o,this.zone);return _l(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return _l(this,Hf(this,t))}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e).negate();return _l(this,Hf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=St.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,u=y2(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Bt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new hn("max requires all arguments be DateTimes");return Mf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return F0(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=Et.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new R0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new hn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new hn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Vl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return pr}static get DATE_MED(){return Vb}static get DATE_MED_WITH_WEEKDAY(){return Vv}static get DATE_FULL(){return Bb}static get DATE_HUGE(){return Wb}static get TIME_SIMPLE(){return Yb}static get TIME_WITH_SECONDS(){return Kb}static get TIME_WITH_SHORT_OFFSET(){return Jb}static get TIME_WITH_LONG_OFFSET(){return Zb}static get TIME_24_SIMPLE(){return Gb}static get TIME_24_WITH_SECONDS(){return Xb}static get TIME_24_WITH_SHORT_OFFSET(){return Qb}static get TIME_24_WITH_LONG_OFFSET(){return xb}static get DATETIME_SHORT(){return e0}static get DATETIME_SHORT_WITH_SECONDS(){return t0}static get DATETIME_MED(){return n0}static get DATETIME_MED_WITH_SECONDS(){return i0}static get DATETIME_MED_WITH_WEEKDAY(){return Bv}static get DATETIME_FULL(){return l0}static get DATETIME_FULL_WITH_SECONDS(){return s0}static get DATETIME_HUGE(){return o0}static get DATETIME_HUGE_WITH_SECONDS(){return r0}}function ks(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&el(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new hn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const z2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],U2=[".mp4",".avi",".mov",".3gp",".wmv"],V2=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],B2=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],U0=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class 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 zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||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==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return V.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0: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 mergeUnique(e,t){for(let i of t)V.pushUnique(e,i);return e}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=V.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!V.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!V.isObject(s)&&!Array.isArray(s)||!V.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!V.isObject(l)&&!Array.isArray(l)||!V.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):V.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||V.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||V.isObject(e)&&Object.keys(e).length>0)&&V.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return V.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),V.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",V.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Xe.fromFormat(e,i,{zone:"UTC"})}return typeof e=="number"?Xe.fromMillis(e):Xe.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.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);V.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!z2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!U2.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!V2.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!B2.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(l=>{let s=new FileReader;s.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),l(a.toDataURL(e.type))},r.src=o.target.result},s.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 l of i)V.addValueToFormData(e,t,l);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){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},V.dummyCollectionSchemaData(e))}static dummyCollectionSchemaData(e,t=!1){var s;const i=(e==null?void 0:e.fields)||[],l={};for(const o of i){if(o.hidden||t&&o.primaryKey&&o.autogeneratePattern)continue;let r=null;if(o.type==="number")r=123;else if(o.type==="date"||o.type==="autodate")r="2022-01-01 10:00:00.123Z";else if(o.type=="bool")r=!0;else if(o.type=="email")r="test@example.com";else if(o.type=="url")r="https://example.com";else if(o.type=="json")r="JSON";else if(o.type=="file"){if(t)continue;r="filename.jpg",o.maxSelect!=1&&(r=[r])}else o.type=="select"?(r=(s=o==null?void 0:o.values)==null?void 0:s[0],(o==null?void 0:o.maxSelect)!=1&&(r=[r])):o.type=="relation"?(r="RELATION_RECORD_ID",(o==null?void 0:o.maxSelect)!=1&&(r=[r])):r="test";l[o.name]=r}return l}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"password":return"ri-lock-password-line";case"autodate":return"ri-calendar-check-line";default:return"ri-star-s-line"}}static getFieldValueType(e){switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){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)&&(e==null?void 0:e.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!=="fields"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const l=Array.isArray(e.fields)?e.fields:[],s=Array.isArray(t.fields)?t.fields:[],o=l.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=V.isObject(u)&&V.findByKey(l,"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=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name0){const r=V.getExpandPresentableRelField(o,t,i-1);r&&(s+="."+r)}return s}return""}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],h=d.create(c,u,m);d.add(h),l(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=V.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=V.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(V.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?V.plainText(e):e,V.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return V.truncate(e.join(","),i);if(typeof e=="object")try{return V.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of V.extractColumnsFromQuery(e.viewQuery))V.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)V.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){let s=e.find(r=>r.name==t||r.id==t);if(!s||l>=4)return[];s.fields=s.fields||[];let o=V.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=V.getCollectionAutocompleteKeys(e,r.collectionId,a+".",l+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&["select","file","relation"].includes(r.type)&&(o.push(a+":each"),o.push(a+":length"))}for(const r of e){r.fields=r.fields||[];for(const a of r.fields)if(a.type=="relation"&&a.collectionId==s.id){const u=i+r.name+"_via_"+a.name,f=V.getCollectionAutocompleteKeys(e,r.id,u+".",l+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,l;for(const s of e)if(!s.system){i="@collection."+s.name+".",l=V.getCollectionAutocompleteKeys(e,s.name,i);for(const o of l)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.body."),i.push("@request.headers."),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName");const l=e.filter(s=>s.type==="auth");for(const s of l){if(s.system)continue;const o=V.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)V.pushUnique(i,r)}if(t){const s=V.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of s){i.push(o);const r=o.split(".");r.length===3&&r[2].indexOf(":")===-1&&i.push(o+":isset")}}return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!V.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(f=_[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+V.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` +}`,c=`__svelte_${Dv(f)}_${r}`,d=qb(n),{stylesheet:m,rules:h}=cr.get(d)||Iv(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,dr+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),dr-=l,dr||Lv())}function Lv(){fu(()=>{dr||(cr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),cr.clear())})}function Av(n,e,t,i){if(!e)return te;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return te;const{delay:s=0,duration:o=300,easing:r=so,start:a=Or()+s,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=Us(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&Vs(n,h),d=!1}return Er(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),g()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),_(),f(0,1),g}function Pv(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,jb(n,l)}}function jb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function Fi(n){Bs=n}function oo(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function Zt(n){oo().$$.on_mount.push(n)}function Nv(n){oo().$$.after_update.push(n)}function ro(n){oo().$$.on_destroy.push(n)}function bt(){const n=oo();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Hb(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ne(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Yl=[],ie=[];let Gl=[];const Pa=[],zb=Promise.resolve();let Na=!1;function Ub(){Na||(Na=!0,zb.then(cu))}function un(){return Ub(),zb}function tt(n){Gl.push(n)}function Te(n){Pa.push(n)}const Zr=new Set;let jl=0;function cu(){if(jl!==0)return;const n=Bs;do{try{for(;jln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let bs;function du(){return bs||(bs=Promise.resolve(),bs.then(()=>{bs=null})),bs}function Ol(n,e,t){n.dispatchEvent(Hb(`${e?"intro":"outro"}${t}`))}const Qo=new Set;let Si;function ae(){Si={r:0,c:[],p:Si}}function ue(){Si.r||Ie(Si.c),Si=Si.p}function M(n,e){n&&n.i&&(Qo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Qo.has(n))return;Qo.add(n),Si.c.push(()=>{Qo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pu={duration:0};function Vb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=so,tick:_=te,css:g}=l||pu;g&&(o=Us(n,0,1,m,d,h,g,a++)),_(0,1);const k=Or()+d,S=k+m;r&&r.abort(),s=!0,tt(()=>Ol(n,!0,"start")),r=Er($=>{if(s){if($>=S)return _(1,0),Ol(n,!0,"end"),u(),s=!1;if($>=k){const T=h(($-k)/m);_(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),Nt(l)?(l=l(i),du().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function mu(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=Si;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=so,tick:m=te,css:h}=l||pu;h&&(o=Us(n,1,0,c,f,d,h));const _=Or()+f,g=_+c;tt(()=>Ol(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Er(k=>{if(s){if(k>=g)return m(0,1),Ol(n,!1,"end"),--r.r||Ie(r.c),!1;if(k>=_){const S=d((k-_)/c);m(1-S,S)}}return s})}return Nt(l)?du().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&Vs(n,o),s=!1)}}}function je(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:k=so,tick:S=te,css:$}=s||pu,T={start:Or()+_,b:h};h||(T.group=Si,Si.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Us(n,o,h,g,_,k,$)),h&&S(0,1),r=d(T,g),tt(()=>Ol(n,h,"start")),Er(O=>{if(a&&O>a.start&&(r=d(a,g),a=null,Ol(n,r.b,"start"),$&&(c(),u=Us(n,o,r.b,r.duration,0,k,s.css))),r){if(O>=r.end)S(o=r.b,1-o),Ol(n,r.b,"end"),a||(r.b?c():--r.group.r||Ie(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*k(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Nt(s)?du().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function mf(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(ae(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ue())}):e.block.d(1),u.c(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&cu()}if(wv(n)){const l=oo();if(n.then(s=>{Fi(l),i(e.then,1,e.value,s),Fi(null)},s=>{if(Fi(l),i(e.catch,2,e.error,s),Fi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function qv(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function de(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function pi(n,e){n.d(1),e.delete(n.key)}function zt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Hv(n,e){n.f(),zt(n,e)}function yt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],k=new Map,S=new Map,$=[];for(h=m;h--;){const I=c(l,s,h),L=t(I);let A=o.get(L);A?$.push(()=>A.p(I,e)):(A=u(L,I),A.c()),k.set(L,g[h]=A),L in _&&S.set(L,Math.abs(h-_[L]))}const T=new Set,O=new Set;function E(I){M(I,1),I.m(r,f),o.set(I.key,I),f=I.first,m--}for(;d&&m;){const I=g[m-1],L=n[d-1],A=I.key,P=L.key;I===L?(f=I.first,d--,m--):k.has(P)?!o.has(A)||T.has(A)?E(I):O.has(P)?d--:S.get(A)>S.get(P)?(O.add(A),E(I)):(T.add(P),d--):(a(L,o),d--)}for(;d--;){const I=n[d];k.has(I.key)||a(I,o)}for(;m;)E(g[m-1]);return Ie($),g}function wt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Rt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function j(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),tt(()=>{const s=n.$$.on_mount.map(Ab).filter(Nt);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ie(s),n.$$.on_mount=[]}),l.forEach(tt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Fv(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function jv(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Ub(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&jv(n,c)),d}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Ev(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),cu()}Fi(a)}class we{constructor(){ct(this,"$$");ct(this,"$$set")}$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!Nt(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!Sv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const zv="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(zv);class Pl extends Error{}class Uv extends Pl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Vv extends Pl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Bv extends Pl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Pl{}class Bb extends Pl{constructor(e){super(`Invalid unit ${e}`)}}class hn extends Pl{}class Wi extends Pl{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ci="short",Bn="long",pr={year:Ue,month:Ue,day:Ue},Wb={year:Ue,month:ci,day:Ue},Wv={year:Ue,month:ci,day:Ue,weekday:ci},Yb={year:Ue,month:Bn,day:Ue},Kb={year:Ue,month:Bn,day:Ue,weekday:Bn},Jb={hour:Ue,minute:Ue},Zb={hour:Ue,minute:Ue,second:Ue},Gb={hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},Xb={hour:Ue,minute:Ue,second:Ue,timeZoneName:Bn},Qb={hour:Ue,minute:Ue,hourCycle:"h23"},xb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},e0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ci},t0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Bn},n0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},i0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},l0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue},s0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue,second:Ue},Yv={year:Ue,month:ci,day:Ue,weekday:ci,hour:Ue,minute:Ue},o0={year:Ue,month:Bn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ci},r0={year:Ue,month:Bn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},a0={year:Ue,month:Bn,day:Ue,weekday:Bn,hour:Ue,minute:Ue,timeZoneName:Bn},u0={year:Ue,month:Bn,day:Ue,weekday:Bn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Bn};class ao{get type(){throw new Wi}get name(){throw new Wi}get ianaName(){return this.name}get isUniversal(){throw new Wi}offsetName(e,t){throw new Wi}formatOffset(e,t){throw new Wi}offset(e){throw new Wi}equals(e){throw new Wi}get isValid(){throw new Wi}}let Gr=null;class Mr extends ao{static get instance(){return Gr===null&&(Gr=new Mr),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return b0(e,t,i)}formatOffset(e,t){return Ds(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let xo={};function Kv(n){return xo[n]||(xo[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"})),xo[n]}const Jv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Zv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function Gv(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let hf={};function Xv(n,e={}){const t=JSON.stringify([n,e]);let i=hf[t];return i||(i=new Intl.ListFormat(n,e),hf[t]=i),i}let Ra={};function Fa(n,e={}){const t=JSON.stringify([n,e]);let i=Ra[t];return i||(i=new Intl.DateTimeFormat(n,e),Ra[t]=i),i}let qa={};function Qv(n,e={}){const t=JSON.stringify([n,e]);let i=qa[t];return i||(i=new Intl.NumberFormat(n,e),qa[t]=i),i}let Ha={};function xv(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Ha[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Ha[l]=s),s}let $s=null;function ey(){return $s||($s=new Intl.DateTimeFormat().resolvedOptions().locale,$s)}let _f={};function ty(n){let e=_f[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,_f[n]=e}return e}function ny(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Fa(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Fa(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function iy(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function ly(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function sy(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function Co(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function oy(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 ry{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Qv(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):ku(e,3);return xt(t,this.padTo)}}}class ay{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Hi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Fa(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class uy{constructor(e,t,i){this.opts={style:"long",...i},!t&&_0()&&(this.rtf=xv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Ly(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const fy={firstDay:1,minimalDays:4,weekend:[6,7]};class Et{static fromOpts(e){return Et.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Wt.defaultLocale,r=o||(s?"en-US":ey()),a=t||Wt.defaultNumberingSystem,u=i||Wt.defaultOutputCalendar,f=ja(l)||Wt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){$s=null,Ra={},qa={},Ha={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return Et.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=ny(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=iy(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=oy(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:Et.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ja(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Co(this,e,y0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=ly(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Co(this,e,T0,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=sy(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Co(this,void 0,()=>$0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Co(this,e,C0,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Xe.utc(-40,1,1),Xe.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new ry(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new ay(e,this.intl,t)}relFormatter(e={}){return new uy(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Xv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:g0()?ty(this.locale):fy}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Xr=null;class Cn extends ao{static get utcInstance(){return Xr===null&&(Xr=new Cn(0)),Xr}static instance(e){return e===0?Cn.utcInstance:new Cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Cn(Lr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ds(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ds(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Ds(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 cy extends ao{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 Gi(n,e){if(it(n)||n===null)return e;if(n instanceof ao)return n;if(gy(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?Cn.utcInstance:Cn.parseSpecifier(t)||Hi.create(n)}else return el(n)?Cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new cy(n)}const hu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},gf={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]},dy=hu.hanidec.replace(/[\[|\]]/g,"").split("");function py(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function my(){Kl={}}function si({numberingSystem:n},e=""){const t=n||"latn";return Kl[t]||(Kl[t]={}),Kl[t][e]||(Kl[t][e]=new RegExp(`${hu[t]}${e}`)),Kl[t][e]}let bf=()=>Date.now(),kf="system",vf=null,yf=null,wf=null,Sf=60,Tf,$f=null;class Wt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){kf=e}static get defaultZone(){return Gi(kf,Mr.instance)}static get defaultLocale(){return vf}static set defaultLocale(e){vf=e}static get defaultNumberingSystem(){return yf}static set defaultNumberingSystem(e){yf=e}static get defaultOutputCalendar(){return wf}static set defaultOutputCalendar(e){wf=e}static get defaultWeekSettings(){return $f}static set defaultWeekSettings(e){$f=ja(e)}static get twoDigitCutoffYear(){return Sf}static set twoDigitCutoffYear(e){Sf=e%100}static get throwOnInvalid(){return Tf}static set throwOnInvalid(e){Tf=e}static resetCaches(){Et.resetCache(),Hi.resetCache(),Xe.resetCache(),my()}}class ri{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const f0=[0,31,59,90,120,151,181,212,243,273,304,334],c0=[0,31,60,91,121,152,182,213,244,274,305,335];function Xn(n,e){return new ri("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function _u(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function d0(n,e,t){return t+(uo(n)?c0:f0)[e-1]}function p0(n,e){const t=uo(n)?c0:f0,i=t.findIndex(s=>sWs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Ar(n)}}function Cf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=gu(_u(i,1,e),t),r=Xl(i);let a=l*7+s-o-7+e,u;a<1?(u=i-1,a+=Xl(u)):a>r?(u=i+1,a-=Xl(i)):u=i;const{month:f,day:c}=p0(u,a);return{year:u,month:f,day:c,...Ar(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=d0(e,t,i);return{year:e,ordinal:l,...Ar(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=p0(e,t);return{year:e,month:i,day:l,...Ar(n)}}function Ef(n,e){if(!it(n.localWeekday)||!it(n.localWeekNumber)||!it(n.localWeekYear)){if(!it(n.weekday)||!it(n.weekNumber)||!it(n.weekYear))throw new Jl("Cannot mix locale-based week fields with ISO-based week fields");return it(n.localWeekday)||(n.weekday=n.localWeekday),it(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),it(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function hy(n,e=4,t=1){const i=Dr(n.weekYear),l=Qn(n.weekNumber,1,Ws(n.weekYear,e,t)),s=Qn(n.weekday,1,7);return i?l?s?!1:Xn("weekday",n.weekday):Xn("week",n.weekNumber):Xn("weekYear",n.weekYear)}function _y(n){const e=Dr(n.year),t=Qn(n.ordinal,1,Xl(n.year));return e?t?!1:Xn("ordinal",n.ordinal):Xn("year",n.year)}function m0(n){const e=Dr(n.year),t=Qn(n.month,1,12),i=Qn(n.day,1,hr(n.year,n.month));return e?t?i?!1:Xn("day",n.day):Xn("month",n.month):Xn("year",n.year)}function h0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Qn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Qn(t,0,59),r=Qn(i,0,59),a=Qn(l,0,999);return s?o?r?a?!1:Xn("millisecond",l):Xn("second",i):Xn("minute",t):Xn("hour",e)}function it(n){return typeof n>"u"}function el(n){return typeof n=="number"}function Dr(n){return typeof n=="number"&&n%1===0}function gy(n){return typeof n=="string"}function by(n){return Object.prototype.toString.call(n)==="[object Date]"}function _0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function g0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function ky(n){return Array.isArray(n)?n:[n]}function Mf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function vy(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ja(n){if(n==null)return null;if(typeof n!="object")throw new hn("Week settings must be an object");if(!Qn(n.firstDay,1,7)||!Qn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Qn(e,1,7)))throw new hn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Qn(n,e,t){return Dr(n)&&n>=e&&n<=t}function yy(n,e){return n-e*Math.floor(n/e)}function xt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ji(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function hl(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function bu(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ku(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function uo(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return uo(n)?366:365}function hr(n,e){const t=yy(e-1,12)+1,i=n+(e-t)/12;return t===2?uo(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ir(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Df(n,e,t){return-gu(_u(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=Df(n,e,t),l=Df(n+1,e,t);return(Xl(n)-i+l)/7}function za(n){return n>99?n:n>Wt.twoDigitCutoffYear?1900+n:2e3+n}function b0(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Lr(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function k0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new hn(`Invalid unit value ${n}`);return e}function _r(n,e){const t={};for(const i in n)if(ns(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=k0(l)}return t}function Ds(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${xt(t,2)}:${xt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${xt(t,2)}${xt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ar(n){return vy(n,["hour","minute","second","millisecond"])}const wy=["January","February","March","April","May","June","July","August","September","October","November","December"],v0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sy=["J","F","M","A","M","J","J","A","S","O","N","D"];function y0(n){switch(n){case"narrow":return[...Sy];case"short":return[...v0];case"long":return[...wy];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 w0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],S0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ty=["M","T","W","T","F","S","S"];function T0(n){switch(n){case"narrow":return[...Ty];case"short":return[...S0];case"long":return[...w0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $0=["AM","PM"],$y=["Before Christ","Anno Domini"],Cy=["BC","AD"],Oy=["B","A"];function C0(n){switch(n){case"narrow":return[...Oy];case"short":return[...Cy];case"long":return[...$y];default:return null}}function Ey(n){return $0[n.hour<12?0:1]}function My(n,e){return T0(e)[n.weekday-1]}function Dy(n,e){return y0(e)[n.month-1]}function Iy(n,e){return C0(e)[n.year<0?0:1]}function Ly(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function If(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Ay={D:pr,DD:Wb,DDD:Yb,DDDD:Kb,t:Jb,tt:Zb,ttt:Gb,tttt:Xb,T:Qb,TT:xb,TTT:e0,TTTT:t0,f:n0,ff:l0,fff:o0,ffff:a0,F:i0,FF:s0,FFF:r0,FFFF:u0};class gn{static create(e,t={}){return new gn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Ay[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return xt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Ey(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Dy(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?My(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=gn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Iy(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return 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 l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return If(gn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=gn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return If(s,l(r))}}const O0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function os(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function rs(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function as(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function E0(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&f)?-m:m;return[{years:d(hl(t)),months:d(hl(i)),weeks:d(hl(l)),days:d(hl(s)),hours:d(hl(o)),minutes:d(hl(r)),seconds:d(hl(a),a==="-0"),milliseconds:d(bu(u),c)}]}const Yy={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 wu(n,e,t,i,l,s,o){const r={year:e.length===2?za(Ji(e)):Ji(e),month:v0.indexOf(t)+1,day:Ji(i),hour:Ji(l),minute:Ji(s)};return o&&(r.second=Ji(o)),n&&(r.weekday=n.length>3?w0.indexOf(n)+1:S0.indexOf(n)+1),r}const Ky=/^(?:(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 Jy(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=wu(e,l,i,t,s,o,r);let m;return a?m=Yy[a]:u?m=0:m=Lr(f,c),[d,new Cn(m)]}function Zy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Gy=/^(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$/,Xy=/^(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$/,Qy=/^(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 Lf(n){const[,e,t,i,l,s,o,r]=n;return[wu(e,l,i,t,s,o,r),Cn.utcInstance]}function xy(n){const[,e,t,i,l,s,o,r]=n;return[wu(e,r,t,i,l,s,o),Cn.utcInstance]}const e2=os(Ny,yu),t2=os(Ry,yu),n2=os(Fy,yu),i2=os(D0),L0=rs(Uy,us,fo,co),l2=rs(qy,us,fo,co),s2=rs(Hy,us,fo,co),o2=rs(us,fo,co);function r2(n){return as(n,[e2,L0],[t2,l2],[n2,s2],[i2,o2])}function a2(n){return as(Zy(n),[Ky,Jy])}function u2(n){return as(n,[Gy,Lf],[Xy,Lf],[Qy,xy])}function f2(n){return as(n,[By,Wy])}const c2=rs(us);function d2(n){return as(n,[Vy,c2])}const p2=os(jy,zy),m2=os(I0),h2=rs(us,fo,co);function _2(n){return as(n,[p2,L0],[m2,h2])}const Af="Invalid Duration",A0={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}},g2={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},...A0},Kn=146097/400,zl=146097/4800,b2={years:{quarters:4,months:12,weeks:Kn/7,days:Kn,hours:Kn*24,minutes:Kn*24*60,seconds:Kn*24*60*60,milliseconds:Kn*24*60*60*1e3},quarters:{months:3,weeks:Kn/28,days:Kn/4,hours:Kn*24/4,minutes:Kn*24*60/4,seconds:Kn*24*60*60/4,milliseconds:Kn*24*60*60*1e3/4},months:{weeks:zl/7,days:zl,hours:zl*24,minutes:zl*24*60,seconds:zl*24*60*60,milliseconds:zl*24*60*60*1e3},...A0},Tl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],k2=Tl.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function P0(n,e){let t=e.milliseconds??0;for(const i of k2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=P0(n,e)<0?-1:1;Tl.reduceRight((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Tl.reduce((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function v2(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class St{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?b2:g2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Et.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return St.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new hn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new St({values:_r(e,St.normalizeUnit),loc:Et.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(el(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new hn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=f2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=d2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the Duration is invalid");const i=e instanceof ri?e:new ri(e,t);if(Wt.throwOnInvalid)throw new Bv(i);return new St({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 Bb(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?gn.create(this.loc,i).formatDurationFromString(this,e):Af}toHuman(e={}){if(!this.isValid)return Af;const t=Tl.map(i=>{const l=this.values[i];return it(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ku(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Xe.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?P0(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e),i={};for(const l of Tl)(ns(t.values,l)||ns(this.values,l))&&(i[l]=t.get(l)+this.get(l));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=St.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]=k0(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,..._r(e,St.normalizeUnit)};return Yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return Yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pf(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=v2(this.normalize().shiftToAll().toObject());return Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>St.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Tl)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;el(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else el(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Pf(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Tl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ul="Invalid Interval";function y2(n,e){return!n||!n.isValid?Bt.invalid("missing or invalid start"):!e||!e.isValid?Bt.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?Bt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ks).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Bt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=St.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Bt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Bt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Bt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,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&&l.push(Bt.fromDateTimes(t,a.time)),t=null);return Bt.merge(l)}difference(...e){return Bt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ul}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=pr,t={}){return this.isValid?gn.create(this.s.loc.clone(t),e).formatInterval(this):Ul}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ul}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ul}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ul}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ul}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):St.invalid(this.invalidReason)}mapEndpoints(e){return Bt.fromDateTimes(e(this.s),e(this.e))}}class Oo{static hasDST(e=Wt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Hi.isValidZone(e)}static normalizeZone(e){return Gi(e,Wt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Et.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Et.create(t,null,"gregory").eras(e)}static features(){return{relative:_0(),localeWeek:g0()}}}function Nf(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(St.fromMillis(i).as("days"))}function w2(n,e,t){const i=[["years",(a,u)=>u.year-a.year],["quarters",(a,u)=>u.quarter-a.quarter+(u.year-a.year)*4],["months",(a,u)=>u.month-a.month+(u.year-a.year)*12],["weeks",(a,u)=>{const f=Nf(a,u);return(f-f%7)/7}],["days",Nf]],l={},s=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,l[a]=u(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function S2(n,e,t,i){let[l,s,o,r]=w2(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?St.fromMillis(a,i).shiftTo(...u).plus(f):f}const T2="missing Intl.DateTimeFormat.formatToParts support";function Tt(n,e=t=>t){return{regex:n,deser:([t])=>e(py(t))}}const $2=" ",N0=`[ ${$2}]`,R0=new RegExp(N0,"g");function C2(n){return n.replace(/\./g,"\\.?").replace(R0,N0)}function Rf(n){return n.replace(/\./g,"").replace(R0," ").toLowerCase()}function oi(n,e){return n===null?null:{regex:RegExp(n.map(C2).join("|")),deser:([t])=>n.findIndex(i=>Rf(t)===Rf(i))+e}}function Ff(n,e){return{regex:n,deser:([,t,i])=>Lr(t,i),groups:e}}function Eo(n){return{regex:n,deser:([e])=>e}}function O2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function E2(n,e){const t=si(e),i=si(e,"{2}"),l=si(e,"{3}"),s=si(e,"{4}"),o=si(e,"{6}"),r=si(e,"{1,2}"),a=si(e,"{1,3}"),u=si(e,"{1,6}"),f=si(e,"{1,9}"),c=si(e,"{2,4}"),d=si(e,"{4,6}"),m=g=>({regex:RegExp(O2(g.val)),deser:([k])=>k,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return oi(e.eras("short"),0);case"GG":return oi(e.eras("long"),0);case"y":return Tt(u);case"yy":return Tt(c,za);case"yyyy":return Tt(s);case"yyyyy":return Tt(d);case"yyyyyy":return Tt(o);case"M":return Tt(r);case"MM":return Tt(i);case"MMM":return oi(e.months("short",!0),1);case"MMMM":return oi(e.months("long",!0),1);case"L":return Tt(r);case"LL":return Tt(i);case"LLL":return oi(e.months("short",!1),1);case"LLLL":return oi(e.months("long",!1),1);case"d":return Tt(r);case"dd":return Tt(i);case"o":return Tt(a);case"ooo":return Tt(l);case"HH":return Tt(i);case"H":return Tt(r);case"hh":return Tt(i);case"h":return Tt(r);case"mm":return Tt(i);case"m":return Tt(r);case"q":return Tt(r);case"qq":return Tt(i);case"s":return Tt(r);case"ss":return Tt(i);case"S":return Tt(a);case"SSS":return Tt(l);case"u":return Eo(f);case"uu":return Eo(r);case"uuu":return Tt(t);case"a":return oi(e.meridiems(),0);case"kkkk":return Tt(s);case"kk":return Tt(c,za);case"W":return Tt(r);case"WW":return Tt(i);case"E":case"c":return Tt(t);case"EEE":return oi(e.weekdays("short",!1),1);case"EEEE":return oi(e.weekdays("long",!1),1);case"ccc":return oi(e.weekdays("short",!0),1);case"cccc":return oi(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ff(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ff(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Eo(/[a-z_+-/]{1,256}?/i);case" ":return Eo(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:T2};return _.token=n,_}const M2={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function D2(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=M2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function I2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function L2(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(ns(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function A2(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return it(n.z)||(t=Hi.create(n.z)),it(n.Z)||(t||(t=new Cn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(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),it(n.u)||(n.S=bu(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let xr=null;function P2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function N2(n,e){if(n.literal)return n;const t=gn.macroTokenToFormatOpts(n.val),i=j0(t,e);return i==null||i.includes(void 0)?n:i}function F0(n,e){return Array.prototype.concat(...n.map(t=>N2(t,e)))}class q0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=F0(gn.parseFormat(t),e),this.units=this.tokens.map(i=>E2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=I2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=L2(e,this.regex,this.handlers),[l,s,o]=i?A2(i):[null,null,void 0];if(ns(i,"a")&&ns(i,"H"))throw new Jl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function H0(n,e,t){return new q0(n,t).explainFromTokens(e)}function R2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=H0(n,e,t);return[i,l,s,o]}function j0(n,e){if(!n)return null;const i=gn.create(e,n).dtFormatter(P2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>D2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function Cs(n){return new ri("unsupported zone",`the zone "${n.name}" is not supported`)}function ta(n){return n.weekData===null&&(n.weekData=mr(n.c)),n.weekData}function na(n){return n.localWeekData===null&&(n.localWeekData=mr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function _l(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function z0(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Mo(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 er(n,e,t){return z0(Ir(n),e,t)}function Hf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,hr(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=St.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=Ir(s);let[a,u]=z0(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return Xe.invalid(new ri("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Do(n,e,t=!0){return n.isValid?gn.create(Et.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ia(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=xt(n.c.year,t?6:4),e?(i+="-",i+=xt(n.c.month),i+="-",i+=xt(n.c.day)):(i+=xt(n.c.month),i+=xt(n.c.day)),i}function jf(n,e,t,i,l,s){let o=xt(n.c.hour);return e?(o+=":",o+=xt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=xt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=xt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=xt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=xt(Math.trunc(-n.o/60)),o+=":",o+=xt(Math.trunc(-n.o%60))):(o+="+",o+=xt(Math.trunc(n.o/60)),o+=":",o+=xt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const U0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},F2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},q2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},V0=["year","month","day","hour","minute","second","millisecond"],H2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],j2=["year","ordinal","hour","minute","second","millisecond"];function z2(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 Bb(n);return e}function zf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return z2(n)}}function U2(n){return nr[n]||(tr===void 0&&(tr=Wt.now()),nr[n]=n.offset(tr)),nr[n]}function Uf(n,e){const t=Gi(e.zone,Wt.defaultZone);if(!t.isValid)return Xe.invalid(Cs(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Wt.now();else{for(const a of V0)it(n[a])&&(n[a]=U0[a]);const o=m0(n)||h0(n);if(o)return Xe.invalid(o);const r=U2(t);[l,s]=er(n,r,t)}return new Xe({ts:l,zone:t,loc:i,o:s})}function Vf(n,e,t){const i=it(t.round)?!0:t.round,l=(o,r)=>(o=ku(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Bf(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]}let tr,nr={};class Xe{constructor(e){const t=e.zone||Wt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ri("invalid input"):null)||(t.isValid?null:Cs(t));this.ts=it(e.ts)?Wt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=el(e.o)&&!e.old?e.o:t.offset(this.ts);l=Mo(this.ts,r),i=Number.isNaN(l.year)?new ri("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||Et.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return e.zone=Cn.utcInstance,Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=by(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Gi(t.zone,Wt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid(Cs(l))}static fromMillis(e,t={}){if(el(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Gi(t.zone,Wt.defaultZone),loc:Et.fromObject(t)});throw new hn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(el(e))return new Xe({ts:e*1e3,zone:Gi(t.zone,Wt.defaultZone),loc:Et.fromObject(t)});throw new hn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Gi(t.zone,Wt.defaultZone);if(!i.isValid)return Xe.invalid(Cs(i));const l=Et.fromObject(t),s=_r(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Ef(s,l),a=Wt.now(),u=it(t.specificOffset)?i.offset(a):t.specificOffset,f=!it(s.ordinal),c=!it(s.year),d=!it(s.month)||!it(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||f)&&h)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Jl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,k,S=Mo(a,u);_?(g=H2,k=F2,S=mr(S,o,r)):f?(g=j2,k=q2,S=Qr(S)):(g=V0,k=U0);let $=!1;for(const P of g){const N=s[P];it(N)?$?s[P]=k[P]:s[P]=S[P]:$=!0}const T=_?hy(s,o,r):f?_y(s):m0(s),O=T||h0(s);if(O)return Xe.invalid(O);const E=_?Cf(s,o,r):f?Of(s):s,[I,L]=er(E,u,i),A=new Xe({ts:I,zone:i,o:L,loc:l});return s.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,l]=r2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=a2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=u2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new hn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=R2(o,e,t);return f?Xe.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=_2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new hn("need to specify a reason the DateTime is invalid");const i=e instanceof ri?e:new ri(e,t);if(Wt.throwOnInvalid)throw new Uv(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=j0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return F0(gn.parseFormat(e),Et.fromObject(t)).map(l=>l.val).join("")}static resetCache(){tr=void 0,nr={}}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?ta(this).weekYear:NaN}get weekNumber(){return this.isValid?ta(this).weekNumber:NaN}get weekday(){return this.isValid?ta(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?na(this).weekday:NaN}get localWeekNumber(){return this.isValid?na(this).weekNumber:NaN}get localWeekYear(){return this.isValid?na(this).weekYear:NaN}get ordinal(){return this.isValid?Qr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Oo.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Oo.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Oo.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Oo.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Ir(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Mo(a,o),c=Mo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[_l(this,{ts:a}),_l(this,{ts:u})]:[this]}get isInLeapYear(){return uo(this.year)}get daysInMonth(){return hr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(Cn.instance(e),t)}toLocal(){return this.setZone(Wt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Gi(e,Wt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=er(o,s,e)}return _l(this,{ts:l,zone:e})}else return Xe.invalid(Cs(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return _l(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_r(e,zf),{minDaysInFirstWeek:i,startOfWeek:l}=Ef(t,this.loc),s=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),o=!it(t.ordinal),r=!it(t.year),a=!it(t.month)||!it(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Jl("Can't mix ordinal dates with month/day");let c;s?c=Cf({...mr(this.c,i,l),...t},i,l):it(t.ordinal)?(c={...this.toObject(),...t},it(t.day)&&(c.day=Math.min(hr(c.year,c.month),c.day))):c=Of({...Qr(this.c),...t});const[d,m]=er(c,this.o,this.zone);return _l(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return _l(this,Hf(this,t))}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e).negate();return _l(this,Hf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=St.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,u=S2(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Bt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new hn("max requires all arguments be DateTimes");return Mf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return H0(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=Et.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new q0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new hn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new hn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Vl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return pr}static get DATE_MED(){return Wb}static get DATE_MED_WITH_WEEKDAY(){return Wv}static get DATE_FULL(){return Yb}static get DATE_HUGE(){return Kb}static get TIME_SIMPLE(){return Jb}static get TIME_WITH_SECONDS(){return Zb}static get TIME_WITH_SHORT_OFFSET(){return Gb}static get TIME_WITH_LONG_OFFSET(){return Xb}static get TIME_24_SIMPLE(){return Qb}static get TIME_24_WITH_SECONDS(){return xb}static get TIME_24_WITH_SHORT_OFFSET(){return e0}static get TIME_24_WITH_LONG_OFFSET(){return t0}static get DATETIME_SHORT(){return n0}static get DATETIME_SHORT_WITH_SECONDS(){return i0}static get DATETIME_MED(){return l0}static get DATETIME_MED_WITH_SECONDS(){return s0}static get DATETIME_MED_WITH_WEEKDAY(){return Yv}static get DATETIME_FULL(){return o0}static get DATETIME_FULL_WITH_SECONDS(){return r0}static get DATETIME_HUGE(){return a0}static get DATETIME_HUGE_WITH_SECONDS(){return u0}}function ks(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&el(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new hn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const V2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],B2=[".mp4",".avi",".mov",".3gp",".wmv"],W2=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Y2=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],B0=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class 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 zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||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==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return V.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0: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 mergeUnique(e,t){for(let i of t)V.pushUnique(e,i);return e}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=V.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!V.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!V.isObject(s)&&!Array.isArray(s)||!V.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!V.isObject(l)&&!Array.isArray(l)||!V.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):V.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||V.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||V.isObject(e)&&Object.keys(e).length>0)&&V.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return V.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),V.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",V.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Xe.fromFormat(e,i,{zone:"UTC"})}return typeof e=="number"?Xe.fromMillis(e):Xe.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.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);V.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!V2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!B2.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!W2.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Y2.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(l=>{let s=new FileReader;s.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),l(a.toDataURL(e.type))},r.src=o.target.result},s.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 l of i)V.addValueToFormData(e,t,l);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){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},V.dummyCollectionSchemaData(e))}static dummyCollectionSchemaData(e,t=!1){var s;const i=(e==null?void 0:e.fields)||[],l={};for(const o of i){if(o.hidden||t&&o.primaryKey&&o.autogeneratePattern)continue;let r=null;if(o.type==="number")r=123;else if(o.type==="date"||o.type==="autodate")r="2022-01-01 10:00:00.123Z";else if(o.type=="bool")r=!0;else if(o.type=="email")r="test@example.com";else if(o.type=="url")r="https://example.com";else if(o.type=="json")r="JSON";else if(o.type=="file"){if(t)continue;r="filename.jpg",o.maxSelect!=1&&(r=[r])}else o.type=="select"?(r=(s=o==null?void 0:o.values)==null?void 0:s[0],(o==null?void 0:o.maxSelect)!=1&&(r=[r])):o.type=="relation"?(r="RELATION_RECORD_ID",(o==null?void 0:o.maxSelect)!=1&&(r=[r])):r="test";l[o.name]=r}return l}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"password":return"ri-lock-password-line";case"autodate":return"ri-calendar-check-line";default:return"ri-star-s-line"}}static getFieldValueType(e){switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){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)&&(e==null?void 0:e.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!=="fields"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const l=Array.isArray(e.fields)?e.fields:[],s=Array.isArray(t.fields)?t.fields:[],o=l.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=V.isObject(u)&&V.findByKey(l,"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=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name0){const r=V.getExpandPresentableRelField(o,t,i-1);r&&(s+="."+r)}return s}return""}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],h=d.create(c,u,m);d.add(h),l(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=V.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=V.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(V.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?V.plainText(e):e,V.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return V.truncate(e.join(","),i);if(typeof e=="object")try{return V.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of V.extractColumnsFromQuery(e.viewQuery))V.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)V.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){let s=e.find(r=>r.name==t||r.id==t);if(!s||l>=4)return[];s.fields=s.fields||[];let o=V.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=V.getCollectionAutocompleteKeys(e,r.collectionId,a+".",l+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&["select","file","relation"].includes(r.type)&&(o.push(a+":each"),o.push(a+":length"))}for(const r of e){r.fields=r.fields||[];for(const a of r.fields)if(a.type=="relation"&&a.collectionId==s.id){const u=i+r.name+"_via_"+a.name,f=V.getCollectionAutocompleteKeys(e,r.id,u+".",l+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,l;for(const s of e)if(!s.system){i="@collection."+s.name+".",l=V.getCollectionAutocompleteKeys(e,s.name,i);for(const o of l)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.body."),i.push("@request.headers."),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName");const l=e.filter(s=>s.type==="auth");for(const s of l){if(s.system)continue;const o=V.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)V.pushUnique(i,r)}if(t){const s=V.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of s){i.push(o);const r=o.split(".");r.length===3&&r[2].indexOf(":")===-1&&i.push(o+":isset")}}return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!V.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(f=_[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+V.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=V.parseIndex(e);return i.tableName=t,V.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=V.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?V.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return V.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}let Ua,gl;const Va="app-tooltip";function Wf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function tl(){return gl=gl||document.querySelector("."+Va),gl||(gl=document.createElement("div"),gl.classList.add(Va),document.body.appendChild(gl)),gl}function V0(n,e){let t=tl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ba();return}t.textContent=e.text,t.className=Va+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ba(){clearTimeout(Ua),tl().classList.remove("active"),tl().activeNode=void 0}function W2(n,e){tl().activeNode=n,clearTimeout(Ua),Ua=setTimeout(()=>{tl().classList.add("active"),V0(n,e)},isNaN(e.delay)?0:e.delay)}function He(n,e){let t=Wf(e);function i(){W2(n,t)}function l(){Ba()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&V.isFocusable(n))&&n.addEventListener("click",l),tl(),{update(s){var o,r;t=Wf(s),(r=(o=tl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&V0(n,t)},destroy(){var s,o;(o=(s=tl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Ba(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Pr(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=so}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Pr,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pf(l),[m,h]=pf(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` +`),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 l=V.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?V.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return V.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}let Ua,gl;const Va="app-tooltip";function Wf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function tl(){return gl=gl||document.querySelector("."+Va),gl||(gl=document.createElement("div"),gl.classList.add(Va),document.body.appendChild(gl)),gl}function W0(n,e){let t=tl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ba();return}t.textContent=e.text,t.className=Va+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ba(){clearTimeout(Ua),tl().classList.remove("active"),tl().activeNode=void 0}function K2(n,e){tl().activeNode=n,clearTimeout(Ua),Ua=setTimeout(()=>{tl().classList.add("active"),W0(n,e)},isNaN(e.delay)?0:e.delay)}function He(n,e){let t=Wf(e);function i(){K2(n,t)}function l(){Ba()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&V.isFocusable(n))&&n.addEventListener("click",l),tl(),{update(s){var o,r;t=Wf(s),(r=(o=tl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&W0(n,t)},destroy(){var s,o;(o=(s=tl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Ba(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Pr(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=so}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Pr,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pf(l),[m,h]=pf(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` transform: ${u} translate(${(1-_)*c}${d}, ${(1-_)*m}${h}); opacity: ${a-f*g}`}}function mt(n,{delay:e=0,duration:t=400,easing:i=Pr,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),h=parseFloat(s[`margin${f[1]}`]),_=parseFloat(s[`border${f[0]}Width`]),g=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*_}px;border-${u[1]}-width: ${k*g}px;`}}function Mt(n,{delay:e=0,duration:t=400,easing:i=Pr,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}const Y2=n=>({}),Yf=n=>({}),K2=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=It(T,n,n[18],Kf);let M=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=It(L,n,n[18],null),A=n[19].footer,P=It(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),M&&M.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("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(s,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(s,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,R){y(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),M&&M.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),g=!0,k||(S=[B(t,"click",et(n[20])),B(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&E($,1)):($=Zf(n),$.c(),E($,1),$.m(o,r)):$&&(ae(),D($,1,1,()=>{$=null}),ue()),O&&O.p&&(!g||R[0]&262144)&&At(O,T,n,n[18],g?Lt(T,n[18],R,K2):Pt(n[18]),Kf),n[4]&&n[2]?M?M.p(n,R):(M=Gf(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!g||R[0]&262144)&&At(I,L,n,n[18],g?Lt(L,n[18],R,null):Pt(n[18]),null),P&&P.p&&(!g||R[0]&262144)&&At(P,A,n,n[18],g?Lt(A,n[18],R,Y2):Pt(n[18]),Yf),(!g||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||R[0]&262)&&Q(s,"popup",n[2]),(!g||R[0]&4)&&Q(e,"padded",n[2]),(!g||R[0]&1)&&Q(e,"active",n[0])},i(N){g||(N&&tt(()=>{g&&(i||(i=je(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),E($),E(O,N),E(I,N),E(P,N),N&&tt(()=>{g&&(_&&_.end(1),h=zb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),g=!0)},o(N){N&&(i||(i=je(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(_=mu(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),g=!1},d(N){N&&v(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),M&&M.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&_&&_.end(),k=!1,Ie(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){y(o,e,r),i=!0,l||(s=B(e,"click",et(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){y(l,e,s),t||(i=B(e,"click",et(n[5])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function J2(n){let e,t,i,l,s=n[0]&&Jf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){y(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[B(window,"resize",n[10]),B(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Jf(o),s.c(),E(s,1),s.m(e,null)):s&&(ae(),D(s,1,1,()=>{s=null}),ue())},i(o){t||(E(s),t=!0)},o(o){D(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let bl,la=[];function B0(){return bl=bl||document.querySelector(".overlays"),bl||(bl=document.createElement("div"),bl.classList.add("overlays"),document.body.appendChild(bl)),bl}let Zi=150;function Xf(){return 1e3+B0().querySelectorAll(".overlay-panel-container.active").length}function Z2(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=bt(),h="op_"+V.randomString(10);let _,g,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(X){t(17,T=X),X?(k=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await un(),A()}function A(){_&&(o?t(6,_.style.zIndex=Xf(),_):t(6,_.style="",_))}function P(){V.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){V.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(X){o&&f&&X.code=="Escape"&&!V.isInput(X.target)&&_&&_.style.zIndex==Xf()&&(X.preventDefault(),M())}function z(X){o&&F(g)}function F(X,oe){oe&&t(8,$=""),!(!X||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}X.scrollTop==0?t(8,$+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Zt(()=>(B0().appendChild(_),()=>{var X;clearTimeout(S),N(),(X=_==null?void 0:_.classList)==null||X.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const U=()=>a?M():!0;function J(X){ie[X?"unshift":"push"](()=>{g=X,t(7,g)})}const K=X=>F(X.target);function x(X){ie[X?"unshift":"push"](()=>{_=X,t(6,_)})}return n.$$set=X=>{"class"in X&&t(1,s=X.class),"active"in X&&t(0,o=X.active),"popup"in X&&t(2,r=X.popup),"overlayClose"in X&&t(3,a=X.overlayClose),"btnClose"in X&&t(4,u=X.btnClose),"escClose"in X&&t(12,f=X.escClose),"beforeOpen"in X&&t(13,c=X.beforeOpen),"beforeHide"in X&&t(14,d=X.beforeHide),"$$scope"in X&&t(18,l=X.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(g,!0),n.$$.dirty[0]&64&&_&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,M,_,g,$,R,z,F,f,c,d,O,L,T,l,i,U,J,K,x]}class nn extends we{constructor(e){super(),ye(this,e,Z2,J2,_e,{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]}}const Bl=[];function W0(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(_e(n,r)&&(n=r,t)){const a=!Bl.length;for(const u of i)u[1](),Bl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function Y0(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return W0(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=Nt(h)?h:te},m=l.map((h,_)=>uu(h,g=>{u[_]=g,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){Ie(m),c(),a=!1}})}const Su=Hn({});function pn(n,e,t){Su.set({text:n,yesCallback:e,noCallback:t})}function K0(){Su.set({})}function G2(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){y(s,e,o),w(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&re(i,t)},d(s){s&&v(e)}}}function X2(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=C(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],Q(l,"btn-loading",n[2])},m(a,u){y(a,e,u),w(e,t),y(a,i,u),y(a,l,u),w(l,s),e.focus(),o||(r=[B(e,"click",n[4]),B(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&Q(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,Ie(r)}}}function Q2(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:[X2],header:[G2]},$$scope:{ctx:n}};return e=new nn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[6](null),H(e,l)}}}function x2(n,e,t){let i;Qe(n,Su,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){ie[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await un(),t(3,o=!1),K0()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class ew extends we{constructor(e){super(),ye(this,e,x2,Q2,_e,{})}}function tw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Ov(e,"visibility","hidden")},m(t,i){y(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function nw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){y(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function iw(n){let e;function t(s,o){return s[1]?nw:tw}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){y(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:te,o:te,d(s){s&&v(e),l.d(),n[16](null)}}}function lw(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let sw=lw();function sa(){return window&&window.tinymce?window.tinymce:null}function ow(n,e,t){let{id:i="tinymce_svelte"+V.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,_,g,k=u,S=s;const $=bt();function T(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,g=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,_.style.visibility="",_),sa().init(I)}Zt(()=>(sa()!==null?T():sw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{g&&((I=g.dom)==null||I.unbind(document),(A=sa())==null||A.remove(g))}catch{}}));function O(I){ie[I?"unshift":"push"](()=>{_=I,t(4,_)})}function M(I){ie[I?"unshift":"push"](()=>{_=I,t(4,_)})}function L(I){ie[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&k!==u&&(g.setContent(u),t(6,f=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,_,u,f,s,o,r,a,g,k,S,O,M,L]}class Tu extends we{constructor(e){super(),ye(this,e,ow,iw,_e,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function rw(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Pr}=i;return{delay:f,duration:Nt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${k}, ${S});`}}}const Nr=Hn([]);function Ks(n,e=4e3){return Rr(n,"info",e)}function en(n,e=3e3){return Rr(n,"success",e)}function Ci(n,e=4500){return Rr(n,"error",e)}function aw(n,e=4500){return Rr(n,"warning",e)}function Rr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J0(i)},t)};Nr.update(l=>($u(l,i.message),V.pushOrReplaceByKey(l,i,"message"),l))}function J0(n){Nr.update(e=>($u(e,n),e))}function Is(){Nr.update(n=>{for(let e of n)$u(n,e);return[]})}function $u(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))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function uw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function fw(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function cw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function dw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,_,g,k;function S(M,L){return M[2].type==="info"?dw:M[2].type==="success"?cw:M[2].type==="warning"?fw:uw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=C(),s=b("div"),r=W(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(s,"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,L){y(M,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),_=!0,g||(k=B(u,"click",et(O)),g=!0)},p(M,L){e=M,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!_||L&1)&&o!==(o=e[2].message+"")&&re(r,o),(!_||L&1)&&Q(t,"alert-info",e[2].type=="info"),(!_||L&1)&&Q(t,"alert-success",e[2].type=="success"),(!_||L&1)&&Q(t,"alert-danger",e[2].type=="error"),(!_||L&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){Lv(t),h(),qb(t,m)},a(){h(),h=Iv(t,m,rw,{duration:150})},i(M){_||(M&&tt(()=>{_&&(d&&d.end(1),c=zb(t,mt,{duration:150}),c.start())}),_=!0)},o(M){c&&c.invalidate(),M&&(d=mu(t,Ys,{duration:150})),_=!1},d(M){M&&v(t),T.d(),M&&d&&d.end(),g=!1,k()}}}function pw(n){let e,t=[],i=new Map,l,s=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J0(s)]}class hw extends we{constructor(e){super(),ye(this,e,mw,pw,_e,{})}}function ec(n){let e,t,i;const l=n[18].default,s=It(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){y(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&At(s,l,o,o[17],i?Lt(l,o[17],r,null):Pt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&Q(e,"active",o[0])},i(o){i||(E(s,o),o&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=je(e,qn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function _w(n){let e,t,i,l,s=n[0]&&ec(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){y(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[B(window,"click",n[7]),B(window,"mousedown",n[6]),B(window,"keydown",n[5]),B(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=ec(o),s.c(),E(s,1),s.m(e,null)):s&&(ae(),D(s,1,1,()=>{s=null}),ue())},i(o){t||(E(s),t=!0)},o(o){D(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function gw(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,_,g=!1;const k=bt();function S(X=0){o&&(clearTimeout(_),_=setTimeout($,X))}function $(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function T(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function M(X){return!c||X.classList.contains(u)||c.contains(X)&&X.closest&&X.closest("."+u)}function L(X){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=X||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(X){X.stopPropagation(),M(X.target)&&$()}function P(X){(X.code==="Enter"||X.code==="Space")&&(X.stopPropagation(),M(X.target)&&S(150))}function N(X){X.preventDefault(),X.stopPropagation(),O()}function R(X){(X.code==="Enter"||X.code==="Space")&&(X.preventDefault(),X.stopPropagation(),O())}function z(X){o&&!(m!=null&&m.contains(X.target))&&!(c!=null&&c.contains(X.target))&&O()}function F(X){o&&r&&X.code==="Escape"&&(X.preventDefault(),$())}function U(X){o&&(g=!(c!=null&&c.contains(X.target)))}function J(X){var oe;o&&g&&!(c!=null&&c.contains(X.target))&&!(m!=null&&m.contains(X.target))&&!((oe=X.target)!=null&&oe.closest(".flatpickr-calendar"))&&$()}Zt(()=>(L(),()=>I()));function K(X){ie[X?"unshift":"push"](()=>{d=X,t(3,d)})}function x(X){ie[X?"unshift":"push"](()=>{c=X,t(2,c)})}return n.$$set=X=>{"trigger"in X&&t(8,s=X.trigger),"active"in X&&t(0,o=X.active),"escClose"in X&&t(9,r=X.escClose),"autoScroll"in X&&t(10,a=X.autoScroll),"closableClass"in X&&t(11,u=X.closableClass),"class"in X&&t(1,f=X.class),"$$scope"in X&&t(17,l=X.$$scope)},n.$$.update=()=>{var X,oe;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((X=m==null?void 0:m.classList)==null||X.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((oe=m==null?void 0:m.classList)==null||oe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,U,J,s,r,a,u,S,$,T,O,m,l,i,K,x]}class jn extends we{constructor(e){super(),ye(this,e,gw,_w,_e,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const fn=Hn(""),gr=Hn(""),Dl=Hn(!1),yn=Hn({});function Yt(n){yn.set(n||{})}function di(n){yn.update(e=>(V.deleteByPath(e,n),e))}const Fr=Hn({});function tc(n){Fr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.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 Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?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.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.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{...this}}}const Io=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function bw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||kw;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}Z0=typeof atob!="function"||yw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Ou{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Cu(this.token)}get isAdmin(){return xl(this.token).type==="admin"}get isAuthRecord(){return xl(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=ic){const i=bw(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.record||l.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=xl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.record&&r>4096){s.record={id:(a=s.record)==null?void 0:a.id,email:(u=s.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(s.record[c]=this.record[c]);o=nc(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{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.record)}}class G0 extends Ou{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class ww extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Sw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Eu(n){if(n){n.query=n.query||{};for(let e in n)Sw.includes(e)||(n.query[e]=n[e],delete n[e])}}function X0(n){const e=[];for(const t in n){if(n[t]===null)continue;const i=n[t],l=encodeURIComponent(t);if(Array.isArray(i))for(const s of i)e.push(l+"="+encodeURIComponent(s));else i instanceof Date?e.push(l+"="+encodeURIComponent(i.toISOString())):typeof i!==null&&typeof i=="object"?e.push(l+"="+encodeURIComponent(JSON.stringify(i))):e.push(l+"="+encodeURIComponent(i))}return e.join("&")}class Q0 extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class x0 extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Tw extends x0{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.record)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.record)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.record)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.record)==null?void 0:l.id)!==e||((s=this.client.authStore.record)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let l;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(l=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||oa(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return s=this.authResponse(s),l&&this.isSuperusers&&function(r,a,u,f){oa(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,_)=>{(!h||(_==null?void 0:_.id)!=(d==null?void 0:d.id)||(_!=null&&_.collectionId||d!=null&&d.collectionId)&&(_==null?void 0:_.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,_)=>{var $;const g=r.authStore.token;if(($=_.query)!=null&&$.autoRefresh)return c?c(h,_):{url:h,sendOptions:_};let k=r.authStore.isValid;if(k&&Cu(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=_.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&g==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return _.headers=S,c?c(h,_):{url:h,sendOptions:_}}}(this.client,l,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),s}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:l,createData:s}};return a=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new Q0(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var _;try{await l.subscribe("@oauth2",async $=>{var O;const T=l.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const M=Object.assign({},t);delete M.provider,delete M.scopes,delete M.createData,delete M.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,M);m(L)}catch(M){h(new Fn(M))}s()});const g={state:l.clientId};(_=t.scopes)!=null&&_.length&&(g.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,g);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(g){s(),h(new Fn(g))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new po(this.client.baseURL,new Ou,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class $w extends x0{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class Cw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Ow extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class Ew extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Mw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Wa(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function sc(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function oc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Wa(i))return!0}return!1}class Dw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Iw(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l0&&s.length==l.length){e.files[i]=e.files[i]||[];for(let r of s)e.files[i].push(r)}else if(e.json[i]=o,s.length>0){let r=i;i.startsWith("+")||i.endsWith("+")||(r+="+"),e.files[r]=e.files[r]||[];for(let a of s)e.files[r].push(a)}}else e.json[i]=l}}}class po{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Ou:this.authStore=new G0,this.collections=new $w(this),this.files=new Ew(this),this.logs=new Cw(this),this.settings=new ww(this),this.realtime=new Q0(this),this.health=new Ow(this),this.backups=new Mw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Dw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Tw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=X0(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const En=Hn([]),ei=Hn({}),Js=Hn(!1),ek=Hn({}),Mu=Hn({});let Ls;typeof BroadcastChannel<"u"&&(Ls=new BroadcastChannel("collections"),Ls.onmessage=()=>{var n;Du((n=Lb(ei))==null?void 0:n.id)});function tk(){Ls==null||Ls.postMessage("reload")}function Lw(n){En.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ei.set(t):e.length&&ei.set(e.find(i=>!i.system)||e[0]),e})}function Aw(n){ei.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),En.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Iu(),tk(),V.sortCollections(e)))}function Pw(n){En.update(e=>(V.removeByKey(e,"id",n.id),ei.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Iu(),tk(),e))}async function Du(n=null){Js.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),En.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ei.set(t):e.length&&ei.set(e.find(i=>!i.system)||e[0]),Iu(),Mu.set(await me.collections.getScaffolds())}catch(e){me.error(e)}Js.set(!1)}function Iu(){ek.update(n=>(En.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(l=>l.type=="file"&&l.protected));return e}),n))}function nk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function Nw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function Rw(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function Fw(n){let e,t,i,l;const s=[Rw,Nw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function rc(){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 qr=W0(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Y0(qr,n=>n.location);const Lu=Y0(qr,n=>n.querystring),ac=Hn(void 0);async function Il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await un();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 Vn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function qw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(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||Hw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Hw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function jw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=nk(O);this.path=O,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=L,this._keys=I}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const M=this._pattern.exec(O);if(M===null)return null;if(this._keys===!1)return M;const L={};let I=0;for(;I{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=bt();async function d(T,O){await un(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Av(()=>{qw(m)}));let _=null,g=null;const k=qr.subscribe(async T=>{_=T;let O=0;for(;O{ac.set(u)});return}t(0,a=null),g=null,ac.set(void 0)});ro(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Ne.call(this,n,T)}function $(T){Ne.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class zw extends we{constructor(e){super(),ye(this,e,jw,Fw,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";po.prototype.logout=function(n=!0){this.authStore.clear(),n&&Il("/login")};po.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&Ci(s),V.isEmpty(l.data)||Yt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Il("/")};po.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Lb(ek);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Cu(t,10))&&(t&&localStorage.removeItem(ra),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(ra,t),this._superuserFileTokenRequest=null),t};class Uw extends G0{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const me=new po("../",new Uw);me.authStore.isValid&&me.collection(me.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&me.authStore.clear()});const ir=[];let ik;function lk(n){const e=n.pattern.test(ik);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{ik=n.location+(n.querystring?"?"+n.querystring:""),ir.map(lk)});function qi(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"?nk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ir.push(i),lk(i),{destroy(){ir.splice(ir.indexOf(i),1)}}}const Vw="modulepreload",Bw=function(n,e){return new URL(n,e).href},dc={},Ct=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=Bw(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===u&&(!f||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":Vw,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})},Ww=n=>({}),pc=n=>({});function mc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.0-rc9",p(e,"href","https://pocketbase.io/docs/"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),y(r,l,a),y(r,s,a),w(s,o)},d(r){r&&(v(e),v(t),v(i),v(l),v(s))}}}function Yw(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=It(a,n,n[3],null),f=n[4].footer,c=It(f,n,n[3],pc);let d=((m=n[2])==null?void 0:m.id)&&mc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(h,_){y(h,e,_),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[_]){var g;u&&u.p&&(!r||_&8)&&At(u,a,h,h[3],r?Lt(a,h[3],_,null):Pt(h[3]),null),c&&c.p&&(!r||_&8)&&At(c,f,h,h[3],r?Lt(f,h[3],_,Ww):Pt(h[3]),pc),(g=h[2])!=null&&g.id?d||(d=mc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||_&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||_&3)&&Q(e,"center-content",h[0])},i(h){r||(E(u,h),E(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&v(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function Kw(n,e,t){let i;Qe(n,Fr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class mi extends we{constructor(e){super(),ye(this,e,Kw,Yw,_e,{center:0,class:1})}}function hc(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function Jw(n){let e,t,i,l=!n[0]&&hc();const s=n[1].default,o=It(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){y(r,e,a),l&&l.m(e,null),w(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=hc(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&At(o,s,r,r[2],i?Lt(s,r[2],a,null):Pt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function Zw(n){let e,t;return e=new mi({props:{class:"full-page",center:!0,$$slots:{default:[Jw]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Gw(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class sk extends we{constructor(e){super(),ye(this,e,Gw,Zw,_e,{nobranding:0})}}function _c(n,e,t){const i=n.slice();return i[12]=e[t],i}const Xw=n=>({}),gc=n=>({uniqueId:n[4]});function Qw(n){let e,t,i=pe(n[3]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o({}),Yf=n=>({}),Z2=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=It(T,n,n[18],Kf);let E=n[4]&&n[2]&&Gf(n);const I=n[19].default,L=It(I,n,n[18],null),A=n[19].footer,P=It(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),L&&L.c(),c=C(),d=b("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(s,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(s,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,R){y(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),L&&L.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),g=!0,k||(S=[W(t,"click",et(n[20])),W(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=Zf(n),$.c(),M($,1),$.m(o,r)):$&&(ae(),D($,1,1,()=>{$=null}),ue()),O&&O.p&&(!g||R[0]&262144)&&At(O,T,n,n[18],g?Lt(T,n[18],R,Z2):Pt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),L&&L.p&&(!g||R[0]&262144)&&At(L,I,n,n[18],g?Lt(I,n[18],R,null):Pt(n[18]),null),P&&P.p&&(!g||R[0]&262144)&&At(P,A,n,n[18],g?Lt(A,n[18],R,J2):Pt(n[18]),Yf),(!g||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||R[0]&262)&&Q(s,"popup",n[2]),(!g||R[0]&4)&&Q(e,"padded",n[2]),(!g||R[0]&1)&&Q(e,"active",n[0])},i(N){g||(N&&tt(()=>{g&&(i||(i=je(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(L,N),M(P,N),N&&tt(()=>{g&&(_&&_.end(1),h=Vb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),g=!0)},o(N){N&&(i||(i=je(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(L,N),D(P,N),h&&h.invalidate(),N&&(_=mu(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),g=!1},d(N){N&&v(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),L&&L.d(N),n[21](null),P&&P.d(N),N&&_&&_.end(),k=!1,Ie(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){y(o,e,r),i=!0,l||(s=W(e,"click",et(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){y(l,e,s),t||(i=W(e,"click",et(n[5])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function G2(n){let e,t,i,l,s=n[0]&&Jf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){y(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[W(window,"resize",n[10]),W(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Jf(o),s.c(),M(s,1),s.m(e,null)):s&&(ae(),D(s,1,1,()=>{s=null}),ue())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let bl,la=[];function Y0(){return bl=bl||document.querySelector(".overlays"),bl||(bl=document.createElement("div"),bl.classList.add("overlays"),document.body.appendChild(bl)),bl}let Zi=150;function Xf(){return 1e3+Y0().querySelectorAll(".overlay-panel-container.active").length}function X2(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=bt(),h="op_"+V.randomString(10);let _,g,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function I(){return o}async function L(X){t(17,T=X),X?(k=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await un(),A()}function A(){_&&(o?t(6,_.style.zIndex=Xf(),_):t(6,_.style="",_))}function P(){V.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){V.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(X){o&&f&&X.code=="Escape"&&!V.isInput(X.target)&&_&&_.style.zIndex==Xf()&&(X.preventDefault(),E())}function z(X){o&&F(g)}function F(X,oe){oe&&t(8,$=""),!(!X||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}X.scrollTop==0?t(8,$+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Zt(()=>(Y0().appendChild(_),()=>{var X;clearTimeout(S),N(),(X=_==null?void 0:_.classList)==null||X.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const U=()=>a?E():!0;function J(X){ie[X?"unshift":"push"](()=>{g=X,t(7,g)})}const K=X=>F(X.target);function x(X){ie[X?"unshift":"push"](()=>{_=X,t(6,_)})}return n.$$set=X=>{"class"in X&&t(1,s=X.class),"active"in X&&t(0,o=X.active),"popup"in X&&t(2,r=X.popup),"overlayClose"in X&&t(3,a=X.overlayClose),"btnClose"in X&&t(4,u=X.btnClose),"escClose"in X&&t(12,f=X.escClose),"beforeOpen"in X&&t(13,c=X.beforeOpen),"beforeHide"in X&&t(14,d=X.beforeHide),"$$scope"in X&&t(18,l=X.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&L(o),n.$$.dirty[0]&128&&F(g,!0),n.$$.dirty[0]&64&&_&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,_,g,$,R,z,F,f,c,d,O,I,T,l,i,U,J,K,x]}class Gt extends we{constructor(e){super(),ye(this,e,X2,G2,_e,{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]}}const Bl=[];function K0(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(_e(n,r)&&(n=r,t)){const a=!Bl.length;for(const u of i)u[1](),Bl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function J0(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return K0(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=Nt(h)?h:te},m=l.map((h,_)=>uu(h,g=>{u[_]=g,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){Ie(m),c(),a=!1}})}const Su=Hn({});function pn(n,e,t){Su.set({text:n,yesCallback:e,noCallback:t})}function Z0(){Su.set({})}function Q2(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=B(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){y(s,e,o),w(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&re(i,t)},d(s){s&&v(e)}}}function x2(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=C(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],Q(l,"btn-loading",n[2])},m(a,u){y(a,e,u),w(e,t),y(a,i,u),y(a,l,u),w(l,s),e.focus(),o||(r=[W(e,"click",n[4]),W(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&Q(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,Ie(r)}}}function ew(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:[x2],header:[Q2]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[6](null),H(e,l)}}}function tw(n,e,t){let i;Qe(n,Su,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){ie[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await un(),t(3,o=!1),Z0()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class nw extends we{constructor(e){super(),ye(this,e,tw,ew,_e,{})}}function iw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Mv(e,"visibility","hidden")},m(t,i){y(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function lw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){y(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function sw(n){let e;function t(s,o){return s[1]?lw:iw}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){y(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:te,o:te,d(s){s&&v(e),l.d(),n[16](null)}}}function ow(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let rw=ow();function sa(){return window&&window.tinymce?window.tinymce:null}function aw(n,e,t){let{id:i="tinymce_svelte"+V.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(L,A)=>{d.forEach(P=>{L.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:L})})})};let h,_,g,k=u,S=s;const $=bt();function T(){const L={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,g=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,_.style.visibility="",_),sa().init(L)}Zt(()=>(sa()!==null?T():rw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var L,A;try{g&&((L=g.dom)==null||L.unbind(document),(A=sa())==null||A.remove(g))}catch{}}));function O(L){ie[L?"unshift":"push"](()=>{_=L,t(4,_)})}function E(L){ie[L?"unshift":"push"](()=>{_=L,t(4,_)})}function I(L){ie[L?"unshift":"push"](()=>{h=L,t(3,h)})}return n.$$set=L=>{"id"in L&&t(0,i=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,s=L.disabled),"scriptSrc"in L&&t(8,o=L.scriptSrc),"conf"in L&&t(9,r=L.conf),"modelEvents"in L&&t(10,a=L.modelEvents),"value"in L&&t(5,u=L.value),"text"in L&&t(6,f=L.text),"cssClass"in L&&t(2,c=L.cssClass)},n.$$.update=()=>{var L;if(n.$$.dirty&14496)try{g&&k!==u&&(g.setContent(u),t(6,f=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((L=g.mode)==null?void 0:L.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,_,u,f,s,o,r,a,g,k,S,O,E,I]}class Tu extends we{constructor(e){super(),ye(this,e,aw,sw,_e,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function uw(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Pr}=i;return{delay:f,duration:Nt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${k}, ${S});`}}}const Nr=Hn([]);function Ks(n,e=4e3){return Rr(n,"info",e)}function tn(n,e=3e3){return Rr(n,"success",e)}function Ci(n,e=4500){return Rr(n,"error",e)}function fw(n,e=4500){return Rr(n,"warning",e)}function Rr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{G0(i)},t)};Nr.update(l=>($u(l,i.message),V.pushOrReplaceByKey(l,i,"message"),l))}function G0(n){Nr.update(e=>($u(e,n),e))}function Is(){Nr.update(n=>{for(let e of n)$u(n,e);return[]})}function $u(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))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function cw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function dw(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function pw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function mw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,_,g,k;function S(E,I){return E[2].type==="info"?mw:E[2].type==="success"?pw:E[2].type==="warning"?dw:cw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=C(),s=b("div"),r=B(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(s,"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(E,I){y(E,t,I),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),_=!0,g||(k=W(u,"click",et(O)),g=!0)},p(E,I){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!_||I&1)&&o!==(o=e[2].message+"")&&re(r,o),(!_||I&1)&&Q(t,"alert-info",e[2].type=="info"),(!_||I&1)&&Q(t,"alert-success",e[2].type=="success"),(!_||I&1)&&Q(t,"alert-danger",e[2].type=="error"),(!_||I&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){Pv(t),h(),jb(t,m)},a(){h(),h=Av(t,m,uw,{duration:150})},i(E){_||(E&&tt(()=>{_&&(d&&d.end(1),c=Vb(t,mt,{duration:150}),c.start())}),_=!0)},o(E){c&&c.invalidate(),E&&(d=mu(t,Ys,{duration:150})),_=!1},d(E){E&&v(t),T.d(),E&&d&&d.end(),g=!1,k()}}}function hw(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>G0(s)]}class gw extends we{constructor(e){super(),ye(this,e,_w,hw,_e,{})}}function ec(n){let e,t,i;const l=n[18].default,s=It(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){y(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&At(s,l,o,o[17],i?Lt(l,o[17],r,null):Pt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&Q(e,"active",o[0])},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=je(e,qn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function bw(n){let e,t,i,l,s=n[0]&&ec(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){y(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[W(window,"click",n[7]),W(window,"mousedown",n[6]),W(window,"keydown",n[5]),W(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=ec(o),s.c(),M(s,1),s.m(e,null)):s&&(ae(),D(s,1,1,()=>{s=null}),ue())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function kw(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,_,g=!1;const k=bt();function S(X=0){o&&(clearTimeout(_),_=setTimeout($,X))}function $(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function T(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function E(X){return!c||X.classList.contains(u)||c.contains(X)&&X.closest&&X.closest("."+u)}function I(X){L(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=X||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function L(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(X){X.stopPropagation(),E(X.target)&&$()}function P(X){(X.code==="Enter"||X.code==="Space")&&(X.stopPropagation(),E(X.target)&&S(150))}function N(X){X.preventDefault(),X.stopPropagation(),O()}function R(X){(X.code==="Enter"||X.code==="Space")&&(X.preventDefault(),X.stopPropagation(),O())}function z(X){o&&!(m!=null&&m.contains(X.target))&&!(c!=null&&c.contains(X.target))&&O()}function F(X){o&&r&&X.code==="Escape"&&(X.preventDefault(),$())}function U(X){o&&(g=!(c!=null&&c.contains(X.target)))}function J(X){var oe;o&&g&&!(c!=null&&c.contains(X.target))&&!(m!=null&&m.contains(X.target))&&!((oe=X.target)!=null&&oe.closest(".flatpickr-calendar"))&&$()}Zt(()=>(I(),()=>L()));function K(X){ie[X?"unshift":"push"](()=>{d=X,t(3,d)})}function x(X){ie[X?"unshift":"push"](()=>{c=X,t(2,c)})}return n.$$set=X=>{"trigger"in X&&t(8,s=X.trigger),"active"in X&&t(0,o=X.active),"escClose"in X&&t(9,r=X.escClose),"autoScroll"in X&&t(10,a=X.autoScroll),"closableClass"in X&&t(11,u=X.closableClass),"class"in X&&t(1,f=X.class),"$$scope"in X&&t(17,l=X.$$scope)},n.$$.update=()=>{var X,oe;n.$$.dirty[0]&260&&c&&I(s),n.$$.dirty[0]&65537&&(o?((X=m==null?void 0:m.classList)==null||X.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((oe=m==null?void 0:m.classList)==null||oe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,U,J,s,r,a,u,S,$,T,O,m,l,i,K,x]}class jn extends we{constructor(e){super(),ye(this,e,kw,bw,_e,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const fn=Hn(""),gr=Hn(""),Dl=Hn(!1),yn=Hn({});function Yt(n){yn.set(n||{})}function di(n){yn.update(e=>(V.deleteByPath(e,n),e))}const Fr=Hn({});function tc(n){Fr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.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 Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?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.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.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{...this}}}const Io=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function vw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||yw;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}X0=typeof atob!="function"||Sw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Ou{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Cu(this.token)}get isAdmin(){return xl(this.token).type==="admin"}get isAuthRecord(){return xl(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=ic){const i=vw(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.record||l.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=xl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.record&&r>4096){s.record={id:(a=s.record)==null?void 0:a.id,email:(u=s.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(s.record[c]=this.record[c]);o=nc(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{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.record)}}class Q0 extends Ou{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Tw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const $w=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Eu(n){if(n){n.query=n.query||{};for(let e in n)$w.includes(e)||(n.query[e]=n[e],delete n[e])}}function x0(n){const e=[];for(const t in n){if(n[t]===null)continue;const i=n[t],l=encodeURIComponent(t);if(Array.isArray(i))for(const s of i)e.push(l+"="+encodeURIComponent(s));else i instanceof Date?e.push(l+"="+encodeURIComponent(i.toISOString())):typeof i!==null&&typeof i=="object"?e.push(l+"="+encodeURIComponent(JSON.stringify(i))):e.push(l+"="+encodeURIComponent(i))}return e.join("&")}class ek extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class tk extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Cw extends tk{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.record)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.record)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.record)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.record)==null?void 0:l.id)!==e||((s=this.client.authStore.record)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let l;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(l=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||oa(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return s=this.authResponse(s),l&&this.isSuperusers&&function(r,a,u,f){oa(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,_)=>{(!h||(_==null?void 0:_.id)!=(d==null?void 0:d.id)||(_!=null&&_.collectionId||d!=null&&d.collectionId)&&(_==null?void 0:_.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,_)=>{var $;const g=r.authStore.token;if(($=_.query)!=null&&$.autoRefresh)return c?c(h,_):{url:h,sendOptions:_};let k=r.authStore.isValid;if(k&&Cu(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=_.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&g==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return _.headers=S,c?c(h,_):{url:h,sendOptions:_}}}(this.client,l,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),s}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:l,createData:s}};return a=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new ek(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var _;try{await l.subscribe("@oauth2",async $=>{var O;const T=l.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const I=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(I)}catch(E){h(new Fn(E))}s()});const g={state:l.clientId};(_=t.scopes)!=null&&_.length&&(g.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,g);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(g){s(),h(new Fn(g))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new po(this.client.baseURL,new Ou,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class Ow extends tk{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class Ew extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Mw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class Dw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Iw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Wa(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function sc(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function oc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Wa(i))return!0}return!1}class Lw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Aw(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l0&&s.length==l.length){e.files[i]=e.files[i]||[];for(let r of s)e.files[i].push(r)}else if(e.json[i]=o,s.length>0){let r=i;i.startsWith("+")||i.endsWith("+")||(r+="+"),e.files[r]=e.files[r]||[];for(let a of s)e.files[r].push(a)}}else e.json[i]=l}}}class po{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Ou:this.authStore=new Q0,this.collections=new Ow(this),this.files=new Dw(this),this.logs=new Ew(this),this.settings=new Tw(this),this.realtime=new ek(this),this.health=new Mw(this),this.backups=new Iw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Lw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Cw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=x0(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const En=Hn([]),ei=Hn({}),Js=Hn(!1),nk=Hn({}),Mu=Hn({});let Ls;typeof BroadcastChannel<"u"&&(Ls=new BroadcastChannel("collections"),Ls.onmessage=()=>{var n;Du((n=Pb(ei))==null?void 0:n.id)});function ik(){Ls==null||Ls.postMessage("reload")}function Pw(n){En.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ei.set(t):e.length&&ei.set(e.find(i=>!i.system)||e[0]),e})}function Nw(n){ei.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),En.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Iu(),ik(),V.sortCollections(e)))}function Rw(n){En.update(e=>(V.removeByKey(e,"id",n.id),ei.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Iu(),ik(),e))}async function Du(n=null){Js.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),En.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ei.set(t):e.length&&ei.set(e.find(i=>!i.system)||e[0]),Iu(),Mu.set(await me.collections.getScaffolds())}catch(e){me.error(e)}Js.set(!1)}function Iu(){nk.update(n=>(En.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(l=>l.type=="file"&&l.protected));return e}),n))}function lk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function Fw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function qw(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function Hw(n){let e,t,i,l;const s=[qw,Fw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function rc(){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 qr=K0(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});J0(qr,n=>n.location);const Lu=J0(qr,n=>n.querystring),ac=Hn(void 0);async function Il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await un();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 Vn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function jw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(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||zw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function zw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Uw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:I,keys:L}=lk(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=I,this._keys=L}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const I={};let L=0;for(;L{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=bt();async function d(T,O){await un(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Nv(()=>{jw(m)}));let _=null,g=null;const k=qr.subscribe(async T=>{_=T;let O=0;for(;O{ac.set(u)});return}t(0,a=null),g=null,ac.set(void 0)});ro(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Ne.call(this,n,T)}function $(T){Ne.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class Vw extends we{constructor(e){super(),ye(this,e,Uw,Hw,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";po.prototype.logout=function(n=!0){this.authStore.clear(),n&&Il("/login")};po.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&Ci(s),V.isEmpty(l.data)||Yt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Il("/")};po.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Pb(nk);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Cu(t,10))&&(t&&localStorage.removeItem(ra),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(ra,t),this._superuserFileTokenRequest=null),t};class Bw extends Q0{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const me=new po("../",new Bw);me.authStore.isValid&&me.collection(me.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&me.authStore.clear()});const ir=[];let sk;function ok(n){const e=n.pattern.test(sk);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{sk=n.location+(n.querystring?"?"+n.querystring:""),ir.map(ok)});function qi(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"?lk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ir.push(i),ok(i),{destroy(){ir.splice(ir.indexOf(i),1)}}}const Ww="modulepreload",Yw=function(n,e){return new URL(n,e).href},dc={},Ct=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=Yw(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===u&&(!f||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":Ww,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})},Kw=n=>({}),pc=n=>({});function mc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.0-rc9",p(e,"href","https://pocketbase.io/docs/"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),y(r,l,a),y(r,s,a),w(s,o)},d(r){r&&(v(e),v(t),v(i),v(l),v(s))}}}function Jw(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=It(a,n,n[3],null),f=n[4].footer,c=It(f,n,n[3],pc);let d=((m=n[2])==null?void 0:m.id)&&mc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(h,_){y(h,e,_),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[_]){var g;u&&u.p&&(!r||_&8)&&At(u,a,h,h[3],r?Lt(a,h[3],_,null):Pt(h[3]),null),c&&c.p&&(!r||_&8)&&At(c,f,h,h[3],r?Lt(f,h[3],_,Kw):Pt(h[3]),pc),(g=h[2])!=null&&g.id?d||(d=mc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||_&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||_&3)&&Q(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&v(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function Zw(n,e,t){let i;Qe(n,Fr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class mi extends we{constructor(e){super(),ye(this,e,Zw,Jw,_e,{center:0,class:1})}}function hc(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function Gw(n){let e,t,i,l=!n[0]&&hc();const s=n[1].default,o=It(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){y(r,e,a),l&&l.m(e,null),w(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=hc(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&At(o,s,r,r[2],i?Lt(s,r[2],a,null):Pt(r[2]),null)},i(r){i||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function Xw(n){let e,t;return e=new mi({props:{class:"full-page",center:!0,$$slots:{default:[Gw]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Qw(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class rk extends we{constructor(e){super(),ye(this,e,Qw,Xw,_e,{nobranding:0})}}function _c(n,e,t){const i=n.slice();return i[12]=e[t],i}const xw=n=>({}),gc=n=>({uniqueId:n[4]});function e3(n){let e,t,i=de(n[3]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=je(t,Mt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=je(t,Mt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function bc(n){let e,t,i=br(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){y(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=br(a[12])+"")&&re(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=je(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=je(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function e3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=It(a,n,n[8],gc),f=[xw,Qw],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(m,h){y(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=B(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&At(u,a,m,m[8],s?Lt(a,m[8],h,Xw):Pt(m[8]),gc);let _=i;i=d(m),i===_?c[i].p(m,h):(ae(),D(c[_],1,1,()=>{c[_]=null}),ue(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&Q(e,"error",m[3].length)},i(m){s||(E(u,m),E(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const kc="Invalid value";function br(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||kc:n||kc}function t3(n,e,t){let i;Qe(n,yn,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){di(r)}Zt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(_){Ne.call(this,n,_)}function h(_){ie[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,u=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends we{constructor(e){super(),ye(this,e,t3,e3,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function n3(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=C(),s=b("input"),p(e,"for",i=n[17]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[17]),s.required=!0,s.autofocus=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[2]),s.focus(),r||(a=B(s,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function i3(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Password"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Recommended at least 10 characters.",p(e,"for",i=n[17]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[17]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[3]),y(c,r,d),y(c,a,d),u||(f=B(s,"input",n[10]),u=!0)},p(c,d){d&131072&&i!==(i=c[17])&&p(e,"for",i),d&131072&&o!==(o=c[17])&&p(s,"id",o),d&8&&s.value!==c[3]&&ce(s,c[3])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function l3(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Password confirm"),l=C(),s=b("input"),p(e,"for",i=n[17]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[17]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[4]),r||(a=B(s,"input",n[11]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(s,"id",o),f&16&&s.value!==u[4]&&ce(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function s3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$;return l=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[n3,({uniqueId:T})=>({17:T}),({uniqueId:T})=>T?131072:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[i3,({uniqueId:T})=>({17:T}),({uniqueId:T})=>T?131072:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[l3,({uniqueId:T})=>({17:T}),({uniqueId:T})=>T?131072:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first superuser account in order to continue

",i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),f=b("button"),f.innerHTML='Create superuser and login ',c=C(),d=b("hr"),m=C(),h=b("label"),h.innerHTML=' Or initialize from backup',_=C(),g=b("input"),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[6]),Q(f,"btn-loading",n[0]),p(e,"class","block"),p(e,"autocomplete","off"),p(h,"for","backupFileInput"),p(h,"class","btn btn-lg btn-hint btn-transparent btn-block"),Q(h,"btn-disabled",n[6]),Q(h,"btn-loading",n[1]),p(g,"id","backupFileInput"),p(g,"type","file"),p(g,"class","hidden"),p(g,"accept",".zip")},m(T,O){y(T,e,O),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),w(e,u),w(e,f),y(T,c,O),y(T,d,O),y(T,m,O),y(T,h,O),y(T,_,O),y(T,g,O),n[12](g),k=!0,S||($=[B(e,"submit",et(n[7])),B(g,"change",n[13])],S=!0)},p(T,[O]){const M={};O&393220&&(M.$$scope={dirty:O,ctx:T}),l.$set(M);const L={};O&393224&&(L.$$scope={dirty:O,ctx:T}),o.$set(L);const I={};O&393232&&(I.$$scope={dirty:O,ctx:T}),a.$set(I),(!k||O&64)&&Q(f,"btn-disabled",T[6]),(!k||O&1)&&Q(f,"btn-loading",T[0]),(!k||O&64)&&Q(h,"btn-disabled",T[6]),(!k||O&2)&&Q(h,"btn-loading",T[1])},i(T){k||(E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),k=!0)},o(T){D(l.$$.fragment,T),D(o.$$.fragment,T),D(a.$$.fragment,T),k=!1},d(T){T&&(v(e),v(c),v(d),v(m),v(h),v(_),v(g)),H(l),H(o),H(a),n[12](null),S=!1,Ie($)}}}function o3(n,e,t){let i;const l=bt();let s="",o="",r="",a=!1,u=!1,f;async function c(){if(!i){t(0,a=!0);try{await me.collection("_superusers").create({email:s,password:o,passwordConfirm:r}),await me.collection("_superusers").authWithPassword(s,o),l("submit")}catch(T){me.error(T)}t(0,a=!1)}}function d(){f&&t(5,f.value="",f)}function m(T){T&&pn(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source. +`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=je(t,Mt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=je(t,Mt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function bc(n){let e,t,i=br(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=B(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){y(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=br(a[12])+"")&&re(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=je(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=je(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function n3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=It(a,n,n[8],gc),f=[t3,e3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(m,h){y(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=W(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&At(u,a,m,m[8],s?Lt(a,m[8],h,xw):Pt(m[8]),gc);let _=i;i=d(m),i===_?c[i].p(m,h):(ae(),D(c[_],1,1,()=>{c[_]=null}),ue(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&Q(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const kc="Invalid value";function br(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||kc:n||kc}function i3(n,e,t){let i;Qe(n,yn,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){di(r)}Zt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(_){Ne.call(this,n,_)}function h(_){ie[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,u=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends we{constructor(e){super(),ye(this,e,i3,n3,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function l3(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Email"),l=C(),s=b("input"),p(e,"for",i=n[17]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[17]),s.required=!0,s.autofocus=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[2]),s.focus(),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function s3(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Password"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Recommended at least 10 characters.",p(e,"for",i=n[17]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[17]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[3]),y(c,r,d),y(c,a,d),u||(f=W(s,"input",n[10]),u=!0)},p(c,d){d&131072&&i!==(i=c[17])&&p(e,"for",i),d&131072&&o!==(o=c[17])&&p(s,"id",o),d&8&&s.value!==c[3]&&ce(s,c[3])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function o3(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Password confirm"),l=C(),s=b("input"),p(e,"for",i=n[17]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[17]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[4]),r||(a=W(s,"input",n[11]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(s,"id",o),f&16&&s.value!==u[4]&&ce(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function r3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$;return l=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[l3,({uniqueId:T})=>({17:T}),({uniqueId:T})=>T?131072:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[s3,({uniqueId:T})=>({17:T}),({uniqueId:T})=>T?131072:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[o3,({uniqueId:T})=>({17:T}),({uniqueId:T})=>T?131072:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first superuser account in order to continue

",i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),f=b("button"),f.innerHTML='Create superuser and login ',c=C(),d=b("hr"),m=C(),h=b("label"),h.innerHTML=' Or initialize from backup',_=C(),g=b("input"),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[6]),Q(f,"btn-loading",n[0]),p(e,"class","block"),p(e,"autocomplete","off"),p(h,"for","backupFileInput"),p(h,"class","btn btn-lg btn-hint btn-transparent btn-block"),Q(h,"btn-disabled",n[6]),Q(h,"btn-loading",n[1]),p(g,"id","backupFileInput"),p(g,"type","file"),p(g,"class","hidden"),p(g,"accept",".zip")},m(T,O){y(T,e,O),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),w(e,u),w(e,f),y(T,c,O),y(T,d,O),y(T,m,O),y(T,h,O),y(T,_,O),y(T,g,O),n[12](g),k=!0,S||($=[W(e,"submit",et(n[7])),W(g,"change",n[13])],S=!0)},p(T,[O]){const E={};O&393220&&(E.$$scope={dirty:O,ctx:T}),l.$set(E);const I={};O&393224&&(I.$$scope={dirty:O,ctx:T}),o.$set(I);const L={};O&393232&&(L.$$scope={dirty:O,ctx:T}),a.$set(L),(!k||O&64)&&Q(f,"btn-disabled",T[6]),(!k||O&1)&&Q(f,"btn-loading",T[0]),(!k||O&64)&&Q(h,"btn-disabled",T[6]),(!k||O&2)&&Q(h,"btn-loading",T[1])},i(T){k||(M(l.$$.fragment,T),M(o.$$.fragment,T),M(a.$$.fragment,T),k=!0)},o(T){D(l.$$.fragment,T),D(o.$$.fragment,T),D(a.$$.fragment,T),k=!1},d(T){T&&(v(e),v(c),v(d),v(m),v(h),v(_),v(g)),H(l),H(o),H(a),n[12](null),S=!1,Ie($)}}}function a3(n,e,t){let i;const l=bt();let s="",o="",r="",a=!1,u=!1,f;async function c(){if(!i){t(0,a=!0);try{await me.collection("_superusers").create({email:s,password:o,passwordConfirm:r}),await me.collection("_superusers").authWithPassword(s,o),l("submit")}catch(T){me.error(T)}t(0,a=!1)}}function d(){f&&t(5,f.value="",f)}function m(T){T&&pn(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source. -Do you really want to upload and initialize "${T.name}"?`,()=>{h(T)},()=>{d()})}async function h(T){if(!(!T||i)){t(1,u=!0);try{await me.backups.upload({file:T}),await me.backups.restore(T.name),Ks("Please wait while extracting the uploaded archive!"),await new Promise(O=>setTimeout(O,2e3)),l("submit")}catch(O){me.error(O)}d(),t(1,u=!1)}}function _(){s=this.value,t(2,s)}function g(){o=this.value,t(3,o)}function k(){r=this.value,t(4,r)}function S(T){ie[T?"unshift":"push"](()=>{f=T,t(5,f)})}const $=T=>{var O,M;m((M=(O=T.target)==null?void 0:O.files)==null?void 0:M[0])};return n.$$.update=()=>{n.$$.dirty&3&&t(6,i=a||u)},[a,u,s,o,r,f,i,c,m,_,g,k,S,$]}class r3 extends we{constructor(e){super(),ye(this,e,o3,s3,_e,{})}}function vc(n){let e,t;return e=new sk({props:{$$slots:{default:[a3]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function a3(n){let e,t;return e=new r3({}),e.$on("submit",n[1]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p:te,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function u3(n){let e,t,i=n[0]&&vc(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),y(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=vc(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ae(),D(i,1,1,()=>{i=null}),ue())},i(l){t||(E(i),t=!0)},o(l){D(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function f3(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("pbinstal")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Il("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await un(),window.location.search=""}]}class c3 extends we{constructor(e){super(),ye(this,e,f3,u3,_e,{})}}function d3(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){y(s,e,o),n[13](e),ce(e,n[7]),i||(l=B(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&ce(e,s[7])},i:te,o:te,d(s){s&&v(e),n[13](null),i=!1,l()}}}function p3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=jt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){ae();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};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],Te(()=>t=!1)),e.$set(f)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function yc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){y(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=je(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function wc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){y(o,e,r),i=!0,l||(s=B(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function m3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[p3,d3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&yc(),g=(n[0].length||n[7].length)&&wc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=C(),o.c(),r=C(),_&&_.c(),a=C(),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(k,S){y(k,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),_&&_.m(e,null),w(e,a),g&&g.m(e,null),u=!0,f||(c=[B(e,"click",On(n[11])),B(e,"submit",et(n[10]))],f=!0)},p(k,[S]){let $=s;s=h(k),s===$?m[s].p(k,S):(ae(),D(m[$],1,1,()=>{m[$]=null}),ue(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),E(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?_?S&129&&E(_,1):(_=yc(),_.c(),E(_,1),_.m(e,a)):_&&(ae(),D(_,1,1,()=>{_=null}),ue()),k[0].length||k[7].length?g?(g.p(k,S),S&129&&E(g,1)):(g=wc(k),g.c(),E(g,1),g.m(e,null)):g&&(ae(),D(g,1,1,()=>{g=null}),ue())},i(k){u||(E(o),E(_),E(g),u=!0)},o(k){D(o),D(_),D(g),u=!1},d(k){k&&v(e),m[s].d(),_&&_.d(),g&&g.d(),f=!1,Ie(c)}}}function h3(n,e,t){const i=bt(),l="search_"+V.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){u||f||(t(5,f=!0),t(4,u=(await Ct(async()=>{const{default:O}=await import("./FilterAutocompleteInput-B-j6H3tq.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Zt(()=>{_()});function g(O){Ne.call(this,n,O)}function k(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,g,k,S,$,T]}class Hr extends we{constructor(e){super(),ye(this,e,h3,m3,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function _3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){y(r,e,a),w(e,t),s||(o=[Ee(l=He.call(null,e,n[0])),B(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Nt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:te,o:te,d(r){r&&v(e),s=!1,Ie(o)}}}function g3(n,e,t){const i=bt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Zt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Au extends we{constructor(e){super(),ye(this,e,g3,_3,_e,{tooltip:0,class:1})}}const b3=n=>({}),Sc=n=>({}),k3=n=>({}),Tc=n=>({});function v3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=It(u,n,n[10],Tc),c=n[11].default,d=It(c,n,n[10],null),m=n[11].after,h=It(m,n,n[10],Sc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),s=C(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){y(_,e,g),f&&f.m(e,null),w(e,t),w(e,i),d&&d.m(i,null),n[12](i),w(e,s),h&&h.m(e,null),o=!0,r||(a=[B(window,"resize",n[1]),B(i,"scroll",n[1])],r=!0)},p(_,[g]){f&&f.p&&(!o||g&1024)&&At(f,u,_,_[10],o?Lt(u,_[10],g,k3):Pt(_[10]),Tc),d&&d.p&&(!o||g&1024)&&At(d,c,_,_[10],o?Lt(c,_[10],g,null):Pt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&At(h,m,_,_[10],o?Lt(m,_[10],g,b3):Pt(_[10]),Sc)},i(_){o||(E(f,_),E(d,_),E(h,_),o=!0)},o(_){D(f,_),D(d,_),D(h,_),o=!1},d(_){_&&v(e),f&&f.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,Ie(a)}}}function y3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=bt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,_,g,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),_=f.clientWidth+2,g=f.clientHeight+2,m=f.scrollWidth-_,h=f.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}Zt(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function M(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,l,i,M]}class Pu extends we{constructor(e){super(),ye(this,e,y3,v3,_e,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function w3(n){let e,t,i,l,s;const o=n[6].default,r=It(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),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){y(a,e,u),r&&r.m(e,null),i=!0,l||(s=[B(e,"click",n[7]),B(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&At(r,o,a,a[5],i?Lt(o,a[5],u,null):Pt(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||(E(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,Ie(s)}}}function S3(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class lr extends we{constructor(e){super(),ye(this,e,S3,w3,_e,{class:1,name:2,sort:0,disable:3})}}function T3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){y(o,e,r),w(e,i),l||(s=Ee(He.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&re(i,t)},i:te,o:te,d(o){o&&v(e),l=!1,s()}}}function $3(n,e,t){let{date:i}=e;const l={get text(){return V.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class ok extends we{constructor(e){super(),ye(this,e,$3,T3,_e,{date:0})}}function C3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=W(i),s=W(" ("),o=W(n[0]),r=W(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){y(u,e,f),w(e,t),w(t,l),w(t,s),w(t,o),w(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&re(l,i),f&1&&re(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&v(e)}}}function O3(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=U0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class rk extends we{constructor(e){super(),ye(this,e,O3,C3,_e,{level:0})}}function $c(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=H3(i[32]);return i[34]=s,i}function Cc(n,e,t){const i=n.slice();return i[37]=e[t],i}function E3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){y(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=B(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function M3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function D3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function I3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function L3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Oc(n){let e;function t(s,o){return s[7]?P3:A3}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function A3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Ec(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=C(),o&&o.c(),s=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){y(a,e,u),w(e,t),w(t,i),w(t,l),o&&o.m(t,null),w(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Ec(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function P3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Ec(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[26]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function Mc(n){let e,t=pe(n[34]),i=[];for(let l=0;l',P=C(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[32].id),s.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(M,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(x,X){y(x,t,X),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,_),w(_,g),w(g,k),w(k,$),w(_,T),U&&U.m(_,null),w(t,O),w(t,M),q(L,M,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[B(s,"change",F),B(l,"click",On(e[18])),B(t,"click",J),B(t,"keydown",K)],R=!0)},p(x,X){e=x,(!N||X[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||X[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||X[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const oe={};X[0]&8&&(oe.level=e[32].level),m.$set(oe),(!N||X[0]&8)&&S!==(S=e[32].message+"")&&re($,S),e[34].length?U?U.p(e,X):(U=Mc(e),U.c(),U.m(_,null)):U&&(U.d(1),U=null);const Se={};X[0]&8&&(Se.date=e[32].created),L.$set(Se)},i(x){N||(E(m.$$.fragment,x),E(L.$$.fragment,x),N=!0)},o(x){D(m.$$.fragment,x),D(L.$$.fragment,x),N=!1},d(x){x&&v(t),H(m),U&&U.d(),H(L),R=!1,Ie(z)}}}function F3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S=[],$=new Map,T;function O(K,x){return K[7]?M3:E3}let M=O(n),L=M(n);function I(K){n[20](K)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[D3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new lr({props:A}),ie.push(()=>be(o,"sort",I));function P(K){n[21](K)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[I3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new lr({props:N}),ie.push(()=>be(u,"sort",P));function R(K){n[22](K)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new lr({props:z}),ie.push(()=>be(d,"sort",R));let F=pe(n[3]);const U=K=>K[32].id;for(let K=0;Kr=!1)),o.$set(X);const oe={};x[1]&512&&(oe.$$scope={dirty:x,ctx:K}),!f&&x[0]&2&&(f=!0,oe.sort=K[1],Te(()=>f=!1)),u.$set(oe);const Se={};x[1]&512&&(Se.$$scope={dirty:x,ctx:K}),!m&&x[0]&2&&(m=!0,Se.sort=K[1],Te(()=>m=!1)),d.$set(Se),x[0]&9369&&(F=pe(K[3]),ae(),S=yt(S,x,U,1,K,F,$,k,zt,Ic,null,$c),ue(),!F.length&&J?J.p(K,x):F.length?J&&(J.d(1),J=null):(J=Oc(K),J.c(),J.m(k,null))),(!T||x[0]&128)&&Q(e,"table-loading",K[7])},i(K){if(!T){E(o.$$.fragment,K),E(u.$$.fragment,K),E(d.$$.fragment,K);for(let x=0;xLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[7]),Q(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){y(s,e,o),w(e,t),i||(l=B(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&Q(t,"btn-loading",s[7]),o[0]&128&&Q(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function Ac(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,_,g,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),l=b("strong"),s=W(n[5]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){y($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),g=!0,k||(S=[B(f,"click",n[28]),B(h,"click",n[14])],k=!0)},p($,T){(!g||T[0]&32)&&re(s,$[5]),(!g||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&re(a,r)},i($){g||($&&tt(()=>{g&&(_||(_=je(e,qn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o($){$&&(_||(_=je(e,qn,{duration:150,y:5},!1)),_.run(0)),g=!1},d($){$&&v(e),$&&_&&_.end(),k=!1,Ie(S)}}}function q3(n){let e,t,i,l,s;e=new Pu({props:{class:"table-wrapper",$$slots:{default:[F3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Lc(n),r=n[5]&&Ac(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ke()},m(a,u){q(e,a,u),y(a,t,u),o&&o.m(a,u),y(a,i,u),r&&r.m(a,u),y(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Lc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&E(r,1)):(r=Ac(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(ae(),D(r,1,1,()=>{r=null}),ue())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(v(t),v(i),v(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Pc=50,aa=/[-:\. ]/gi;function H3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function j3(n,e,t){let i,l,s;const o=bt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,_=0,g={};async function k(X=1,oe=!0){t(7,h=!0);const Se=[a,V.normalizeLogsFilter(r)];return u.min&&u.max&&Se.push(`created >= "${u.min}" && created <= "${u.max}"`),me.logs.getList(X,Pc,{sort:f,skipTotal:1,filter:Se.filter(Boolean).join("&&")}).then(async ge=>{var Ye;X<=1&&S();const $e=V.toArray(ge.items);if(t(7,h=!1),t(6,d=ge.page),t(17,m=((Ye=ge.items)==null?void 0:Ye.length)||0),o("load",c.concat($e)),oe){const nt=++_;for(;$e.length&&_==nt;){const xe=$e.splice(0,10);for(let We of xe)V.pushOrReplaceByKey(c,We);t(3,c),await V.yieldToMain()}}else{for(let nt of $e)V.pushOrReplaceByKey(c,nt);t(3,c)}}).catch(ge=>{ge!=null&&ge.isAbort||(t(7,h=!1),console.warn(ge),S(),me.error(ge,!Se||(ge==null?void 0:ge.status)!=400))})}function S(){t(3,c=[]),t(4,g={}),t(6,d=1),t(17,m=0)}function $(){s?T():O()}function T(){t(4,g={})}function O(){for(const X of c)t(4,g[X.id]=X,g);t(4,g)}function M(X){g[X.id]?delete g[X.id]:t(4,g[X.id]=X,g),t(4,g)}function L(){const X=Object.values(g).sort((ge,$e)=>ge.created<$e.created?1:ge.created>$e.created?-1:0);if(!X.length)return;if(X.length==1)return V.downloadJson(X[0],"log_"+X[0].created.replaceAll(aa,"")+".json");const oe=X[0].created.replaceAll(aa,""),Se=X[X.length-1].created.replaceAll(aa,"");return V.downloadJson(X,`${X.length}_logs_${Se}_to_${oe}.json`)}function I(X){Ne.call(this,n,X)}const A=()=>$();function P(X){f=X,t(1,f)}function N(X){f=X,t(1,f)}function R(X){f=X,t(1,f)}const z=X=>M(X),F=X=>o("select",X),U=(X,oe)=>{oe.code==="Enter"&&(oe.preventDefault(),o("select",X))},J=()=>t(0,r=""),K=()=>k(d+1),x=()=>T();return n.$$set=X=>{"filter"in X&&t(0,r=X.filter),"presets"in X&&t(15,a=X.presets),"zoom"in X&&t(16,u=X.zoom),"sort"in X&&t(1,f=X.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Pc),n.$$.dirty[0]&16&&t(5,l=Object.keys(g).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,k,c,g,l,d,h,s,i,o,$,T,M,L,a,u,m,I,A,P,N,R,z,F,U,J,K,x]}class z3 extends we{constructor(e){super(),ye(this,e,j3,q3,_e,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! +Do you really want to upload and initialize "${T.name}"?`,()=>{h(T)},()=>{d()})}async function h(T){if(!(!T||i)){t(1,u=!0);try{await me.backups.upload({file:T}),await me.backups.restore(T.name),Ks("Please wait while extracting the uploaded archive!"),await new Promise(O=>setTimeout(O,2e3)),l("submit")}catch(O){me.error(O)}d(),t(1,u=!1)}}function _(){s=this.value,t(2,s)}function g(){o=this.value,t(3,o)}function k(){r=this.value,t(4,r)}function S(T){ie[T?"unshift":"push"](()=>{f=T,t(5,f)})}const $=T=>{var O,E;m((E=(O=T.target)==null?void 0:O.files)==null?void 0:E[0])};return n.$$.update=()=>{n.$$.dirty&3&&t(6,i=a||u)},[a,u,s,o,r,f,i,c,m,_,g,k,S,$]}class u3 extends we{constructor(e){super(),ye(this,e,a3,r3,_e,{})}}function vc(n){let e,t;return e=new rk({props:{$$slots:{default:[f3]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f3(n){let e,t;return e=new u3({}),e.$on("submit",n[1]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p:te,i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function c3(n){let e,t,i=n[0]&&vc(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),y(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&M(i,1)):(i=vc(l),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(ae(),D(i,1,1,()=>{i=null}),ue())},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function d3(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("pbinstal")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Il("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await un(),window.location.search=""}]}class p3 extends we{constructor(e){super(),ye(this,e,d3,c3,_e,{})}}function m3(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){y(s,e,o),n[13](e),ce(e,n[7]),i||(l=W(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&ce(e,s[7])},i:te,o:te,d(s){s&&v(e),n[13](null),i=!1,l()}}}function h3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=jt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){ae();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};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],Te(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function yc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){y(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=je(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function wc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){y(o,e,r),i=!0,l||(s=W(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function _3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[h3,m3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&yc(),g=(n[0].length||n[7].length)&&wc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=C(),o.c(),r=C(),_&&_.c(),a=C(),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(k,S){y(k,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),_&&_.m(e,null),w(e,a),g&&g.m(e,null),u=!0,f||(c=[W(e,"click",On(n[11])),W(e,"submit",et(n[10]))],f=!0)},p(k,[S]){let $=s;s=h(k),s===$?m[s].p(k,S):(ae(),D(m[$],1,1,()=>{m[$]=null}),ue(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?_?S&129&&M(_,1):(_=yc(),_.c(),M(_,1),_.m(e,a)):_&&(ae(),D(_,1,1,()=>{_=null}),ue()),k[0].length||k[7].length?g?(g.p(k,S),S&129&&M(g,1)):(g=wc(k),g.c(),M(g,1),g.m(e,null)):g&&(ae(),D(g,1,1,()=>{g=null}),ue())},i(k){u||(M(o),M(_),M(g),u=!0)},o(k){D(o),D(_),D(g),u=!1},d(k){k&&v(e),m[s].d(),_&&_.d(),g&&g.d(),f=!1,Ie(c)}}}function g3(n,e,t){const i=bt(),l="search_"+V.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){u||f||(t(5,f=!0),t(4,u=(await Ct(async()=>{const{default:O}=await import("./FilterAutocompleteInput-SHg3tCmR.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Zt(()=>{_()});function g(O){Ne.call(this,n,O)}function k(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,g,k,S,$,T]}class Hr extends we{constructor(e){super(),ye(this,e,g3,_3,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function b3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){y(r,e,a),w(e,t),s||(o=[Ee(l=He.call(null,e,n[0])),W(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Nt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:te,o:te,d(r){r&&v(e),s=!1,Ie(o)}}}function k3(n,e,t){const i=bt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Zt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Au extends we{constructor(e){super(),ye(this,e,k3,b3,_e,{tooltip:0,class:1})}}const v3=n=>({}),Sc=n=>({}),y3=n=>({}),Tc=n=>({});function w3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=It(u,n,n[10],Tc),c=n[11].default,d=It(c,n,n[10],null),m=n[11].after,h=It(m,n,n[10],Sc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),s=C(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){y(_,e,g),f&&f.m(e,null),w(e,t),w(e,i),d&&d.m(i,null),n[12](i),w(e,s),h&&h.m(e,null),o=!0,r||(a=[W(window,"resize",n[1]),W(i,"scroll",n[1])],r=!0)},p(_,[g]){f&&f.p&&(!o||g&1024)&&At(f,u,_,_[10],o?Lt(u,_[10],g,y3):Pt(_[10]),Tc),d&&d.p&&(!o||g&1024)&&At(d,c,_,_[10],o?Lt(c,_[10],g,null):Pt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&At(h,m,_,_[10],o?Lt(m,_[10],g,v3):Pt(_[10]),Sc)},i(_){o||(M(f,_),M(d,_),M(h,_),o=!0)},o(_){D(f,_),D(d,_),D(h,_),o=!1},d(_){_&&v(e),f&&f.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,Ie(a)}}}function S3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=bt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,_,g,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),_=f.clientWidth+2,g=f.clientHeight+2,m=f.scrollWidth-_,h=f.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}Zt(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(I){ie[I?"unshift":"push"](()=>{f=I,t(2,f)})}return n.$$set=I=>{"class"in I&&t(0,o=I.class),"vThreshold"in I&&t(4,r=I.vThreshold),"hThreshold"in I&&t(5,a=I.hThreshold),"dispatchOnNoScroll"in I&&t(6,u=I.dispatchOnNoScroll),"$$scope"in I&&t(10,l=I.$$scope)},[o,O,f,c,r,a,u,S,$,T,l,i,E]}class Pu extends we{constructor(e){super(),ye(this,e,S3,w3,_e,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function T3(n){let e,t,i,l,s;const o=n[6].default,r=It(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),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){y(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"click",n[7]),W(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&At(r,o,a,a[5],i?Lt(o,a[5],u,null):Pt(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||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,Ie(s)}}}function $3(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class lr extends we{constructor(e){super(),ye(this,e,$3,T3,_e,{class:1,name:2,sort:0,disable:3})}}function C3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt-nowrap")},m(o,r){y(o,e,r),w(e,i),l||(s=Ee(He.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&re(i,t)},i:te,o:te,d(o){o&&v(e),l=!1,s()}}}function O3(n,e,t){let{date:i}=e;const l={get text(){return V.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class ak extends we{constructor(e){super(),ye(this,e,O3,C3,_e,{date:0})}}function E3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=B(i),s=B(" ("),o=B(n[0]),r=B(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){y(u,e,f),w(e,t),w(t,l),w(t,s),w(t,o),w(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&re(l,i),f&1&&re(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&v(e)}}}function M3(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=B0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class uk extends we{constructor(e){super(),ye(this,e,M3,E3,_e,{level:0})}}function $c(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=z3(i[32]);return i[34]=s,i}function Cc(n,e,t){const i=n.slice();return i[37]=e[t],i}function D3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){y(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function I3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function L3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function A3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function P3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Oc(n){let e;function t(s,o){return s[7]?R3:N3}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function N3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Ec(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=C(),o&&o.c(),s=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){y(a,e,u),w(e,t),w(t,i),w(t,l),o&&o.m(t,null),w(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Ec(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function R3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Ec(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[26]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function Mc(n){let e,t=de(n[34]),i=[];for(let l=0;l',P=C(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[32].id),s.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(x,X){y(x,t,X),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,_),w(_,g),w(g,k),w(k,$),w(_,T),U&&U.m(_,null),w(t,O),w(t,E),q(I,E,null),w(t,L),w(t,A),w(t,P),N=!0,R||(z=[W(s,"change",F),W(l,"click",On(e[18])),W(t,"click",J),W(t,"keydown",K)],R=!0)},p(x,X){e=x,(!N||X[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||X[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||X[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const oe={};X[0]&8&&(oe.level=e[32].level),m.$set(oe),(!N||X[0]&8)&&S!==(S=e[32].message+"")&&re($,S),e[34].length?U?U.p(e,X):(U=Mc(e),U.c(),U.m(_,null)):U&&(U.d(1),U=null);const Se={};X[0]&8&&(Se.date=e[32].created),I.$set(Se)},i(x){N||(M(m.$$.fragment,x),M(I.$$.fragment,x),N=!0)},o(x){D(m.$$.fragment,x),D(I.$$.fragment,x),N=!1},d(x){x&&v(t),H(m),U&&U.d(),H(I),R=!1,Ie(z)}}}function H3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S=[],$=new Map,T;function O(K,x){return K[7]?I3:D3}let E=O(n),I=E(n);function L(K){n[20](K)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new lr({props:A}),ie.push(()=>be(o,"sort",L));function P(K){n[21](K)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[A3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new lr({props:N}),ie.push(()=>be(u,"sort",P));function R(K){n[22](K)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[P3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new lr({props:z}),ie.push(()=>be(d,"sort",R));let F=de(n[3]);const U=K=>K[32].id;for(let K=0;Kr=!1)),o.$set(X);const oe={};x[1]&512&&(oe.$$scope={dirty:x,ctx:K}),!f&&x[0]&2&&(f=!0,oe.sort=K[1],Te(()=>f=!1)),u.$set(oe);const Se={};x[1]&512&&(Se.$$scope={dirty:x,ctx:K}),!m&&x[0]&2&&(m=!0,Se.sort=K[1],Te(()=>m=!1)),d.$set(Se),x[0]&9369&&(F=de(K[3]),ae(),S=yt(S,x,U,1,K,F,$,k,zt,Ic,null,$c),ue(),!F.length&&J?J.p(K,x):F.length?J&&(J.d(1),J=null):(J=Oc(K),J.c(),J.m(k,null))),(!T||x[0]&128)&&Q(e,"table-loading",K[7])},i(K){if(!T){M(o.$$.fragment,K),M(u.$$.fragment,K),M(d.$$.fragment,K);for(let x=0;xLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[7]),Q(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){y(s,e,o),w(e,t),i||(l=W(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&Q(t,"btn-loading",s[7]),o[0]&128&&Q(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function Ac(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,_,g,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[5]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){y($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),g=!0,k||(S=[W(f,"click",n[28]),W(h,"click",n[14])],k=!0)},p($,T){(!g||T[0]&32)&&re(s,$[5]),(!g||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&re(a,r)},i($){g||($&&tt(()=>{g&&(_||(_=je(e,qn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o($){$&&(_||(_=je(e,qn,{duration:150,y:5},!1)),_.run(0)),g=!1},d($){$&&v(e),$&&_&&_.end(),k=!1,Ie(S)}}}function j3(n){let e,t,i,l,s;e=new Pu({props:{class:"table-wrapper",$$slots:{default:[H3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Lc(n),r=n[5]&&Ac(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ke()},m(a,u){q(e,a,u),y(a,t,u),o&&o.m(a,u),y(a,i,u),r&&r.m(a,u),y(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Lc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Ac(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(ae(),D(r,1,1,()=>{r=null}),ue())},i(a){s||(M(e.$$.fragment,a),M(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(v(t),v(i),v(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Pc=50,aa=/[-:\. ]/gi;function z3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function U3(n,e,t){let i,l,s;const o=bt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,_=0,g={};async function k(X=1,oe=!0){t(7,h=!0);const Se=[a,V.normalizeLogsFilter(r)];return u.min&&u.max&&Se.push(`created >= "${u.min}" && created <= "${u.max}"`),me.logs.getList(X,Pc,{sort:f,skipTotal:1,filter:Se.filter(Boolean).join("&&")}).then(async ge=>{var Ye;X<=1&&S();const $e=V.toArray(ge.items);if(t(7,h=!1),t(6,d=ge.page),t(17,m=((Ye=ge.items)==null?void 0:Ye.length)||0),o("load",c.concat($e)),oe){const nt=++_;for(;$e.length&&_==nt;){const xe=$e.splice(0,10);for(let We of xe)V.pushOrReplaceByKey(c,We);t(3,c),await V.yieldToMain()}}else{for(let nt of $e)V.pushOrReplaceByKey(c,nt);t(3,c)}}).catch(ge=>{ge!=null&&ge.isAbort||(t(7,h=!1),console.warn(ge),S(),me.error(ge,!Se||(ge==null?void 0:ge.status)!=400))})}function S(){t(3,c=[]),t(4,g={}),t(6,d=1),t(17,m=0)}function $(){s?T():O()}function T(){t(4,g={})}function O(){for(const X of c)t(4,g[X.id]=X,g);t(4,g)}function E(X){g[X.id]?delete g[X.id]:t(4,g[X.id]=X,g),t(4,g)}function I(){const X=Object.values(g).sort((ge,$e)=>ge.created<$e.created?1:ge.created>$e.created?-1:0);if(!X.length)return;if(X.length==1)return V.downloadJson(X[0],"log_"+X[0].created.replaceAll(aa,"")+".json");const oe=X[0].created.replaceAll(aa,""),Se=X[X.length-1].created.replaceAll(aa,"");return V.downloadJson(X,`${X.length}_logs_${Se}_to_${oe}.json`)}function L(X){Ne.call(this,n,X)}const A=()=>$();function P(X){f=X,t(1,f)}function N(X){f=X,t(1,f)}function R(X){f=X,t(1,f)}const z=X=>E(X),F=X=>o("select",X),U=(X,oe)=>{oe.code==="Enter"&&(oe.preventDefault(),o("select",X))},J=()=>t(0,r=""),K=()=>k(d+1),x=()=>T();return n.$$set=X=>{"filter"in X&&t(0,r=X.filter),"presets"in X&&t(15,a=X.presets),"zoom"in X&&t(16,u=X.zoom),"sort"in X&&t(1,f=X.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Pc),n.$$.dirty[0]&16&&t(5,l=Object.keys(g).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,k,c,g,l,d,h,s,i,o,$,T,E,I,a,u,m,L,A,P,N,R,z,F,U,J,K,x]}class V3 extends we{constructor(e){super(),ye(this,e,U3,j3,_e,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function mo(n){return n+.5|0}const Xi=(n,e,t)=>Math.max(Math.min(n,t),e);function Os(n){return Xi(mo(n*2.55),0,255)}function nl(n){return Xi(mo(n*255),0,255)}function Ri(n){return Xi(mo(n/2.55)/100,0,1)}function Nc(n){return Xi(mo(n*100),0,100)}const Jn={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},Ya=[..."0123456789ABCDEF"],U3=n=>Ya[n&15],V3=n=>Ya[(n&240)>>4]+Ya[n&15],Lo=n=>(n&240)>>4===(n&15),B3=n=>Lo(n.r)&&Lo(n.g)&&Lo(n.b)&&Lo(n.a);function W3(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Jn[n[1]]*17,g:255&Jn[n[2]]*17,b:255&Jn[n[3]]*17,a:e===5?Jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Jn[n[1]]<<4|Jn[n[2]],g:Jn[n[3]]<<4|Jn[n[4]],b:Jn[n[5]]<<4|Jn[n[6]],a:e===9?Jn[n[7]]<<4|Jn[n[8]]:255})),t}const Y3=(n,e)=>n<255?e(n):"";function K3(n){var e=B3(n)?U3:V3;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Y3(n.a,e):void 0}const J3=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ak(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function Z3(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function G3(n,e,t){const i=ak(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function X3(n,e,t,i,l){return n===l?(e-t)/i+(e.5?f/(2-s-o):f/(s+o),a=X3(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Ru(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(nl)}function Fu(n,e,t){return Ru(ak,n,e,t)}function Q3(n,e,t){return Ru(G3,n,e,t)}function x3(n,e,t){return Ru(Z3,n,e,t)}function uk(n){return(n%360+360)%360}function eS(n){const e=J3.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Os(+e[5]):nl(+e[5]));const l=uk(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=Q3(l,s,o):e[1]==="hsv"?i=x3(l,s,o):i=Fu(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function tS(n,e){var t=Nu(n);t[0]=uk(t[0]+e),t=Fu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function nS(n){if(!n)return;const e=Nu(n),t=e[0],i=Nc(e[1]),l=Nc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${Ri(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const Rc={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"},Fc={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 iS(){const n={},e=Object.keys(Fc),t=Object.keys(Rc);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let Ao;function lS(n){Ao||(Ao=iS(),Ao.transparent=[0,0,0,0]);const e=Ao[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const sS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oS(n){const e=sS.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Os(o):Xi(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Os(i):Xi(i,0,255)),l=255&(e[4]?Os(l):Xi(l,0,255)),s=255&(e[6]?Os(s):Xi(s,0,255)),{r:i,g:l,b:s,a:t}}}function rS(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ri(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ua=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function aS(n,e,t){const i=Wl(Ri(n.r)),l=Wl(Ri(n.g)),s=Wl(Ri(n.b));return{r:nl(ua(i+t*(Wl(Ri(e.r))-i))),g:nl(ua(l+t*(Wl(Ri(e.g))-l))),b:nl(ua(s+t*(Wl(Ri(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Po(n,e,t){if(n){let i=Nu(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Fu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function fk(n,e){return n&&Object.assign(e||{},n)}function qc(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=nl(n[3]))):(e=fk(n,{r:0,g:0,b:0,a:1}),e.a=nl(e.a)),e}function uS(n){return n.charAt(0)==="r"?oS(n):eS(n)}class Zs{constructor(e){if(e instanceof Zs)return e;const t=typeof e;let i;t==="object"?i=qc(e):t==="string"&&(i=W3(e)||lS(e)||uS(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=fk(this._rgb);return e&&(e.a=Ri(e.a)),e}set rgb(e){this._rgb=qc(e)}rgbString(){return this._valid?rS(this._rgb):void 0}hexString(){return this._valid?K3(this._rgb):void 0}hslString(){return this._valid?nS(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=aS(this._rgb,e._rgb,t)),this}clone(){return new Zs(this.rgb)}alpha(e){return this._rgb.a=nl(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=mo(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 Po(this._rgb,2,e),this}darken(e){return Po(this._rgb,2,-e),this}saturate(e){return Po(this._rgb,1,e),this}desaturate(e){return Po(this._rgb,1,-e),this}rotate(e){return tS(this._rgb,e),this}}/*! + */function mo(n){return n+.5|0}const Xi=(n,e,t)=>Math.max(Math.min(n,t),e);function Os(n){return Xi(mo(n*2.55),0,255)}function nl(n){return Xi(mo(n*255),0,255)}function Ri(n){return Xi(mo(n/2.55)/100,0,1)}function Nc(n){return Xi(mo(n*100),0,100)}const Jn={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},Ya=[..."0123456789ABCDEF"],B3=n=>Ya[n&15],W3=n=>Ya[(n&240)>>4]+Ya[n&15],Lo=n=>(n&240)>>4===(n&15),Y3=n=>Lo(n.r)&&Lo(n.g)&&Lo(n.b)&&Lo(n.a);function K3(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Jn[n[1]]*17,g:255&Jn[n[2]]*17,b:255&Jn[n[3]]*17,a:e===5?Jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Jn[n[1]]<<4|Jn[n[2]],g:Jn[n[3]]<<4|Jn[n[4]],b:Jn[n[5]]<<4|Jn[n[6]],a:e===9?Jn[n[7]]<<4|Jn[n[8]]:255})),t}const J3=(n,e)=>n<255?e(n):"";function Z3(n){var e=Y3(n)?B3:W3;return n?"#"+e(n.r)+e(n.g)+e(n.b)+J3(n.a,e):void 0}const G3=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function fk(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function X3(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Q3(n,e,t){const i=fk(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function x3(n,e,t,i,l){return n===l?(e-t)/i+(e.5?f/(2-s-o):f/(s+o),a=x3(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Ru(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(nl)}function Fu(n,e,t){return Ru(fk,n,e,t)}function eS(n,e,t){return Ru(Q3,n,e,t)}function tS(n,e,t){return Ru(X3,n,e,t)}function ck(n){return(n%360+360)%360}function nS(n){const e=G3.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Os(+e[5]):nl(+e[5]));const l=ck(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=eS(l,s,o):e[1]==="hsv"?i=tS(l,s,o):i=Fu(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function iS(n,e){var t=Nu(n);t[0]=ck(t[0]+e),t=Fu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function lS(n){if(!n)return;const e=Nu(n),t=e[0],i=Nc(e[1]),l=Nc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${Ri(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const Rc={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"},Fc={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 sS(){const n={},e=Object.keys(Fc),t=Object.keys(Rc);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let Ao;function oS(n){Ao||(Ao=sS(),Ao.transparent=[0,0,0,0]);const e=Ao[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const rS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function aS(n){const e=rS.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Os(o):Xi(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Os(i):Xi(i,0,255)),l=255&(e[4]?Os(l):Xi(l,0,255)),s=255&(e[6]?Os(s):Xi(s,0,255)),{r:i,g:l,b:s,a:t}}}function uS(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ri(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ua=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function fS(n,e,t){const i=Wl(Ri(n.r)),l=Wl(Ri(n.g)),s=Wl(Ri(n.b));return{r:nl(ua(i+t*(Wl(Ri(e.r))-i))),g:nl(ua(l+t*(Wl(Ri(e.g))-l))),b:nl(ua(s+t*(Wl(Ri(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Po(n,e,t){if(n){let i=Nu(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Fu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function dk(n,e){return n&&Object.assign(e||{},n)}function qc(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=nl(n[3]))):(e=dk(n,{r:0,g:0,b:0,a:1}),e.a=nl(e.a)),e}function cS(n){return n.charAt(0)==="r"?aS(n):nS(n)}class Zs{constructor(e){if(e instanceof Zs)return e;const t=typeof e;let i;t==="object"?i=qc(e):t==="string"&&(i=K3(e)||oS(e)||cS(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=dk(this._rgb);return e&&(e.a=Ri(e.a)),e}set rgb(e){this._rgb=qc(e)}rgbString(){return this._valid?uS(this._rgb):void 0}hexString(){return this._valid?Z3(this._rgb):void 0}hslString(){return this._valid?lS(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=fS(this._rgb,e._rgb,t)),this}clone(){return new Zs(this.rgb)}alpha(e){return this._rgb.a=nl(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=mo(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 Po(this._rgb,2,e),this}darken(e){return Po(this._rgb,2,-e),this}saturate(e){return Po(this._rgb,1,e),this}desaturate(e){return Po(this._rgb,1,-e),this}rotate(e){return iS(this._rgb,e),this}}/*! * Chart.js v4.4.4 * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function Ai(){}const fS=(()=>{let n=0;return()=>n++})();function Kt(n){return n===null||typeof n>"u"}function an(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 vt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function vn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gi(n,e){return vn(n)?n:e}function Ot(n,e){return typeof n>"u"?e:n}const cS=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function dt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function _t(n,e,t,i){let l,s,o;if(an(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function mS(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function hS(n){const e=mS(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function yr(n,e){return(Hc[e]||(Hc[e]=hS(e)))(n)}function qu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const wr=n=>typeof n<"u",ll=n=>typeof n=="function",jc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function _S(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const bn=Math.PI,$i=2*bn,gS=$i+bn,Sr=Number.POSITIVE_INFINITY,bS=bn/180,ai=bn/2,kl=bn/4,zc=bn*2/3,Ka=Math.log10,sl=Math.sign;function Ps(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function vS(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function yS(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Hu(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Cl=(n,e,t,i)=>Hu(n,t,i?l=>{const s=n[l][e];return sn[l][e]Hu(n,t,i=>n[i][e]>=t);function OS(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+qu(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function Bc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(mk.forEach(s=>{delete n[s]}),delete n._chartjs)}function MS(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const hk=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function _k(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,hk.call(window,()=>{i=!1,n.apply(e,t)}))}}function DS(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const IS=n=>n==="start"?"left":n==="end"?"right":"center",Wc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function LS(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=ui(Math.min(Cl(r,a,u).lo,t?i:Cl(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=ui(Math.max(Cl(r,o.axis,f,!0).hi+1,t?0:Cl(e,a,o.getPixelForValue(f),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function AS(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const No=n=>n===0||n===1,Yc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*$i/t)),Kc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*$i/t)+1,Ns={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*ai)+1,easeOutSine:n=>Math.sin(n*ai),easeInOutSine:n=>-.5*(Math.cos(bn*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=>No(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=>No(n)?n:Yc(n,.075,.3),easeOutElastic:n=>No(n)?n:Kc(n,.075,.3),easeInOutElastic(n){return No(n)?n:n<.5?.5*Yc(n*2,.1125,.45):.5+.5*Kc(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-Ns.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?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function ju(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Jc(n){return ju(n)?n:new Zs(n)}function fa(n){return ju(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const PS=["x","y","borderWidth","radius","tension"],NS=["color","borderColor","backgroundColor"];function RS(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:NS},numbers:{type:"number",properties:PS}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function FS(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Zc=new Map;function qS(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Zc.get(t);return i||(i=new Intl.NumberFormat(n,e),Zc.set(t,i)),i}function gk(n,e,t){return qS(e,t).format(n)}const bk={values(n){return an(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=HS(n,t)}const o=Ka(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),gk(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ka(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?bk.numeric.call(this,n,e,t):""}};function HS(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 kk={formatters:bk};function jS(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:kk.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Ll=Object.create(null),Za=Object.create(null);function Rs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>fa(l.backgroundColor),this.hoverBorderColor=(i,l)=>fa(l.borderColor),this.hoverColor=(i,l)=>fa(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return ca(this,e,t)}get(e){return Rs(this,e)}describe(e,t){return ca(Za,e,t)}override(e,t){return ca(Ll,e,t)}route(e,t,i,l){const s=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return vt(a)?Object.assign({},u,a):Ot(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var tn=new zS({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[RS,FS,jS]);function US(n){return!n||Kt(n.size)||Kt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Gc(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function vl(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Xc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Ga(n,e,t,i){VS(n,e,t,i)}function VS(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*bS;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,$i),n.closePath();break;case"triangle":f=_,n.moveTo(t+Math.sin(g)*f,i-Math.cos(g)*_),g+=zc,n.lineTo(t+Math.sin(g)*f,i-Math.cos(g)*_),g+=zc,n.lineTo(t+Math.sin(g)*f,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":u=_*.516,a=_-u,o=Math.cos(g+kl)*a,c=Math.cos(g+kl)*a,r=Math.sin(g+kl)*a,d=Math.sin(g+kl)*a,n.arc(t-c,i-r,u,g-bn,g-ai),n.arc(t+d,i-o,u,g-ai,g),n.arc(t+c,i+r,u,g,g+ai),n.arc(t-d,i+o,u,g+ai,g+bn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,f=a,n.rect(t-f,i-a,2*f,2*a);break}g+=kl;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=kl;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=kl,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function Qs(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,YS(n,s),a=0;a+n||0;function vk(n,e){const t={},i=vt(e),l=i?Object.keys(e):e,s=vt(n)?i?o=>Ot(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=QS(s(o));return t}function xS(n){return vk(n,{top:"y",right:"x",bottom:"y",left:"x"})}function sr(n){return vk(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ol(n){const e=xS(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ti(n,e){n=n||{},e=e||tn.font;let t=Ot(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Ot(n.style,e.style);i&&!(""+i).match(GS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Ot(n.family,e.family),lineHeight:XS(Ot(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Ot(n.weight,e.weight),string:""};return l.string=US(l),l}function Ro(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Nl(n,e){return Object.assign(Object.create(n),e)}function Vu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Tk("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Vu([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return wk(r,a,()=>a4(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return td(r).includes(a)},ownKeys(r){return td(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function is(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:yk(n,i),setContext:s=>is(n,s,t,i),override:s=>is(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return wk(s,o,()=>n4(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function yk(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:ll(t)?t:()=>t,isIndexable:ll(i)?i:()=>i}}const t4=(n,e)=>n?n+qu(e):e,Bu=(n,e)=>vt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function wk(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function n4(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ll(r)&&o.isScriptable(e)&&(r=i4(e,r,n,t)),an(r)&&r.length&&(r=l4(e,r,n,o.isIndexable)),Bu(e,r)&&(r=is(r,l,s&&s[e],o)),r}function i4(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Bu(n,a)&&(a=Wu(l._scopes,l,n,a)),a}function l4(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(vt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Wu(u,l,n,f);e.push(is(c,s,o&&o[n],r))}}return e}function Sk(n,e,t){return ll(n)?n(e,t):n}const s4=(n,e)=>n===!0?e:typeof n=="string"?yr(e,n):void 0;function o4(n,e,t,i,l){for(const s of e){const o=s4(t,s);if(o){n.add(o);const r=Sk(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Wu(n,e,t,i){const l=e._rootScopes,s=Sk(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=ed(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=ed(r,o,s,a,i),a===null)?!1:Vu(Array.from(r),[""],l,s,()=>r4(e,t,i))}function ed(n,e,t,i,l){for(;t;)t=o4(n,e,t,i,l);return t}function r4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return an(l)&&vt(t)?t:l||{}}function a4(n,e,t,i){let l;for(const s of e)if(l=Tk(t4(s,n),t),typeof l<"u")return Bu(n,l)?Wu(t,i,n,l):l}function Tk(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function td(n){let e=n._keys;return e||(e=n._keys=u4(n._scopes)),e}function u4(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const f4=Number.EPSILON||1e-14,ls=(n,e)=>en==="x"?"y":"x";function c4(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Ja(s,l),a=Ja(o,s);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:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function d4(n,e,t){const i=n.length;let l,s,o,r,a,u=ls(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")m4(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function g4(n,e){return jr(n).getPropertyValue(e)}const b4=["top","right","bottom","left"];function El(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=b4[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const k4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function v4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(k4(l,s,n.target))r=l,a=s;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 yi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=jr(t),s=l.boxSizing==="border-box",o=El(l,"padding"),r=El(l,"border","width"),{x:a,y:u,box:f}=v4(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function y4(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Ku(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=jr(s),a=El(r,"border","width"),u=El(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Tr(r.maxWidth,s,"clientWidth"),l=Tr(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Sr,maxHeight:l||Sr}}const qo=n=>Math.round(n*10)/10;function w4(n,e,t,i){const l=jr(n),s=El(l,"margin"),o=Tr(l.maxWidth,n,"clientWidth")||Sr,r=Tr(l.maxHeight,n,"clientHeight")||Sr,a=y4(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=El(l,"border","width"),m=El(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=qo(Math.min(u,o,a.maxWidth)),f=qo(Math.min(f,r,a.maxHeight)),u&&!f&&(f=qo(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=qo(Math.floor(f*i))),{width:u,height:f}}function nd(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const S4=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Yu()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function id(n,e){const t=g4(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function wl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function T4(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 $4(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=wl(n,l,t),r=wl(l,s,t),a=wl(s,e,t),u=wl(o,r,t),f=wl(r,a,t);return wl(u,f,t)}const C4=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}}},O4=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function da(n,e,t){return n?C4(e,t):O4()}function E4(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 M4(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Ck(n){return n==="angle"?{between:dk,compare:TS,normalize:vi}:{between:pk,compare:(e,t)=>e-t,normalize:e=>e}}function ld({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function D4(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Ck(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(l,$,k)&&r(l,$)!==0,O=()=>r(s,k)===0||a(s,$,k),M=()=>_||T(),L=()=>!_||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(k=u(S[i]),k!==$&&(_=a(k,l,s),g===null&&M()&&(g=r(k,l)===0?I:A),g!==null&&L()&&(h.push(ld({start:g,end:I,loop:d,count:o,style:m})),g=null),A=I,$=k));return g!==null&&h.push(ld({start:g,end:c,loop:d,count:o,style:m})),h}function Ek(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function L4(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function A4(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=I4(t,l,s,i);if(i===!0)return sd(n,[{start:o,end:r,loop:s}],t,e);const a=r{let n=0;return()=>n++})();function Kt(n){return n===null||typeof n>"u"}function an(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 vt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function vn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gi(n,e){return vn(n)?n:e}function Ot(n,e){return typeof n>"u"?e:n}const pS=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function pt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function _t(n,e,t,i){let l,s,o;if(an(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function _S(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function gS(n){const e=_S(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function yr(n,e){return(Hc[e]||(Hc[e]=gS(e)))(n)}function qu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const wr=n=>typeof n<"u",ll=n=>typeof n=="function",jc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function bS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const bn=Math.PI,$i=2*bn,kS=$i+bn,Sr=Number.POSITIVE_INFINITY,vS=bn/180,ai=bn/2,kl=bn/4,zc=bn*2/3,Ka=Math.log10,sl=Math.sign;function Ps(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function wS(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function SS(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Hu(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Cl=(n,e,t,i)=>Hu(n,t,i?l=>{const s=n[l][e];return sn[l][e]Hu(n,t,i=>n[i][e]>=t);function MS(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+qu(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function Bc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(_k.forEach(s=>{delete n[s]}),delete n._chartjs)}function IS(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const gk=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function bk(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,gk.call(window,()=>{i=!1,n.apply(e,t)}))}}function LS(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const AS=n=>n==="start"?"left":n==="end"?"right":"center",Wc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function PS(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=ui(Math.min(Cl(r,a,u).lo,t?i:Cl(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=ui(Math.max(Cl(r,o.axis,f,!0).hi+1,t?0:Cl(e,a,o.getPixelForValue(f),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function NS(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const No=n=>n===0||n===1,Yc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*$i/t)),Kc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*$i/t)+1,Ns={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*ai)+1,easeOutSine:n=>Math.sin(n*ai),easeInOutSine:n=>-.5*(Math.cos(bn*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=>No(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=>No(n)?n:Yc(n,.075,.3),easeOutElastic:n=>No(n)?n:Kc(n,.075,.3),easeInOutElastic(n){return No(n)?n:n<.5?.5*Yc(n*2,.1125,.45):.5+.5*Kc(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-Ns.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?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function ju(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Jc(n){return ju(n)?n:new Zs(n)}function fa(n){return ju(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const RS=["x","y","borderWidth","radius","tension"],FS=["color","borderColor","backgroundColor"];function qS(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:FS},numbers:{type:"number",properties:RS}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function HS(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Zc=new Map;function jS(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Zc.get(t);return i||(i=new Intl.NumberFormat(n,e),Zc.set(t,i)),i}function kk(n,e,t){return jS(e,t).format(n)}const vk={values(n){return an(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=zS(n,t)}const o=Ka(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),kk(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ka(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?vk.numeric.call(this,n,e,t):""}};function zS(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 yk={formatters:vk};function US(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:yk.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Ll=Object.create(null),Za=Object.create(null);function Rs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>fa(l.backgroundColor),this.hoverBorderColor=(i,l)=>fa(l.borderColor),this.hoverColor=(i,l)=>fa(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return ca(this,e,t)}get(e){return Rs(this,e)}describe(e,t){return ca(Za,e,t)}override(e,t){return ca(Ll,e,t)}route(e,t,i,l){const s=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return vt(a)?Object.assign({},u,a):Ot(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var nn=new VS({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[qS,HS,US]);function BS(n){return!n||Kt(n.size)||Kt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Gc(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function vl(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Xc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Ga(n,e,t,i){WS(n,e,t,i)}function WS(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*vS;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,$i),n.closePath();break;case"triangle":f=_,n.moveTo(t+Math.sin(g)*f,i-Math.cos(g)*_),g+=zc,n.lineTo(t+Math.sin(g)*f,i-Math.cos(g)*_),g+=zc,n.lineTo(t+Math.sin(g)*f,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":u=_*.516,a=_-u,o=Math.cos(g+kl)*a,c=Math.cos(g+kl)*a,r=Math.sin(g+kl)*a,d=Math.sin(g+kl)*a,n.arc(t-c,i-r,u,g-bn,g-ai),n.arc(t+d,i-o,u,g-ai,g),n.arc(t+c,i+r,u,g,g+ai),n.arc(t-d,i+o,u,g+ai,g+bn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,f=a,n.rect(t-f,i-a,2*f,2*a);break}g+=kl;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=kl;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=kl,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function Qs(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,JS(n,s),a=0;a+n||0;function wk(n,e){const t={},i=vt(e),l=i?Object.keys(e):e,s=vt(n)?i?o=>Ot(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=e4(s(o));return t}function t4(n){return wk(n,{top:"y",right:"x",bottom:"y",left:"x"})}function sr(n){return wk(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ol(n){const e=t4(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ti(n,e){n=n||{},e=e||nn.font;let t=Ot(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Ot(n.style,e.style);i&&!(""+i).match(QS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Ot(n.family,e.family),lineHeight:xS(Ot(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Ot(n.weight,e.weight),string:""};return l.string=BS(l),l}function Ro(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Nl(n,e){return Object.assign(Object.create(n),e)}function Vu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Ck("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Vu([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return Tk(r,a,()=>f4(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return td(r).includes(a)},ownKeys(r){return td(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function is(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Sk(n,i),setContext:s=>is(n,s,t,i),override:s=>is(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return Tk(s,o,()=>l4(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function Sk(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:ll(t)?t:()=>t,isIndexable:ll(i)?i:()=>i}}const i4=(n,e)=>n?n+qu(e):e,Bu=(n,e)=>vt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Tk(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function l4(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ll(r)&&o.isScriptable(e)&&(r=s4(e,r,n,t)),an(r)&&r.length&&(r=o4(e,r,n,o.isIndexable)),Bu(e,r)&&(r=is(r,l,s&&s[e],o)),r}function s4(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Bu(n,a)&&(a=Wu(l._scopes,l,n,a)),a}function o4(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(vt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Wu(u,l,n,f);e.push(is(c,s,o&&o[n],r))}}return e}function $k(n,e,t){return ll(n)?n(e,t):n}const r4=(n,e)=>n===!0?e:typeof n=="string"?yr(e,n):void 0;function a4(n,e,t,i,l){for(const s of e){const o=r4(t,s);if(o){n.add(o);const r=$k(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Wu(n,e,t,i){const l=e._rootScopes,s=$k(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=ed(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=ed(r,o,s,a,i),a===null)?!1:Vu(Array.from(r),[""],l,s,()=>u4(e,t,i))}function ed(n,e,t,i,l){for(;t;)t=a4(n,e,t,i,l);return t}function u4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return an(l)&&vt(t)?t:l||{}}function f4(n,e,t,i){let l;for(const s of e)if(l=Ck(i4(s,n),t),typeof l<"u")return Bu(n,l)?Wu(t,i,n,l):l}function Ck(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function td(n){let e=n._keys;return e||(e=n._keys=c4(n._scopes)),e}function c4(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const d4=Number.EPSILON||1e-14,ls=(n,e)=>en==="x"?"y":"x";function p4(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Ja(s,l),a=Ja(o,s);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:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function m4(n,e,t){const i=n.length;let l,s,o,r,a,u=ls(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")_4(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function k4(n,e){return jr(n).getPropertyValue(e)}const v4=["top","right","bottom","left"];function El(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=v4[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const y4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function w4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(y4(l,s,n.target))r=l,a=s;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 yi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=jr(t),s=l.boxSizing==="border-box",o=El(l,"padding"),r=El(l,"border","width"),{x:a,y:u,box:f}=w4(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function S4(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Ku(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=jr(s),a=El(r,"border","width"),u=El(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Tr(r.maxWidth,s,"clientWidth"),l=Tr(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Sr,maxHeight:l||Sr}}const qo=n=>Math.round(n*10)/10;function T4(n,e,t,i){const l=jr(n),s=El(l,"margin"),o=Tr(l.maxWidth,n,"clientWidth")||Sr,r=Tr(l.maxHeight,n,"clientHeight")||Sr,a=S4(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=El(l,"border","width"),m=El(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=qo(Math.min(u,o,a.maxWidth)),f=qo(Math.min(f,r,a.maxHeight)),u&&!f&&(f=qo(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=qo(Math.floor(f*i))),{width:u,height:f}}function nd(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $4=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Yu()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function id(n,e){const t=k4(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function wl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function C4(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 O4(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=wl(n,l,t),r=wl(l,s,t),a=wl(s,e,t),u=wl(o,r,t),f=wl(r,a,t);return wl(u,f,t)}const E4=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}}},M4=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function da(n,e,t){return n?E4(e,t):M4()}function D4(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 I4(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Ek(n){return n==="angle"?{between:mk,compare:CS,normalize:vi}:{between:hk,compare:(e,t)=>e-t,normalize:e=>e}}function ld({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function L4(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Ek(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(l,$,k)&&r(l,$)!==0,O=()=>r(s,k)===0||a(s,$,k),E=()=>_||T(),I=()=>!_||O();for(let L=f,A=f;L<=c;++L)S=e[L%o],!S.skip&&(k=u(S[i]),k!==$&&(_=a(k,l,s),g===null&&E()&&(g=r(k,l)===0?L:A),g!==null&&I()&&(h.push(ld({start:g,end:L,loop:d,count:o,style:m})),g=null),A=L,$=k));return g!==null&&h.push(ld({start:g,end:c,loop:d,count:o,style:m})),h}function Dk(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function P4(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function N4(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=A4(t,l,s,i);if(i===!0)return sd(n,[{start:o,end:r,loop:s}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=hk.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new R4;const rd="transparent",F4={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Jc(n||rd),l=i.valid&&Jc(e||rd);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class q4{constructor(e,t,i,l){const s=t[i];l=Ro([e.to,l,s,e.from]);const o=Ro([e.from,s,l]);this._active=!0,this._fn=e.fn||F4[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Ro([e.to,t,l,e.from]),this._from=Ro([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!vt(s))return;const o={};for(const r of t)o[r]=s[r];(an(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=j4(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&H4(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[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}s[u]=c=new q4(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Pi.add(this._chart,i),!0}}function H4(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function dd(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=B4(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function K4(n,e){return Nl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function J4(n,e,t){return Nl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const ma=n=>n==="reset"||n==="none",pd=(n,e)=>e?n:Object.assign({},n),Z4=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Dk(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=fd(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&vs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=Ot(i.xAxisID,pa(e,"x")),o=t.yAxisID=Ot(i.yAxisID,pa(e,"y")),r=t.rAxisID=Ot(i.rAxisID,pa(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(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&&Bc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(vt(t)){const l=this._cachedMeta;this._data=V4(t,l)}else if(i!==t){if(i){Bc(i,this);const l=this._cachedMeta;vs(l),l._parsed=[]}t&&Object.isExtensible(t)&&ES(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=fd(t.vScale,t),t.stack!==i.stack&&(l=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&dd(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{an(l[e])?d=this.parseArrayData(i,l,e,t):vt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=u.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(pd(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const 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 Mk(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ma(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){ma(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!ma(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let O=0;O<$;++O){const M=e[O],L=k?M:{};if(O=S){L.skip=!0;continue}const I=this.getParsed(O),A=Kt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],O);L.skip=isNaN(P)||isNaN(N)||A,L.stop=O>0&&Math.abs(I[d]-T[d])>g,_&&(L.parsed=I,L.raw=u.data[O]),c&&(L.options=f||this.resolveDataElementOptions(O,M.active?"active":l)),k||this.updateElement(M,O,L,l),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ct(or,"id","line"),ct(or,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ct(or,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function yl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ju{constructor(e){ct(this,"options");this.options=e||{}}static override(e){Object.assign(Ju.prototype,e)}init(){}formats(){return yl()}parse(){return yl()}format(){return yl()}add(){return yl()}diff(){return yl()}startOf(){return yl()}endOf(){return yl()}}var Ik={_date:Ju};function G4(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?CS:Cl;if(i){if(l._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(s,e,t-f),d=a(s,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function ho(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var eT={evaluateInteractionItems:ho,modes:{index(n,e,t,i){const l=yi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?ha(n,l,s,i,o):_a(n,l,s,!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 l=yi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?ha(n,l,s,i,o):_a(n,l,s,!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 hd(n,e){return n.filter(t=>Lk.indexOf(t.pos)===-1&&t.box.axis===e)}function ws(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function tT(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=ws(ys(e,"left"),!0),l=ws(ys(e,"right")),s=ws(ys(e,"top"),!0),o=ws(ys(e,"bottom")),r=hd(e,"x"),a=hd(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:ys(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function _d(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Ak(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 sT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!vt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Ak(o,s.getPadding());const r=Math.max(0,e.outerWidth-_d(o,n,"left","right")),a=Math.max(0,e.outerHeight-_d(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 oT(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function rT(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const f=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Ak(d,ol(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=iT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),oT(m),gd(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,gd(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Pk{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class aT extends Pk{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rr="$chartjs",uT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bd=n=>n===null||n==="";function fT(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[rr]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",bd(l)){const s=id(n,"width");s!==void 0&&(n.width=s)}if(bd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=id(n,"height");s!==void 0&&(n.height=s)}return n}const Nk=S4?{passive:!0}:!1;function cT(n,e,t){n&&n.addEventListener(e,t,Nk)}function dT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Nk)}function pT(n,e){const t=uT[n.type]||n.type,{x:i,y:l}=yi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function $r(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function mT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||$r(r.addedNodes,i),o=o&&!$r(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function hT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||$r(r.removedNodes,i),o=o&&!$r(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const xs=new Map;let kd=0;function Rk(){const n=window.devicePixelRatio;n!==kd&&(kd=n,xs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function _T(n,e){xs.size||window.addEventListener("resize",Rk),xs.set(n,e)}function gT(n){xs.delete(n),xs.size||window.removeEventListener("resize",Rk)}function bT(n,e,t){const i=n.canvas,l=i&&Ku(i);if(!l)return;const s=_k((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),_T(n,s),o}function ga(n,e,t){t&&t.disconnect(),e==="resize"&&gT(n)}function kT(n,e,t){const i=n.canvas,l=_k(s=>{n.ctx!==null&&t(pT(s,n))},n);return cT(i,e,l),l}class vT extends Pk{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(fT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[rr])return!1;const i=t[rr].initial;["height","width"].forEach(s=>{const o=i[s];Kt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[rr],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:mT,detach:hT,resize:bT}[t]||kT;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:ga,detach:ga,resize:ga}[t]||dT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return w4(e,t,i,l)}isAttached(e){const t=e&&Ku(e);return!!(t&&t.isConnected)}}function yT(n){return!Yu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?aT:vT}class Al{constructor(){ct(this,"x");ct(this,"y");ct(this,"active",!1);ct(this,"options");ct(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}ct(Al,"defaults",{}),ct(Al,"defaultRoutes");function wT(n,e){const t=n.options.ticks,i=ST(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?$T(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return CT(e,u,s,o/l),u;const f=TT(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(zo(e,u,f,Kt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function $T(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,vd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,yd=(n,e)=>Math.min(e||n,n);function wd(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function DT(n,e){_t(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:gi(t,gi(i,t)),max:gi(i,gi(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){dt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=e4(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=ui(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-Ss(e.grid)-t.padding-Sd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=wS(Math.min(Math.asin(ui((f.highest.height+6)/r,-1,1)),Math.asin(ui(a/u,-1,1))-Math.asin(ui(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){dt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Sd(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ss(s)+a):(e.height=this.maxHeight,e.width=Ss(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=$l(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const k=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,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=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-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;s==="start"?(f=0,c=e.height):s==="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(){dt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[A]||0,height:r[A]||0});return{first:I(0),last:I(t-1),widest:I(M),highest:I(L),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return $S(this._alignToPixels?vl(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ss(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,k=function(J){return vl(i,J,_)};let S,$,T,O,M,L,I,A,P,N,R,z;if(o==="top")S=k(this.bottom),L=this.bottom-d,A=S-g,N=k(e.top)+g,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-g,L=S+g,A=this.top+d;else if(o==="left")S=k(this.right),M=this.right-d,I=S-g,P=k(e.left)+g,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-g,M=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(vt(o)){const J=Object.keys(o)[0],K=o[J];S=k(this.chart.scales[J].getPixelForValue(K))}N=e.top,z=e.bottom,L=S+g,A=L+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(vt(o)){const J=Object.keys(o)[0],K=o[J];S=k(this.chart.scales[J].getPixelForValue(K))}M=S-g,I=M-d,P=e.left,R=e.right}const F=Ot(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/F));for($=0;$0&&(xe-=Ye/2);break}Se={left:xe,top:nt,width:Ye+ge.width,height:$e+ge.height,color:U.backdropColor}}g.push({label:T,font:A,textOffset:R,options:{rotation:_,color:K,strokeColor:x,strokeWidth:X,textAlign:oe,textBaseline:z,translation:[O,M],backdrop:Se}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-$l(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let u,f;return t==="left"?l?(f=this.right+s,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?l?(f=this.left+s,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,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(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");tn.route(s,l,a,r)})}function FT(n){return"id"in n&&"defaults"in n}class qT{constructor(){this.controllers=new Uo(Fs,"datasets",!0),this.elements=new Uo(Al,"elements"),this.plugins=new Uo(Object,"plugins"),this.scales=new Uo(_o,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=qu(e);dt(i["before"+l],[],i),t[e](i),dt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function jT(n){const e={},t=[],i=Object.keys(ki.plugins.items);for(let s=0;s1&&Td(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $d(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function KT(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return $d(n,"x",t[0])||$d(n,"y",t[0])}return{}}function JT(n,e){const t=Ll[n.type]||{scales:{}},i=e.scales||{},l=Xa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!vt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=Qa(o,r,KT(o,n),tn.scales[r.type]),u=WT(a,l),f=t.scales||{};s[o]=As(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||Xa(r,e),f=(Ll[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=BT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),As(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];As(r,[tn.scales[r.type],tn.scale])}),s}function Fk(n){const e=n.options||(n.options={});e.plugins=Ot(e.plugins,{}),e.scales=JT(n,e)}function qk(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function ZT(n){return n=n||{},n.data=qk(n.data),Fk(n),n}const Cd=new Map,Hk=new Set;function Vo(n,e){let t=Cd.get(n);return t||(t=e(),Cd.set(n,t),Hk.add(t)),t}const Ts=(n,e,t)=>{const i=yr(e,t);i!==void 0&&n.add(i)};class GT{constructor(e){this._config=ZT(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=qk(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(),Fk(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Vo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Vo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Vo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Vo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Ts(a,e,c))),f.forEach(c=>Ts(a,l,c)),f.forEach(c=>Ts(a,Ll[s]||{},c)),f.forEach(c=>Ts(a,tn,c)),f.forEach(c=>Ts(a,Za,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Hk.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Ll[t]||{},tn.datasets[t]||{},{type:t},tn,Za]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Od(this._resolverCache,e,l);let a=o;if(QT(o,t)){s.$shared=!1,i=ll(i)?i():i;const u=this.createResolver(e,i,r);a=is(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Od(this._resolverCache,e,i);return vt(t)?is(s,t,void 0,l):s}}function Od(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Vu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const XT=n=>vt(n)&&Object.getOwnPropertyNames(n).some(e=>ll(n[e]));function QT(n,e){const{isScriptable:t,isIndexable:i}=yk(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(ll(r)||XT(r))||o&&an(r))return!0}return!1}var xT="4.4.4";const e$=["top","bottom","left","right","chartArea"];function Ed(n,e){return n==="top"||n==="bottom"||e$.indexOf(n)===-1&&e==="x"}function Md(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Dd(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),dt(t&&t.onComplete,[n],e)}function t$(n){const e=n.chart,t=e.options.animation;dt(t&&t.onProgress,[n],e)}function jk(n){return Yu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ar={},Id=n=>{const e=jk(n);return Object.values(ar).filter(t=>t.canvas===e).pop()};function n$(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function i$(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Bo(n,e,t){return n.options.clip?n[t]:e[t]}function l$(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Bo(t,e,"left"),right:Bo(t,e,"right"),top:Bo(i,e,"top"),bottom:Bo(i,e,"bottom")}:e}class wi{static register(...e){ki.add(...e),Ld()}static unregister(...e){ki.remove(...e),Ld()}constructor(e,t){const i=this.config=new GT(t),l=jk(e),s=Id(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||yT(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=fS(),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 HT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=DS(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ar[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Pi.listen(this,"complete",Dd),Pi.listen(this,"progress",t$),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Kt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ki}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():nd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Xc(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(e,t){Pi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,nd(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),dt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=Qa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,u=Qa(a,r),f=Ot(r.type,o.dtype);(r.position===void 0||Ed(r.position,u)!==Ed(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ki.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),_t(l,(o,r)=>{o||delete i[r]}),_t(i,o=>{jo.configure(this,o,o.options),jo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Md("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{jo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!jc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;n$(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;jo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=l$(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&zu(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Uu(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Qs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=eT.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=Nl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);wr(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!kr(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=_S(e),u=i$(e,this._lastEvent,i,a);i&&(this._lastEvent=null,dt(s.onHover,[e,r,this],this),a&&dt(s.onClick,[e,r,this],this));const f=!kr(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}ct(wi,"defaults",tn),ct(wi,"instances",ar),ct(wi,"overrides",Ll),ct(wi,"registry",ki),ct(wi,"version",xT),ct(wi,"getChart",Id);function Ld(){return _t(wi.instances,n=>n._plugins.invalidate())}function zk(n,e,t=e){n.lineCap=Ot(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Ot(t.borderDash,e.borderDash)),n.lineDashOffset=Ot(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Ot(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Ot(t.borderWidth,e.borderWidth),n.strokeStyle=Ot(t.borderColor,e.borderColor)}function s$(n,e,t){n.lineTo(t.x,t.y)}function o$(n){return n.stepped?BS:n.tension||n.cubicInterpolationMode==="monotone"?WS:s$}function Uk(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{_!==g&&(n.lineTo(f,g),n.lineTo(f,_),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,O=m.y,M=T|0;M===h?(O<_?_=O:O>g&&(g=O),f=(c*f+T)/++c):($(),n.lineTo(T,O),h=M,c=0,_=g=O),k=O}$()}function xa(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?a$:r$}function u$(n){return n.stepped?T4:n.tension||n.cubicInterpolationMode==="monotone"?$4:wl}function f$(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),zk(n,e.options),n.stroke(l)}function c$(n,e,t,i){const{segments:l,options:s}=e,o=xa(e);for(const r of l)zk(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const d$=typeof Path2D=="function";function p$(n,e,t,i){d$&&!e.options.segment?f$(n,e,t,i):c$(n,e,t,i)}class Qi extends Al{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;_4(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=A4(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=Ek(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=u$(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Ad(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Zu(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Zu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Pd(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Vk(n,e){let t=[],i=!1;return an(n)?(i=!0,t=n):t=h$(n,e),t.length?new Qi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Nd(n){return n&&n.fill!==!1}function _$(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!vn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function g$(n,e,t){const i=y$(n);if(vt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return vn(l)&&Math.floor(l)===l?b$(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function b$(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function k$(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:vt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function v$(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:vt(n)?i=n.value:i=e.getBaseValue(),i}function y$(n){const e=n.options,t=e.fill;let i=Ot(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function w$(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=S$(e,t);r.push(Vk({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&ba(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;Nd(s)&&ba(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Nd(i)||t.drawTime!=="beforeDatasetDraw"||ba(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ms={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;sr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=gk.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new q4;const rd="transparent",H4={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Jc(n||rd),l=i.valid&&Jc(e||rd);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class j4{constructor(e,t,i,l){const s=t[i];l=Ro([e.to,l,s,e.from]);const o=Ro([e.from,s,l]);this._active=!0,this._fn=e.fn||H4[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Ro([e.to,t,l,e.from]),this._from=Ro([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!vt(s))return;const o={};for(const r of t)o[r]=s[r];(an(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=U4(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&z4(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[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}s[u]=c=new j4(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Pi.add(this._chart,i),!0}}function z4(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function dd(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=Y4(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function Z4(n,e){return Nl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function G4(n,e,t){return Nl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const ma=n=>n==="reset"||n==="none",pd=(n,e)=>e?n:Object.assign({},n),X4=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Lk(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=fd(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&vs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=Ot(i.xAxisID,pa(e,"x")),o=t.yAxisID=Ot(i.yAxisID,pa(e,"y")),r=t.rAxisID=Ot(i.rAxisID,pa(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(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&&Bc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(vt(t)){const l=this._cachedMeta;this._data=W4(t,l)}else if(i!==t){if(i){Bc(i,this);const l=this._cachedMeta;vs(l),l._parsed=[]}t&&Object.isExtensible(t)&&DS(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=fd(t.vScale,t),t.stack!==i.stack&&(l=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&dd(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{an(l[e])?d=this.parseArrayData(i,l,e,t):vt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=u.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(pd(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const 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 Ik(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ma(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){ma(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!ma(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let O=0;O<$;++O){const E=e[O],I=k?E:{};if(O=S){I.skip=!0;continue}const L=this.getParsed(O),A=Kt(L[m]),P=I[d]=o.getPixelForValue(L[d],O),N=I[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,L,a):L[m],O);I.skip=isNaN(P)||isNaN(N)||A,I.stop=O>0&&Math.abs(L[d]-T[d])>g,_&&(I.parsed=L,I.raw=u.data[O]),c&&(I.options=f||this.resolveDataElementOptions(O,E.active?"active":l)),k||this.updateElement(E,O,I,l),T=L}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ct(or,"id","line"),ct(or,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ct(or,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function yl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ju{constructor(e){ct(this,"options");this.options=e||{}}static override(e){Object.assign(Ju.prototype,e)}init(){}formats(){return yl()}parse(){return yl()}format(){return yl()}add(){return yl()}diff(){return yl()}startOf(){return yl()}endOf(){return yl()}}var Ak={_date:Ju};function Q4(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?ES:Cl;if(i){if(l._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(s,e,t-f),d=a(s,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function ho(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var nT={evaluateInteractionItems:ho,modes:{index(n,e,t,i){const l=yi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?ha(n,l,s,i,o):_a(n,l,s,!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 l=yi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?ha(n,l,s,i,o):_a(n,l,s,!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 hd(n,e){return n.filter(t=>Pk.indexOf(t.pos)===-1&&t.box.axis===e)}function ws(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function iT(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=ws(ys(e,"left"),!0),l=ws(ys(e,"right")),s=ws(ys(e,"top"),!0),o=ws(ys(e,"bottom")),r=hd(e,"x"),a=hd(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:ys(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function _d(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Nk(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 rT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!vt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Nk(o,s.getPadding());const r=Math.max(0,e.outerWidth-_d(o,n,"left","right")),a=Math.max(0,e.outerHeight-_d(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 aT(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function uT(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const f=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Nk(d,ol(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=sT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),aT(m),gd(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,gd(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Rk{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class fT extends Rk{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rr="$chartjs",cT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bd=n=>n===null||n==="";function dT(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[rr]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",bd(l)){const s=id(n,"width");s!==void 0&&(n.width=s)}if(bd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=id(n,"height");s!==void 0&&(n.height=s)}return n}const Fk=$4?{passive:!0}:!1;function pT(n,e,t){n&&n.addEventListener(e,t,Fk)}function mT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Fk)}function hT(n,e){const t=cT[n.type]||n.type,{x:i,y:l}=yi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function $r(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function _T(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||$r(r.addedNodes,i),o=o&&!$r(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function gT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||$r(r.removedNodes,i),o=o&&!$r(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const xs=new Map;let kd=0;function qk(){const n=window.devicePixelRatio;n!==kd&&(kd=n,xs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function bT(n,e){xs.size||window.addEventListener("resize",qk),xs.set(n,e)}function kT(n){xs.delete(n),xs.size||window.removeEventListener("resize",qk)}function vT(n,e,t){const i=n.canvas,l=i&&Ku(i);if(!l)return;const s=bk((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),bT(n,s),o}function ga(n,e,t){t&&t.disconnect(),e==="resize"&&kT(n)}function yT(n,e,t){const i=n.canvas,l=bk(s=>{n.ctx!==null&&t(hT(s,n))},n);return pT(i,e,l),l}class wT extends Rk{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(dT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[rr])return!1;const i=t[rr].initial;["height","width"].forEach(s=>{const o=i[s];Kt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[rr],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:_T,detach:gT,resize:vT}[t]||yT;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:ga,detach:ga,resize:ga}[t]||mT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return T4(e,t,i,l)}isAttached(e){const t=e&&Ku(e);return!!(t&&t.isConnected)}}function ST(n){return!Yu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?fT:wT}class Al{constructor(){ct(this,"x");ct(this,"y");ct(this,"active",!1);ct(this,"options");ct(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}ct(Al,"defaults",{}),ct(Al,"defaultRoutes");function TT(n,e){const t=n.options.ticks,i=$T(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?OT(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return ET(e,u,s,o/l),u;const f=CT(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(zo(e,u,f,Kt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function OT(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,vd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,yd=(n,e)=>Math.min(e||n,n);function wd(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function LT(n,e){_t(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:gi(t,gi(i,t)),max:gi(i,gi(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){pt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=n4(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=ui(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-Ss(e.grid)-t.padding-Sd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=TS(Math.min(Math.asin(ui((f.highest.height+6)/r,-1,1)),Math.asin(ui(a/u,-1,1))-Math.asin(ui(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){pt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){pt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Sd(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ss(s)+a):(e.height=this.maxHeight,e.width=Ss(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=$l(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const k=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,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=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-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;s==="start"?(f=0,c=e.height):s==="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(){pt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[A]||0,height:r[A]||0});return{first:L(0),last:L(t-1),widest:L(E),highest:L(I),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return OS(this._alignToPixels?vl(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ss(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,k=function(J){return vl(i,J,_)};let S,$,T,O,E,I,L,A,P,N,R,z;if(o==="top")S=k(this.bottom),I=this.bottom-d,A=S-g,N=k(e.top)+g,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-g,I=S+g,A=this.top+d;else if(o==="left")S=k(this.right),E=this.right-d,L=S-g,P=k(e.left)+g,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-g,E=S+g,L=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(vt(o)){const J=Object.keys(o)[0],K=o[J];S=k(this.chart.scales[J].getPixelForValue(K))}N=e.top,z=e.bottom,I=S+g,A=I+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(vt(o)){const J=Object.keys(o)[0],K=o[J];S=k(this.chart.scales[J].getPixelForValue(K))}E=S-g,L=E-d,P=e.left,R=e.right}const F=Ot(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/F));for($=0;$0&&(xe-=Ye/2);break}Se={left:xe,top:nt,width:Ye+ge.width,height:$e+ge.height,color:U.backdropColor}}g.push({label:T,font:A,textOffset:R,options:{rotation:_,color:K,strokeColor:x,strokeWidth:X,textAlign:oe,textBaseline:z,translation:[O,E],backdrop:Se}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-$l(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let u,f;return t==="left"?l?(f=this.right+s,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?l?(f=this.left+s,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,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(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");nn.route(s,l,a,r)})}function HT(n){return"id"in n&&"defaults"in n}class jT{constructor(){this.controllers=new Uo(Fs,"datasets",!0),this.elements=new Uo(Al,"elements"),this.plugins=new Uo(Object,"plugins"),this.scales=new Uo(_o,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=qu(e);pt(i["before"+l],[],i),t[e](i),pt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function UT(n){const e={},t=[],i=Object.keys(ki.plugins.items);for(let s=0;s1&&Td(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $d(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function ZT(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return $d(n,"x",t[0])||$d(n,"y",t[0])}return{}}function GT(n,e){const t=Ll[n.type]||{scales:{}},i=e.scales||{},l=Xa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!vt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=Qa(o,r,ZT(o,n),nn.scales[r.type]),u=KT(a,l),f=t.scales||{};s[o]=As(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||Xa(r,e),f=(Ll[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=YT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),As(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];As(r,[nn.scales[r.type],nn.scale])}),s}function Hk(n){const e=n.options||(n.options={});e.plugins=Ot(e.plugins,{}),e.scales=GT(n,e)}function jk(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function XT(n){return n=n||{},n.data=jk(n.data),Hk(n),n}const Cd=new Map,zk=new Set;function Vo(n,e){let t=Cd.get(n);return t||(t=e(),Cd.set(n,t),zk.add(t)),t}const Ts=(n,e,t)=>{const i=yr(e,t);i!==void 0&&n.add(i)};class QT{constructor(e){this._config=XT(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=jk(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(),Hk(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Vo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Vo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Vo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Vo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Ts(a,e,c))),f.forEach(c=>Ts(a,l,c)),f.forEach(c=>Ts(a,Ll[s]||{},c)),f.forEach(c=>Ts(a,nn,c)),f.forEach(c=>Ts(a,Za,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),zk.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Ll[t]||{},nn.datasets[t]||{},{type:t},nn,Za]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Od(this._resolverCache,e,l);let a=o;if(e$(o,t)){s.$shared=!1,i=ll(i)?i():i;const u=this.createResolver(e,i,r);a=is(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Od(this._resolverCache,e,i);return vt(t)?is(s,t,void 0,l):s}}function Od(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Vu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const xT=n=>vt(n)&&Object.getOwnPropertyNames(n).some(e=>ll(n[e]));function e$(n,e){const{isScriptable:t,isIndexable:i}=Sk(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(ll(r)||xT(r))||o&&an(r))return!0}return!1}var t$="4.4.4";const n$=["top","bottom","left","right","chartArea"];function Ed(n,e){return n==="top"||n==="bottom"||n$.indexOf(n)===-1&&e==="x"}function Md(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Dd(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),pt(t&&t.onComplete,[n],e)}function i$(n){const e=n.chart,t=e.options.animation;pt(t&&t.onProgress,[n],e)}function Uk(n){return Yu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ar={},Id=n=>{const e=Uk(n);return Object.values(ar).filter(t=>t.canvas===e).pop()};function l$(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function s$(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Bo(n,e,t){return n.options.clip?n[t]:e[t]}function o$(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Bo(t,e,"left"),right:Bo(t,e,"right"),top:Bo(i,e,"top"),bottom:Bo(i,e,"bottom")}:e}class wi{static register(...e){ki.add(...e),Ld()}static unregister(...e){ki.remove(...e),Ld()}constructor(e,t){const i=this.config=new QT(t),l=Uk(e),s=Id(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ST(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=dS(),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 zT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LS(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ar[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Pi.listen(this,"complete",Dd),Pi.listen(this,"progress",i$),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Kt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ki}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():nd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Xc(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(e,t){Pi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,nd(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),pt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=Qa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,u=Qa(a,r),f=Ot(r.type,o.dtype);(r.position===void 0||Ed(r.position,u)!==Ed(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ki.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),_t(l,(o,r)=>{o||delete i[r]}),_t(i,o=>{jo.configure(this,o,o.options),jo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Md("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{jo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!jc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;l$(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;jo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=o$(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&zu(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Uu(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Qs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=nT.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=Nl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);wr(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!kr(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=bS(e),u=s$(e,this._lastEvent,i,a);i&&(this._lastEvent=null,pt(s.onHover,[e,r,this],this),a&&pt(s.onClick,[e,r,this],this));const f=!kr(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}ct(wi,"defaults",nn),ct(wi,"instances",ar),ct(wi,"overrides",Ll),ct(wi,"registry",ki),ct(wi,"version",t$),ct(wi,"getChart",Id);function Ld(){return _t(wi.instances,n=>n._plugins.invalidate())}function Vk(n,e,t=e){n.lineCap=Ot(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Ot(t.borderDash,e.borderDash)),n.lineDashOffset=Ot(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Ot(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Ot(t.borderWidth,e.borderWidth),n.strokeStyle=Ot(t.borderColor,e.borderColor)}function r$(n,e,t){n.lineTo(t.x,t.y)}function a$(n){return n.stepped?YS:n.tension||n.cubicInterpolationMode==="monotone"?KS:r$}function Bk(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{_!==g&&(n.lineTo(f,g),n.lineTo(f,_),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,O=m.y,E=T|0;E===h?(O<_?_=O:O>g&&(g=O),f=(c*f+T)/++c):($(),n.lineTo(T,O),h=E,c=0,_=g=O),k=O}$()}function xa(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?f$:u$}function c$(n){return n.stepped?C4:n.tension||n.cubicInterpolationMode==="monotone"?O4:wl}function d$(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Vk(n,e.options),n.stroke(l)}function p$(n,e,t,i){const{segments:l,options:s}=e,o=xa(e);for(const r of l)Vk(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const m$=typeof Path2D=="function";function h$(n,e,t,i){m$&&!e.options.segment?d$(n,e,t,i):p$(n,e,t,i)}class Qi extends Al{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;b4(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=N4(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=Dk(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=c$(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Ad(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Zu(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Zu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Pd(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Wk(n,e){let t=[],i=!1;return an(n)?(i=!0,t=n):t=g$(n,e),t.length?new Qi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Nd(n){return n&&n.fill!==!1}function b$(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!vn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function k$(n,e,t){const i=S$(n);if(vt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return vn(l)&&Math.floor(l)===l?v$(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function v$(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function y$(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:vt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function w$(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:vt(n)?i=n.value:i=e.getBaseValue(),i}function S$(n){const e=n.options,t=e.fill;let i=Ot(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function T$(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=$$(e,t);r.push(Wk({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&ba(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;Nd(s)&&ba(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Nd(i)||t.drawTime!=="beforeDatasetDraw"||ba(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ms={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;s-1?n.split(` -`):n}function P$(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function Hd(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Ti(e.bodyFont),u=Ti(e.titleFont),f=Ti(e.footerFont),c=s.length,d=l.length,m=i.length,h=ol(e.padding);let _=h.height,g=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){g=Math.max(g,t.measureText(T).width+S)};return t.save(),t.font=u.string,_t(n.title,$),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,_t(i,T=>{_t(T.before,$),_t(T.lines,$),_t(T.after,$)}),S=0,t.font=f.string,_t(n.footer,$),t.restore(),g+=h.width,{width:g,height:_}}function N$(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function R$(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function F$(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),R$(u,n,e,t)&&(u="center"),u}function jd(n,e,t){const i=t.yAlign||e.yAlign||N$(n,t);return{xAlign:t.xAlign||e.xAlign||F$(n,e,t,i),yAlign:i}}function q$(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function H$(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function zd(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=sr(o);let h=q$(e,r);const _=H$(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:ui(h,0,i.width-e.width),y:ui(_,0,i.height-e.height)}}function Wo(n,e,t){const i=ol(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Ud(n){return bi([],Ni(n))}function j$(n,e,t){return Nl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Vd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Wk={beforeTitle:Ai,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?Wk[e].call(t,i):l}class tu extends Al{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Mk(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=j$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=In(i,"beforeTitle",this,e),s=In(i,"title",this,e),o=In(i,"afterTitle",this,e);let r=[];return r=bi(r,Ni(l)),r=bi(r,Ni(s)),r=bi(r,Ni(o)),r}getBeforeBody(e,t){return Ud(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=Vd(i,s);bi(o.before,Ni(In(r,"beforeLabel",this,s))),bi(o.lines,In(r,"label",this,s)),bi(o.after,Ni(In(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Ud(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=In(i,"beforeFooter",this,e),s=In(i,"footer",this,e),o=In(i,"afterFooter",this,e);let r=[];return r=bi(r,Ni(l)),r=bi(r,Ni(s)),r=bi(r,Ni(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],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))),_t(r,f=>{const c=Vd(e.callbacks,f);l.push(In(c,"labelColor",this,f)),s.push(In(c,"labelPointStyle",this,f)),o.push(In(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ms[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Hd(this,i),u=Object.assign({},r,a),f=jd(this.chart,i,u),c=zd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=sr(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,k,S,$,T,O;return s==="center"?(T=m+_/2,l==="left"?(g=d,k=g-o,$=T+o,O=T-o):(g=d+h,k=g+o,$=T-o,O=T+o),S=g):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,g=k-o,S=k+o):($=m+_,T=$+o,g=k+o,S=k-o),O=$),{x1:g,x2:k,x3:S,y1:$,y2:T,y3:O}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=da(i.rtl,this.x,this.width);for(e.x=Wo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Ti(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,xc(e,{x:_,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),xc(e,{x:g,y:h+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,u,a),e.strokeRect(_,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Ti(i.bodyFont);let d=c.lineHeight,m=0;const h=da(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let k,S,$,T,O,M,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Wo(this,g,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,_),m=r&&g!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,M=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Ms[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Hd(this,e),a=Object.assign({},o,this._size),u=jd(t,e,a),f=zd(e,a,u,t);(l._to!==f.x||s._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 l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ol(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),E4(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),M4(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=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}}),s=!kr(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!kr(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Ms[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}ct(tu,"positioners",Ms);var z$={id:"tooltip",_element:tu,positioners:Ms,afterInit(n,e,t){t&&(n.tooltip=new tu({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Wk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function U$(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,h=f-1,{min:_,max:g}=e,k=!Kt(o),S=!Kt(r),$=!Kt(u),T=(g-_)/(c+1);let O=Uc((g-_)/h/m)*m,M,L,I,A;if(O<1e-14&&!k&&!S)return[{value:_},{value:g}];A=Math.ceil(g/O)-Math.floor(_/O),A>h&&(O=Uc(A*O/h/m)*m),Kt(a)||(M=Math.pow(10,a),O=Math.ceil(O*M)/M),l==="ticks"?(L=Math.floor(_/O)*O,I=Math.ceil(g/O)*O):(L=_,I=g),k&&S&&s&&vS((r-o)/s,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):$?(L=k?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ps(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Vc(O),Vc(L));M=Math.pow(10,Kt(a)?P:a),L=Math.round(L*M)/M,I=Math.round(I*M)/M;let N=0;for(k&&(d&&L!==o?(t.push({value:o}),Lr)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ps(t[t.length-1].value,r,Bd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function Bd(n,e,{horizontal:t,minRotation:i}){const l=$l(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class V$ extends _o{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Kt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=sl(l),u=sl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=U$(l,s);return e.bounds==="ticks"&&yS(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return gk(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends V${determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=vn(e)?e:0,this.max=vn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=$l(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ct(nu,"id","linear"),ct(nu,"defaults",{ticks:{callback:kk.formatters.numeric}});const zr={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}},Nn=Object.keys(zr);function Wd(n,e){return n-e}function Yd(n,e){if(Kt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),vn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Xs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Kd(n,e,t,i){const l=Nn.length;for(let s=Nn.indexOf(n);s=Nn.indexOf(t);s--){const o=Nn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Nn[t?Nn.indexOf(t):0]}function W$(n){for(let e=Nn.indexOf(n)+1,t=Nn.length;e=e?t[i]:t[l];n[s]=!0}}function Y$(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Zd(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=ui(t,0,o),i=ui(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||Kd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Ot(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Xs(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 h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return dt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Cl(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Cl(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Gd extends eo{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=Yo(t,this.min),this._tableRange=Yo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Yo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Yo(this._table,i*this._tableRange+this._minPos,!0)}}ct(Gd,"id","timeseries"),ct(Gd,"defaults",eo.defaults);/*! +`):n}function R$(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function Hd(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Ti(e.bodyFont),u=Ti(e.titleFont),f=Ti(e.footerFont),c=s.length,d=l.length,m=i.length,h=ol(e.padding);let _=h.height,g=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){g=Math.max(g,t.measureText(T).width+S)};return t.save(),t.font=u.string,_t(n.title,$),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,_t(i,T=>{_t(T.before,$),_t(T.lines,$),_t(T.after,$)}),S=0,t.font=f.string,_t(n.footer,$),t.restore(),g+=h.width,{width:g,height:_}}function F$(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function q$(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function H$(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),q$(u,n,e,t)&&(u="center"),u}function jd(n,e,t){const i=t.yAlign||e.yAlign||F$(n,t);return{xAlign:t.xAlign||e.xAlign||H$(n,e,t,i),yAlign:i}}function j$(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function z$(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function zd(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=sr(o);let h=j$(e,r);const _=z$(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:ui(h,0,i.width-e.width),y:ui(_,0,i.height-e.height)}}function Wo(n,e,t){const i=ol(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Ud(n){return bi([],Ni(n))}function U$(n,e,t){return Nl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Vd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Kk={beforeTitle:Ai,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?Kk[e].call(t,i):l}class tu extends Al{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Ik(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=U$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=In(i,"beforeTitle",this,e),s=In(i,"title",this,e),o=In(i,"afterTitle",this,e);let r=[];return r=bi(r,Ni(l)),r=bi(r,Ni(s)),r=bi(r,Ni(o)),r}getBeforeBody(e,t){return Ud(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=Vd(i,s);bi(o.before,Ni(In(r,"beforeLabel",this,s))),bi(o.lines,In(r,"label",this,s)),bi(o.after,Ni(In(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Ud(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=In(i,"beforeFooter",this,e),s=In(i,"footer",this,e),o=In(i,"afterFooter",this,e);let r=[];return r=bi(r,Ni(l)),r=bi(r,Ni(s)),r=bi(r,Ni(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],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))),_t(r,f=>{const c=Vd(e.callbacks,f);l.push(In(c,"labelColor",this,f)),s.push(In(c,"labelPointStyle",this,f)),o.push(In(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ms[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Hd(this,i),u=Object.assign({},r,a),f=jd(this.chart,i,u),c=zd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=sr(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,k,S,$,T,O;return s==="center"?(T=m+_/2,l==="left"?(g=d,k=g-o,$=T+o,O=T-o):(g=d+h,k=g+o,$=T-o,O=T+o),S=g):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,g=k-o,S=k+o):($=m+_,T=$+o,g=k+o,S=k-o),O=$),{x1:g,x2:k,x3:S,y1:$,y2:T,y3:O}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=da(i.rtl,this.x,this.width);for(e.x=Wo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Ti(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,xc(e,{x:_,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),xc(e,{x:g,y:h+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,u,a),e.strokeRect(_,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Ti(i.bodyFont);let d=c.lineHeight,m=0;const h=da(i.rtl,this.x,this.width),_=function(L){t.fillText(L,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let k,S,$,T,O,E,I;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Wo(this,g,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,_),m=r&&g!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Ms[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Hd(this,e),a=Object.assign({},o,this._size),u=jd(t,e,a),f=zd(e,a,u,t);(l._to!==f.x||s._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 l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ol(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),D4(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),I4(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=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}}),s=!kr(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!kr(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Ms[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}ct(tu,"positioners",Ms);var V$={id:"tooltip",_element:tu,positioners:Ms,afterInit(n,e,t){t&&(n.tooltip=new tu({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Kk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function B$(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,h=f-1,{min:_,max:g}=e,k=!Kt(o),S=!Kt(r),$=!Kt(u),T=(g-_)/(c+1);let O=Uc((g-_)/h/m)*m,E,I,L,A;if(O<1e-14&&!k&&!S)return[{value:_},{value:g}];A=Math.ceil(g/O)-Math.floor(_/O),A>h&&(O=Uc(A*O/h/m)*m),Kt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),l==="ticks"?(I=Math.floor(_/O)*O,L=Math.ceil(g/O)*O):(I=_,L=g),k&&S&&s&&wS((r-o)/s,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,I=o,L=r):$?(I=k?o:I,L=S?r:L,A=u-1,O=(L-I)/A):(A=(L-I)/O,Ps(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Vc(O),Vc(I));E=Math.pow(10,Kt(a)?P:a),I=Math.round(I*E)/E,L=Math.round(L*E)/E;let N=0;for(k&&(d&&I!==o?(t.push({value:o}),Ir)break;t.push({value:R})}return S&&d&&L!==r?t.length&&Ps(t[t.length-1].value,r,Bd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||L===r)&&t.push({value:L}),t}function Bd(n,e,{horizontal:t,minRotation:i}){const l=$l(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class W$ extends _o{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Kt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=sl(l),u=sl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=B$(l,s);return e.bounds==="ticks"&&SS(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return kk(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends W${determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=vn(e)?e:0,this.max=vn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=$l(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ct(nu,"id","linear"),ct(nu,"defaults",{ticks:{callback:yk.formatters.numeric}});const zr={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}},Nn=Object.keys(zr);function Wd(n,e){return n-e}function Yd(n,e){if(Kt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),vn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Xs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Kd(n,e,t,i){const l=Nn.length;for(let s=Nn.indexOf(n);s=Nn.indexOf(t);s--){const o=Nn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Nn[t?Nn.indexOf(t):0]}function K$(n){for(let e=Nn.indexOf(n)+1,t=Nn.length;e=e?t[i]:t[l];n[s]=!0}}function J$(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Zd(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=ui(t,0,o),i=ui(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||Kd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Ot(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Xs(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 h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return pt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Cl(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Cl(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Gd extends eo{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=Yo(t,this.min),this._tableRange=Yo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Yo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Yo(this._table,i*this._tableRange+this._minPos,!0)}}ct(Gd,"id","timeseries"),ct(Gd,"defaults",eo.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license - */const K$={datetime:Xe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Xe.TIME_WITH_SECONDS,minute:Xe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Ik._date.override({_id:"luxon",_create:function(n){return Xe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return K$},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Xe.fromFormat(n,e,t):n=Xe.fromISO(n,t):n instanceof Date?n=Xe.fromJSDate(n,t):i==="object"&&!(n instanceof Xe)&&(n=Xe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function J$(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yk={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22 + */const Z$={datetime:Xe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Xe.TIME_WITH_SECONDS,minute:Xe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Ak._date.override({_id:"luxon",_create:function(n){return Xe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return Z$},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Xe.fromFormat(n,e,t):n=Xe.fromISO(n,t):n instanceof Date?n=Xe.fromJSDate(n,t):i==="object"&&!(n instanceof Xe)&&(n=Xe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function G$(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Jk={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; - * Licensed under the MIT license */(function(n){(function(e,t,i,l){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(Y,G,ne){return setTimeout($(Y,ne),G)}function d(Y,G,ne){return Array.isArray(Y)?(m(Y,ne[G],ne),!0):!1}function m(Y,G,ne){var de;if(Y)if(Y.forEach)Y.forEach(G,ne);else if(Y.length!==l)for(de=0;de\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ht=e.console&&(e.console.warn||e.console.log);return ht&&ht.call(e.console,de,Ke),Y.apply(this,arguments)}}var _;typeof Object.assign!="function"?_=function(G){if(G===l||G===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(G),de=1;de-1}function P(Y){return Y.trim().split(/\s+/g)}function N(Y,G,ne){if(Y.indexOf&&!ne)return Y.indexOf(G);for(var de=0;deTn[G]}),de}function F(Y,G){for(var ne,de,Ae=G[0].toUpperCase()+G.slice(1),Ke=0;Ke1&&!ne.firstMultiple?ne.firstMultiple=Vt(G):Ae===1&&(ne.firstMultiple=!1);var Ke=ne.firstInput,ht=ne.firstMultiple,rn=ht?ht.center:Ke.center,dn=G.center=wn(de);G.timeStamp=f(),G.deltaTime=G.timeStamp-Ke.timeStamp,G.angle=kt(rn,dn),G.distance=ii(rn,dn),Re(ne,G),G.offsetDirection=Oi(G.deltaX,G.deltaY);var Tn=cn(G.deltaTime,G.deltaX,G.deltaY);G.overallVelocityX=Tn.x,G.overallVelocityY=Tn.y,G.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,G.scale=ht?ln(ht.pointers,de):1,G.rotation=ht?Sn(ht.pointers,de):0,G.maxPointers=ne.prevInput?G.pointers.length>ne.prevInput.maxPointers?G.pointers.length:ne.prevInput.maxPointers:G.pointers.length,Ft(ne,G);var _i=Y.element;I(G.srcEvent.target,_i)&&(_i=G.srcEvent.target),G.target=_i}function Re(Y,G){var ne=G.center,de=Y.offsetDelta||{},Ae=Y.prevDelta||{},Ke=Y.prevInput||{};(G.eventType===We||Ke.eventType===Ze)&&(Ae=Y.prevDelta={x:Ke.deltaX||0,y:Ke.deltaY||0},de=Y.offsetDelta={x:ne.x,y:ne.y}),G.deltaX=Ae.x+(ne.x-de.x),G.deltaY=Ae.y+(ne.y-de.y)}function Ft(Y,G){var ne=Y.lastInterval||G,de=G.timeStamp-ne.timeStamp,Ae,Ke,ht,rn;if(G.eventType!=at&&(de>xe||ne.velocity===l)){var dn=G.deltaX-ne.deltaX,Tn=G.deltaY-ne.deltaY,_i=cn(de,dn,Tn);Ke=_i.x,ht=_i.y,Ae=u(_i.x)>u(_i.y)?_i.x:_i.y,rn=Oi(dn,Tn),Y.lastInterval=G}else Ae=ne.velocity,Ke=ne.velocityX,ht=ne.velocityY,rn=ne.direction;G.velocity=Ae,G.velocityX=Ke,G.velocityY=ht,G.direction=rn}function Vt(Y){for(var G=[],ne=0;ne=u(G)?Y<0?Ve:Me:G<0?st:De}function ii(Y,G,ne){ne||(ne=ut);var de=G[ne[0]]-Y[ne[0]],Ae=G[ne[1]]-Y[ne[1]];return Math.sqrt(de*de+Ae*Ae)}function kt(Y,G,ne){ne||(ne=ut);var de=G[ne[0]]-Y[ne[0]],Ae=G[ne[1]]-Y[ne[1]];return Math.atan2(Ae,de)*180/Math.PI}function Sn(Y,G){return kt(G[1],G[0],qt)+kt(Y[1],Y[0],qt)}function ln(Y,G){return ii(G[0],G[1],qt)/ii(Y[0],Y[1],qt)}var Dt={mousedown:We,mousemove:rt,mouseup:Ze},Ei="mousedown",ul="mousemove mouseup";function zi(){this.evEl=Ei,this.evWin=ul,this.pressed=!1,Le.apply(this,arguments)}S(zi,Le,{handler:function(G){var ne=Dt[G.type];ne&We&&G.button===0&&(this.pressed=!0),ne&rt&&G.which!==1&&(ne=Ze),this.pressed&&(ne&Ze&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[G],changedPointers:[G],pointerType:Ye,srcEvent:G}))}});var Ui={pointerdown:We,pointermove:rt,pointerup:Ze,pointercancel:at,pointerout:at},fl={2:ge,3:$e,4:Ye,5:nt},Dn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Dn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Dn,this.evWin=Rl,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Le,{handler:function(G){var ne=this.store,de=!1,Ae=G.type.toLowerCase().replace("ms",""),Ke=Ui[Ae],ht=fl[G.pointerType]||G.pointerType,rn=ht==ge,dn=N(ne,G.pointerId,"pointerId");Ke&We&&(G.button===0||rn)?dn<0&&(ne.push(G),dn=ne.length-1):Ke&(Ze|at)&&(de=!0),!(dn<0)&&(ne[dn]=G,this.callback(this.manager,Ke,{pointers:ne,changedPointers:[G],pointerType:ht,srcEvent:G}),de&&ne.splice(dn,1))}});var Z={touchstart:We,touchmove:rt,touchend:Ze,touchcancel:at},ee="touchstart",se="touchstart touchmove touchend touchcancel";function he(){this.evTarget=ee,this.evWin=se,this.started=!1,Le.apply(this,arguments)}S(he,Le,{handler:function(G){var ne=Z[G.type];if(ne===We&&(this.started=!0),!!this.started){var de=qe.call(this,G,ne);ne&(Ze|at)&&de[0].length-de[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:de[0],changedPointers:de[1],pointerType:ge,srcEvent:G})}}});function qe(Y,G){var ne=R(Y.touches),de=R(Y.changedTouches);return G&(Ze|at)&&(ne=z(ne.concat(de),"identifier")),[ne,de]}var le={touchstart:We,touchmove:rt,touchend:Ze,touchcancel:at},Oe="touchstart touchmove touchend touchcancel";function Fe(){this.evTarget=Oe,this.targetIds={},Le.apply(this,arguments)}S(Fe,Le,{handler:function(G){var ne=le[G.type],de=Je.call(this,G,ne);de&&this.callback(this.manager,ne,{pointers:de[0],changedPointers:de[1],pointerType:ge,srcEvent:G})}});function Je(Y,G){var ne=R(Y.touches),de=this.targetIds;if(G&(We|rt)&&ne.length===1)return de[ne[0].identifier]=!0,[ne,ne];var Ae,Ke,ht=R(Y.changedTouches),rn=[],dn=this.target;if(Ke=ne.filter(function(Tn){return I(Tn.target,dn)}),G===We)for(Ae=0;Ae-1&&de.splice(Ke,1)};setTimeout(Ae,Pe)}}function dl(Y){for(var G=Y.srcEvent.clientX,ne=Y.srcEvent.clientY,de=0;de-1&&this.requireFail.splice(G,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(Y){return!!this.simultaneous[Y.id]},emit:function(Y){var G=this,ne=this.state;function de(Ae){G.manager.emit(Ae,Y)}ne=Vi&&de(G.options.event+af(ne))},tryEmit:function(Y){if(this.canEmit())return this.emit(Y);this.state=hi},canEmit:function(){for(var Y=0;YG.threshold&&Ae&G.direction},attrTest:function(Y){return li.prototype.attrTest.call(this,Y)&&(this.state&Yn||!(this.state&Yn)&&this.directionTest(Y))},emit:function(Y){this.pX=Y.deltaX,this.pY=Y.deltaY;var G=uf(Y.direction);G&&(Y.additionalEvent=this.options.event+G),this._super.emit.call(this,Y)}});function Br(){li.apply(this,arguments)}S(Br,li,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(Y){return this._super.attrTest.call(this,Y)&&(Math.abs(Y.scale-1)>this.options.threshold||this.state&Yn)},emit:function(Y){if(Y.scale!==1){var G=Y.scale<1?"in":"out";Y.additionalEvent=this.options.event+G}this._super.emit.call(this,Y)}});function Wr(){Li.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Li,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ko]},process:function(Y){var G=this.options,ne=Y.pointers.length===G.pointers,de=Y.distanceG.time;if(this._input=Y,!de||!ne||Y.eventType&(Ze|at)&&!Ae)this.reset();else if(Y.eventType&We)this.reset(),this._timer=c(function(){this.state=Ii,this.tryEmit()},G.time,this);else if(Y.eventType&Ze)return Ii;return hi},reset:function(){clearTimeout(this._timer)},emit:function(Y){this.state===Ii&&(Y&&Y.eventType&Ze?this.manager.emit(this.options.event+"up",Y):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){li.apply(this,arguments)}S(Yr,li,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(Y){return this._super.attrTest.call(this,Y)&&(Math.abs(Y.rotation)>this.options.threshold||this.state&Yn)}});function Kr(){li.apply(this,arguments)}S(Kr,li,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Be|ve,pointers:1},getTouchAction:function(){return wo.prototype.getTouchAction.call(this)},attrTest:function(Y){var G=this.options.direction,ne;return G&(Be|ve)?ne=Y.overallVelocity:G&Be?ne=Y.overallVelocityX:G&ve&&(ne=Y.overallVelocityY),this._super.attrTest.call(this,Y)&&G&Y.offsetDirection&&Y.distance>this.options.threshold&&Y.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&Y.eventType&Ze},emit:function(Y){var G=uf(Y.offsetDirection);G&&this.manager.emit(this.options.event+G,Y),this.manager.emit(this.options.event,Y)}});function So(){Li.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(So,Li,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[hs]},process:function(Y){var G=this.options,ne=Y.pointers.length===G.pointers,de=Y.distance\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ht=e.console&&(e.console.warn||e.console.log);return ht&&ht.call(e.console,pe,Ke),Y.apply(this,arguments)}}var _;typeof Object.assign!="function"?_=function(G){if(G===l||G===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(G),pe=1;pe-1}function P(Y){return Y.trim().split(/\s+/g)}function N(Y,G,ne){if(Y.indexOf&&!ne)return Y.indexOf(G);for(var pe=0;peTn[G]}),pe}function F(Y,G){for(var ne,pe,Ae=G[0].toUpperCase()+G.slice(1),Ke=0;Ke1&&!ne.firstMultiple?ne.firstMultiple=Vt(G):Ae===1&&(ne.firstMultiple=!1);var Ke=ne.firstInput,ht=ne.firstMultiple,rn=ht?ht.center:Ke.center,dn=G.center=wn(pe);G.timeStamp=f(),G.deltaTime=G.timeStamp-Ke.timeStamp,G.angle=kt(rn,dn),G.distance=ii(rn,dn),Re(ne,G),G.offsetDirection=Oi(G.deltaX,G.deltaY);var Tn=cn(G.deltaTime,G.deltaX,G.deltaY);G.overallVelocityX=Tn.x,G.overallVelocityY=Tn.y,G.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,G.scale=ht?ln(ht.pointers,pe):1,G.rotation=ht?Sn(ht.pointers,pe):0,G.maxPointers=ne.prevInput?G.pointers.length>ne.prevInput.maxPointers?G.pointers.length:ne.prevInput.maxPointers:G.pointers.length,Ft(ne,G);var _i=Y.element;L(G.srcEvent.target,_i)&&(_i=G.srcEvent.target),G.target=_i}function Re(Y,G){var ne=G.center,pe=Y.offsetDelta||{},Ae=Y.prevDelta||{},Ke=Y.prevInput||{};(G.eventType===We||Ke.eventType===Ze)&&(Ae=Y.prevDelta={x:Ke.deltaX||0,y:Ke.deltaY||0},pe=Y.offsetDelta={x:ne.x,y:ne.y}),G.deltaX=Ae.x+(ne.x-pe.x),G.deltaY=Ae.y+(ne.y-pe.y)}function Ft(Y,G){var ne=Y.lastInterval||G,pe=G.timeStamp-ne.timeStamp,Ae,Ke,ht,rn;if(G.eventType!=at&&(pe>xe||ne.velocity===l)){var dn=G.deltaX-ne.deltaX,Tn=G.deltaY-ne.deltaY,_i=cn(pe,dn,Tn);Ke=_i.x,ht=_i.y,Ae=u(_i.x)>u(_i.y)?_i.x:_i.y,rn=Oi(dn,Tn),Y.lastInterval=G}else Ae=ne.velocity,Ke=ne.velocityX,ht=ne.velocityY,rn=ne.direction;G.velocity=Ae,G.velocityX=Ke,G.velocityY=ht,G.direction=rn}function Vt(Y){for(var G=[],ne=0;ne=u(G)?Y<0?Ve:Me:G<0?st:De}function ii(Y,G,ne){ne||(ne=ut);var pe=G[ne[0]]-Y[ne[0]],Ae=G[ne[1]]-Y[ne[1]];return Math.sqrt(pe*pe+Ae*Ae)}function kt(Y,G,ne){ne||(ne=ut);var pe=G[ne[0]]-Y[ne[0]],Ae=G[ne[1]]-Y[ne[1]];return Math.atan2(Ae,pe)*180/Math.PI}function Sn(Y,G){return kt(G[1],G[0],qt)+kt(Y[1],Y[0],qt)}function ln(Y,G){return ii(G[0],G[1],qt)/ii(Y[0],Y[1],qt)}var Dt={mousedown:We,mousemove:rt,mouseup:Ze},Ei="mousedown",ul="mousemove mouseup";function zi(){this.evEl=Ei,this.evWin=ul,this.pressed=!1,Le.apply(this,arguments)}S(zi,Le,{handler:function(G){var ne=Dt[G.type];ne&We&&G.button===0&&(this.pressed=!0),ne&rt&&G.which!==1&&(ne=Ze),this.pressed&&(ne&Ze&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[G],changedPointers:[G],pointerType:Ye,srcEvent:G}))}});var Ui={pointerdown:We,pointermove:rt,pointerup:Ze,pointercancel:at,pointerout:at},fl={2:ge,3:$e,4:Ye,5:nt},Dn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Dn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Dn,this.evWin=Rl,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Le,{handler:function(G){var ne=this.store,pe=!1,Ae=G.type.toLowerCase().replace("ms",""),Ke=Ui[Ae],ht=fl[G.pointerType]||G.pointerType,rn=ht==ge,dn=N(ne,G.pointerId,"pointerId");Ke&We&&(G.button===0||rn)?dn<0&&(ne.push(G),dn=ne.length-1):Ke&(Ze|at)&&(pe=!0),!(dn<0)&&(ne[dn]=G,this.callback(this.manager,Ke,{pointers:ne,changedPointers:[G],pointerType:ht,srcEvent:G}),pe&&ne.splice(dn,1))}});var Z={touchstart:We,touchmove:rt,touchend:Ze,touchcancel:at},ee="touchstart",se="touchstart touchmove touchend touchcancel";function he(){this.evTarget=ee,this.evWin=se,this.started=!1,Le.apply(this,arguments)}S(he,Le,{handler:function(G){var ne=Z[G.type];if(ne===We&&(this.started=!0),!!this.started){var pe=qe.call(this,G,ne);ne&(Ze|at)&&pe[0].length-pe[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:pe[0],changedPointers:pe[1],pointerType:ge,srcEvent:G})}}});function qe(Y,G){var ne=R(Y.touches),pe=R(Y.changedTouches);return G&(Ze|at)&&(ne=z(ne.concat(pe),"identifier")),[ne,pe]}var le={touchstart:We,touchmove:rt,touchend:Ze,touchcancel:at},Oe="touchstart touchmove touchend touchcancel";function Fe(){this.evTarget=Oe,this.targetIds={},Le.apply(this,arguments)}S(Fe,Le,{handler:function(G){var ne=le[G.type],pe=Je.call(this,G,ne);pe&&this.callback(this.manager,ne,{pointers:pe[0],changedPointers:pe[1],pointerType:ge,srcEvent:G})}});function Je(Y,G){var ne=R(Y.touches),pe=this.targetIds;if(G&(We|rt)&&ne.length===1)return pe[ne[0].identifier]=!0,[ne,ne];var Ae,Ke,ht=R(Y.changedTouches),rn=[],dn=this.target;if(Ke=ne.filter(function(Tn){return L(Tn.target,dn)}),G===We)for(Ae=0;Ae-1&&pe.splice(Ke,1)};setTimeout(Ae,Pe)}}function dl(Y){for(var G=Y.srcEvent.clientX,ne=Y.srcEvent.clientY,pe=0;pe-1&&this.requireFail.splice(G,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(Y){return!!this.simultaneous[Y.id]},emit:function(Y){var G=this,ne=this.state;function pe(Ae){G.manager.emit(Ae,Y)}ne=Vi&&pe(G.options.event+af(ne))},tryEmit:function(Y){if(this.canEmit())return this.emit(Y);this.state=hi},canEmit:function(){for(var Y=0;YG.threshold&&Ae&G.direction},attrTest:function(Y){return li.prototype.attrTest.call(this,Y)&&(this.state&Yn||!(this.state&Yn)&&this.directionTest(Y))},emit:function(Y){this.pX=Y.deltaX,this.pY=Y.deltaY;var G=uf(Y.direction);G&&(Y.additionalEvent=this.options.event+G),this._super.emit.call(this,Y)}});function Br(){li.apply(this,arguments)}S(Br,li,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(Y){return this._super.attrTest.call(this,Y)&&(Math.abs(Y.scale-1)>this.options.threshold||this.state&Yn)},emit:function(Y){if(Y.scale!==1){var G=Y.scale<1?"in":"out";Y.additionalEvent=this.options.event+G}this._super.emit.call(this,Y)}});function Wr(){Li.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Li,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ko]},process:function(Y){var G=this.options,ne=Y.pointers.length===G.pointers,pe=Y.distanceG.time;if(this._input=Y,!pe||!ne||Y.eventType&(Ze|at)&&!Ae)this.reset();else if(Y.eventType&We)this.reset(),this._timer=c(function(){this.state=Ii,this.tryEmit()},G.time,this);else if(Y.eventType&Ze)return Ii;return hi},reset:function(){clearTimeout(this._timer)},emit:function(Y){this.state===Ii&&(Y&&Y.eventType&Ze?this.manager.emit(this.options.event+"up",Y):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){li.apply(this,arguments)}S(Yr,li,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(Y){return this._super.attrTest.call(this,Y)&&(Math.abs(Y.rotation)>this.options.threshold||this.state&Yn)}});function Kr(){li.apply(this,arguments)}S(Kr,li,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Be|ve,pointers:1},getTouchAction:function(){return wo.prototype.getTouchAction.call(this)},attrTest:function(Y){var G=this.options.direction,ne;return G&(Be|ve)?ne=Y.overallVelocity:G&Be?ne=Y.overallVelocityX:G&ve&&(ne=Y.overallVelocityY),this._super.attrTest.call(this,Y)&&G&Y.offsetDirection&&Y.distance>this.options.threshold&&Y.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&Y.eventType&Ze},emit:function(Y){var G=uf(Y.offsetDirection);G&&this.manager.emit(this.options.event+G,Y),this.manager.emit(this.options.event,Y)}});function So(){Li.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(So,Li,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[hs]},process:function(Y){var G=this.options,ne=Y.pointers.length===G.pointers,pe=Y.distancen&&n.enabled&&n.modifierKey,Kk=(n,e)=>n&&e[n+"Key"],Gu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ka(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function G$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function X$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function Jk(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=X$(e,t),r=ka(i,t),a=ka(l,t);if(s){const f=ka(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const iu=new WeakMap;function Jt(n){let e=iu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},iu.set(n,e)),e}function Q$(n){iu.delete(n)}function Zk(n,e,t){const i=n.max-n.min,l=i*(e-1),s=n.isHorizontal()?t.x:t.y,o=Math.max(0,Math.min(1,(n.getValueForPixel(s)-n.min)/i||0)),r=1-o;return{min:l*o,max:l*r}}function Xd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Ot(o.options,o.scale)}return Ot(s,l)}function x$(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function fs(n,{min:e,max:t},i,l=!1){const s=Jt(n.chart),{id:o,axis:r,options:a}=n,u=i&&(i[o]||i[r])||{},{minRange:f=0}=u,c=Xd(s,n,u,"min",-1/0),d=Xd(s,n,u,"max",1/0),m=l?Math.max(t-e,f):n.max-n.min,h=(m-t+e)/2;return e-=h,t+=h,ed&&(t=d,e=Math.max(d-m,c)),a.min=e,a.max=t,s.updatedScaleLimits[n.id]={min:e,max:t},n.parse(e)!==n.min||n.parse(t)!==n.max}function eC(n,e,t,i){const l=Zk(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return fs(n,s,i,!0)}function tC(n,e,t,i){fs(n,x$(n,e,t),i,!0)}const Qd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function nC(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),fs(n,{min:s,max:o},t)||f}const oC={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function Gk(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=oC[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e),{min:c=-1/0,max:d=1/0}=i&&t&&t[n.axis]||{};return isNaN(u)||isNaN(f)||ud?!0:fs(n,{min:u,max:f},t,i)}function xd(n,e,t){return Gk(n,e,t,!0)}const lu={category:iC,default:eC},su={default:tC},ou={category:sC,default:Gk,logarithmic:xd,timeseries:xd};function rC(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max!==s}function ep(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function cs(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){rC(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),ep(i,t),ep(l,t),i}function tp(n,e,t,i){const l=lu[n.type]||lu.default;dt(l,[n,e,t,i])}function np(n,e,t,i,l){const s=su[n.type]||su.default;dt(s,[n,e,t,i,l])}function aC(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Xu(n,e,t="none"){const{x:i=1,y:l=1,focalPoint:s=aC(n)}=typeof e=="number"?{x:e,y:e}:e,o=Jt(n),{options:{limits:r,zoom:a}}=o;cs(n,o);const u=i!==1,f=l!==1,c=Jk(a,s,n);_t(c||n.scales,function(d){d.isHorizontal()&&u?tp(d,i,s,r):!d.isHorizontal()&&f&&tp(d,l,s,r)}),n.update(t),dt(a.onZoom,[{chart:n}])}function Xk(n,e,t,i="none"){const l=Jt(n),{options:{limits:s,zoom:o}}=l,{mode:r="xy"}=o;cs(n,l);const a=rl(r,"x",n),u=rl(r,"y",n);_t(n.scales,function(f){f.isHorizontal()&&a?np(f,e.x,t.x,s):!f.isHorizontal()&&u&&np(f,e.y,t.y,s)}),n.update(i),dt(o.onZoom,[{chart:n}])}function uC(n,e,t,i="none"){cs(n,Jt(n));const l=n.scales[e];fs(l,t,void 0,!0),n.update(i)}function fC(n,e="default"){const t=Jt(n),i=cs(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max)}),n.update(e),dt(t.options.zoom.onZoomComplete,[{chart:n}])}function cC(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Ot(l.options,l.scale)-Ot(i.options,i.scale)}function dC(n){const e=Jt(n);let t=1,i=1;return _t(n.scales,function(l){const s=cC(e,l.id);if(s){const o=Math.round(s/(l.max-l.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function ip(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=ou[n.type]||ou.default;dt(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function Qk(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Jt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};cs(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?ip(d,l,a,o):!d.isHorizontal()&&c&&ip(d,s,a,o)}),n.update(i),dt(u,[{chart:n}])}function xk(n){const e=Jt(n);cs(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:l,max:s}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:l.scale,max:s.scale}}return t}function pC(n){const e=xk(n);for(const t of Object.keys(n.scales)){const{min:i,max:l}=e[t];if(i!==void 0&&n.scales[t].min!==i||l!==void 0&&n.scales[t].max!==l)return!0}return!1}function An(n,e){const{handlers:t}=Jt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Jt(n),o=l[t];o&&o.target===e||(An(n,t),l[t]=r=>i(n,r,s),l[t].target=e,e.addEventListener(t,l[t]))}function mC(n,e){const t=Jt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function hC(n,e){const t=Jt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function ev(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=yi(e,n);if(dt(i,[{chart:n,event:e,point:s}])===!1)return dt(l,[{chart:n,event:e}]),!1}}function _C(n,e){const t=Jt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||Kk(to(i),e)||Gu(to(l.drag),e))return dt(l.onZoomRejected,[{chart:n,event:e}]);ev(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas,"mousemove",mC),Hs(n,window.document,"keydown",hC))}function tv(n,e,t,i){const l=rl(e,"x",n),s=rl(e,"y",n);let{top:o,left:r,right:a,bottom:u,width:f,height:c}=n.chartArea;const d=yi(t,n),m=yi(i,n);l&&(r=Math.min(d.x,m.x),a=Math.max(d.x,m.x)),s&&(o=Math.min(d.y,m.y),u=Math.max(d.y,m.y));const h=a-r,_=u-o;return{left:r,top:o,right:a,bottom:u,width:h,height:_,zoomX:l&&h?1+(f-h)/f:1,zoomY:s&&_?1+(c-_)/c:1}}function gC(n,e){const t=Jt(n);if(!t.dragStart)return;An(n,"mousemove");const{mode:i,onZoomComplete:l,drag:{threshold:s=0}}=t.options.zoom,o=tv(n,i,t.dragStart,e),r=rl(i,"x",n)?o.width:0,a=rl(i,"y",n)?o.height:0,u=Math.sqrt(r*r+a*a);if(t.dragStart=t.dragEnd=null,u<=s){t.dragging=!1,n.update("none");return}Xk(n,{x:o.left,y:o.top},{x:o.right,y:o.bottom},"zoom"),setTimeout(()=>t.dragging=!1,500),dt(l,[{chart:n}])}function bC(n,e,t){if(Gu(to(t.wheel),e)){dt(t.onZoomRejected,[{chart:n,event:e}]);return}if(ev(n,e,t)!==!1&&(e.cancelable&&e.preventDefault(),e.deltaY!==void 0))return!0}function kC(n,e){const{handlers:{onZoomComplete:t},options:{zoom:i}}=Jt(n);if(!bC(n,e,i))return;const l=e.target.getBoundingClientRect(),s=1+(e.deltaY>=0?-i.wheel.speed:i.wheel.speed),o={x:s,y:s,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};Xu(n,o),t&&t()}function vC(n,e,t,i){t&&(Jt(n).handlers[e]=G$(()=>dt(t,[{chart:n}]),i))}function yC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",kC),vC(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",_C),Hs(n,t.ownerDocument,"mouseup",gC)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function wC(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function SC(n,e){return function(t,i){const{pan:l,zoom:s={}}=e.options;if(!l||!l.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(Gu(to(l),o)||Kk(to(s.drag),o))?(dt(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function TC(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),l=t/i;let s,o;return l>.3&&l<1.7?s=o=!0:t>i?s=!0:o=!0,{x:s,y:o}}function nv(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=TC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Xu(n,u),e.scale=t.scale}}function $C(n,e){e.options.zoom.pinch.enabled&&(e.scale=1)}function CC(n,e,t){e.scale&&(nv(n,e,t),e.scale=null,dt(e.options.zoom.onZoomComplete,[{chart:n}]))}function iv(n,e,t){const i=e.delta;i&&(e.panning=!0,Qk(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function OC(n,e,t){const{enabled:i,onPanStart:l,onPanRejected:s}=e.options.pan;if(!i)return;const o=t.target.getBoundingClientRect(),r={x:t.center.x-o.left,y:t.center.y-o.top};if(dt(l,[{chart:n,event:t,point:r}])===!1)return dt(s,[{chart:n,event:t}]);e.panScales=Jk(e.options.pan,r,n),e.delta={x:0,y:0},clearTimeout(e.panEndTimeout),iv(n,e,t)}function EC(n,e){e.delta=null,e.panning&&(e.panEndTimeout=setTimeout(()=>e.panning=!1,500),dt(e.options.pan.onPanComplete,[{chart:n}]))}const ru=new WeakMap;function MC(n,e){const t=Jt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",()=>$C(n,t)),o.on("pinch",r=>nv(n,t,r)),o.on("pinchend",r=>CC(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:SC(n,t)})),o.on("panstart",r=>OC(n,t,r)),o.on("panmove",r=>iv(n,t,r)),o.on("panend",()=>EC(n,t))),ru.set(n,o)}function DC(n){const e=ru.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),ru.delete(n))}var IC="2.0.1";function Ko(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Jt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=tv(n,t.zoom.mode,l,s),f=n.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",f.fillRect(o,r,a,u),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||"rgba(225,225,225)",f.strokeRect(o,r,a,u)),f.restore()}var LC={id:"zoom",version:IC,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,e,t){const i=Jt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&MC(n,t),n.pan=(l,s,o)=>Qk(n,l,s,o),n.zoom=(l,s)=>Xu(n,l,s),n.zoomRect=(l,s,o)=>Xk(n,l,s,o),n.zoomScale=(l,s,o)=>uC(n,l,s,o),n.resetZoom=l=>fC(n,l),n.getZoomLevel=()=>dC(n),n.getInitialScaleBounds=()=>xk(n),n.isZoomedOrPanned=()=>pC(n)},beforeEvent(n){const e=Jt(n);if(e.panning||e.dragging)return!1},beforeUpdate:function(n,e,t){const i=Jt(n);i.options=t,yC(n,t)},beforeDatasetsDraw(n,e,t){Ko(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Ko(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Ko(n,"beforeDraw",t)},afterDraw(n,e,t){Ko(n,"afterDraw",t)},stop:function(n){wC(n),qs&&DC(n),Q$(n)},panFunctions:ou,zoomFunctions:lu,zoomRectFunctions:su};function lp(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(l,s){y(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=je(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function sp(n){let e,t,i;return{c(){e=b("button"),e.textContent="Reset zoom",p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-chart-zoom svelte-kfnurg")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[4]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function AC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&lp(),_=n[3]&&sp(n);return{c(){e=b("div"),t=b("div"),i=W("Found "),l=W(n[1]),s=C(),r=W(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),_&&_.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),Q(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),Q(e,"loading",n[2])},m(g,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(t,r),w(e,a),h&&h.m(e,null),w(e,u),w(e,f),n[11](f),w(e,c),_&&_.m(e,null),d||(m=B(f,"dblclick",n[4]),d=!0)},p(g,[k]){k&2&&re(l,g[1]),k&2&&o!==(o=g[1]==1?"log":"logs")&&re(r,o),k&4&&Q(t,"hidden",g[2]),g[2]?h?k&4&&E(h,1):(h=lp(),h.c(),E(h,1),h.m(e,u)):h&&(ae(),D(h,1,1,()=>{h=null}),ue()),g[3]?_?_.p(g,k):(_=sp(g),_.c(),_.m(e,null)):_&&(_.d(1),_=null),k&4&&Q(e,"loading",g[2])},i(g){E(h)},o(g){D(h)},d(g){g&&v(e),h&&h.d(),n[11](null),_&&_.d(),d=!1,m()}}}function PC(n,e,t){let{filter:i=""}=e,{zoom:l={}}=e,{presets:s=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const g=[s,V.normalizeLogsFilter(i)].filter(Boolean).join("&&");return me.logs.getStats({filter:g}).then(k=>{m(),k=V.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),me.error(k,!g||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Zt(()=>(wi.register(Qi,ur,or,nu,eo,A$,z$),wi.register(LC),t(9,r=new wi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:g=>{var k;return(k=g.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:g=>{var k;return(k=g.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:g})=>{t(3,c=g.isZoomedOrPanned()),c?(t(5,l.min=V.formatToUTCDate(g.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=V.formatToUTCDate(g.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",l)):(l.min||l.max)&&t(5,l={})}}}}}})),()=>r==null?void 0:r.destroy()));function _(g){ie[g?"unshift":"push"](()=>{o=g,t(0,o)})}return n.$$set=g=>{"filter"in g&&t(6,i=g.filter),"zoom"in g&&t(5,l=g.zoom),"presets"in g&&t(7,s=g.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof s<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,h,l,i,s,d,r,a,_]}class NC extends we{constructor(e){super(),ye(this,e,PC,AC,_e,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function RC(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){y(l,e,s),w(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(l){l&&v(e)}}}function FC(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Qu extends we{constructor(e){super(),ye(this,e,FC,RC,_e,{content:2,language:3,class:0})}}function qC(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){y(o,e,r),l||(s=[Ee(i=He.call(null,e,n[3]?void 0:n[0])),B(e,"click",On(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Nt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&v(e),l=!1,Ie(s)}}}function HC(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){V.isEmpty(i)||(V.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Zt(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,l=f.tooltip),"idleClasses"in f&&t(1,s=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[l,s,o,a,u,i,r]}class fi extends we{constructor(e){super(),ye(this,e,HC,qC,_e,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function op(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=V.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function jC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P,N,R,z,F,U,J,K;d=new fi({props:{value:n[1].id}}),S=new rk({props:{level:n[1].level}}),O=new fi({props:{value:n[1].level}}),N=new ok({props:{date:n[1].created}}),F=new fi({props:{value:n[1].created}});let x=!n[4]&&rp(n),X=pe(n[5](n[1].data)),oe=[];for(let ge=0;geD(oe[ge],1,1,()=>{oe[ge]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("span"),u=W(a),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("tr"),_=b("td"),_.textContent="level",g=C(),k=b("td"),j(S.$$.fragment),$=C(),T=b("div"),j(O.$$.fragment),M=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),j(N.$$.fragment),R=C(),z=b("div"),j(F.$$.fragment),U=C(),x&&x.c(),J=C();for(let ge=0;ge{x=null}),ue()):x?(x.p(ge,$e),$e&16&&E(x,1)):(x=rp(ge),x.c(),E(x,1),x.m(t,J)),$e&50){X=pe(ge[5](ge[1].data));let Ze;for(Ze=0;Ze',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function rp(n){let e,t,i,l,s,o,r;const a=[VC,UC],u=[];function f(c,d){return c[1].message?0:1}return s=f(n),o=u[s]=a[s](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),l=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(l,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),u[s].m(l,null),r=!0},p(c,d){let m=s;s=f(c),s===m?u[s].p(c,d):(ae(),D(u[m],1,1,()=>{u[m]=null}),ue(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),E(o,1),o.m(l,null))},i(c){r||(E(o),r=!0)},o(c){D(o),r=!1},d(c){c&&v(e),u[s].d()}}}function UC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function VC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new fi({props:{value:n[1].message}}),{c(){e=b("span"),i=W(t),l=C(),s=b("div"),j(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),y(a,s,u),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&re(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(l),v(s)),H(o)}}}function BC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=W(t),s=W(l),p(e,"class","txt")},m(o,r){y(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&re(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&re(s,l)},i:te,o:te,d(o){o&&v(e)}}}function WC(n){let e,t;return e=new Qu({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&re(i,t)},i:te,o:te,d(l){l&&v(e)}}}function KC(n){let e,t;return e=new Qu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function ap(n){let e,t,i;return t=new fi({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function up(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[JC,KC,YC,WC,BC],h=[];function _(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=_(n),u=h[a]=m[a](n);let g=!n[18]&&ap(n);return{c(){e=b("tr"),t=b("td"),i=W("data."),s=W(l),o=C(),r=b("td"),u.c(),f=C(),g&&g.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),Q(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){y(k,e,S),w(e,t),w(t,i),w(t,s),w(e,o),w(e,r),h[a].m(r,null),w(r,f),g&&g.m(r,null),w(e,c),d=!0},p(k,S){(!d||S&2)&&l!==(l=k[16]+"")&&re(s,l),(!d||S&34)&&Q(t,"v-align-top",k[19]);let $=a;a=_(k),a===$?h[a].p(k,S):(ae(),D(h[$],1,1,()=>{h[$]=null}),ue(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),E(u,1),u.m(r,f)),k[18]?g&&(ae(),D(g,1,1,()=>{g=null}),ue()):g?(g.p(k,S),S&2&&E(g,1)):(g=ap(k),g.c(),E(g,1),g.m(r,null))},i(k){d||(E(u),E(g),d=!0)},o(k){D(u),D(g),d=!1},d(k){k&&v(e),h[a].d(),g&&g.d()}}}function ZC(n){let e,t,i,l;const s=[zC,jC],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ke()},m(a,u){~e&&o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(ae(),D(o[f],1,1,()=>{o[f]=null}),ue()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function GC(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function XC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),l=b("i"),s=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){y(u,e,f),y(u,t,f),y(u,i,f),w(i,l),w(i,s),w(i,o),r||(a=[B(e,"click",n[9]),B(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(v(e),v(t),v(i)),r=!1,Ie(a)}}}function QC(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[XC],header:[GC],default:[ZC]},$$scope:{ctx:n}};return e=new nn({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const fp="log_view";function xC(n,e,t){let i;const l=bt();let s,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return me.cancelRequest(fp),s==null?void 0:s.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await me.logs.getOne($,{requestKey:fp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Ci(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let M of c)typeof $[M]<"u"&&T.push(M);const O=Object.keys($);for(let M of O)T.includes(M)||T.push(M);return T}function m(){V.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>u(),k=()=>m();function S($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,s,r,i,d,m,_,a,g,k,S]}class e5 extends we{constructor(e){super(),ye(this,e,xC,QC,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function t5(n,e,t){const i=n.slice();return i[1]=e[t],i}function n5(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function i5(n){let e,t,i,l=pe(U0),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class lv extends we{constructor(e){super(),ye(this,e,l5,i5,_e,{class:0})}}function s5(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[r5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[a5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[u5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[f5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){y(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=B(e,"submit",et(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),l.$set(_);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),o.$set(g);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(E(t.$$.fragment,d),E(l.$$.fragment,d),E(o.$$.fragment,d),E(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&v(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function o5(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function r5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[1].logs.maxDays),y(c,r,d),y(c,a,d),u||(f=B(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&>(s.value)!==c[1].logs.maxDays&&ce(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function a5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new lv({}),{c(){e=b("label"),t=W("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){y(h,e,_),w(e,t),y(h,l,_),y(h,s,_),ce(s,n[1].logs.minLevel),y(h,o,_),y(h,r,_),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=B(s,"input",n[12]),d=!0)},p(h,_){(!c||_&8388608&&i!==(i=h[23]))&&p(e,"for",i),_&2&>(s.value)!==h[1].logs.minLevel&&ce(s,h[1].logs.minLevel)},i(h){c||(E(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),H(f),d=!1,m()}}}function u5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){y(u,e,f),e.checked=n[1].logs.logIP,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function f5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){y(u,e,f),e.checked=n[1].logs.logAuthId,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function c5(n){let e,t,i,l;const s=[o5,s5],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function d5(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function p5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],Q(l,"btn-loading",n[3])},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&Q(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function m5(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[p5],header:[d5],default:[c5]},$$scope:{ctx:n}};return e=new nn({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function h5(n,e,t){let i,l;const s=bt(),o="logs_settings_"+V.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Yt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function _(){t(4,u=!0);try{const P=await me.settings.getAll()||{};k(P)}catch(P){me.error(P)}t(4,u=!1)}async function g(){if(l){t(3,a=!0);try{const P=await me.settings.update(V.filterRedactedProps(c));k(P),t(3,a=!1),m(),en("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),me.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=gt(this.value),t(1,c)}function $(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const M=()=>!a;function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Ne.call(this,n,P)}function A(P){Ne.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,g,d,f,i,S,$,T,O,M,L,I,A]}class _5 extends we{constructor(e){super(),ye(this,e,h5,m5,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function g5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){y(u,e,f),e.checked=n[2],y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function cp(n){let e,t,i;function l(o){n[14](o)}let s={filter:n[1],presets:n[6]};return n[5]!==void 0&&(s.zoom=n[5]),e=new NC({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new z3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],Te(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],Te(()=>i=!1)),e.$set(f)},i(a){l||(E(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function b5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T=n[4],O,M=n[4],L,I,A,P;u=new Au({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[g5,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),g=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[13]),S=new lv({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=cp(n),R=dp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=W(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),j(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),j(h.$$.fragment),_=C(),j(g.$$.fragment),k=C(),j(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ke(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){y(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,_),q(g,e,null),w(e,k),q(S,e,null),w(e,$),N.m(e,null),y(z,O,F),R.m(z,F),y(z,L,F),I=!0,A||(P=[Ee(He.call(null,r,{text:"Logs settings",position:"right"})),B(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&re(s,z[7]);const U={};F&100663300&&(U.$$scope={dirty:F,ctx:z}),h.$set(U);const J={};F&2&&(J.value=z[1]),g.$set(J),F&16&&_e(T,T=z[4])?(ae(),D(N,1,1,te),ue(),N=cp(z),N.c(),E(N,1),N.m(e,null)):N.p(z,F),F&16&&_e(M,M=z[4])?(ae(),D(R,1,1,te),ue(),R=dp(z),R.c(),E(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(E(u.$$.fragment,z),E(h.$$.fragment,z),E(g.$$.fragment,z),E(S.$$.fragment,z),E(N),E(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(g.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(v(e),v(O),v(L)),H(u),H(h),H(g),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function k5(n){let e,t,i,l,s,o;e=new mi({props:{$$slots:{default:[b5]},$$scope:{ctx:n}}});let r={};i=new e5({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new _5({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(u,f){q(e,u,f),y(u,t,f),q(i,u,f),y(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(E(e.$$.fragment,u),E(i.$$.fragment,u),E(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(v(t),v(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Jo="logId",pp="superuserRequests",mp="superuserLogRequests";function v5(n,e,t){var R;let i,l,s;Qe(n,Lu,z=>t(22,l=z)),Qe(n,fn,z=>t(7,s=z)),Rn(fn,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(pp)||((R=window.localStorage)==null?void 0:R.getItem(mp)))<<0,m=d;function h(){t(4,u++,u)}function _(z={}){let F={};F.filter=f||null,F[pp]=d<<0||null,V.replaceHashQueryParams(Object.assign(F,z))}const g=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function M(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var U;let F={};F[Jo]=((U=z.detail)==null?void 0:U.id)||null,V.replaceHashQueryParams(F)},P=()=>{let z={};z[Jo]=null,V.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Jo)&&r&&r.show(o.get(Jo)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(mp,d<<0),_()),n.$$.dirty&2&&typeof f<"u"&&_()},[r,f,d,a,u,c,i,s,h,m,g,k,S,$,T,O,M,L,I,A,P,N]}class y5 extends we{constructor(e){super(),ye(this,e,v5,k5,_e,{})}}function hp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function _p(n){n[18]=n[19].default}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function bp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),Q(e,"active",n[5]===n[14])},m(a,u){y(a,e,u),w(e,i),w(e,l),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&re(i,t),u&40&&Q(e,"active",n[5]===n[14])},d(a){a&&v(e),s=!1,o()}}}function S5(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=W(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){y(r,e,a),w(e,i),w(e,l),s||(o=Ee(He.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&re(i,t)},d(r){r&&v(e),s=!1,o()}}}function kp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&bp();function r(f,c){return f[15].disabled?S5:w5}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),l=C(),u.c(),s=ke(),this.first=t},m(f,c){y(f,t,c),o&&o.m(f,c),y(f,l,c),u.m(f,c),y(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=bp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(v(t),v(l),v(s)),o&&o.d(f),u.d(f)}}}function vp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:C5,then:$5,catch:T5,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ke(),l.block.c()},m(s,o){y(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&mf(t,l)||Rv(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function T5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function $5(n){_p(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=C()},m(l,s){q(e,l,s),y(l,t,s),i=!0},p(l,s){_p(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&v(t),H(e,l)}}}function C5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function yp(n,e){let t,i,l,s=e[5]===e[14]&&vp(e);return{key:n,first:null,c(){t=ke(),s&&s.c(),i=ke(),this.first=t},m(o,r){y(o,t,r),s&&s.m(o,r),y(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=vp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ae(),D(s,1,1,()=>{s=null}),ue())},i(o){l||(E(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function O5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[8]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function M5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[E5],default:[O5]},$$scope:{ctx:n}};return e=new nn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function D5(n,e,t){const i={list:{label:"List/Search",component:Ct(()=>import("./ListApiDocs-BMqVRxIN.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Ct(()=>import("./ViewApiDocs-CKC6to1U.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Ct(()=>import("./CreateApiDocs-D8M_3QcG.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Ct(()=>import("./UpdateApiDocs-BpylGSeY.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Ct(()=>import("./DeleteApiDocs-Be4u5GI8.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Ct(()=>import("./RealtimeApiDocs-BY_VlCDF.js"),[],import.meta.url)},batch:{label:"Batch",component:Ct(()=>import("./BatchApiDocs-nZcx7pNm.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Ct(()=>import("./AuthMethodsDocs-3arq40Jt.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Ct(()=>import("./AuthWithPasswordDocs-TxLWhk-X.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Ct(()=>import("./AuthWithOAuth2Docs-QI0g6yCp.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Ct(()=>import("./AuthWithOtpDocs-BauQ25ER.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Ct(()=>import("./AuthRefreshDocs-Dl355FHl.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Ct(()=>import("./VerificationDocs-Btf-LIzb.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Ct(()=>import("./PasswordResetDocs-DhK7YTwM.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Ct(()=>import("./EmailChangeDocs-DZGm4aOE.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ie[k?"unshift":"push"](()=>{s=k,t(4,s)})}function _(k){Ne.call(this,n,k)}function g(k){Ne.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):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,s,r,i,u,d,m,h,_,g]}class I5 extends we{constructor(e){super(),ye(this,e,D5,M5,_e,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const L5=n=>({active:n&1}),wp=n=>({active:n[0]});function Sp(n){let e,t,i;const l=n[15].default,s=It(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){y(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&At(s,l,o,o[14],i?Lt(l,o[14],r,null):Pt(o[14]),null)},i(o){i||(E(s,o),o&&tt(()=>{i&&(t||(t=je(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=je(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function A5(n){let e,t,i,l,s,o,r;const a=n[15].header,u=It(a,n,n[14],wp);let f=n[0]&&Sp(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),Q(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){y(c,e,d),w(e,t),u&&u.m(t,null),w(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[B(t,"click",et(n[17])),B(t,"drop",et(n[18])),B(t,"dragstart",n[19]),B(t,"dragenter",n[20]),B(t,"dragleave",n[21]),B(t,"dragover",et(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&At(u,a,c,c[14],s?Lt(a,c[14],d,L5):Pt(c[14]),wp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&E(f,1)):(f=Sp(c),f.c(),E(f,1),f.m(e,null)):f&&(ae(),D(f,1,1,()=>{f=null}),ue()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&Q(e,"active",c[0])},i(c){s||(E(u,c),E(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function P5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=bt();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 h(){return!!f}function _(){S(),t(0,f=!0),s("expand")}function g(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?g():_()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}Zt(()=>()=>clearTimeout(r));function $(P){Ne.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},M=P=>u&&s("dragstart",P),L=P=>{u&&(t(7,m=!0),s("dragenter",P))},I=P=>{u&&(t(7,m=!1),s("dragleave",P))};function A(P){ie[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,l=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,k,S,o,m,s,d,h,_,g,r,l,i,$,T,O,M,L,I,A]}class ji extends we{constructor(e){super(),ye(this,e,P5,A5,_e,{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 Tp(n,e,t){const i=n.slice();return i[25]=e[t],i}function $p(n,e,t){const i=n.slice();return i[25]=e[t],i}function Cp(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s0&&Cp(n);return{c(){e=b("label"),t=W("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){y(m,e,h),w(e,t),y(m,l,h),y(m,s,h),ce(s,n[0].subject),y(m,r,h),c&&c.m(m,h),y(m,a,h),u||(f=B(s,"input",n[14]),u=!0)},p(m,h){var _;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&ce(s,m[0].subject),((_=m[3])==null?void 0:_.length)>0?c?c.p(m,h):(c=Cp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(m),u=!1,f()}}}function R5(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){y(s,e,o),ce(e,n[0].body),i||(l=B(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&ce(e,s[0].body)},i:te,o:te,d(s){s&&v(e),i=!1,l()}}}function F5(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=jt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){ae();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,Te(()=>t=!1)),e.$set(f)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function Ep(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s0&&Ep(n);return{c(){e=b("label"),t=W("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ke(),p(e,"for",i=n[24])},m(_,g){y(_,e,g),w(e,t),y(_,l,g),c[s].m(_,g),y(_,r,g),m&&m.m(_,g),y(_,a,g),u=!0},p(_,g){var S;(!u||g&16777216&&i!==(i=_[24]))&&p(e,"for",i);let k=s;s=d(_),s===k?c[s].p(_,g):(ae(),D(c[k],1,1,()=>{c[k]=null}),ue(),o=c[s],o?o.p(_,g):(o=c[s]=f[s](_),o.c()),E(o,1),o.m(r.parentNode,r)),((S=_[3])==null?void 0:S.length)>0?m?m.p(_,g):(m=Ep(_),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(_){u||(E(o),u=!0)},o(_){D(o),u=!1},d(_){_&&(v(e),v(l),v(r),v(a)),c[s].d(_),m&&m.d(_)}}}function H5(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[N5,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[q5,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function Dp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function j5(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Dp();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=W(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),y(c,o,d),y(c,r,d),y(c,a,d),f&&f.m(c,d),y(c,u,d)},p(c,d){d&4&&re(s,c[2]),c[7]?f?d&128&&E(f,1):(f=Dp(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function z5(n){let e,t;const i=[n[9]];let l={$$slots:{header:[j5],default:[H5]},$$scope:{ctx:n}};for(let s=0;st(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ip,m=!1;function h(){c==null||c.expand()}function _(){c==null||c.collapse()}function g(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Ct(async()=>{const{default:R}=await import("./CodeEditor-DKQxSBo9.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ip=d,t(6,m=!1))}function S(R){R=R.replace("*",""),V.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function M(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Ne.call(this,n,R)}function P(R){Ne.call(this,n,R)}function N(R){Ne.call(this,n,R)}return n.$$set=R=>{e=ze(ze({},e),Ut(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||di(r))},[u,r,a,f,c,d,m,i,S,s,h,_,g,o,$,T,O,M,L,I,A,P,N]}class V5 extends we{constructor(e){super(),ye(this,e,U5,z5,_e,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function B5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),s=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){y(m,e,h),w(e,t),w(e,i),y(m,s,h),y(m,o,h),ce(o,n[0]),y(m,a,h),y(m,u,h),w(u,f),c||(d=[B(o,"input",n[4]),B(f,"click",n[5])],c=!0)},p(m,h){h&8&&re(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&>(o.value)!==m[0]&&ce(o,m[0]),h&2&&Q(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(u)),c=!1,Ie(d)}}}function W5(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[B5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Y5(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class K5 extends we{constructor(e){super(),ye(this,e,Y5,W5,_e,{key:2,label:3,duration:0,secret:1})}}function Lp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Ap(n,e){let t,i,l,s,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new K5({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){y(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,Te(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,Te(()=>s=!1)),i.$set(m)},i(c){r||(E(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&v(t),H(i)}}}function J5(n){let e,t=[],i=new Map,l,s=pe(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Z5(n){let e,t,i,l,s,o=n[2]&&Pp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),l=C(),o&&o.c(),s=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),y(r,l,a),o&&o.m(r,a),y(r,s,a)},p(r,a){r[2]?o?a&4&&E(o,1):(o=Pp(),o.c(),E(o,1),o.m(s.parentNode,s)):o&&(ae(),D(o,1,1,()=>{o=null}),ue())},d(r){r&&(v(e),v(t),v(i),v(l),v(s)),o&&o.d(r)}}}function G5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[Z5],default:[J5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function X5(n,e,t){let i,l,s;Qe(n,yn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(V.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,l=a(s))},[o,r,l,i,s,u,f]}class Q5 extends we{constructor(e){super(),ye(this,e,X5,G5,_e,{collection:0})}}const x5=n=>({isSuperuserOnly:n&2048}),Np=n=>({isSuperuserOnly:n[11]}),e6=n=>({isSuperuserOnly:n&2048}),Rp=n=>({isSuperuserOnly:n[11]}),t6=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]});function n6(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[l6,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function i6(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function qp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=B(e,"click",n[13]),s=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&v(e),s=!1,o()}}}function Hp(n){let e,t,i,l,s,o,r,a=!n[10]&&jp();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){y(u,e,f),a&&a.m(e,null),w(e,t),w(e,i),s=!0,o||(r=B(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=jp(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=je(e,Mt,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=je(e,Mt,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&v(e),a&&a.d(),u&&l&&l.end(),o=!1,r()}}}function jp(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function l6(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,_,g,k,S,$,T,O;const M=n[15].beforeLabel,L=It(M,n,n[18],Fp),I=n[15].afterLabel,A=It(I,n,n[18],Rp);let P=n[5]&&!n[11]&&qp(n);function N(K){n[17](K)}var R=n[8];function z(K,x){let X={id:K[21],baseCollection:K[1],disabled:K[10]||K[11],placeholder:K[11]?"":K[6]};return K[0]!==void 0&&(X.value=K[0]),{props:X}}R&&(m=jt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&Hp(n);const U=n[15].default,J=It(U,n,n[18],Np);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=W(n[2]),o=C(),a=W(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&j(m.$$.fragment),_=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(l,"class","txt"),Q(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(K,x){y(K,e,x),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,_),F&&F.m(e,null),y(K,k,x),y(K,S,x),J&&J.m(S,null),$=!0,T||(O=Ee(g=He.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(K,x){if(L&&L.p&&(!$||x&264192)&&At(L,M,K,K[18],$?Lt(M,K[18],x,t6):Pt(K[18]),Fp),(!$||x&4)&&re(s,K[2]),(!$||x&2048)&&r!==(r=K[11]?"- Superusers only":"")&&re(a,r),(!$||x&2048)&&Q(l,"txt-hint",K[11]),A&&A.p&&(!$||x&264192)&&At(A,I,K,K[18],$?Lt(I,K[18],x,e6):Pt(K[18]),Rp),K[5]&&!K[11]?P?P.p(K,x):(P=qp(K),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||x&2097152&&c!==(c=K[21]))&&p(t,"for",c),x&256&&R!==(R=K[8])){if(m){ae();const X=m;D(X.$$.fragment,1,0,()=>{H(X,1)}),ue()}R?(m=jt(R,z(K)),K[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),E(m.$$.fragment,1),q(m,e,_)):m=null}else if(R){const X={};x&2097152&&(X.id=K[21]),x&2&&(X.baseCollection=K[1]),x&3072&&(X.disabled=K[10]||K[11]),x&2112&&(X.placeholder=K[11]?"":K[6]),!h&&x&1&&(h=!0,X.value=K[0],Te(()=>h=!1)),m.$set(X)}K[5]&&K[11]?F?(F.p(K,x),x&2080&&E(F,1)):(F=Hp(K),F.c(),E(F,1),F.m(e,null)):F&&(ae(),D(F,1,1,()=>{F=null}),ue()),g&&Nt(g.update)&&x&2&&g.update.call(null,K[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||x&264192)&&At(J,U,K,K[18],$?Lt(U,K[18],x,x5):Pt(K[18]),Np)},i(K){$||(E(L,K),E(A,K),m&&E(m.$$.fragment,K),E(F),E(J,K),$=!0)},o(K){D(L,K),D(A,K),m&&D(m.$$.fragment,K),D(F),D(J,K),$=!1},d(K){K&&(v(e),v(k),v(S)),L&&L.d(K),A&&A.d(K),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(K),T=!1,O()}}}function s6(n){let e,t,i,l;const s=[i6,n6],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let zp;function o6(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,_=null,g=null,k=zp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await Ct(async()=>{const{default:I}=await import("./FilterAutocompleteInput-B-j6H3tq.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),zp=k,t(9,S=!1))}async function T(){t(0,a=g||""),await un(),_==null||_.focus()}function O(){g=a,t(0,a=null)}function M(I){ie[I?"unshift":"push"](()=>{_=I,t(7,_)})}function L(I){a=I,t(0,a)}return n.$$set=I=>{"collection"in I&&t(1,r=I.collection),"rule"in I&&t(0,a=I.rule),"label"in I&&t(2,u=I.label),"formKey"in I&&t(3,f=I.formKey),"required"in I&&t(4,c=I.required),"disabled"in I&&t(14,d=I.disabled),"superuserToggle"in I&&t(5,m=I.superuserToggle),"placeholder"in I&&t(6,h=I.placeholder),"$$scope"in I&&t(18,o=I.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,l=d||r.system)},[a,r,u,f,c,m,h,_,k,S,l,i,T,O,d,s,M,L,o]}class il extends we{constructor(e){super(),ye(this,e,o6,s6,_e,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function r6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(s,"class","txt"),p(l,"for",o=n[5])},m(u,f){y(u,e,f),e.checked=n[0].mfa.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function a6(n){let e,t,i,l,s;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to - email != ''.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),y(o,l,r),y(o,s,r)},p:te,d(o){o&&(v(e),v(t),v(i),v(l),v(s))}}}function u6(n){let e,t,i,l,s,o,r,a,u;l=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[r6,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[a6]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth + */const to=n=>n&&n.enabled&&n.modifierKey,Zk=(n,e)=>n&&e[n+"Key"],Gu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ka(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function Q$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function x$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function Gk(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=x$(e,t),r=ka(i,t),a=ka(l,t);if(s){const f=ka(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const iu=new WeakMap;function Jt(n){let e=iu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},iu.set(n,e)),e}function eC(n){iu.delete(n)}function Xk(n,e,t){const i=n.max-n.min,l=i*(e-1),s=n.isHorizontal()?t.x:t.y,o=Math.max(0,Math.min(1,(n.getValueForPixel(s)-n.min)/i||0)),r=1-o;return{min:l*o,max:l*r}}function Xd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Ot(o.options,o.scale)}return Ot(s,l)}function tC(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function fs(n,{min:e,max:t},i,l=!1){const s=Jt(n.chart),{id:o,axis:r,options:a}=n,u=i&&(i[o]||i[r])||{},{minRange:f=0}=u,c=Xd(s,n,u,"min",-1/0),d=Xd(s,n,u,"max",1/0),m=l?Math.max(t-e,f):n.max-n.min,h=(m-t+e)/2;return e-=h,t+=h,ed&&(t=d,e=Math.max(d-m,c)),a.min=e,a.max=t,s.updatedScaleLimits[n.id]={min:e,max:t},n.parse(e)!==n.min||n.parse(t)!==n.max}function nC(n,e,t,i){const l=Xk(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return fs(n,s,i,!0)}function iC(n,e,t,i){fs(n,tC(n,e,t),i,!0)}const Qd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function lC(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),fs(n,{min:s,max:o},t)||f}const aC={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function Qk(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=aC[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e),{min:c=-1/0,max:d=1/0}=i&&t&&t[n.axis]||{};return isNaN(u)||isNaN(f)||ud?!0:fs(n,{min:u,max:f},t,i)}function xd(n,e,t){return Qk(n,e,t,!0)}const lu={category:sC,default:nC},su={default:iC},ou={category:rC,default:Qk,logarithmic:xd,timeseries:xd};function uC(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max!==s}function ep(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function cs(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){uC(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),ep(i,t),ep(l,t),i}function tp(n,e,t,i){const l=lu[n.type]||lu.default;pt(l,[n,e,t,i])}function np(n,e,t,i,l){const s=su[n.type]||su.default;pt(s,[n,e,t,i,l])}function fC(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Xu(n,e,t="none"){const{x:i=1,y:l=1,focalPoint:s=fC(n)}=typeof e=="number"?{x:e,y:e}:e,o=Jt(n),{options:{limits:r,zoom:a}}=o;cs(n,o);const u=i!==1,f=l!==1,c=Gk(a,s,n);_t(c||n.scales,function(d){d.isHorizontal()&&u?tp(d,i,s,r):!d.isHorizontal()&&f&&tp(d,l,s,r)}),n.update(t),pt(a.onZoom,[{chart:n}])}function xk(n,e,t,i="none"){const l=Jt(n),{options:{limits:s,zoom:o}}=l,{mode:r="xy"}=o;cs(n,l);const a=rl(r,"x",n),u=rl(r,"y",n);_t(n.scales,function(f){f.isHorizontal()&&a?np(f,e.x,t.x,s):!f.isHorizontal()&&u&&np(f,e.y,t.y,s)}),n.update(i),pt(o.onZoom,[{chart:n}])}function cC(n,e,t,i="none"){cs(n,Jt(n));const l=n.scales[e];fs(l,t,void 0,!0),n.update(i)}function dC(n,e="default"){const t=Jt(n),i=cs(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max)}),n.update(e),pt(t.options.zoom.onZoomComplete,[{chart:n}])}function pC(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Ot(l.options,l.scale)-Ot(i.options,i.scale)}function mC(n){const e=Jt(n);let t=1,i=1;return _t(n.scales,function(l){const s=pC(e,l.id);if(s){const o=Math.round(s/(l.max-l.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function ip(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=ou[n.type]||ou.default;pt(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function ev(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Jt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};cs(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?ip(d,l,a,o):!d.isHorizontal()&&c&&ip(d,s,a,o)}),n.update(i),pt(u,[{chart:n}])}function tv(n){const e=Jt(n);cs(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:l,max:s}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:l.scale,max:s.scale}}return t}function hC(n){const e=tv(n);for(const t of Object.keys(n.scales)){const{min:i,max:l}=e[t];if(i!==void 0&&n.scales[t].min!==i||l!==void 0&&n.scales[t].max!==l)return!0}return!1}function An(n,e){const{handlers:t}=Jt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Jt(n),o=l[t];o&&o.target===e||(An(n,t),l[t]=r=>i(n,r,s),l[t].target=e,e.addEventListener(t,l[t]))}function _C(n,e){const t=Jt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function gC(n,e){const t=Jt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function nv(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=yi(e,n);if(pt(i,[{chart:n,event:e,point:s}])===!1)return pt(l,[{chart:n,event:e}]),!1}}function bC(n,e){const t=Jt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||Zk(to(i),e)||Gu(to(l.drag),e))return pt(l.onZoomRejected,[{chart:n,event:e}]);nv(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas,"mousemove",_C),Hs(n,window.document,"keydown",gC))}function iv(n,e,t,i){const l=rl(e,"x",n),s=rl(e,"y",n);let{top:o,left:r,right:a,bottom:u,width:f,height:c}=n.chartArea;const d=yi(t,n),m=yi(i,n);l&&(r=Math.min(d.x,m.x),a=Math.max(d.x,m.x)),s&&(o=Math.min(d.y,m.y),u=Math.max(d.y,m.y));const h=a-r,_=u-o;return{left:r,top:o,right:a,bottom:u,width:h,height:_,zoomX:l&&h?1+(f-h)/f:1,zoomY:s&&_?1+(c-_)/c:1}}function kC(n,e){const t=Jt(n);if(!t.dragStart)return;An(n,"mousemove");const{mode:i,onZoomComplete:l,drag:{threshold:s=0}}=t.options.zoom,o=iv(n,i,t.dragStart,e),r=rl(i,"x",n)?o.width:0,a=rl(i,"y",n)?o.height:0,u=Math.sqrt(r*r+a*a);if(t.dragStart=t.dragEnd=null,u<=s){t.dragging=!1,n.update("none");return}xk(n,{x:o.left,y:o.top},{x:o.right,y:o.bottom},"zoom"),setTimeout(()=>t.dragging=!1,500),pt(l,[{chart:n}])}function vC(n,e,t){if(Gu(to(t.wheel),e)){pt(t.onZoomRejected,[{chart:n,event:e}]);return}if(nv(n,e,t)!==!1&&(e.cancelable&&e.preventDefault(),e.deltaY!==void 0))return!0}function yC(n,e){const{handlers:{onZoomComplete:t},options:{zoom:i}}=Jt(n);if(!vC(n,e,i))return;const l=e.target.getBoundingClientRect(),s=1+(e.deltaY>=0?-i.wheel.speed:i.wheel.speed),o={x:s,y:s,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};Xu(n,o),t&&t()}function wC(n,e,t,i){t&&(Jt(n).handlers[e]=Q$(()=>pt(t,[{chart:n}]),i))}function SC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",yC),wC(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",bC),Hs(n,t.ownerDocument,"mouseup",kC)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function TC(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function $C(n,e){return function(t,i){const{pan:l,zoom:s={}}=e.options;if(!l||!l.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(Gu(to(l),o)||Zk(to(s.drag),o))?(pt(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function CC(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),l=t/i;let s,o;return l>.3&&l<1.7?s=o=!0:t>i?s=!0:o=!0,{x:s,y:o}}function lv(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=CC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Xu(n,u),e.scale=t.scale}}function OC(n,e){e.options.zoom.pinch.enabled&&(e.scale=1)}function EC(n,e,t){e.scale&&(lv(n,e,t),e.scale=null,pt(e.options.zoom.onZoomComplete,[{chart:n}]))}function sv(n,e,t){const i=e.delta;i&&(e.panning=!0,ev(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function MC(n,e,t){const{enabled:i,onPanStart:l,onPanRejected:s}=e.options.pan;if(!i)return;const o=t.target.getBoundingClientRect(),r={x:t.center.x-o.left,y:t.center.y-o.top};if(pt(l,[{chart:n,event:t,point:r}])===!1)return pt(s,[{chart:n,event:t}]);e.panScales=Gk(e.options.pan,r,n),e.delta={x:0,y:0},clearTimeout(e.panEndTimeout),sv(n,e,t)}function DC(n,e){e.delta=null,e.panning&&(e.panEndTimeout=setTimeout(()=>e.panning=!1,500),pt(e.options.pan.onPanComplete,[{chart:n}]))}const ru=new WeakMap;function IC(n,e){const t=Jt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",()=>OC(n,t)),o.on("pinch",r=>lv(n,t,r)),o.on("pinchend",r=>EC(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:$C(n,t)})),o.on("panstart",r=>MC(n,t,r)),o.on("panmove",r=>sv(n,t,r)),o.on("panend",()=>DC(n,t))),ru.set(n,o)}function LC(n){const e=ru.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),ru.delete(n))}var AC="2.0.1";function Ko(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Jt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=iv(n,t.zoom.mode,l,s),f=n.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",f.fillRect(o,r,a,u),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||"rgba(225,225,225)",f.strokeRect(o,r,a,u)),f.restore()}var PC={id:"zoom",version:AC,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,e,t){const i=Jt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&IC(n,t),n.pan=(l,s,o)=>ev(n,l,s,o),n.zoom=(l,s)=>Xu(n,l,s),n.zoomRect=(l,s,o)=>xk(n,l,s,o),n.zoomScale=(l,s,o)=>cC(n,l,s,o),n.resetZoom=l=>dC(n,l),n.getZoomLevel=()=>mC(n),n.getInitialScaleBounds=()=>tv(n),n.isZoomedOrPanned=()=>hC(n)},beforeEvent(n){const e=Jt(n);if(e.panning||e.dragging)return!1},beforeUpdate:function(n,e,t){const i=Jt(n);i.options=t,SC(n,t)},beforeDatasetsDraw(n,e,t){Ko(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Ko(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Ko(n,"beforeDraw",t)},afterDraw(n,e,t){Ko(n,"afterDraw",t)},stop:function(n){TC(n),qs&&LC(n),eC(n)},panFunctions:ou,zoomFunctions:lu,zoomRectFunctions:su};function lp(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(l,s){y(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=je(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function sp(n){let e,t,i;return{c(){e=b("button"),e.textContent="Reset zoom",p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-chart-zoom svelte-kfnurg")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[4]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function NC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&lp(),_=n[3]&&sp(n);return{c(){e=b("div"),t=b("div"),i=B("Found "),l=B(n[1]),s=C(),r=B(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),_&&_.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),Q(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),Q(e,"loading",n[2])},m(g,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(t,r),w(e,a),h&&h.m(e,null),w(e,u),w(e,f),n[11](f),w(e,c),_&&_.m(e,null),d||(m=W(f,"dblclick",n[4]),d=!0)},p(g,[k]){k&2&&re(l,g[1]),k&2&&o!==(o=g[1]==1?"log":"logs")&&re(r,o),k&4&&Q(t,"hidden",g[2]),g[2]?h?k&4&&M(h,1):(h=lp(),h.c(),M(h,1),h.m(e,u)):h&&(ae(),D(h,1,1,()=>{h=null}),ue()),g[3]?_?_.p(g,k):(_=sp(g),_.c(),_.m(e,null)):_&&(_.d(1),_=null),k&4&&Q(e,"loading",g[2])},i(g){M(h)},o(g){D(h)},d(g){g&&v(e),h&&h.d(),n[11](null),_&&_.d(),d=!1,m()}}}function RC(n,e,t){let{filter:i=""}=e,{zoom:l={}}=e,{presets:s=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const g=[s,V.normalizeLogsFilter(i)].filter(Boolean).join("&&");return me.logs.getStats({filter:g}).then(k=>{m(),k=V.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),me.error(k,!g||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Zt(()=>(wi.register(Qi,ur,or,nu,eo,N$,V$),wi.register(PC),t(9,r=new wi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:g=>{var k;return(k=g.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:g=>{var k;return(k=g.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:g})=>{t(3,c=g.isZoomedOrPanned()),c?(t(5,l.min=V.formatToUTCDate(g.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=V.formatToUTCDate(g.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",l)):(l.min||l.max)&&t(5,l={})}}}}}})),()=>r==null?void 0:r.destroy()));function _(g){ie[g?"unshift":"push"](()=>{o=g,t(0,o)})}return n.$$set=g=>{"filter"in g&&t(6,i=g.filter),"zoom"in g&&t(5,l=g.zoom),"presets"in g&&t(7,s=g.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof s<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,h,l,i,s,d,r,a,_]}class FC extends we{constructor(e){super(),ye(this,e,RC,NC,_e,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function qC(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){y(l,e,s),w(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(l){l&&v(e)}}}function HC(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Qu extends we{constructor(e){super(),ye(this,e,HC,qC,_e,{content:2,language:3,class:0})}}function jC(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){y(o,e,r),l||(s=[Ee(i=He.call(null,e,n[3]?void 0:n[0])),W(e,"click",On(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Nt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&v(e),l=!1,Ie(s)}}}function zC(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){V.isEmpty(i)||(V.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Zt(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,l=f.tooltip),"idleClasses"in f&&t(1,s=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[l,s,o,a,u,i,r]}class fi extends we{constructor(e){super(),ye(this,e,zC,jC,_e,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function op(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=V.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function UC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P,N,R,z,F,U,J,K;d=new fi({props:{value:n[1].id}}),S=new uk({props:{level:n[1].level}}),O=new fi({props:{value:n[1].level}}),N=new ak({props:{date:n[1].created}}),F=new fi({props:{value:n[1].created}});let x=!n[4]&&rp(n),X=de(n[5](n[1].data)),oe=[];for(let ge=0;geD(oe[ge],1,1,()=>{oe[ge]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("span"),u=B(a),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("tr"),_=b("td"),_.textContent="level",g=C(),k=b("td"),j(S.$$.fragment),$=C(),T=b("div"),j(O.$$.fragment),E=C(),I=b("tr"),L=b("td"),L.textContent="created",A=C(),P=b("td"),j(N.$$.fragment),R=C(),z=b("div"),j(F.$$.fragment),U=C(),x&&x.c(),J=C();for(let ge=0;ge{x=null}),ue()):x?(x.p(ge,$e),$e&16&&M(x,1)):(x=rp(ge),x.c(),M(x,1),x.m(t,J)),$e&50){X=de(ge[5](ge[1].data));let Ze;for(Ze=0;Ze',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function rp(n){let e,t,i,l,s,o,r;const a=[WC,BC],u=[];function f(c,d){return c[1].message?0:1}return s=f(n),o=u[s]=a[s](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),l=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(l,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),u[s].m(l,null),r=!0},p(c,d){let m=s;s=f(c),s===m?u[s].p(c,d):(ae(),D(u[m],1,1,()=>{u[m]=null}),ue(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),M(o,1),o.m(l,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&v(e),u[s].d()}}}function BC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function WC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new fi({props:{value:n[1].message}}),{c(){e=b("span"),i=B(t),l=C(),s=b("div"),j(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),y(a,s,u),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&re(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(l),v(s)),H(o)}}}function YC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=B(t),s=B(l),p(e,"class","txt")},m(o,r){y(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&re(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&re(s,l)},i:te,o:te,d(o){o&&v(e)}}}function KC(n){let e,t;return e=new Qu({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&re(i,t)},i:te,o:te,d(l){l&&v(e)}}}function ZC(n){let e,t;return e=new Qu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function GC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function ap(n){let e,t,i;return t=new fi({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function up(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[GC,ZC,JC,KC,YC],h=[];function _(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=_(n),u=h[a]=m[a](n);let g=!n[18]&&ap(n);return{c(){e=b("tr"),t=b("td"),i=B("data."),s=B(l),o=C(),r=b("td"),u.c(),f=C(),g&&g.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),Q(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){y(k,e,S),w(e,t),w(t,i),w(t,s),w(e,o),w(e,r),h[a].m(r,null),w(r,f),g&&g.m(r,null),w(e,c),d=!0},p(k,S){(!d||S&2)&&l!==(l=k[16]+"")&&re(s,l),(!d||S&34)&&Q(t,"v-align-top",k[19]);let $=a;a=_(k),a===$?h[a].p(k,S):(ae(),D(h[$],1,1,()=>{h[$]=null}),ue(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),M(u,1),u.m(r,f)),k[18]?g&&(ae(),D(g,1,1,()=>{g=null}),ue()):g?(g.p(k,S),S&2&&M(g,1)):(g=ap(k),g.c(),M(g,1),g.m(r,null))},i(k){d||(M(u),M(g),d=!0)},o(k){D(u),D(g),d=!1},d(k){k&&v(e),h[a].d(),g&&g.d()}}}function XC(n){let e,t,i,l;const s=[VC,UC],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ke()},m(a,u){~e&&o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(ae(),D(o[f],1,1,()=>{o[f]=null}),ue()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function QC(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function xC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),l=b("i"),s=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){y(u,e,f),y(u,t,f),y(u,i,f),w(i,l),w(i,s),w(i,o),r||(a=[W(e,"click",n[9]),W(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(v(e),v(t),v(i)),r=!1,Ie(a)}}}function e5(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[xC],header:[QC],default:[XC]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const fp="log_view";function t5(n,e,t){let i;const l=bt();let s,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return me.cancelRequest(fp),s==null?void 0:s.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await me.logs.getOne($,{requestKey:fp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Ci(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const O=Object.keys($);for(let E of O)T.includes(E)||T.push(E);return T}function m(){V.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>u(),k=()=>m();function S($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,s,r,i,d,m,_,a,g,k,S]}class n5 extends we{constructor(e){super(),ye(this,e,t5,e5,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i5(n,e,t){const i=n.slice();return i[1]=e[t],i}function l5(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function s5(n){let e,t,i,l=de(B0),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class ov extends we{constructor(e){super(),ye(this,e,o5,s5,_e,{class:0})}}function r5(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[u5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[f5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[c5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[d5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){y(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=W(e,"submit",et(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),l.$set(_);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),o.$set(g);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&v(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function a5(n){let e;return{c(){e=b("div"),e.innerHTML='

',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function u5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[1].logs.maxDays),y(c,r,d),y(c,a,d),u||(f=W(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&>(s.value)!==c[1].logs.maxDays&&ce(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function f5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new ov({}),{c(){e=b("label"),t=B("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){y(h,e,_),w(e,t),y(h,l,_),y(h,s,_),ce(s,n[1].logs.minLevel),y(h,o,_),y(h,r,_),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=W(s,"input",n[12]),d=!0)},p(h,_){(!c||_&8388608&&i!==(i=h[23]))&&p(e,"for",i),_&2&>(s.value)!==h[1].logs.minLevel&&ce(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),H(f),d=!1,m()}}}function c5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){y(u,e,f),e.checked=n[1].logs.logIP,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function d5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){y(u,e,f),e.checked=n[1].logs.logAuthId,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function p5(n){let e,t,i,l;const s=[a5,r5],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function m5(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function h5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],Q(l,"btn-loading",n[3])},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&Q(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function _5(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[h5],header:[m5],default:[p5]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function g5(n,e,t){let i,l;const s=bt(),o="logs_settings_"+V.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Yt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function _(){t(4,u=!0);try{const P=await me.settings.getAll()||{};k(P)}catch(P){me.error(P)}t(4,u=!1)}async function g(){if(l){t(3,a=!0);try{const P=await me.settings.update(V.filterRedactedProps(c));k(P),t(3,a=!1),m(),tn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),me.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=gt(this.value),t(1,c)}function $(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function I(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function L(P){Ne.call(this,n,P)}function A(P){Ne.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,g,d,f,i,S,$,T,O,E,I,L,A]}class b5 extends we{constructor(e){super(),ye(this,e,g5,_5,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){y(u,e,f),e.checked=n[2],y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function cp(n){let e,t,i;function l(o){n[14](o)}let s={filter:n[1],presets:n[6]};return n[5]!==void 0&&(s.zoom=n[5]),e=new FC({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new V3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],Te(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],Te(()=>i=!1)),e.$set(f)},i(a){l||(M(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function v5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T=n[4],O,E=n[4],I,L,A,P;u=new Au({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[k5,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),g=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[13]),S=new ov({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=cp(n),R=dp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=B(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),j(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),j(h.$$.fragment),_=C(),j(g.$$.fragment),k=C(),j(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),I=ke(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){y(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,_),q(g,e,null),w(e,k),q(S,e,null),w(e,$),N.m(e,null),y(z,O,F),R.m(z,F),y(z,I,F),L=!0,A||(P=[Ee(He.call(null,r,{text:"Logs settings",position:"right"})),W(r,"click",n[10])],A=!0)},p(z,F){(!L||F&128)&&re(s,z[7]);const U={};F&100663300&&(U.$$scope={dirty:F,ctx:z}),h.$set(U);const J={};F&2&&(J.value=z[1]),g.$set(J),F&16&&_e(T,T=z[4])?(ae(),D(N,1,1,te),ue(),N=cp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&_e(E,E=z[4])?(ae(),D(R,1,1,te),ue(),R=dp(z),R.c(),M(R,1),R.m(I.parentNode,I)):R.p(z,F)},i(z){L||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(g.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),L=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(g.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),L=!1},d(z){z&&(v(e),v(O),v(I)),H(u),H(h),H(g),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function y5(n){let e,t,i,l,s,o;e=new mi({props:{$$slots:{default:[v5]},$$scope:{ctx:n}}});let r={};i=new n5({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new b5({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(u,f){q(e,u,f),y(u,t,f),q(i,u,f),y(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(v(t),v(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Jo="logId",pp="superuserRequests",mp="superuserLogRequests";function w5(n,e,t){var R;let i,l,s;Qe(n,Lu,z=>t(22,l=z)),Qe(n,fn,z=>t(7,s=z)),Rn(fn,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(pp)||((R=window.localStorage)==null?void 0:R.getItem(mp)))<<0,m=d;function h(){t(4,u++,u)}function _(z={}){let F={};F.filter=f||null,F[pp]=d<<0||null,V.replaceHashQueryParams(Object.assign(F,z))}const g=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const I=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function L(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var U;let F={};F[Jo]=((U=z.detail)==null?void 0:U.id)||null,V.replaceHashQueryParams(F)},P=()=>{let z={};z[Jo]=null,V.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Jo)&&r&&r.show(o.get(Jo)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(mp,d<<0),_()),n.$$.dirty&2&&typeof f<"u"&&_()},[r,f,d,a,u,c,i,s,h,m,g,k,S,$,T,O,E,I,L,A,P,N]}class S5 extends we{constructor(e){super(),ye(this,e,w5,y5,_e,{})}}function hp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function _p(n){n[18]=n[19].default}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function bp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function T5(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=B(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),Q(e,"active",n[5]===n[14])},m(a,u){y(a,e,u),w(e,i),w(e,l),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&re(i,t),u&40&&Q(e,"active",n[5]===n[14])},d(a){a&&v(e),s=!1,o()}}}function $5(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=B(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){y(r,e,a),w(e,i),w(e,l),s||(o=Ee(He.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&re(i,t)},d(r){r&&v(e),s=!1,o()}}}function kp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&bp();function r(f,c){return f[15].disabled?$5:T5}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),l=C(),u.c(),s=ke(),this.first=t},m(f,c){y(f,t,c),o&&o.m(f,c),y(f,l,c),u.m(f,c),y(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=bp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(v(t),v(l),v(s)),o&&o.d(f),u.d(f)}}}function vp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:E5,then:O5,catch:C5,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ke(),l.block.c()},m(s,o){y(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&mf(t,l)||qv(l,n,o)},i(s){i||(M(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function C5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function O5(n){_p(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=C()},m(l,s){q(e,l,s),y(l,t,s),i=!0},p(l,s){_p(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(M(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&v(t),H(e,l)}}}function E5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function yp(n,e){let t,i,l,s=e[5]===e[14]&&vp(e);return{key:n,first:null,c(){t=ke(),s&&s.c(),i=ke(),this.first=t},m(o,r){y(o,t,r),s&&s.m(o,r),y(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&M(s,1)):(s=vp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(ae(),D(s,1,1,()=>{s=null}),ue())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function M5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=de(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[8]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function I5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[D5],default:[M5]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function L5(n,e,t){const i={list:{label:"List/Search",component:Ct(()=>import("./ListApiDocs-DE6L15a5.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Ct(()=>import("./ViewApiDocs-C8kal0o6.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Ct(()=>import("./CreateApiDocs-BNp07xea.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Ct(()=>import("./UpdateApiDocs-20v7DmgS.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Ct(()=>import("./DeleteApiDocs-CU3e4BJK.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Ct(()=>import("./RealtimeApiDocs-B2eRrxRi.js"),[],import.meta.url)},batch:{label:"Batch",component:Ct(()=>import("./BatchApiDocs-CvuDJe84.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Ct(()=>import("./AuthMethodsDocs-DHqR-_Zg.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Ct(()=>import("./AuthWithPasswordDocs-jAqVZfEu.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Ct(()=>import("./AuthWithOAuth2Docs-DBDNpjcn.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Ct(()=>import("./AuthWithOtpDocs-B3SiNTsQ.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Ct(()=>import("./AuthRefreshDocs-Bw_1qlVd.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Ct(()=>import("./VerificationDocs-CpJrwVE8.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Ct(()=>import("./PasswordResetDocs-8lWAqSSD.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Ct(()=>import("./EmailChangeDocs-BFlX8O9s.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ie[k?"unshift":"push"](()=>{s=k,t(4,s)})}function _(k){Ne.call(this,n,k)}function g(k){Ne.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):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,s,r,i,u,d,m,h,_,g]}class A5 extends we{constructor(e){super(),ye(this,e,L5,I5,_e,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const P5=n=>({active:n&1}),wp=n=>({active:n[0]});function Sp(n){let e,t,i;const l=n[15].default,s=It(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){y(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&At(s,l,o,o[14],i?Lt(l,o[14],r,null):Pt(o[14]),null)},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=je(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=je(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function N5(n){let e,t,i,l,s,o,r;const a=n[15].header,u=It(a,n,n[14],wp);let f=n[0]&&Sp(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),Q(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){y(c,e,d),w(e,t),u&&u.m(t,null),w(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[W(t,"click",et(n[17])),W(t,"drop",et(n[18])),W(t,"dragstart",n[19]),W(t,"dragenter",n[20]),W(t,"dragleave",n[21]),W(t,"dragover",et(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&At(u,a,c,c[14],s?Lt(a,c[14],d,P5):Pt(c[14]),wp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=Sp(c),f.c(),M(f,1),f.m(e,null)):f&&(ae(),D(f,1,1,()=>{f=null}),ue()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&Q(e,"active",c[0])},i(c){s||(M(u,c),M(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function R5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=bt();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 h(){return!!f}function _(){S(),t(0,f=!0),s("expand")}function g(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?g():_()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}Zt(()=>()=>clearTimeout(r));function $(P){Ne.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=P=>u&&s("dragstart",P),I=P=>{u&&(t(7,m=!0),s("dragenter",P))},L=P=>{u&&(t(7,m=!1),s("dragleave",P))};function A(P){ie[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,l=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,k,S,o,m,s,d,h,_,g,r,l,i,$,T,O,E,I,L,A]}class ji extends we{constructor(e){super(),ye(this,e,R5,N5,_e,{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 Tp(n,e,t){const i=n.slice();return i[25]=e[t],i}function $p(n,e,t){const i=n.slice();return i[25]=e[t],i}function Cp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Cp(n);return{c(){e=b("label"),t=B("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){y(m,e,h),w(e,t),y(m,l,h),y(m,s,h),ce(s,n[0].subject),y(m,r,h),c&&c.m(m,h),y(m,a,h),u||(f=W(s,"input",n[14]),u=!0)},p(m,h){var _;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&ce(s,m[0].subject),((_=m[3])==null?void 0:_.length)>0?c?c.p(m,h):(c=Cp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(m),u=!1,f()}}}function q5(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){y(s,e,o),ce(e,n[0].body),i||(l=W(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&ce(e,s[0].body)},i:te,o:te,d(s){s&&v(e),i=!1,l()}}}function H5(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=jt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){ae();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,Te(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function Ep(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Ep(n);return{c(){e=b("label"),t=B("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ke(),p(e,"for",i=n[24])},m(_,g){y(_,e,g),w(e,t),y(_,l,g),c[s].m(_,g),y(_,r,g),m&&m.m(_,g),y(_,a,g),u=!0},p(_,g){var S;(!u||g&16777216&&i!==(i=_[24]))&&p(e,"for",i);let k=s;s=d(_),s===k?c[s].p(_,g):(ae(),D(c[k],1,1,()=>{c[k]=null}),ue(),o=c[s],o?o.p(_,g):(o=c[s]=f[s](_),o.c()),M(o,1),o.m(r.parentNode,r)),((S=_[3])==null?void 0:S.length)>0?m?m.p(_,g):(m=Ep(_),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(_){u||(M(o),u=!0)},o(_){D(o),u=!1},d(_){_&&(v(e),v(l),v(r),v(a)),c[s].d(_),m&&m.d(_)}}}function z5(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[F5,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[j5,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function Dp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function U5(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Dp();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=B(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),y(c,o,d),y(c,r,d),y(c,a,d),f&&f.m(c,d),y(c,u,d)},p(c,d){d&4&&re(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Dp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function V5(n){let e,t;const i=[n[9]];let l={$$slots:{header:[U5],default:[z5]},$$scope:{ctx:n}};for(let s=0;st(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ip,m=!1;function h(){c==null||c.expand()}function _(){c==null||c.collapse()}function g(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Ct(async()=>{const{default:R}=await import("./CodeEditor-pEpUQJ5v.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ip=d,t(6,m=!1))}function S(R){R=R.replace("*",""),V.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const I=R=>S("{"+R+"}");function L(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Ne.call(this,n,R)}function P(R){Ne.call(this,n,R)}function N(R){Ne.call(this,n,R)}return n.$$set=R=>{e=ze(ze({},e),Ut(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||di(r))},[u,r,a,f,c,d,m,i,S,s,h,_,g,o,$,T,O,E,I,L,A,P,N]}class W5 extends we{constructor(e){super(),ye(this,e,B5,V5,_e,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function Y5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=B(n[3]),i=B(" duration (in seconds)"),s=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){y(m,e,h),w(e,t),w(e,i),y(m,s,h),y(m,o,h),ce(o,n[0]),y(m,a,h),y(m,u,h),w(u,f),c||(d=[W(o,"input",n[4]),W(f,"click",n[5])],c=!0)},p(m,h){h&8&&re(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&>(o.value)!==m[0]&&ce(o,m[0]),h&2&&Q(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(u)),c=!1,Ie(d)}}}function K5(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[Y5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function J5(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class Z5 extends we{constructor(e){super(),ye(this,e,J5,K5,_e,{key:2,label:3,duration:0,secret:1})}}function Lp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Ap(n,e){let t,i,l,s,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new Z5({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){y(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,Te(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,Te(()=>s=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&v(t),H(i)}}}function G5(n){let e,t=[],i=new Map,l,s=de(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function X5(n){let e,t,i,l,s,o=n[2]&&Pp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),l=C(),o&&o.c(),s=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),y(r,l,a),o&&o.m(r,a),y(r,s,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Pp(),o.c(),M(o,1),o.m(s.parentNode,s)):o&&(ae(),D(o,1,1,()=>{o=null}),ue())},d(r){r&&(v(e),v(t),v(i),v(l),v(s)),o&&o.d(r)}}}function Q5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[X5],default:[G5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function x5(n,e,t){let i,l,s;Qe(n,yn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(V.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,l=a(s))},[o,r,l,i,s,u,f]}class e6 extends we{constructor(e){super(),ye(this,e,x5,Q5,_e,{collection:0})}}const t6=n=>({isSuperuserOnly:n&2048}),Np=n=>({isSuperuserOnly:n[11]}),n6=n=>({isSuperuserOnly:n&2048}),Rp=n=>({isSuperuserOnly:n[11]}),i6=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]});function l6(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[o6,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function s6(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function qp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=W(e,"click",n[13]),s=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&v(e),s=!1,o()}}}function Hp(n){let e,t,i,l,s,o,r,a=!n[10]&&jp();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){y(u,e,f),a&&a.m(e,null),w(e,t),w(e,i),s=!0,o||(r=W(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=jp(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=je(e,Mt,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=je(e,Mt,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&v(e),a&&a.d(),u&&l&&l.end(),o=!1,r()}}}function jp(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function o6(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,_,g,k,S,$,T,O;const E=n[15].beforeLabel,I=It(E,n,n[18],Fp),L=n[15].afterLabel,A=It(L,n,n[18],Rp);let P=n[5]&&!n[11]&&qp(n);function N(K){n[17](K)}var R=n[8];function z(K,x){let X={id:K[21],baseCollection:K[1],disabled:K[10]||K[11],placeholder:K[11]?"":K[6]};return K[0]!==void 0&&(X.value=K[0]),{props:X}}R&&(m=jt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&Hp(n);const U=n[15].default,J=It(U,n,n[18],Np);return{c(){e=b("div"),t=b("label"),I&&I.c(),i=C(),l=b("span"),s=B(n[2]),o=C(),a=B(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&j(m.$$.fragment),_=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(l,"class","txt"),Q(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(K,x){y(K,e,x),w(e,t),I&&I.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,_),F&&F.m(e,null),y(K,k,x),y(K,S,x),J&&J.m(S,null),$=!0,T||(O=Ee(g=He.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(K,x){if(I&&I.p&&(!$||x&264192)&&At(I,E,K,K[18],$?Lt(E,K[18],x,i6):Pt(K[18]),Fp),(!$||x&4)&&re(s,K[2]),(!$||x&2048)&&r!==(r=K[11]?"- Superusers only":"")&&re(a,r),(!$||x&2048)&&Q(l,"txt-hint",K[11]),A&&A.p&&(!$||x&264192)&&At(A,L,K,K[18],$?Lt(L,K[18],x,n6):Pt(K[18]),Rp),K[5]&&!K[11]?P?P.p(K,x):(P=qp(K),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||x&2097152&&c!==(c=K[21]))&&p(t,"for",c),x&256&&R!==(R=K[8])){if(m){ae();const X=m;D(X.$$.fragment,1,0,()=>{H(X,1)}),ue()}R?(m=jt(R,z(K)),K[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),M(m.$$.fragment,1),q(m,e,_)):m=null}else if(R){const X={};x&2097152&&(X.id=K[21]),x&2&&(X.baseCollection=K[1]),x&3072&&(X.disabled=K[10]||K[11]),x&2112&&(X.placeholder=K[11]?"":K[6]),!h&&x&1&&(h=!0,X.value=K[0],Te(()=>h=!1)),m.$set(X)}K[5]&&K[11]?F?(F.p(K,x),x&2080&&M(F,1)):(F=Hp(K),F.c(),M(F,1),F.m(e,null)):F&&(ae(),D(F,1,1,()=>{F=null}),ue()),g&&Nt(g.update)&&x&2&&g.update.call(null,K[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||x&264192)&&At(J,U,K,K[18],$?Lt(U,K[18],x,t6):Pt(K[18]),Np)},i(K){$||(M(I,K),M(A,K),m&&M(m.$$.fragment,K),M(F),M(J,K),$=!0)},o(K){D(I,K),D(A,K),m&&D(m.$$.fragment,K),D(F),D(J,K),$=!1},d(K){K&&(v(e),v(k),v(S)),I&&I.d(K),A&&A.d(K),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(K),T=!1,O()}}}function r6(n){let e,t,i,l;const s=[s6,l6],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let zp;function a6(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,_=null,g=null,k=zp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await Ct(async()=>{const{default:L}=await import("./FilterAutocompleteInput-SHg3tCmR.js");return{default:L}},__vite__mapDeps([0,1]),import.meta.url)).default),zp=k,t(9,S=!1))}async function T(){t(0,a=g||""),await un(),_==null||_.focus()}function O(){g=a,t(0,a=null)}function E(L){ie[L?"unshift":"push"](()=>{_=L,t(7,_)})}function I(L){a=L,t(0,a)}return n.$$set=L=>{"collection"in L&&t(1,r=L.collection),"rule"in L&&t(0,a=L.rule),"label"in L&&t(2,u=L.label),"formKey"in L&&t(3,f=L.formKey),"required"in L&&t(4,c=L.required),"disabled"in L&&t(14,d=L.disabled),"superuserToggle"in L&&t(5,m=L.superuserToggle),"placeholder"in L&&t(6,h=L.placeholder),"$$scope"in L&&t(18,o=L.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,l=d||r.system)},[a,r,u,f,c,m,h,_,k,S,l,i,T,O,d,s,E,I,o]}class il extends we{constructor(e){super(),ye(this,e,a6,r6,_e,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function u6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(s,"class","txt"),p(l,"for",o=n[5])},m(u,f){y(u,e,f),e.checked=n[0].mfa.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function f6(n){let e,t,i,l,s;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to + email != ''.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),y(o,l,r),y(o,s,r)},p:te,d(o){o&&(v(e),v(t),v(i),v(l),v(s))}}}function c6(n){let e,t,i,l,s,o,r,a,u;l=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[u6,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[f6]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

`,t=C(),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),Q(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){y(d,e,m),y(d,t,m),y(d,i,m),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&1&&(_.disabled=!d[0].mfa.enabled),m&1&&(_.collection=d[0]),m&64&&(_.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,_.rule=d[0].mfa.rule,Te(()=>a=!1)),r.$set(_),(!u||m&1)&&Q(o,"fade",!d[0].mfa.enabled)},i(d){u||(E(l.$$.fragment,d),E(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(v(e),v(t),v(i)),H(l),H(r)}}}function f6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function c6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Up(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function d6(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?c6:f6}let a=r(n),u=a(n),f=n[1]&&Up();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&E(f,1):(f=Up(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function p6(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[d6],default:[u6]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function m6(n,e,t){let i,l;Qe(n,yn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!V.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class h6 extends we{constructor(e){super(),ye(this,e,m6,p6,_e,{collection:0})}}const _6=n=>({}),Vp=n=>({});function Bp(n,e,t){const i=n.slice();return i[50]=e[t],i}const g6=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Kp(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=C(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(l,s){y(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&re(t,l[2]),s[0]&96&&Q(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function b6(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){y(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&re(i,t)},i:te,o:te,d(l){l&&v(e)}}}function k6(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),j(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function Jp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){y(s,e,o),t||(i=[Ee(He.call(null,e,"Clear")),B(e,"click",On(et(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,Ie(i)}}}function Zp(n){let e,t,i,l,s,o;const r=[k6,b6],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Jp(n);return{c(){e=b("div"),i.c(),l=C(),f&&f.c(),s=C(),p(e,"class","option")},m(c,d){y(c,e,d),a[t].m(e,null),w(e,l),f&&f.m(e,null),w(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(ae(),D(a[m],1,1,()=>{a[m]=null}),ue(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Jp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(E(i),o=!0)},o(c){D(i),o=!1},d(c){c&&v(e),a[t].d(),f&&f.d()}}}function Gp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[w6]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function Xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&Qp(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=C(),s=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){y(f,e,c),w(e,t),w(t,i),w(t,l),w(t,s),ce(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=B(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&ce(s,f[17]),f[17].length?u?u.p(f,c):(u=Qp(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function Qp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){y(s,e,o),w(e,t),i||(l=B(t,"click",On(et(n[23]))),i=!0)},p:te,d(s){s&&v(e),i=!1,l()}}}function xp(n){let e,t=n[1]&&em(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=em(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function em(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l[0]&2&&re(t,i[1])},d(i){i&&v(e)}}}function v6(n){let e=n[50]+"",t;return{c(){t=W(e)},m(i,l){y(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&re(t,e)},i:te,o:te,d(i){i&&v(t)}}}function y6(n){let e,t,i;const l=[{item:n[50]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),j(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function tm(n){let e,t,i,l,s,o,r;const a=[y6,v6],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),l=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),Q(e,"closable",n[9]),Q(e,"selected",n[21](n[50]))},m(m,h){y(m,e,h),u[t].m(e,null),w(e,l),s=!0,o||(r=[B(e,"click",c),B(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=f(n),t===_?u[t].p(n,h):(ae(),D(u[_],1,1,()=>{u[_]=null}),ue(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&Q(e,"closable",n[9]),(!s||h[0]&6291456)&&Q(e,"selected",n[21](n[50]))},i(m){s||(E(i),s=!0)},o(m){D(i),s=!1},d(m){m&&v(e),u[t].d(),o=!1,Ie(r)}}}function w6(n){let e,t,i,l,s,o=n[14]&&Xp(n);const r=n[36].beforeOptions,a=It(r,n,n[45],Wp);let u=pe(n[22]),f=[];for(let _=0;_D(f[_],1,1,()=>{f[_]=null});let d=null;u.length||(d=xp(n));const m=n[36].afterOptions,h=It(m,n,n[45],Vp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let _=0;_D(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Kp(n));let c=!n[5]&&!n[6]&&Gp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ue()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&Q(e,"upside",d[7]),(!o||m[0]&32784)&&Q(e,"multiple",d[4]),(!o||m[0]&32800)&&Q(e,"disabled",d[5]),(!o||m[0]&32832)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=g()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:M=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=bt();let{class:N=""}=e,R,z="",F,U;function J(ve){if(V.isEmpty(k))return;let Ce=V.toArray(k);V.inArray(Ce,ve)&&(V.removeByValue(Ce,ve),t(0,k=d?Ce:(Ce==null?void 0:Ce[0])||g())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function K(ve){if(d){let Ce=V.toArray(k);V.inArray(Ce,ve)||t(0,k=[...Ce,ve])}else t(0,k=ve);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function x(ve){return l(ve)?J(ve):K(ve)}function X(){t(0,k=g()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function oe(){R!=null&&R.show&&(R==null||R.show())}function Se(){R!=null&&R.hide&&(R==null||R.hide())}function ge(){if(V.isEmpty(k)||V.isEmpty(c))return;let ve=V.toArray(k),Ce=[];for(const ut of ve)V.inArray(c,ut)||Ce.push(ut);if(Ce.length){for(const ut of Ce)V.removeByValue(ve,ut);t(0,k=d?ve:ve[0])}}function $e(){t(17,z="")}function Ye(ve,Ce){ve=ve||[];const ut=A||T6;return ve.filter(qt=>ut(qt,Ce))||[]}function nt(ve,Ce){ve.preventDefault(),S&&d?x(Ce):K(Ce)}function xe(ve,Ce){(ve.code==="Enter"||ve.code==="Space")&&(nt(ve,Ce),$&&Se())}function We(){$e(),setTimeout(()=>{const ve=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ve&&(ve.focus(),ve.scrollIntoView({block:"nearest"}))},0)}function rt(ve){ve.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Zt(()=>{const ve=document.querySelectorAll(`label[for="${r}"]`);for(const Ce of ve)Ce.addEventListener("click",rt);return()=>{for(const Ce of ve)Ce.removeEventListener("click",rt)}});const Ze=ve=>J(ve);function at(ve){ie[ve?"unshift":"push"](()=>{U=ve,t(20,U)})}function Ht(){z=this.value,t(17,z)}const Ve=(ve,Ce)=>nt(Ce,ve),Me=(ve,Ce)=>xe(Ce,ve);function st(ve){ie[ve?"unshift":"push"](()=>{R=ve,t(18,R)})}function De(ve){Ne.call(this,n,ve)}function Be(ve){ie[ve?"unshift":"push"](()=>{F=ve,t(19,F)})}return n.$$set=ve=>{"id"in ve&&t(27,r=ve.id),"noOptionsText"in ve&&t(1,a=ve.noOptionsText),"selectPlaceholder"in ve&&t(2,u=ve.selectPlaceholder),"searchPlaceholder"in ve&&t(3,f=ve.searchPlaceholder),"items"in ve&&t(28,c=ve.items),"multiple"in ve&&t(4,d=ve.multiple),"disabled"in ve&&t(5,m=ve.disabled),"readonly"in ve&&t(6,h=ve.readonly),"upside"in ve&&t(7,_=ve.upside),"zeroFunc"in ve&&t(29,g=ve.zeroFunc),"selected"in ve&&t(0,k=ve.selected),"toggle"in ve&&t(8,S=ve.toggle),"closable"in ve&&t(9,$=ve.closable),"labelComponent"in ve&&t(10,T=ve.labelComponent),"labelComponentProps"in ve&&t(11,O=ve.labelComponentProps),"optionComponent"in ve&&t(12,M=ve.optionComponent),"optionComponentProps"in ve&&t(13,L=ve.optionComponentProps),"searchable"in ve&&t(14,I=ve.searchable),"searchFunc"in ve&&t(30,A=ve.searchFunc),"class"in ve&&t(15,N=ve.class),"$$scope"in ve&&t(45,o=ve.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ge(),$e()),n.$$.dirty[0]&268566528&&t(22,i=Ye(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ve){const Ce=V.toArray(k);return V.inArray(Ce,ve)})},[k,a,u,f,d,m,h,_,S,$,T,O,M,L,I,N,J,z,R,F,U,l,i,$e,nt,xe,We,r,c,g,A,K,x,X,oe,Se,s,Ze,at,Ht,Ve,Me,st,De,Be,o]}class ds extends we{constructor(e){super(),ye(this,e,$6,S6,_e,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function C6(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o',i=C(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),xn(l,a)},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),l.autofocus&&l.focus(),s||(o=[Ee(He.call(null,t,{position:"left",text:"Set new value"})),B(t,"click",et(n[3]))],s=!0)},p(u,f){xn(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(v(e),v(i),v(l)),s=!1,Ie(o)}}}function E6(n){let e;function t(s,o){return s[1]?O6:C6}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function M6(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await un(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class xu extends we{constructor(e){super(),ye(this,e,M6,E6,_e,{value:0,mask:1})}}function D6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23])},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[1].clientId),r||(a=B(s,"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(s,"id",o),f&2&&s.value!==u[1].clientId&&ce(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function I6(n){let e,t,i,l,s,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),s=new xu({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Client secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Te(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,Te(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function nm(n){let e,t,i,l;const s=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){y(u,e,f),t&&q(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){ae();const c=t;D(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}r?(t=jt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),E(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],Te(()=>i=!1)),t.$set(c)}},i(u){l||(t&&E(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&v(e),t&&H(t)}}}function L6(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[D6,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[I6,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&nm(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){y(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=B(e,"submit",et(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&E(u,1)):(u=nm(f),u.c(),E(u,1),u.m(e,null)):u&&(ae(),D(u,1,1,()=>{u=null}),ue())},i(f){o||(E(t.$$.fragment,f),E(l.$$.fragment,f),E(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&v(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function A6(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function P6(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){y(l,e,s)},p(l,s){s&8&&!kn(e.src,t="./images/oauth2/"+l[3].logo)&&p(e,"src",t),s&8&&i!==(i=l[3].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function N6(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(_,g){return _[3].logo?P6:A6}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=W(l),o=C(),r=b("small"),a=W("("),f=W(u),c=W(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(_,g){y(_,e,g),h.m(e,null),y(_,t,g),y(_,i,g),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(_,g){m===(m=d(_))&&h?h.p(_,g):(h.d(1),h=m(_),h&&(h.c(),h.m(e,null))),g&8&&l!==(l=_[3].title+"")&&re(s,l),g&8&&u!==(u=_[3].key+"")&&re(f,u)},d(_){_&&(v(e),v(t),v(i)),h.d()}}}function im(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=[Ee(He.call(null,e,{text:"Remove provider",position:"right"})),B(e,"click",n[10])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,Ie(s)}}}function R6(n){let e,t,i,l,s,o,r,a,u=!n[4]&&im(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[8]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),w(l,s),r||(a=B(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=im(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(l.disabled=o)},d(f){f&&(v(e),v(t),v(i),v(l)),u&&u.d(f),r=!1,a()}}}function F6(n){let e,t,i={btnClose:!1,$$slots:{footer:[R6],header:[N6],default:[L6]},$$scope:{ctx:n}};return e=new nn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function q6(n,e,t){let i,l;const s=bt(),o="provider_popup_"+V.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=V.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function _(){di(l),r==null||r.hide()}async function g(){s("submit",{uiOptions:a,config:u}),_()}async function k(){pn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),_()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const M=()=>g();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Ne.call(this,n,P)}function A(P){Ne.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,l="oauth2.providers."+m)},[_,u,r,a,f,d,l,i,o,g,k,h,c,m,S,$,T,O,M,L,I,A]}class H6 extends we{constructor(e){super(),ye(this,e,q6,F6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function j6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[2]),r||(a=B(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function z6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Team ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[3]),r||(a=B(s,"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(s,"id",o),f&8&&s.value!==u[3]&&ce(s,u[3])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function U6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Key ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[4]),r||(a=B(s,"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(s,"id",o),f&16&&s.value!==u[4]&&ce(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function V6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",fr),r.required=!0},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[6]),u||(f=[Ee(He.call(null,l,{text:`Max ${fr} seconds (~${fr/(60*60*24*30)<<0} months).`,position:"top"})),B(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&>(r.value)!==c[6]&&ce(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,Ie(f)}}}function B6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Private key"),l=C(),s=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- + (Learn more) .

`,t=C(),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),Q(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){y(d,e,m),y(d,t,m),y(d,i,m),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&1&&(_.disabled=!d[0].mfa.enabled),m&1&&(_.collection=d[0]),m&64&&(_.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,_.rule=d[0].mfa.rule,Te(()=>a=!1)),r.$set(_),(!u||m&1)&&Q(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(v(e),v(t),v(i)),H(l),H(r)}}}function d6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function p6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Up(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function m6(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?p6:d6}let a=r(n),u=a(n),f=n[1]&&Up();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=Up(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function h6(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[m6],default:[c6]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _6(n,e,t){let i,l;Qe(n,yn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!V.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class g6 extends we{constructor(e){super(),ye(this,e,_6,h6,_e,{collection:0})}}const b6=n=>({}),Vp=n=>({});function Bp(n,e,t){const i=n.slice();return i[50]=e[t],i}const k6=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Kp(n){let e,t,i;return{c(){e=b("div"),t=B(n[2]),i=C(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(l,s){y(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&re(t,l[2]),s[0]&96&&Q(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function v6(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(l,s){y(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&re(i,t)},i:te,o:te,d(l){l&&v(e)}}}function y6(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function Jp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){y(s,e,o),t||(i=[Ee(He.call(null,e,"Clear")),W(e,"click",On(et(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,Ie(i)}}}function Zp(n){let e,t,i,l,s,o;const r=[y6,v6],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Jp(n);return{c(){e=b("div"),i.c(),l=C(),f&&f.c(),s=C(),p(e,"class","option")},m(c,d){y(c,e,d),a[t].m(e,null),w(e,l),f&&f.m(e,null),w(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(ae(),D(a[m],1,1,()=>{a[m]=null}),ue(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Jp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&v(e),a[t].d(),f&&f.d()}}}function Gp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[T6]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function Xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&Qp(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=C(),s=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){y(f,e,c),w(e,t),w(t,i),w(t,l),w(t,s),ce(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=W(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&ce(s,f[17]),f[17].length?u?u.p(f,c):(u=Qp(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function Qp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){y(s,e,o),w(e,t),i||(l=W(t,"click",On(et(n[23]))),i=!0)},p:te,d(s){s&&v(e),i=!1,l()}}}function xp(n){let e,t=n[1]&&em(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=em(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function em(n){let e,t;return{c(){e=b("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l[0]&2&&re(t,i[1])},d(i){i&&v(e)}}}function w6(n){let e=n[50]+"",t;return{c(){t=B(e)},m(i,l){y(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&re(t,e)},i:te,o:te,d(i){i&&v(t)}}}function S6(n){let e,t,i;const l=[{item:n[50]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ue()}s?(e=jt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&H(e,r)}}}function tm(n){let e,t,i,l,s,o,r;const a=[S6,w6],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),l=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),Q(e,"closable",n[9]),Q(e,"selected",n[21](n[50]))},m(m,h){y(m,e,h),u[t].m(e,null),w(e,l),s=!0,o||(r=[W(e,"click",c),W(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=f(n),t===_?u[t].p(n,h):(ae(),D(u[_],1,1,()=>{u[_]=null}),ue(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,l)),(!s||h[0]&512)&&Q(e,"closable",n[9]),(!s||h[0]&6291456)&&Q(e,"selected",n[21](n[50]))},i(m){s||(M(i),s=!0)},o(m){D(i),s=!1},d(m){m&&v(e),u[t].d(),o=!1,Ie(r)}}}function T6(n){let e,t,i,l,s,o=n[14]&&Xp(n);const r=n[36].beforeOptions,a=It(r,n,n[45],Wp);let u=de(n[22]),f=[];for(let _=0;_D(f[_],1,1,()=>{f[_]=null});let d=null;u.length||(d=xp(n));const m=n[36].afterOptions,h=It(m,n,n[45],Vp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let _=0;_D(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Kp(n));let c=!n[5]&&!n[6]&&Gp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ue()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&Q(e,"upside",d[7]),(!o||m[0]&32784)&&Q(e,"multiple",d[4]),(!o||m[0]&32800)&&Q(e,"disabled",d[5]),(!o||m[0]&32832)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=g()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:I={}}=e,{searchable:L=!1}=e,{searchFunc:A=void 0}=e;const P=bt();let{class:N=""}=e,R,z="",F,U;function J(ve){if(V.isEmpty(k))return;let Ce=V.toArray(k);V.inArray(Ce,ve)&&(V.removeByValue(Ce,ve),t(0,k=d?Ce:(Ce==null?void 0:Ce[0])||g())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function K(ve){if(d){let Ce=V.toArray(k);V.inArray(Ce,ve)||t(0,k=[...Ce,ve])}else t(0,k=ve);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function x(ve){return l(ve)?J(ve):K(ve)}function X(){t(0,k=g()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function oe(){R!=null&&R.show&&(R==null||R.show())}function Se(){R!=null&&R.hide&&(R==null||R.hide())}function ge(){if(V.isEmpty(k)||V.isEmpty(c))return;let ve=V.toArray(k),Ce=[];for(const ut of ve)V.inArray(c,ut)||Ce.push(ut);if(Ce.length){for(const ut of Ce)V.removeByValue(ve,ut);t(0,k=d?ve:ve[0])}}function $e(){t(17,z="")}function Ye(ve,Ce){ve=ve||[];const ut=A||C6;return ve.filter(qt=>ut(qt,Ce))||[]}function nt(ve,Ce){ve.preventDefault(),S&&d?x(Ce):K(Ce)}function xe(ve,Ce){(ve.code==="Enter"||ve.code==="Space")&&(nt(ve,Ce),$&&Se())}function We(){$e(),setTimeout(()=>{const ve=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ve&&(ve.focus(),ve.scrollIntoView({block:"nearest"}))},0)}function rt(ve){ve.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Zt(()=>{const ve=document.querySelectorAll(`label[for="${r}"]`);for(const Ce of ve)Ce.addEventListener("click",rt);return()=>{for(const Ce of ve)Ce.removeEventListener("click",rt)}});const Ze=ve=>J(ve);function at(ve){ie[ve?"unshift":"push"](()=>{U=ve,t(20,U)})}function Ht(){z=this.value,t(17,z)}const Ve=(ve,Ce)=>nt(Ce,ve),Me=(ve,Ce)=>xe(Ce,ve);function st(ve){ie[ve?"unshift":"push"](()=>{R=ve,t(18,R)})}function De(ve){Ne.call(this,n,ve)}function Be(ve){ie[ve?"unshift":"push"](()=>{F=ve,t(19,F)})}return n.$$set=ve=>{"id"in ve&&t(27,r=ve.id),"noOptionsText"in ve&&t(1,a=ve.noOptionsText),"selectPlaceholder"in ve&&t(2,u=ve.selectPlaceholder),"searchPlaceholder"in ve&&t(3,f=ve.searchPlaceholder),"items"in ve&&t(28,c=ve.items),"multiple"in ve&&t(4,d=ve.multiple),"disabled"in ve&&t(5,m=ve.disabled),"readonly"in ve&&t(6,h=ve.readonly),"upside"in ve&&t(7,_=ve.upside),"zeroFunc"in ve&&t(29,g=ve.zeroFunc),"selected"in ve&&t(0,k=ve.selected),"toggle"in ve&&t(8,S=ve.toggle),"closable"in ve&&t(9,$=ve.closable),"labelComponent"in ve&&t(10,T=ve.labelComponent),"labelComponentProps"in ve&&t(11,O=ve.labelComponentProps),"optionComponent"in ve&&t(12,E=ve.optionComponent),"optionComponentProps"in ve&&t(13,I=ve.optionComponentProps),"searchable"in ve&&t(14,L=ve.searchable),"searchFunc"in ve&&t(30,A=ve.searchFunc),"class"in ve&&t(15,N=ve.class),"$$scope"in ve&&t(45,o=ve.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ge(),$e()),n.$$.dirty[0]&268566528&&t(22,i=Ye(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ve){const Ce=V.toArray(k);return V.inArray(Ce,ve)})},[k,a,u,f,d,m,h,_,S,$,T,O,E,I,L,N,J,z,R,F,U,l,i,$e,nt,xe,We,r,c,g,A,K,x,X,oe,Se,s,Ze,at,Ht,Ve,Me,st,De,Be,o]}class ds extends we{constructor(e){super(),ye(this,e,O6,$6,_e,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function E6(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o',i=C(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),xn(l,a)},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),l.autofocus&&l.focus(),s||(o=[Ee(He.call(null,t,{position:"left",text:"Set new value"})),W(t,"click",et(n[3]))],s=!0)},p(u,f){xn(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(v(e),v(i),v(l)),s=!1,Ie(o)}}}function D6(n){let e;function t(s,o){return s[1]?M6:E6}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function I6(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await un(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class xu extends we{constructor(e){super(),ye(this,e,I6,D6,_e,{value:0,mask:1})}}function L6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23])},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[1].clientId),r||(a=W(s,"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(s,"id",o),f&2&&s.value!==u[1].clientId&&ce(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function A6(n){let e,t,i,l,s,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),s=new xu({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Client secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Te(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,Te(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function nm(n){let e,t,i,l;const s=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){y(u,e,f),t&&q(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){ae();const c=t;D(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}r?(t=jt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],Te(()=>i=!1)),t.$set(c)}},i(u){l||(t&&M(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&v(e),t&&H(t)}}}function P6(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[L6,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[A6,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&nm(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){y(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=W(e,"submit",et(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=nm(f),u.c(),M(u,1),u.m(e,null)):u&&(ae(),D(u,1,1,()=>{u=null}),ue())},i(f){o||(M(t.$$.fragment,f),M(l.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&v(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function N6(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function R6(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){y(l,e,s)},p(l,s){s&8&&!kn(e.src,t="./images/oauth2/"+l[3].logo)&&p(e,"src",t),s&8&&i!==(i=l[3].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function F6(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(_,g){return _[3].logo?R6:N6}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=B(l),o=C(),r=b("small"),a=B("("),f=B(u),c=B(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(_,g){y(_,e,g),h.m(e,null),y(_,t,g),y(_,i,g),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(_,g){m===(m=d(_))&&h?h.p(_,g):(h.d(1),h=m(_),h&&(h.c(),h.m(e,null))),g&8&&l!==(l=_[3].title+"")&&re(s,l),g&8&&u!==(u=_[3].key+"")&&re(f,u)},d(_){_&&(v(e),v(t),v(i)),h.d()}}}function im(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=[Ee(He.call(null,e,{text:"Remove provider",position:"right"})),W(e,"click",n[10])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,Ie(s)}}}function q6(n){let e,t,i,l,s,o,r,a,u=!n[4]&&im(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[8]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),w(l,s),r||(a=W(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=im(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(l.disabled=o)},d(f){f&&(v(e),v(t),v(i),v(l)),u&&u.d(f),r=!1,a()}}}function H6(n){let e,t,i={btnClose:!1,$$slots:{footer:[q6],header:[F6],default:[P6]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function j6(n,e,t){let i,l;const s=bt(),o="provider_popup_"+V.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=V.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function _(){di(l),r==null||r.hide()}async function g(){s("submit",{uiOptions:a,config:u}),_()}async function k(){pn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),_()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>g();function I(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function L(P){Ne.call(this,n,P)}function A(P){Ne.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,l="oauth2.providers."+m)},[_,u,r,a,f,d,l,i,o,g,k,h,c,m,S,$,T,O,E,I,L,A]}class z6 extends we{constructor(e){super(),ye(this,e,j6,H6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function U6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[2]),r||(a=W(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function V6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Team ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[3]),r||(a=W(s,"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(s,"id",o),f&8&&s.value!==u[3]&&ce(s,u[3])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function B6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Key ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[4]),r||(a=W(s,"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(s,"id",o),f&16&&s.value!==u[4]&&ce(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function W6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",fr),r.required=!0},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[6]),u||(f=[Ee(He.call(null,l,{text:`Max ${fr} seconds (~${fr/(60*60*24*30)<<0} months).`,position:"top"})),W(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&>(r.value)!==c[6]&&ce(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,Ie(f)}}}function Y6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Private key"),l=C(),s=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[5]),y(c,r,d),y(c,a,d),u||(f=B(s,"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(s,"id",o),d&32&&ce(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function W6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S;return l=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[j6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[z6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[U6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[V6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),_=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[B6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),j(_.$$.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($,T){y($,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(_,t,null),g=!0,k||(S=B(e,"submit",et(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),l.$set(O);const M={};T&25165832&&(M.$$scope={dirty:T,ctx:$}),r.$set(M);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),_.$set(A)},i($){g||(E(l.$$.fragment,$),E(r.$$.fragment,$),E(f.$$.fragment,$),E(m.$$.fragment,$),E(_.$$.fragment,$),g=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(_.$$.fragment,$),g=!1},d($){$&&v(e),H(l),H(r),H(f),H(m),H(_),k=!1,S()}}}function Y6(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function K6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],Q(l,"btn-loading",n[7])},m(c,d){y(c,e,d),w(e,t),y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=B(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&Q(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function J6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[K6],header:[Y6],default:[W6]},$$scope:{ctx:n}};return e=new nn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const fr=15777e3;function Z6(n,e,t){let i;const l=bt(),s="apple_secret_"+V.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||fr),Yt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const P=await me.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),en("Successfully generated client secret."),l("submit",P),o==null||o.hide()}catch(P){me.error(P)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>_(),M=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Ne.call(this,n,P)}function A(P){Ne.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,_,m,g,k,S,$,T,O,M,L,I,A]}class G6 extends we{constructor(e){super(),ye(this,e,Z6,J6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function X6(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new G6({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Generate secret",o=C(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){y(d,e,m),w(e,t),w(e,i),w(e,l),y(d,o,m),q(r,d,m),a=!0,u||(f=B(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),H(r,d),u=!1,f()}}}function Q6(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){ie[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class x6 extends we{constructor(e){super(),ye(this,e,Q6,X6,_e,{key:1,config:0})}}function e8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Auth URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[0].authURL),y(c,r,d),y(c,a,d),u||(f=B(s,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].authURL&&ce(s,c[0].authURL)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function t8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Token URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[0].tokenURL),y(c,r,d),y(c,a,d),u||(f=B(s,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].tokenURL&&ce(s,c[0].tokenURL)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function n8(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[e8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[t8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){y(r,e,a),y(r,t,a),q(i,r,a),y(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),H(i,r),H(s,r)}}}function i8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authURL=this.value,t(0,l)}function o(){l.tokenURL=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class l8 extends we{constructor(e){super(),ye(this,e,i8,n8,_e,{key:1,config:0})}}function lm(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){y(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function s8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&lm(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=W(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),y(o,e,r),y(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=lm(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&re(l,i)},i:te,o:te,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function o8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class sm extends we{constructor(e){super(),ye(this,e,o8,s8,_e,{item:0})}}const r8=n=>({}),om=n=>({});function a8(n){let e;const t=n[8].afterOptions,i=It(t,n,n[12],om);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&At(i,t,l,l[12],e?Lt(t,l[12],s,r8):Pt(l[12]),om)},i(l){e||(E(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function u8(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[a8]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function f8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=sm}=e,{optionComponent:c=sm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h($){$=V.toArray($,!0);let T=[];for(let O of $){const M=V.findByKey(r,d,O);M&&T.push(M)}$.length&&!T.length||t(0,u=a?T:T[0])}async function _($){let T=V.toArray($,!0).map(O=>O[d]);r.length&&t(6,m=a?T:T[0])}function g($){u=$,t(0,u)}function k($){Ne.call(this,n,$)}function S($){Ne.call(this,n,$)}return n.$$set=$=>{e=ze(ze({},e),Ut($)),t(5,l=lt(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&&h(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,l,m,d,s,g,k,S,o]}class Wn extends we{constructor(e){super(),ye(this,e,f8,u8,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function c8(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(5,s=lt(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ps extends we{constructor(e){super(),ye(this,e,d8,c8,_e,{value:0,separator:1,readonly:2,disabled:3})}}function p8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Display name"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].displayName),r||(a=B(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&ce(s,u[0].displayName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function m8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].authURL),r||(a=B(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&ce(s,u[0].authURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function h8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].tokenURL),r||(a=B(s,"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(s,"id",o),f&1&&s.value!==u[0].tokenURL&&ce(s,u[0].tokenURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function _8(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("Fetch user info from"),l=C(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function g8(n){let e,t,i,l,s,o,r,a;return l=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[k8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[v8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token - is a direct result of the trusted server code->token exchange response.`,i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){y(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(E(l.$$.fragment,u),E(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=je(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=je(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),H(l),H(o),u&&r&&r.end()}}}function b8(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[y8,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){y(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(E(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=je(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=je(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&v(e),H(t),s&&i&&i.end()}}}function k8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[0].extra.jwksURL),u||(f=[Ee(He.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),B(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&ce(r,c[0].extra.jwksURL)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ie(f)}}}function v8(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ps({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,_){y(h,e,_),w(e,t),w(e,i),w(e,l),y(h,o,_),q(r,h,_),u=!0,f||(c=Ee(He.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,_){(!u||_&8192&&s!==(s=h[13]))&&p(e,"for",s);const g={};_&8192&&(g.id=h[13]),!a&&_&1&&(a=!0,g.value=h[0].extra.issuers,Te(()=>a=!1)),r.$set(g)},i(h){u||(E(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),H(r,h),f=!1,c()}}}function y8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].userInfoURL),r||(a=B(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&ce(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function w8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){y(c,e,d),e.checked=n[0].pkce,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[11]),Ee(He.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function S8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[p8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[m8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[h8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[_8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[b8,g8],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),_=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[w8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),j(s.$$.fragment),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),j(_.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),y(T,t,O),y(T,i,O),y(T,l,O),q(s,T,O),y(T,o,O),q(r,T,O),y(T,a,O),q(u,T,O),y(T,f,O),y(T,c,O),S[d].m(c,null),y(T,h,O),q(_,T,O),g=!0},p(T,[O]){const M={};O&2&&(M.name=T[1]+".displayName"),O&24577&&(M.$$scope={dirty:O,ctx:T}),e.$set(M);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),s.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(ae(),D(S[P],1,1,()=>{S[P]=null}),ue(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),E(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),_.$set(N)},i(T){g||(E(e.$$.fragment,T),E(s.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m),E(_.$$.fragment,T),g=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(_.$$.fragment,T),g=!1},d(T){T&&(v(t),v(i),v(l),v(o),v(a),v(f),v(c),v(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(_,T)}}}function T8(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;V.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(g){o=g,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(g){n.$$.not_equal(l.extra.issuers,g)&&(l.extra.issuers=g,t(0,l))}function _(){l.pkce=this.checked,t(0,l)}return n.$$set=g=>{"key"in g&&t(1,i=g.key),"config"in g&&t(0,l=g.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,_]}class va extends we{constructor(e){super(),ye(this,e,T8,S8,_e,{key:1,config:0})}}function $8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].authURL),r||(a=B(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authURL&&ce(s,u[0].authURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function C8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].tokenURL),r||(a=B(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenURL&&ce(s,u[0].tokenURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function O8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].userInfoURL),r||(a=B(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userInfoURL&&ce(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function E8(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[$8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[C8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[O8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){y(f,e,c),w(e,t),y(f,i,c),q(l,f,c),y(f,s,c),q(o,f,c),y(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&re(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(E(l.$$.fragment,f),E(o.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(s),v(r)),H(l,f),H(o,f),H(a,f)}}}function M8(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authURL=this.value,t(0,s)}function u(){s.tokenURL=this.value,t(0,s)}function f(){s.userInfoURL=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class ya extends we{constructor(e){super(),ye(this,e,M8,E8,_e,{key:1,config:0,required:4,title:2})}}const ef=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:x6},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:l8},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:ya,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:ya,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:ya,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function rm(n,e,t){const i=n.slice();return i[16]=e[t],i}function am(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){y(o,e,r),i=!0,l||(s=B(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function D8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&am(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ke(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(s,"id",o=n[19]),p(s,"type","text"),p(s,"placeholder","Search provider")},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),ce(s,n[1]),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=B(s,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(s,"id",o),m&2&&s.value!==d[1]&&ce(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&E(c,1)):(c=am(d),c.c(),E(c,1),c.m(a.parentNode,a)):c&&(ae(),D(c,1,1,()=>{c=null}),ue())},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function um(n){let e,t,i,l,s=n[1]!=""&&fm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),s&&s.c(),l=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){y(o,e,r),w(e,t),w(e,i),s&&s.m(e,null),w(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=fm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&v(e),s&&s.d()}}}function fm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[5]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function cm(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){y(l,e,s)},p(l,s){s&8&&!kn(e.src,t="./images/oauth2/"+l[16].logo)&&p(e,"src",t),s&8&&i!==(i=l[16].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function dm(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,_,g,k=e[16].logo&&cm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),k&&k.c(),s=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-lg-6"),this.first=t},m($,T){y($,t,T),w(t,i),w(i,l),k&&k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(t,h),_||(g=B(i,"click",S),_=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=cm(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&re(u,a),T&8&&d!==(d=e[16].key+"")&&re(m,d)},d($){$&&v(t),k&&k.d(),_=!1,g()}}}function I8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[D8,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=pe(n[3]);const a=f=>f[16].key;for(let f=0;f!l.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),_=$=>f($);function g($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}function k($){Ne.call(this,n,$)}function S($){Ne.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,l=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||l!==-1)&&t(3,r=c())},[u,o,s,r,f,d,l,a,m,h,_,g,k,S]}class R8 extends we{constructor(e){super(),ye(this,e,N8,P8,_e,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function pm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const l=i[9](i[28].name);return i[29]=l,i}function F8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){y(u,e,f),e.checked=n[0].oauth2.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function q8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function H8(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){y(l,e,s)},p(l,s){s[0]&1&&!kn(e.src,t="./images/oauth2/"+l[29].logo)&&p(e,"src",t),s[0]&1&&i!==(i=l[29].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function mm(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){y(s,e,o),t||(i=[Ee(He.call(null,e,{text:"Edit config",position:"left"})),B(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,Ie(i)}}}function hm(n,e){var $;let t,i,l,s,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function _(T,O){var M;return(M=T[29])!=null&&M.logo?H8:q8}let g=_(e),k=g(e),S=e[29]&&mm(e);return{key:n,first:null,c(){var T,O,M;t=b("div"),i=b("div"),l=b("figure"),k.c(),s=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),S&&S.c(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),Q(i,"error",!V.isEmpty((M=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:M[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){y(T,t,O),w(t,i),w(i,l),k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(i,h),S&&S.m(i,null)},p(T,O){var M,L,I,A;e=T,g===(g=_(e))&&k?k.p(e,O):(k.d(1),k=g(e),k&&(k.c(),k.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((M=e[29])==null?void 0:M.title)||"Custom")+"")&&re(u,a),O[0]&1&&d!==(d=e[28].name+"")&&re(m,d),e[29]?S?S.p(e,O):(S=mm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&Q(i,"error",!V.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&v(t),k.d(),S&&S.d()}}}function j8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function z8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function _m(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[U8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[V8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[B8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[W8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(g,k){y(g,e,k),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),_=!0},p(g,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:g}),l.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:g}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:g}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:g}),m.$set(O)},i(g){_||(E(l.$$.fragment,g),E(r.$$.fragment,g),E(f.$$.fragment,g),E(m.$$.fragment,g),g&&tt(()=>{_&&(h||(h=je(e,mt,{duration:150},!0)),h.run(1))}),_=!0)},o(g){D(l.$$.fragment,g),D(r.$$.fragment,g),D(f.$$.fragment,g),D(m.$$.fragment,g),g&&(h||(h=je(e,mt,{duration:150},!1)),h.run(0)),_=!1},d(g){g&&v(e),H(l),H(r),H(f),H(m),g&&h&&h.end()}}}function U8(n){let e,t,i,l,s,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:X8,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 full name"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function V8(n){let e,t,i,l,s,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:Q8,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 avatar"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function B8(n){let e,t,i,l,s,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:x8,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 id"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function W8(n){let e,t,i,l,s,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:eO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 username"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function Y8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,_,g,k,S,$,T,O,M;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[F8,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=pe(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=W("Optional "),h=W(m),_=W(" create fields map"),g=C(),N.c(),S=C(),R&&R.c(),$=ke(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),y(z,t,F),y(z,i,F);for(let U=0;U{R=null}),ue())},i(z){T||(E(e.$$.fragment,z),E(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(v(t),v(i),v(u),v(f),v(S),v($)),H(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){y(a,e,u),w(e,t),w(e,i),w(e,s),y(a,o,u),y(a,r,u)},p(a,u){u[0]&128&&re(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&re(s,l),u[0]&128&&Q(e,"label-warning",!a[7]),u[0]&128&&Q(e,"label-info",a[7]>0)},d(a){a&&(v(e),v(o),v(r))}}}function gm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Z8(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?J8:K8}let a=r(n),u=a(n),f=n[8]&&gm();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[8]?f?d[0]&256&&E(f,1):(f=gm(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function G8(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[Z8],default:[Y8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(bm))||[]};i=new R8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new H6({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(c,d){q(e,c,d),y(c,t,d),q(i,c,d),y(c,l,d),q(s,c,d),o=!0},p(c,d){var g,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(g=c[0].oauth2)==null?void 0:g.providers)==null?void 0:k.map(bm))||[]),i.$set(h);const _={};s.$set(_)},i(c){o||(E(e.$$.fragment,c),E(i.$$.fragment,c),E(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(v(t),v(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const X8=()=>"",Q8=()=>"",x8=()=>"",eO=()=>"",bm=n=>n.name;function tO(n,e,t){let i,l,s;Qe(n,yn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function _(F=[]){var U,J;t(5,m=((U=F==null?void 0:F.filter(K=>a.includes(K.type)&&!r.includes(K.name)))==null?void 0:U.map(K=>K.name))||[]),t(6,h=((J=F==null?void 0:F.filter(K=>u.includes(K.type)&&!r.includes(K.name)))==null?void 0:J.map(K=>K.name))||[])}function g(F){for(let U of ef)if(U.key==F)return U;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,U,J)=>{c==null||c.show(F,U,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function M(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var U,J;c.show(F.detail,{},((J=(U=o.oauth2)==null?void 0:U.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const U=F.detail.uiOptions;V.removeByKey(o.oauth2.providers,"name",U.key),t(0,o)},z=F=>{const U=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),V.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:U.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,U;n.$$.dirty[0]&1&&V.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&_(o.fields),n.$$.dirty[0]&2&&t(8,i=!V.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((U=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:U.length)||0)},[o,s,f,c,d,m,h,l,i,g,k,S,$,T,O,M,L,I,A,P,N,R,z]}class nO extends we{constructor(e){super(),ye(this,e,tO,G8,_e,{collection:0},null,[-1,-1])}}function km(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function iO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&km();return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){y(d,e,m),e.checked=n[0].otp.enabled,y(d,i,m),y(d,l,m),w(l,s),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=[B(e,"change",n[4]),B(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[2]?c||(c=km(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(i),v(l),v(r),v(a)),c&&c.d(d),u=!1,Ie(f)}}}function lO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].otp.duration),r||(a=B(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.duration&&ce(s,u[0].otp.duration)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function sO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].otp.length),r||(a=B(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.length&&ce(s,u[0].otp.length)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oO(n){let e,t,i,l,s,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[iO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[lO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[sO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),y(f,t,c),y(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(E(e.$$.fragment,f),E(s.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(v(t),v(i)),H(e,f),H(s),H(a)}}}function rO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function aO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function vm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function uO(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?aO:rO}let a=r(n),u=a(n),f=n[1]&&vm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&E(f,1):(f=vm(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function fO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[uO],default:[oO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function cO(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,l=!V.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class dO extends we{constructor(e){super(),ye(this,e,cO,fO,_e,{collection:0})}}function ym(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function pO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&ym();return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},m(d,m){y(d,e,m),e.checked=n[0].passwordAuth.enabled,y(d,i,m),y(d,l,m),w(l,s),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=B(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=ym(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(i),v(l),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function mO(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function hO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[pO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[mO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function _O(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function gO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function wm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function bO(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?gO:_O}let a=r(n),u=a(n),f=n[2]&&wm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&E(f,1):(f=wm(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function kO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[bO],default:[hO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vO(n,e,t){let i,l,s;Qe(n,yn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],_=(d==null?void 0:d.indexes)||[];for(let g of _){const k=V.parseIndex(g);if(!k.unique||k.columns.length!=1||k.columns[0].name=="email")continue;const S=h.find($=>!$.hidden&&$.name.toLowerCase()==k.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!V.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class yO extends we{constructor(e){super(),ye(this,e,vO,kO,_e,{collection:0})}}function Sm(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tm(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=$v(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=W(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,ce(i,i.__value),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){y(h,t,_),w(t,i),i.checked=i.__value===e[2],w(t,s),w(t,o),w(o,a),w(t,f),d||(m=B(i,"change",e[10]),d=!0)},p(h,_){e=h,_&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&v(t),c.r(),d=!1,m()}}}function wO(n){let e=[],t=new Map,i,l=pe(n[7]);const s=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[SO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){y(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=B(e,"submit",et(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&v(e),H(t),H(l),o=!1,r()}}}function $O(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function CO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],Q(l,"btn-loading",n[4])},m(c,d){y(c,e,d),w(e,t),y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=B(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&Q(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function OO(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:[CO],header:[$O],default:[TO]},$$scope:{ctx:n}};return e=new nn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const wa="last_email_test",$m="email_test_request";function EO(n,e,t){let i;const l=bt(),s="email_test_"+V.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(wa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(wa)),t(2,f=P||o[0].value),Yt({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function _(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(wa,u),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest($m),Ci("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,f,{$cancelKey:$m}),en("Successfully sent test email."),l("submit"),t(4,c=!1),await un(),h()}catch(I){t(4,c=!1),me.error(I)}clearTimeout(d)}}const g=[[]];function k(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const $=()=>_(),T=()=>!c;function O(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function M(I){Ne.call(this,n,I)}function L(I){Ne.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,_,m,k,g,S,$,T,O,M,L]}class sv extends we{constructor(e){super(),ye(this,e,EO,OO,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Cm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function MO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){y(u,e,f),e.checked=n[0].authAlert.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Om(n){let e,t,i;function l(o){n[12](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new nO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Em(n,e){var a;let t,i,l,s;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new V5({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(u,f){y(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,Te(()=>l=!1)),i.$set(c)},i(u){s||(E(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&v(t),H(i,u)}}}function DO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P=[],N=new Map,R,z,F,U,J,K,x,X,oe,Se,ge;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[MO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function $e(De){n[10](De)}let Ye={};n[0]!==void 0&&(Ye.collection=n[0]),u=new dO({props:Ye}),ie.push(()=>be(u,"collection",$e));function nt(De){n[11](De)}let xe={};n[0]!==void 0&&(xe.collection=n[0]),d=new yO({props:xe}),ie.push(()=>be(d,"collection",nt));let We=!n[1]&&Om(n);function rt(De){n[13](De)}let Ze={};n[0]!==void 0&&(Ze.collection=n[0]),g=new h6({props:Ze}),ie.push(()=>be(g,"collection",rt));let at=pe(n[2]);const Ht=De=>De[18].key;for(let De=0;Debe(J,"collection",Ve));let st={};return X=new sv({props:st}),n[17](X),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),c=C(),j(d.$$.fragment),h=C(),We&&We.c(),_=C(),j(g.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),M=b("button"),M.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let De=0;Def=!1)),u.$set(Ce);const ut={};!m&&Be&1&&(m=!0,ut.collection=De[0],Te(()=>m=!1)),d.$set(ut),De[1]?We&&(ae(),D(We,1,1,()=>{We=null}),ue()):We?(We.p(De,Be),Be&2&&E(We,1)):(We=Om(De),We.c(),E(We,1),We.m(a,_));const qt={};!k&&Be&1&&(k=!0,qt.collection=De[0],Te(()=>k=!1)),g.$set(qt),Be&4&&(at=pe(De[2]),ae(),P=yt(P,Be,Ht,1,De,at,N,A,zt,Em,null,Cm),ue());const Le={};!K&&Be&1&&(K=!0,Le.collection=De[0],Te(()=>K=!1)),J.$set(Le);const ot={};X.$set(ot)},i(De){if(!oe){E(o.$$.fragment,De),E(u.$$.fragment,De),E(d.$$.fragment,De),E(We),E(g.$$.fragment,De);for(let Be=0;Bec==null?void 0:c.show(u.id);function S(O,M){n.$$.not_equal(M.config,O)&&(M.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,M;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((M=u.authAlert)==null?void 0:M.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,_,g,k,S,$,T]}class LO extends we{constructor(e){super(),ye(this,e,IO,DO,_e,{collection:0})}}const AO=n=>({dragging:n&4,dragover:n&8}),Mm=n=>({dragging:n[2],dragover:n[3]});function PO(n){let e,t,i,l,s;const o=n[10].default,r=It(o,n,n[9],Mm);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){y(a,e,u),r&&r.m(e,null),i=!0,l||(s=[B(e,"dragover",et(n[11])),B(e,"dragleave",et(n[12])),B(e,"dragend",n[13]),B(e,"dragstart",n[14]),B(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&At(r,o,a,a[9],i?Lt(o,a[9],u,AO):Pt(a[9]),Mm),(!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||(E(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,Ie(s)}}}function NO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=bt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const L=M.index<<0;L{t(3,d=!0)},g=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,_,g,k,S,$]}class go extends we{constructor(e){super(),ye(this,e,NO,PO,_e,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Dm(n,e,t){const i=n.slice();return i[27]=e[t],i}function RO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){y(f,e,c),y(f,l,c),y(f,s,c),w(s,o),a||(u=B(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(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function FO(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=jt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){ae();const c=e;D(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],Te(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function qO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function HO(n){let e,t,i,l;const s=[qO,FO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Im(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[HO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Im(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),r&&r.c(),s=ke()},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),y(a,l,u),r&&r.m(a,u),y(a,s,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=Im(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),H(e,a),H(i,a),r&&r.d(a)}}}function zO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=W(t),l=W(" index")},m(s,o){y(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&re(i,t)},d(s){s&&v(e)}}}function Am(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){y(l,e,s),t||(i=[Ee(He.call(null,e,{text:"Delete",position:"top"})),B(e,"click",n[16])],t=!0)},p:te,d(l){l&&v(e),t=!1,Ie(i)}}}function UO(n){let e,t,i,l,s,o,r=n[5]!=""&&Am(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),Q(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),y(a,e,u),y(a,t,u),y(a,i,u),y(a,l,u),s||(o=[B(t,"click",n[17]),B(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Am(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,Ie(o)}}}function VO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[UO],header:[zO],default:[jO]},$$scope:{ctx:n}};for(let s=0;sx.name==U);K?V.removeByValue(J.columns,K):V.pushUnique(J.columns,{name:U}),t(2,d=V.buildIndex(J))}Zt(async()=>{t(8,_=!0);try{t(7,h=(await Ct(async()=>{const{default:U}=await import("./CodeEditor-DKQxSBo9.js");return{default:U}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,_=!1)});const M=()=>$(),L=()=>k(),I=()=>T(),A=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=V.buildIndex(l))};function P(U){d=U,t(2,d)}const N=U=>O(U);function R(U){ie[U?"unshift":"push"](()=>{f=U,t(4,f)})}function z(U){Ne.call(this,n,U)}function F(U){Ne.call(this,n,U)}return n.$$set=U=>{e=ze(ze({},e),Ut(U)),t(14,r=lt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,J,K;n.$$.dirty[0]&1&&t(10,i=((J=(U=u==null?void 0:u.fields)==null?void 0:U.filter(x=>!x.toDelete&&x.name!="id"))==null?void 0:J.map(x=>x.name))||[]),n.$$.dirty[0]&4&&t(3,l=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((K=l.columns)==null?void 0:K.map(x=>x.name))||[])},[u,k,d,l,f,c,m,h,_,s,i,$,T,O,r,g,M,L,I,A,P,N,R,z,F]}class WO extends we{constructor(e){super(),ye(this,e,BO,VO,_e,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Pm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=V.parseIndex(i[10]);return i[11]=l,i}function Nm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Rm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Fm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&Nm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),s=W(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;y(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Ee(r=He.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),B(e,"click",c)],a=!0)},p(m,h){var _,g,k,S,$;n=m,n[11].unique?f||(f=Nm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Fm).join(", "))+"")&&re(s,l),h&4&&o!==(o="label link-primary "+((k=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Nt(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,Ie(u)}}}function YO(n){var T,O,M;let e,t,i=(((O=(T=n[0])==null?void 0:T.indexes)==null?void 0:O.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,_,g=pe(((M=n[0])==null?void 0:M.indexes)||[]),k=[];for(let L=0;Lbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),l=W(i),s=W(")"),o=C(),r=b("div");for(let L=0;L+ New index',f=C(),j(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(L,I){y(L,e,I),w(e,t),w(e,l),w(e,s),y(L,o,I),y(L,r,I);for(let A=0;Ad=!1)),c.$set(A)},i(L){m||(E(c.$$.fragment,L),m=!0)},o(L){D(c.$$.fragment,L),m=!1},d(L){L&&(v(e),v(o),v(r),v(f)),pt(k,L),n[6](null),H(c,L),h=!1,_()}}}const Fm=n=>n.name;function KO(n,e,t){let i;Qe(n,yn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class JO extends we{constructor(e){super(),ye(this,e,KO,YO,_e,{collection:0})}}function qm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Hm(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent=`${n[5].label}`,s=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){y(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),o||(r=B(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&v(e),o=!1,r()}}}function ZO(n){let e,t=pe(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class QO extends we{constructor(e){super(),ye(this,e,XO,GO,_e,{class:0})}}const xO=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),jm=n=>({interactive:n[7],hasErrors:n[6]}),eE=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),zm=n=>({interactive:n[7],hasErrors:n[6]}),tE=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Um=n=>({interactive:n[7],hasErrors:n[6]});function Vm(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Bm(n){let e,t;return{c(){e=b("span"),t=W(n[5]),p(e,"class","label label-success")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l[0]&32&&re(t,i[5])},d(i){i&&v(e)}}}function Wm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function nE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Bm(n),_=n[0].hidden&&Wm();return{c(){e=b("div"),h&&h.c(),t=C(),_&&_.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=V.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),Q(l,"txt-disabled",!n[7]||n[0].system),p(u,"type","text"),u.required=!0,u.disabled=f=!n[7]||n[0].system,p(u,"spellcheck","false"),p(u,"placeholder","Field name"),u.value=c=n[0].name,p(u,"title","System field")},m(g,k){y(g,e,k),h&&h.m(e,null),w(e,t),_&&_.m(e,null),y(g,i,k),y(g,l,k),w(l,s),y(g,a,k),y(g,u,k),n[22](u),d||(m=[Ee(r=He.call(null,l,n[0].type+(n[0].system?" (system)":""))),B(l,"click",n[21]),B(u,"input",n[23])],d=!0)},p(g,k){g[0].required?h?h.p(g,k):(h=Bm(g),h.c(),h.m(e,t)):h&&(h.d(1),h=null),g[0].hidden?_||(_=Wm(),_.c(),_.m(e,null)):_&&(_.d(1),_=null),k[0]&1&&o!==(o=V.getFieldTypeIcon(g[0].type))&&p(s,"class",o),r&&Nt(r.update)&&k[0]&1&&r.update.call(null,g[0].type+(g[0].system?" (system)":"")),k[0]&129&&Q(l,"txt-disabled",!g[7]||g[0].system),k[0]&129&&f!==(f=!g[7]||g[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=g[0].name)&&u.value!==c&&(u.value=c)},d(g){g&&(v(e),v(i),v(l),v(a),v(u)),h&&h.d(),_&&_.d(),n[22](null),d=!1,Ie(m)}}}function iE(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function lE(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label",i="Toggle "+n[0].name+" field options"),p(e,"class",l="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),Q(e,"btn-hint",!n[4]&&!n[6]),Q(e,"btn-danger",n[6])},m(r,a){y(r,e,a),w(e,t),s||(o=B(e,"click",n[17]),s=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&l!==(l="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",l),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&Q(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&Q(e,"btn-danger",r[6])},d(r){r&&v(e),s=!1,o()}}}function sE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){y(l,e,s),t||(i=[Ee(He.call(null,e,"Restore")),B(e,"click",n[14])],t=!0)},p:te,d(l){l&&v(e),t=!1,Ie(i)}}}function Ym(n){let e,t,i,l,s=!n[0].primaryKey&&n[0].type!="autodate"&&(!n[8]||!n[10].includes(n[0].name)),o,r=!n[0].primaryKey&&(!n[8]||!n[11].includes(n[0].name)),a,u=!n[8]||!n[12].includes(n[0].name),f,c,d,m;const h=n[20].options,_=It(h,n,n[28],zm);let g=s&&Km(n),k=r&&Jm(n),S=u&&Zm(n);const $=n[20].optionsFooter,T=It($,n,n[28],jm);let O=!n[0]._toDelete&&!n[0].primaryKey&&Gm(n);return{c(){e=b("div"),t=b("div"),_&&_.c(),i=C(),l=b("div"),g&&g.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(M,L){y(M,e,L),w(e,t),_&&_.m(t,null),w(e,i),w(e,l),g&&g.m(l,null),w(l,o),k&&k.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),T&&T.m(l,null),w(l,c),O&&O.m(l,null),m=!0},p(M,L){_&&_.p&&(!m||L[0]&268435648)&&At(_,h,M,M[28],m?Lt(h,M[28],L,eE):Pt(M[28]),zm),L[0]&257&&(s=!M[0].primaryKey&&M[0].type!="autodate"&&(!M[8]||!M[10].includes(M[0].name))),s?g?(g.p(M,L),L[0]&257&&E(g,1)):(g=Km(M),g.c(),E(g,1),g.m(l,o)):g&&(ae(),D(g,1,1,()=>{g=null}),ue()),L[0]&257&&(r=!M[0].primaryKey&&(!M[8]||!M[11].includes(M[0].name))),r?k?(k.p(M,L),L[0]&257&&E(k,1)):(k=Jm(M),k.c(),E(k,1),k.m(l,a)):k&&(ae(),D(k,1,1,()=>{k=null}),ue()),L[0]&257&&(u=!M[8]||!M[12].includes(M[0].name)),u?S?(S.p(M,L),L[0]&257&&E(S,1)):(S=Zm(M),S.c(),E(S,1),S.m(l,f)):S&&(ae(),D(S,1,1,()=>{S=null}),ue()),T&&T.p&&(!m||L[0]&268435648)&&At(T,$,M,M[28],m?Lt($,M[28],L,xO):Pt(M[28]),jm),!M[0]._toDelete&&!M[0].primaryKey?O?(O.p(M,L),L[0]&1&&E(O,1)):(O=Gm(M),O.c(),E(O,1),O.m(l,null)):O&&(ae(),D(O,1,1,()=>{O=null}),ue())},i(M){m||(E(_,M),E(g),E(k),E(S),E(T,M),E(O),M&&tt(()=>{m&&(d||(d=je(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(M){D(_,M),D(g),D(k),D(S),D(T,M),D(O),M&&(d||(d=je(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(M){M&&v(e),_&&_.d(M),g&&g.d(),k&&k.d(),S&&S.d(),T&&T.d(M),O&&O.d(),M&&d&&d.end()}}}function Km(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[oE,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function oE(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),o=W(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[34])},m(m,h){y(m,e,h),e.checked=n[0].required,y(m,i,h),y(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[B(e,"change",n[24]),Ee(u=He.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&(e.checked=m[0].required),h[0]&32&&re(o,m[5]),u&&Nt(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(v(e),v(i),v(l)),c=!1,Ie(d)}}}function Jm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[rE,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function rE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){y(c,e,d),e.checked=n[0].hidden,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[25]),B(e,"change",n[26]),Ee(He.call(null,r,{text:"Hide from the JSON API response and filters."}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].hidden),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function Zm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[aE,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function aE(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=C(),s=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(s,"for",f=n[34])},m(m,h){y(m,e,h),e.checked=n[0].presentable,y(m,l,h),y(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[B(e,"change",n[27]),Ee(He.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),h[0]&1&&(e.checked=m[0].presentable),h[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),h[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(v(e),v(l),v(s)),c=!1,Ie(d)}}}function Gm(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[uE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){y(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(o)}}}function Xm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=B(e,"click",et(n[13])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function uE(n){let e,t,i,l,s,o=!n[0].system&&Xm(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ke(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){y(r,e,a),y(r,t,a),o&&o.m(r,a),y(r,i,a),l||(s=B(e,"click",et(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=Xm(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(v(e),v(t),v(i)),o&&o.d(r),l=!1,s()}}}function fE(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Vm();l=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[nE]},$$scope:{ctx:n}}});const c=n[20].default,d=It(c,n,n[28],Um),m=d||iE();function h(S,$){if(S[0]._toDelete)return sE;if(S[7])return lE}let _=h(n),g=_&&_(n),k=n[7]&&n[4]&&Ym(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),j(l.$$.fragment),s=C(),m&&m.c(),o=C(),g&&g.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[7]&&n[4]),Q(e,"deleted",n[0]._toDelete)},m(S,$){y(S,e,$),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),g&&g.m(t,null),w(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=Vm(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$[0]&268435648)&&At(d,c,S,S[28],u?Lt(c,S[28],$,tE):Pt(S[28]),Um),_===(_=h(S))&&g?g.p(S,$):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&E(k,1)):(k=Ym(S),k.c(),E(k,1),k.m(e,null)):k&&(ae(),D(k,1,1,()=>{k=null}),ue()),(!u||$[0]&1)&&Q(e,"required",S[0].required),(!u||$[0]&144)&&Q(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&Q(e,"deleted",S[0]._toDelete)},i(S){u||(E(l.$$.fragment,S),E(m,S),E(k),S&&tt(()=>{u&&(a||(a=je(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(k),S&&(a||(a=je(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),H(l),m&&m.d(S),g&&g.d(),k&&k.d(),S&&a&&a.end()}}}let Sa=[];function cE(n,e,t){let i,l,s,o,r;Qe(n,yn,Se=>t(19,r=Se));let{$$slots:a={},$$scope:u}=e;const f="f_"+V.randomString(8),c=bt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],_=["password","tokenKey"];let{key:g=""}=e,{field:k=V.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function M(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Yt({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(Se){return V.slugify(Se)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let Se of Sa)Se.id!=f&&Se.collapse()}Zt(()=>(Sa.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{V.removeByKey(Sa,"id",f)}));const F=()=>T==null?void 0:T.focus();function U(Se){ie[Se?"unshift":"push"](()=>{T=Se,t(3,T)})}const J=Se=>{const ge=k.name;t(0,k.name=A(Se.target.value),k),Se.target.value=k.name,c("rename",{oldName:ge,newName:k.name})};function K(){k.required=this.checked,t(0,k)}function x(){k.hidden=this.checked,t(0,k)}const X=Se=>{Se.target.checked&&t(0,k.presentable=!1,k)};function oe(){k.presentable=this.checked,t(0,k)}return n.$$set=Se=>{"key"in Se&&t(1,g=Se.key),"field"in Se&&t(0,k=Se.field),"draggable"in Se&&t(2,S=Se.draggable),"collection"in Se&&t(18,$=Se.collection),"$$scope"in Se&&t(28,u=Se.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,l=!k._toDelete),n.$$.dirty[0]&524290&&t(6,s=!V.isEmpty(V.getNestedVal(r,`fields.${g}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,g,S,T,O,o,s,l,i,c,m,h,_,M,L,I,A,R,$,r,a,F,U,J,K,x,X,oe,u]}class ti extends we{constructor(e){super(),ye(this,e,cE,fE,_e,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function dE(n){let e,t,i,l,s,o;function r(u){n[5](u)}let a={id:n[13],items:n[3],disabled:n[0].system,readonly:!n[12]};return n[2]!==void 0&&(a.keyOfSelected=n[2]),t=new Wn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){y(u,e,f),q(t,e,null),l=!0,s||(o=Ee(He.call(null,e,{text:"Auto set on:",position:"top"})),s=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],Te(()=>i=!1)),t.$set(c)},i(u){l||(E(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&v(e),H(t),s=!1,o()}}}function pE(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[dE,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){y(r,e,a),y(r,t,a),q(i,r,a),y(r,l,a),y(r,s,a),o=!0},p(r,a){const u={};a&4096&&(u.class="form-field form-field-single-multiple-select form-field-autodate-select "+(r[12]?"":"readonly")),a&28677&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),H(i,r)}}}function mE(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[pE,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const Ta=1,$a=2,Ca=3;function hE(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:Ta},{label:"Update",value:$a},{label:"Create/Update",value:Ca}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Ca:o.onUpdate?$a:Ta}function f(g){switch(g){case Ta:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case $a:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Ca:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(g){a=g,t(2,a)}function d(g){o=g,t(0,o)}function m(g){Ne.call(this,n,g)}function h(g){Ne.call(this,n,g)}function _(g){Ne.call(this,n,g)}return n.$$set=g=>{e=ze(ze({},e),Ut(g)),t(4,l=lt(e,i)),"field"in g&&t(0,o=g.field),"key"in g&&t(1,r=g.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,_]}class _E extends we{constructor(e){super(),ye(this,e,hE,mE,_e,{field:0,key:1})}}function gE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function bE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ne.call(this,n,c)}function u(c){Ne.call(this,n,c)}function f(c){Ne.call(this,n,c)}return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class kE extends we{constructor(e){super(),ye(this,e,bE,gE,_e,{field:0,key:1})}}var Oa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],es={_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},no={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},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Zn=function(n){return n===!0?1:0};function Qm(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Ea=function(n){return n instanceof Array?n:[n]};function $n(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function $t(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 Zo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function ov(n,e){if(e(n))return n;if(n.parentNode)return ov(n.parentNode,e)}function Go(n,e){var t=$t("div","numInputWrapper"),i=$t("input","numInput "+n),l=$t("span","arrowUp"),s=$t("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function zn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Ma=function(){},Cr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},vE={D:Ma,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*Zn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Ma,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:Ma,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Sl={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})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return Cr(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(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[Zn(n.getHours()>11)]},M:function(n,e){return Cr(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(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)}},rv=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?no:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},au=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?no:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||es).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var h=void 0,_=[],g=0,k=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),se=Ia(t.config);ee.setHours(se.hours,se.minutes,se.seconds,ee.getMilliseconds()),t.selectedDates=[ee],t.latestSelectedDateObj=ee}Z!==void 0&&Z.type!=="blur"&&cl(Z);var he=t._input.value;c(),Dn(),t._input.value!==he&&t._debouncedChange()}function u(Z,ee){return Z%12+12*Zn(ee===t.l10n.amPM[1])}function f(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,ee=(parseInt(t.minuteElement.value,10)||0)%60,se=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=u(Z,t.amPM.textContent));var he=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Un(t.latestSelectedDateObj,t.config.minDate,!0)===0,qe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Un(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 le=Da(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Oe=Da(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Fe=Da(Z,ee,se);if(Fe>Oe&&Fe=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(se)))}function h(Z){var ee=zn(Z),se=parseInt(ee.value)+(Z.delta||0);(se/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(se.toString()))&&We(se)}function _(Z,ee,se,he){if(ee instanceof Array)return ee.forEach(function(qe){return _(Z,qe,se,he)});if(Z instanceof Array)return Z.forEach(function(qe){return _(qe,ee,se,he)});Z.addEventListener(ee,se,he),t._handlers.push({remove:function(){return Z.removeEventListener(ee,se,he)}})}function g(){Dt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(se){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+se+"]"),function(he){return _(he,"click",t[se])})}),t.isMobile){Sn();return}var Z=Qm(Me,50);if(t._debouncedChange=Qm(g,TE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(se){t.config.mode==="range"&&Ve(zn(se))}),_(t._input,"keydown",Ht),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Ht),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",Rl),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",Mn)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var ee=function(se){return zn(se).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",$),_([t.hourElement,t.minuteElement],["focus","click"],ee),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(se){a(se)})}t.config.allowInput&&_(t._input,"blur",at)}function S(Z,ee){var se=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var qe=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&&(!qe&&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 le=$t("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.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(Z,ee,se,he){var qe=rt(ee,!0),le=$t("span",Z,ee.getDate().toString());return le.dateObj=ee,le.$i=he,le.setAttribute("aria-label",t.formatDate(ee,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&Un(ee,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),qe?(le.tabIndex=-1,ul(ee)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&($n(le,"startRange",t.selectedDates[0]&&Un(ee,t.selectedDates[0],!0)===0),$n(le,"endRange",t.selectedDates[1]&&Un(ee,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(ee)&&!ul(ee)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&he%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(ee)+""),Dt("onDayCreate",le),le}function L(Z){Z.focus(),t.config.mode==="range"&&Ve(Z)}function I(Z){for(var ee=Z>0?0:t.config.showMonths-1,se=Z>0?t.config.showMonths:-1,he=ee;he!=se;he+=Z)for(var qe=t.daysContainer.children[he],le=Z>0?0:qe.children.length-1,Oe=Z>0?qe.children.length:-1,Fe=le;Fe!=Oe;Fe+=Z){var Je=qe.children[Fe];if(Je.className.indexOf("hidden")===-1&&rt(Je.dateObj))return Je}}function A(Z,ee){for(var se=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,he=ee>0?t.config.showMonths:-1,qe=ee>0?1:-1,le=se-t.currentMonth;le!=he;le+=qe)for(var Oe=t.daysContainer.children[le],Fe=se-t.currentMonth===le?Z.$i+ee:ee<0?Oe.children.length-1:0,Je=Oe.children.length,Pe=Fe;Pe>=0&&Pe0?Je:-1);Pe+=qe){var Ge=Oe.children[Pe];if(Ge.className.indexOf("hidden")===-1&&rt(Ge.dateObj)&&Math.abs(Z.$i-Pe)>=Math.abs(ee))return L(Ge)}t.changeMonth(qe),P(I(qe),0)}function P(Z,ee){var se=s(),he=Ze(se||document.body),qe=Z!==void 0?Z:he?se:t.selectedDateElem!==void 0&&Ze(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Ze(t.todayDateElem)?t.todayDateElem:I(ee>0?1:-1);qe===void 0?t._input.focus():he?A(qe,ee):L(qe)}function N(Z,ee){for(var se=(new Date(Z,ee,1).getDay()-t.l10n.firstDayOfWeek+7)%7,he=t.utils.getDaysInMonth((ee-1+12)%12,Z),qe=t.utils.getDaysInMonth(ee,Z),le=window.document.createDocumentFragment(),Oe=t.config.showMonths>1,Fe=Oe?"prevMonthDay hidden":"prevMonthDay",Je=Oe?"nextMonthDay hidden":"nextMonthDay",Pe=he+1-se,Ge=0;Pe<=he;Pe++,Ge++)le.appendChild(M("flatpickr-day "+Fe,new Date(Z,ee-1,Pe),Pe,Ge));for(Pe=1;Pe<=qe;Pe++,Ge++)le.appendChild(M("flatpickr-day",new Date(Z,ee,Pe),Pe,Ge));for(var ft=qe+1;ft<=42-se&&(t.config.showMonths===1||Ge%7!==0);ft++,Ge++)le.appendChild(M("flatpickr-day "+Je,new Date(Z,ee+1,ft%qe),ft,Ge));var Gt=$t("div","dayContainer");return Gt.appendChild(le),Gt}function R(){if(t.daysContainer!==void 0){Zo(t.daysContainer),t.weekNumbers&&Zo(t.weekNumbers);for(var Z=document.createDocumentFragment(),ee=0;ee1||t.config.monthSelectorType!=="dropdown")){var Z=function(he){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&het.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var ee=0;ee<12;ee++)if(Z(ee)){var se=$t("option","flatpickr-monthDropdown-month");se.value=new Date(t.currentYear,ee).getMonth().toString(),se.textContent=Cr(ee,t.config.shorthandCurrentMonth,t.l10n),se.tabIndex=-1,t.currentMonth===ee&&(se.selected=!0),t.monthsDropdownContainer.appendChild(se)}}}function F(){var Z=$t("div","flatpickr-month"),ee=window.document.createDocumentFragment(),se;t.config.showMonths>1||t.config.monthSelectorType==="static"?se=$t("span","cur-month"):(t.monthsDropdownContainer=$t("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Oe){var Fe=zn(Oe),Je=parseInt(Fe.value,10);t.changeMonth(Je-t.currentMonth),Dt("onMonthChange")}),z(),se=t.monthsDropdownContainer);var he=Go("cur-year",{tabindex:"-1"}),qe=he.getElementsByTagName("input")[0];qe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&qe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(qe.setAttribute("max",t.config.maxDate.getFullYear().toString()),qe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=$t("div","flatpickr-current-month");return le.appendChild(se),le.appendChild(he),ee.appendChild(le),Z.appendChild(ee),{container:Z,yearElement:qe,monthElement:se}}function U(){Zo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var ee=F();t.yearElements.push(ee.yearElement),t.monthElements.push(ee.monthElement),t.monthNav.appendChild(ee.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=$t("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=$t("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=$t("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&($n(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&($n(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function K(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Ia(t.config);t.timeContainer=$t("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var ee=$t("span","flatpickr-time-separator",":"),se=Go("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=se.getElementsByTagName("input")[0];var he=Go("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=he.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.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(se),t.timeContainer.appendChild(ee),t.timeContainer.appendChild(he),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var qe=Go("flatpickr-second");t.secondElement=qe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.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($t("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(qe)}return t.config.time_24hr||(t.amPM=$t("span","flatpickr-am-pm",t.l10n.amPM[Zn((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 x(){t.weekdayContainer?Zo(t.weekdayContainer):t.weekdayContainer=$t("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var ee=$t("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(ee)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,ee=xm(t.l10n.weekdays.shorthand);Z>0&&Z({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[V6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[B6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[W6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),_=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Y6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),j(_.$$.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($,T){y($,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(_,t,null),g=!0,k||(S=W(e,"submit",et(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const I={};T&25165840&&(I.$$scope={dirty:T,ctx:$}),f.$set(I);const L={};T&25165888&&(L.$$scope={dirty:T,ctx:$}),m.$set(L);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),_.$set(A)},i($){g||(M(l.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(_.$$.fragment,$),g=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(_.$$.fragment,$),g=!1},d($){$&&v(e),H(l),H(r),H(f),H(m),H(_),k=!1,S()}}}function J6(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Z6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],Q(l,"btn-loading",n[7])},m(c,d){y(c,e,d),w(e,t),y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&Q(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function G6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[Z6],header:[J6],default:[K6]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const fr=15777e3;function X6(n,e,t){let i;const l=bt(),s="apple_secret_"+V.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||fr),Yt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const P=await me.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),tn("Successfully generated client secret."),l("submit",P),o==null||o.hide()}catch(P){me.error(P)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>_(),E=()=>!d;function I(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function L(P){Ne.call(this,n,P)}function A(P){Ne.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,_,m,g,k,S,$,T,O,E,I,L,A]}class Q6 extends we{constructor(e){super(),ye(this,e,X6,G6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function x6(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new Q6({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Generate secret",o=C(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){y(d,e,m),w(e,t),w(e,i),w(e,l),y(d,o,m),q(r,d,m),a=!0,u||(f=W(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),H(r,d),u=!1,f()}}}function e8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){ie[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class t8 extends we{constructor(e){super(),ye(this,e,e8,x6,_e,{key:1,config:0})}}function n8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[0].authURL),y(c,r,d),y(c,a,d),u||(f=W(s,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].authURL&&ce(s,c[0].authURL)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function i8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[0].tokenURL),y(c,r,d),y(c,a,d),u||(f=W(s,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].tokenURL&&ce(s,c[0].tokenURL)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function l8(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[n8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[i8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){y(r,e,a),y(r,t,a),q(i,r,a),y(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(i.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),H(i,r),H(s,r)}}}function s8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authURL=this.value,t(0,l)}function o(){l.tokenURL=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class o8 extends we{constructor(e){super(),ye(this,e,s8,l8,_e,{key:1,config:0})}}function lm(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){y(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function r8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&lm(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=B(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),y(o,e,r),y(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=lm(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&re(l,i)},i:te,o:te,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function a8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class sm extends we{constructor(e){super(),ye(this,e,a8,r8,_e,{item:0})}}const u8=n=>({}),om=n=>({});function f8(n){let e;const t=n[8].afterOptions,i=It(t,n,n[12],om);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&At(i,t,l,l[12],e?Lt(t,l[12],s,u8):Pt(l[12]),om)},i(l){e||(M(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function c8(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[f8]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function d8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=sm}=e,{optionComponent:c=sm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h($){$=V.toArray($,!0);let T=[];for(let O of $){const E=V.findByKey(r,d,O);E&&T.push(E)}$.length&&!T.length||t(0,u=a?T:T[0])}async function _($){let T=V.toArray($,!0).map(O=>O[d]);r.length&&t(6,m=a?T:T[0])}function g($){u=$,t(0,u)}function k($){Ne.call(this,n,$)}function S($){Ne.call(this,n,$)}return n.$$set=$=>{e=ze(ze({},e),Ut($)),t(5,l=lt(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&&h(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,l,m,d,s,g,k,S,o]}class Wn extends we{constructor(e){super(),ye(this,e,d8,c8,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function p8(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(5,s=lt(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ps extends we{constructor(e){super(),ye(this,e,m8,p8,_e,{value:0,separator:1,readonly:2,disabled:3})}}function h8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Display name"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].displayName),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&ce(s,u[0].displayName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function _8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&ce(s,u[0].authURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function g8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].tokenURL),r||(a=W(s,"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(s,"id",o),f&1&&s.value!==u[0].tokenURL&&ce(s,u[0].tokenURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function b8(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("Fetch user info from"),l=C(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function k8(n){let e,t,i,l,s,o,r,a;return l=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[y8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[w8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token + is a direct result of the trusted server code->token exchange response.`,i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){y(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=je(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=je(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),H(l),H(o),u&&r&&r.end()}}}function v8(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[S8,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){y(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=je(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=je(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&v(e),H(t),s&&i&&i.end()}}}function y8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[0].extra.jwksURL),u||(f=[Ee(He.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),W(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&ce(r,c[0].extra.jwksURL)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ie(f)}}}function w8(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ps({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,_){y(h,e,_),w(e,t),w(e,i),w(e,l),y(h,o,_),q(r,h,_),u=!0,f||(c=Ee(He.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,_){(!u||_&8192&&s!==(s=h[13]))&&p(e,"for",s);const g={};_&8192&&(g.id=h[13]),!a&&_&1&&(a=!0,g.value=h[0].extra.issuers,Te(()=>a=!1)),r.$set(g)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),H(r,h),f=!1,c()}}}function S8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].userInfoURL),r||(a=W(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&ce(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function T8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){y(c,e,d),e.checked=n[0].pkce,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[11]),Ee(He.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function $8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[h8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[_8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[g8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[b8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[v8,k8],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),_=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[T8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),j(s.$$.fragment),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),j(_.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),y(T,t,O),y(T,i,O),y(T,l,O),q(s,T,O),y(T,o,O),q(r,T,O),y(T,a,O),q(u,T,O),y(T,f,O),y(T,c,O),S[d].m(c,null),y(T,h,O),q(_,T,O),g=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const I={};O&2&&(I.name=T[1]+".authURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),s.$set(I);const L={};O&2&&(L.name=T[1]+".tokenURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),r.$set(L);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(ae(),D(S[P],1,1,()=>{S[P]=null}),ue(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),_.$set(N)},i(T){g||(M(e.$$.fragment,T),M(s.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(_.$$.fragment,T),g=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(_.$$.fragment,T),g=!1},d(T){T&&(v(t),v(i),v(l),v(o),v(a),v(f),v(c),v(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(_,T)}}}function C8(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;V.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(g){o=g,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(g){n.$$.not_equal(l.extra.issuers,g)&&(l.extra.issuers=g,t(0,l))}function _(){l.pkce=this.checked,t(0,l)}return n.$$set=g=>{"key"in g&&t(1,i=g.key),"config"in g&&t(0,l=g.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,_]}class va extends we{constructor(e){super(),ye(this,e,C8,$8,_e,{key:1,config:0})}}function O8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authURL&&ce(s,u[0].authURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function E8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenURL&&ce(s,u[0].tokenURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function M8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].userInfoURL),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userInfoURL&&ce(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function D8(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[O8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[E8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[M8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=B(n[2]),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){y(f,e,c),w(e,t),y(f,i,c),q(l,f,c),y(f,s,c),q(o,f,c),y(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&re(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(l.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(s),v(r)),H(l,f),H(o,f),H(a,f)}}}function I8(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authURL=this.value,t(0,s)}function u(){s.tokenURL=this.value,t(0,s)}function f(){s.userInfoURL=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class ya extends we{constructor(e){super(),ye(this,e,I8,D8,_e,{key:1,config:0,required:4,title:2})}}const ef=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:t8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:o8},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:ya,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:ya,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:ya,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function rm(n,e,t){const i=n.slice();return i[16]=e[t],i}function am(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){y(o,e,r),i=!0,l||(s=W(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function L8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&am(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ke(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(s,"id",o=n[19]),p(s,"type","text"),p(s,"placeholder","Search provider")},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),ce(s,n[1]),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=W(s,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(s,"id",o),m&2&&s.value!==d[1]&&ce(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=am(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(ae(),D(c,1,1,()=>{c=null}),ue())},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function um(n){let e,t,i,l,s=n[1]!=""&&fm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),s&&s.c(),l=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){y(o,e,r),w(e,t),w(e,i),s&&s.m(e,null),w(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=fm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&v(e),s&&s.d()}}}function fm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[5]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function cm(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){y(l,e,s)},p(l,s){s&8&&!kn(e.src,t="./images/oauth2/"+l[16].logo)&&p(e,"src",t),s&8&&i!==(i=l[16].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function dm(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,_,g,k=e[16].logo&&cm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),k&&k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-lg-6"),this.first=t},m($,T){y($,t,T),w(t,i),w(i,l),k&&k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(t,h),_||(g=W(i,"click",S),_=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=cm(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&re(u,a),T&8&&d!==(d=e[16].key+"")&&re(m,d)},d($){$&&v(t),k&&k.d(),_=!1,g()}}}function A8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[L8,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=de(n[3]);const a=f=>f[16].key;for(let f=0;f!l.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),_=$=>f($);function g($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}function k($){Ne.call(this,n,$)}function S($){Ne.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,l=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||l!==-1)&&t(3,r=c())},[u,o,s,r,f,d,l,a,m,h,_,g,k,S]}class q8 extends we{constructor(e){super(),ye(this,e,F8,R8,_e,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function pm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const l=i[9](i[28].name);return i[29]=l,i}function H8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){y(u,e,f),e.checked=n[0].oauth2.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function j8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function z8(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){y(l,e,s)},p(l,s){s[0]&1&&!kn(e.src,t="./images/oauth2/"+l[29].logo)&&p(e,"src",t),s[0]&1&&i!==(i=l[29].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function mm(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){y(s,e,o),t||(i=[Ee(He.call(null,e,{text:"Edit config",position:"left"})),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,Ie(i)}}}function hm(n,e){var $;let t,i,l,s,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function _(T,O){var E;return(E=T[29])!=null&&E.logo?z8:j8}let g=_(e),k=g(e),S=e[29]&&mm(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),l=b("figure"),k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),S&&S.c(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),Q(i,"error",!V.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){y(T,t,O),w(t,i),w(i,l),k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(i,h),S&&S.m(i,null)},p(T,O){var E,I,L,A;e=T,g===(g=_(e))&&k?k.p(e,O):(k.d(1),k=g(e),k&&(k.c(),k.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&re(u,a),O[0]&1&&d!==(d=e[28].name+"")&&re(m,d),e[29]?S?S.p(e,O):(S=mm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&Q(i,"error",!V.isEmpty((A=(L=(I=e[1])==null?void 0:I.oauth2)==null?void 0:L.providers)==null?void 0:A[e[31]]))},d(T){T&&v(t),k.d(),S&&S.d()}}}function U8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function V8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function _m(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[B8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[W8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[Y8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[K8,({uniqueId:g})=>({27:g}),({uniqueId:g})=>[g?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(g,k){y(g,e,k),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),_=!0},p(g,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:g}),l.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:g}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:g}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:g}),m.$set(O)},i(g){_||(M(l.$$.fragment,g),M(r.$$.fragment,g),M(f.$$.fragment,g),M(m.$$.fragment,g),g&&tt(()=>{_&&(h||(h=je(e,mt,{duration:150},!0)),h.run(1))}),_=!0)},o(g){D(l.$$.fragment,g),D(r.$$.fragment,g),D(f.$$.fragment,g),D(m.$$.fragment,g),g&&(h||(h=je(e,mt,{duration:150},!1)),h.run(0)),_=!1},d(g){g&&v(e),H(l),H(r),H(f),H(m),g&&h&&h.end()}}}function B8(n){let e,t,i,l,s,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:x8,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 full name"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function W8(n){let e,t,i,l,s,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:eO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 avatar"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function Y8(n){let e,t,i,l,s,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:tO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 id"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function K8(n){let e,t,i,l,s,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:nO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ds({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 username"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function J8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,_,g,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[H8,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let I=de(n[0].oauth2.providers);const L=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=B("Optional "),h=B(m),_=B(" create fields map"),g=C(),N.c(),S=C(),R&&R.c(),$=ke(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),y(z,t,F),y(z,i,F);for(let U=0;U{R=null}),ue())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(v(t),v(i),v(u),v(f),v(S),v($)),H(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){y(a,e,u),w(e,t),w(e,i),w(e,s),y(a,o,u),y(a,r,u)},p(a,u){u[0]&128&&re(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&re(s,l),u[0]&128&&Q(e,"label-warning",!a[7]),u[0]&128&&Q(e,"label-info",a[7]>0)},d(a){a&&(v(e),v(o),v(r))}}}function gm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function X8(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?G8:Z8}let a=r(n),u=a(n),f=n[8]&&gm();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[8]?f?d[0]&256&&M(f,1):(f=gm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function Q8(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[X8],default:[J8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(bm))||[]};i=new q8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new z6({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(c,d){q(e,c,d),y(c,t,d),q(i,c,d),y(c,l,d),q(s,c,d),o=!0},p(c,d){var g,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(g=c[0].oauth2)==null?void 0:g.providers)==null?void 0:k.map(bm))||[]),i.$set(h);const _={};s.$set(_)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(v(t),v(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const x8=()=>"",eO=()=>"",tO=()=>"",nO=()=>"",bm=n=>n.name;function iO(n,e,t){let i,l,s;Qe(n,yn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function _(F=[]){var U,J;t(5,m=((U=F==null?void 0:F.filter(K=>a.includes(K.type)&&!r.includes(K.name)))==null?void 0:U.map(K=>K.name))||[]),t(6,h=((J=F==null?void 0:F.filter(K=>u.includes(K.type)&&!r.includes(K.name)))==null?void 0:J.map(K=>K.name))||[])}function g(F){for(let U of ef)if(U.key==F)return U;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,U,J)=>{c==null||c.show(F,U,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var U,J;c.show(F.detail,{},((J=(U=o.oauth2)==null?void 0:U.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const U=F.detail.uiOptions;V.removeByKey(o.oauth2.providers,"name",U.key),t(0,o)},z=F=>{const U=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),V.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:U.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,U;n.$$.dirty[0]&1&&V.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&_(o.fields),n.$$.dirty[0]&2&&t(8,i=!V.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((U=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:U.length)||0)},[o,s,f,c,d,m,h,l,i,g,k,S,$,T,O,E,I,L,A,P,N,R,z]}class lO extends we{constructor(e){super(),ye(this,e,iO,Q8,_e,{collection:0},null,[-1,-1])}}function km(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function sO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&km();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){y(d,e,m),e.checked=n[0].otp.enabled,y(d,i,m),y(d,l,m),w(l,s),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=[W(e,"change",n[4]),W(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[2]?c||(c=km(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(i),v(l),v(r),v(a)),c&&c.d(d),u=!1,Ie(f)}}}function oO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].otp.duration),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.duration&&ce(s,u[0].otp.duration)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function rO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].otp.length),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.length&&ce(s,u[0].otp.length)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function aO(n){let e,t,i,l,s,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[sO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[oO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[rO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),y(f,t,c),y(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(s.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(v(t),v(i)),H(e,f),H(s),H(a)}}}function uO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function fO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function vm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function cO(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?fO:uO}let a=r(n),u=a(n),f=n[1]&&vm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=vm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function dO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[cO],default:[aO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pO(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,l=!V.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class mO extends we{constructor(e){super(),ye(this,e,pO,dO,_e,{collection:0})}}function ym(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function hO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&ym();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},m(d,m){y(d,e,m),e.checked=n[0].passwordAuth.enabled,y(d,i,m),y(d,l,m),w(l,s),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=W(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=ym(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(i),v(l),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function _O(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function gO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[hO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[_O,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function bO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function kO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function wm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function vO(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?kO:bO}let a=r(n),u=a(n),f=n[2]&&wm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&M(f,1):(f=wm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function yO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[vO],default:[gO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function wO(n,e,t){let i,l,s;Qe(n,yn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],_=(d==null?void 0:d.indexes)||[];for(let g of _){const k=V.parseIndex(g);if(!k.unique||k.columns.length!=1||k.columns[0].name=="email")continue;const S=h.find($=>!$.hidden&&$.name.toLowerCase()==k.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!V.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class SO extends we{constructor(e){super(),ye(this,e,wO,yO,_e,{collection:0})}}function Sm(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tm(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Ov(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=B(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,ce(i,i.__value),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){y(h,t,_),w(t,i),i.checked=i.__value===e[2],w(t,s),w(t,o),w(o,a),w(t,f),d||(m=W(i,"change",e[10]),d=!0)},p(h,_){e=h,_&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&v(t),c.r(),d=!1,m()}}}function TO(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[$O,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){y(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=W(e,"submit",et(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(M(t.$$.fragment,a),M(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&v(e),H(t),H(l),o=!1,r()}}}function OO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function EO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],Q(l,"btn-loading",n[4])},m(c,d){y(c,e,d),w(e,t),y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&Q(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function MO(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:[EO],header:[OO],default:[CO]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const wa="last_email_test",$m="email_test_request";function DO(n,e,t){let i;const l=bt(),s="email_test_"+V.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(wa),f=o[0].value,c=!1,d=null;function m(L="",A="",P=""){a=L||"_superusers",t(1,u=A||localStorage.getItem(wa)),t(2,f=P||o[0].value),Yt({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function _(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(wa,u),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest($m),Ci("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,f,{$cancelKey:$m}),tn("Successfully sent test email."),l("submit"),t(4,c=!1),await un(),h()}catch(L){t(4,c=!1),me.error(L)}clearTimeout(d)}}const g=[[]];function k(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const $=()=>_(),T=()=>!c;function O(L){ie[L?"unshift":"push"](()=>{r=L,t(3,r)})}function E(L){Ne.call(this,n,L)}function I(L){Ne.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,_,m,k,g,S,$,T,O,E,I]}class rv extends we{constructor(e){super(),ye(this,e,DO,MO,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Cm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function IO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){y(u,e,f),e.checked=n[0].authAlert.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Om(n){let e,t,i;function l(o){n[12](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new lO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Em(n,e){var a;let t,i,l,s;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new W5({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(u,f){y(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,Te(()=>l=!1)),i.$set(c)},i(u){s||(M(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&v(t),H(i,u)}}}function LO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P=[],N=new Map,R,z,F,U,J,K,x,X,oe,Se,ge;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[IO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function $e(De){n[10](De)}let Ye={};n[0]!==void 0&&(Ye.collection=n[0]),u=new mO({props:Ye}),ie.push(()=>be(u,"collection",$e));function nt(De){n[11](De)}let xe={};n[0]!==void 0&&(xe.collection=n[0]),d=new SO({props:xe}),ie.push(()=>be(d,"collection",nt));let We=!n[1]&&Om(n);function rt(De){n[13](De)}let Ze={};n[0]!==void 0&&(Ze.collection=n[0]),g=new g6({props:Ze}),ie.push(()=>be(g,"collection",rt));let at=de(n[2]);const Ht=De=>De[18].key;for(let De=0;Debe(J,"collection",Ve));let st={};return X=new rv({props:st}),n[17](X),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),c=C(),j(d.$$.fragment),h=C(),We&&We.c(),_=C(),j(g.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",I=C(),L=b("div"),A=b("div");for(let De=0;Def=!1)),u.$set(Ce);const ut={};!m&&Be&1&&(m=!0,ut.collection=De[0],Te(()=>m=!1)),d.$set(ut),De[1]?We&&(ae(),D(We,1,1,()=>{We=null}),ue()):We?(We.p(De,Be),Be&2&&M(We,1)):(We=Om(De),We.c(),M(We,1),We.m(a,_));const qt={};!k&&Be&1&&(k=!0,qt.collection=De[0],Te(()=>k=!1)),g.$set(qt),Be&4&&(at=de(De[2]),ae(),P=yt(P,Be,Ht,1,De,at,N,A,zt,Em,null,Cm),ue());const Le={};!K&&Be&1&&(K=!0,Le.collection=De[0],Te(()=>K=!1)),J.$set(Le);const ot={};X.$set(ot)},i(De){if(!oe){M(o.$$.fragment,De),M(u.$$.fragment,De),M(d.$$.fragment,De),M(We),M(g.$$.fragment,De);for(let Be=0;Bec==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,_,g,k,S,$,T]}class PO extends we{constructor(e){super(),ye(this,e,AO,LO,_e,{collection:0})}}const NO=n=>({dragging:n&4,dragover:n&8}),Mm=n=>({dragging:n[2],dragover:n[3]});function RO(n){let e,t,i,l,s;const o=n[10].default,r=It(o,n,n[9],Mm);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){y(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"dragover",et(n[11])),W(e,"dragleave",et(n[12])),W(e,"dragend",n[13]),W(e,"dragstart",n[14]),W(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&At(r,o,a,a[9],i?Lt(o,a[9],u,NO):Pt(a[9]),Mm),(!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||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,Ie(s)}}}function FO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=bt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const I=E.index<<0;I{t(3,d=!0)},g=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,_,g,k,S,$]}class go extends we{constructor(e){super(),ye(this,e,FO,RO,_e,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Dm(n,e,t){const i=n.slice();return i[27]=e[t],i}function qO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){y(f,e,c),y(f,l,c),y(f,s,c),w(s,o),a||(u=W(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(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function HO(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=jt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){ae();const c=e;D(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],Te(()=>t=!1)),e.$set(c)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function jO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function zO(n){let e,t,i,l;const s=[jO,HO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Im(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[zO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Im(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),r&&r.c(),s=ke()},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),y(a,l,u),r&&r.m(a,u),y(a,s,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=Im(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),H(e,a),H(i,a),r&&r.d(a)}}}function VO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=B(t),l=B(" index")},m(s,o){y(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&re(i,t)},d(s){s&&v(e)}}}function Am(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){y(l,e,s),t||(i=[Ee(He.call(null,e,{text:"Delete",position:"top"})),W(e,"click",n[16])],t=!0)},p:te,d(l){l&&v(e),t=!1,Ie(i)}}}function BO(n){let e,t,i,l,s,o,r=n[5]!=""&&Am(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),Q(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),y(a,e,u),y(a,t,u),y(a,i,u),y(a,l,u),s||(o=[W(t,"click",n[17]),W(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Am(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,Ie(o)}}}function WO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[BO],header:[VO],default:[UO]},$$scope:{ctx:n}};for(let s=0;sx.name==U);K?V.removeByValue(J.columns,K):V.pushUnique(J.columns,{name:U}),t(2,d=V.buildIndex(J))}Zt(async()=>{t(8,_=!0);try{t(7,h=(await Ct(async()=>{const{default:U}=await import("./CodeEditor-pEpUQJ5v.js");return{default:U}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,_=!1)});const E=()=>$(),I=()=>k(),L=()=>T(),A=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=V.buildIndex(l))};function P(U){d=U,t(2,d)}const N=U=>O(U);function R(U){ie[U?"unshift":"push"](()=>{f=U,t(4,f)})}function z(U){Ne.call(this,n,U)}function F(U){Ne.call(this,n,U)}return n.$$set=U=>{e=ze(ze({},e),Ut(U)),t(14,r=lt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,J,K;n.$$.dirty[0]&1&&t(10,i=((J=(U=u==null?void 0:u.fields)==null?void 0:U.filter(x=>!x.toDelete&&x.name!="id"))==null?void 0:J.map(x=>x.name))||[]),n.$$.dirty[0]&4&&t(3,l=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((K=l.columns)==null?void 0:K.map(x=>x.name))||[])},[u,k,d,l,f,c,m,h,_,s,i,$,T,O,r,g,E,I,L,A,P,N,R,z,F]}class KO extends we{constructor(e){super(),ye(this,e,YO,WO,_e,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Pm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=V.parseIndex(i[10]);return i[11]=l,i}function Nm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Rm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Fm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&Nm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;y(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Ee(r=He.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),W(e,"click",c)],a=!0)},p(m,h){var _,g,k,S,$;n=m,n[11].unique?f||(f=Nm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Fm).join(", "))+"")&&re(s,l),h&4&&o!==(o="label link-primary "+((k=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Nt(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,Ie(u)}}}function JO(n){var T,O,E;let e,t,i=(((O=(T=n[0])==null?void 0:T.indexes)==null?void 0:O.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,_,g=de(((E=n[0])==null?void 0:E.indexes)||[]),k=[];for(let I=0;Ibe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=B("Unique constraints and indexes ("),l=B(i),s=B(")"),o=C(),r=b("div");for(let I=0;I+ New index',f=C(),j(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(I,L){y(I,e,L),w(e,t),w(e,l),w(e,s),y(I,o,L),y(I,r,L);for(let A=0;Ad=!1)),c.$set(A)},i(I){m||(M(c.$$.fragment,I),m=!0)},o(I){D(c.$$.fragment,I),m=!1},d(I){I&&(v(e),v(o),v(r),v(f)),dt(k,I),n[6](null),H(c,I),h=!1,_()}}}const Fm=n=>n.name;function ZO(n,e,t){let i;Qe(n,yn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class GO extends we{constructor(e){super(),ye(this,e,ZO,JO,_e,{collection:0})}}function qm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Hm(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent=`${n[5].label}`,s=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){y(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),o||(r=W(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&v(e),o=!1,r()}}}function XO(n){let e,t=de(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class eE extends we{constructor(e){super(),ye(this,e,xO,QO,_e,{class:0})}}const tE=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),jm=n=>({interactive:n[7],hasErrors:n[6]}),nE=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),zm=n=>({interactive:n[7],hasErrors:n[6]}),iE=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Um=n=>({interactive:n[7],hasErrors:n[6]});function Vm(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Bm(n){let e,t;return{c(){e=b("span"),t=B(n[5]),p(e,"class","label label-success")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l[0]&32&&re(t,i[5])},d(i){i&&v(e)}}}function Wm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function lE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Bm(n),_=n[0].hidden&&Wm();return{c(){e=b("div"),h&&h.c(),t=C(),_&&_.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=V.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),Q(l,"txt-disabled",!n[7]||n[0].system),p(u,"type","text"),u.required=!0,u.disabled=f=!n[7]||n[0].system,p(u,"spellcheck","false"),p(u,"placeholder","Field name"),u.value=c=n[0].name,p(u,"title","System field")},m(g,k){y(g,e,k),h&&h.m(e,null),w(e,t),_&&_.m(e,null),y(g,i,k),y(g,l,k),w(l,s),y(g,a,k),y(g,u,k),n[22](u),d||(m=[Ee(r=He.call(null,l,n[0].type+(n[0].system?" (system)":""))),W(l,"click",n[21]),W(u,"input",n[23])],d=!0)},p(g,k){g[0].required?h?h.p(g,k):(h=Bm(g),h.c(),h.m(e,t)):h&&(h.d(1),h=null),g[0].hidden?_||(_=Wm(),_.c(),_.m(e,null)):_&&(_.d(1),_=null),k[0]&1&&o!==(o=V.getFieldTypeIcon(g[0].type))&&p(s,"class",o),r&&Nt(r.update)&&k[0]&1&&r.update.call(null,g[0].type+(g[0].system?" (system)":"")),k[0]&129&&Q(l,"txt-disabled",!g[7]||g[0].system),k[0]&129&&f!==(f=!g[7]||g[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=g[0].name)&&u.value!==c&&(u.value=c)},d(g){g&&(v(e),v(i),v(l),v(a),v(u)),h&&h.d(),_&&_.d(),n[22](null),d=!1,Ie(m)}}}function sE(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function oE(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label",i="Toggle "+n[0].name+" field options"),p(e,"class",l="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),Q(e,"btn-hint",!n[4]&&!n[6]),Q(e,"btn-danger",n[6])},m(r,a){y(r,e,a),w(e,t),s||(o=W(e,"click",n[17]),s=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&l!==(l="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",l),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&Q(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&Q(e,"btn-danger",r[6])},d(r){r&&v(e),s=!1,o()}}}function rE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){y(l,e,s),t||(i=[Ee(He.call(null,e,"Restore")),W(e,"click",n[14])],t=!0)},p:te,d(l){l&&v(e),t=!1,Ie(i)}}}function Ym(n){let e,t,i,l,s=!n[0].primaryKey&&n[0].type!="autodate"&&(!n[8]||!n[10].includes(n[0].name)),o,r=!n[0].primaryKey&&(!n[8]||!n[11].includes(n[0].name)),a,u=!n[8]||!n[12].includes(n[0].name),f,c,d,m;const h=n[20].options,_=It(h,n,n[28],zm);let g=s&&Km(n),k=r&&Jm(n),S=u&&Zm(n);const $=n[20].optionsFooter,T=It($,n,n[28],jm);let O=!n[0]._toDelete&&!n[0].primaryKey&&Gm(n);return{c(){e=b("div"),t=b("div"),_&&_.c(),i=C(),l=b("div"),g&&g.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,I){y(E,e,I),w(e,t),_&&_.m(t,null),w(e,i),w(e,l),g&&g.m(l,null),w(l,o),k&&k.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),T&&T.m(l,null),w(l,c),O&&O.m(l,null),m=!0},p(E,I){_&&_.p&&(!m||I[0]&268435648)&&At(_,h,E,E[28],m?Lt(h,E[28],I,nE):Pt(E[28]),zm),I[0]&257&&(s=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),s?g?(g.p(E,I),I[0]&257&&M(g,1)):(g=Km(E),g.c(),M(g,1),g.m(l,o)):g&&(ae(),D(g,1,1,()=>{g=null}),ue()),I[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,I),I[0]&257&&M(k,1)):(k=Jm(E),k.c(),M(k,1),k.m(l,a)):k&&(ae(),D(k,1,1,()=>{k=null}),ue()),I[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,I),I[0]&257&&M(S,1)):(S=Zm(E),S.c(),M(S,1),S.m(l,f)):S&&(ae(),D(S,1,1,()=>{S=null}),ue()),T&&T.p&&(!m||I[0]&268435648)&&At(T,$,E,E[28],m?Lt($,E[28],I,tE):Pt(E[28]),jm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,I),I[0]&1&&M(O,1)):(O=Gm(E),O.c(),M(O,1),O.m(l,null)):O&&(ae(),D(O,1,1,()=>{O=null}),ue())},i(E){m||(M(_,E),M(g),M(k),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=je(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(_,E),D(g),D(k),D(S),D(T,E),D(O),E&&(d||(d=je(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&v(e),_&&_.d(E),g&&g.d(),k&&k.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function Km(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[aE,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function aE(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),o=B(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[34])},m(m,h){y(m,e,h),e.checked=n[0].required,y(m,i,h),y(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[W(e,"change",n[24]),Ee(u=He.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&(e.checked=m[0].required),h[0]&32&&re(o,m[5]),u&&Nt(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(v(e),v(i),v(l)),c=!1,Ie(d)}}}function Jm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[uE,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function uE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){y(c,e,d),e.checked=n[0].hidden,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[25]),W(e,"change",n[26]),Ee(He.call(null,r,{text:"Hide from the JSON API response and filters."}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].hidden),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function Zm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[fE,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function fE(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=C(),s=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(s,"for",f=n[34])},m(m,h){y(m,e,h),e.checked=n[0].presentable,y(m,l,h),y(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[W(e,"change",n[27]),Ee(He.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),h[0]&1&&(e.checked=m[0].presentable),h[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),h[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(v(e),v(l),v(s)),c=!1,Ie(d)}}}function Gm(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[cE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){y(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(o)}}}function Xm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=W(e,"click",et(n[13])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function cE(n){let e,t,i,l,s,o=!n[0].system&&Xm(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ke(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){y(r,e,a),y(r,t,a),o&&o.m(r,a),y(r,i,a),l||(s=W(e,"click",et(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=Xm(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(v(e),v(t),v(i)),o&&o.d(r),l=!1,s()}}}function dE(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Vm();l=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[lE]},$$scope:{ctx:n}}});const c=n[20].default,d=It(c,n,n[28],Um),m=d||sE();function h(S,$){if(S[0]._toDelete)return rE;if(S[7])return oE}let _=h(n),g=_&&_(n),k=n[7]&&n[4]&&Ym(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),j(l.$$.fragment),s=C(),m&&m.c(),o=C(),g&&g.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[7]&&n[4]),Q(e,"deleted",n[0]._toDelete)},m(S,$){y(S,e,$),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),g&&g.m(t,null),w(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=Vm(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$[0]&268435648)&&At(d,c,S,S[28],u?Lt(c,S[28],$,iE):Pt(S[28]),Um),_===(_=h(S))&&g?g.p(S,$):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&M(k,1)):(k=Ym(S),k.c(),M(k,1),k.m(e,null)):k&&(ae(),D(k,1,1,()=>{k=null}),ue()),(!u||$[0]&1)&&Q(e,"required",S[0].required),(!u||$[0]&144)&&Q(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&Q(e,"deleted",S[0]._toDelete)},i(S){u||(M(l.$$.fragment,S),M(m,S),M(k),S&&tt(()=>{u&&(a||(a=je(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(k),S&&(a||(a=je(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),H(l),m&&m.d(S),g&&g.d(),k&&k.d(),S&&a&&a.end()}}}let Sa=[];function pE(n,e,t){let i,l,s,o,r;Qe(n,yn,Se=>t(19,r=Se));let{$$slots:a={},$$scope:u}=e;const f="f_"+V.randomString(8),c=bt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],_=["password","tokenKey"];let{key:g=""}=e,{field:k=V.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function I(){t(0,k._toDelete=!1,k),Yt({})}function L(){k._toDelete||(N(),c("duplicate"))}function A(Se){return V.slugify(Se)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let Se of Sa)Se.id!=f&&Se.collapse()}Zt(()=>(Sa.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{V.removeByKey(Sa,"id",f)}));const F=()=>T==null?void 0:T.focus();function U(Se){ie[Se?"unshift":"push"](()=>{T=Se,t(3,T)})}const J=Se=>{const ge=k.name;t(0,k.name=A(Se.target.value),k),Se.target.value=k.name,c("rename",{oldName:ge,newName:k.name})};function K(){k.required=this.checked,t(0,k)}function x(){k.hidden=this.checked,t(0,k)}const X=Se=>{Se.target.checked&&t(0,k.presentable=!1,k)};function oe(){k.presentable=this.checked,t(0,k)}return n.$$set=Se=>{"key"in Se&&t(1,g=Se.key),"field"in Se&&t(0,k=Se.field),"draggable"in Se&&t(2,S=Se.draggable),"collection"in Se&&t(18,$=Se.collection),"$$scope"in Se&&t(28,u=Se.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,l=!k._toDelete),n.$$.dirty[0]&524290&&t(6,s=!V.isEmpty(V.getNestedVal(r,`fields.${g}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,g,S,T,O,o,s,l,i,c,m,h,_,E,I,L,A,R,$,r,a,F,U,J,K,x,X,oe,u]}class ti extends we{constructor(e){super(),ye(this,e,pE,dE,_e,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function mE(n){let e,t,i,l,s,o;function r(u){n[5](u)}let a={id:n[13],items:n[3],disabled:n[0].system,readonly:!n[12]};return n[2]!==void 0&&(a.keyOfSelected=n[2]),t=new Wn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){y(u,e,f),q(t,e,null),l=!0,s||(o=Ee(He.call(null,e,{text:"Auto set on:",position:"top"})),s=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],Te(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&v(e),H(t),s=!1,o()}}}function hE(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[mE,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){y(r,e,a),y(r,t,a),q(i,r,a),y(r,l,a),y(r,s,a),o=!0},p(r,a){const u={};a&4096&&(u.class="form-field form-field-single-multiple-select form-field-autodate-select "+(r[12]?"":"readonly")),a&28677&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),H(i,r)}}}function _E(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[hE,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const Ta=1,$a=2,Ca=3;function gE(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:Ta},{label:"Update",value:$a},{label:"Create/Update",value:Ca}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Ca:o.onUpdate?$a:Ta}function f(g){switch(g){case Ta:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case $a:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Ca:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(g){a=g,t(2,a)}function d(g){o=g,t(0,o)}function m(g){Ne.call(this,n,g)}function h(g){Ne.call(this,n,g)}function _(g){Ne.call(this,n,g)}return n.$$set=g=>{e=ze(ze({},e),Ut(g)),t(4,l=lt(e,i)),"field"in g&&t(0,o=g.field),"key"in g&&t(1,r=g.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,_]}class bE extends we{constructor(e){super(),ye(this,e,gE,_E,_e,{field:0,key:1})}}function kE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function vE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ne.call(this,n,c)}function u(c){Ne.call(this,n,c)}function f(c){Ne.call(this,n,c)}return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class yE extends we{constructor(e){super(),ye(this,e,vE,kE,_e,{field:0,key:1})}}var Oa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],es={_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},no={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},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Zn=function(n){return n===!0?1:0};function Qm(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Ea=function(n){return n instanceof Array?n:[n]};function $n(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function $t(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 Zo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function av(n,e){if(e(n))return n;if(n.parentNode)return av(n.parentNode,e)}function Go(n,e){var t=$t("div","numInputWrapper"),i=$t("input","numInput "+n),l=$t("span","arrowUp"),s=$t("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function zn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Ma=function(){},Cr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},wE={D:Ma,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*Zn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Ma,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:Ma,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Sl={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})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return Cr(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(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[Zn(n.getHours()>11)]},M:function(n,e){return Cr(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(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)}},uv=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?no:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},au=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?no:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||es).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var h=void 0,_=[],g=0,k=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),se=Ia(t.config);ee.setHours(se.hours,se.minutes,se.seconds,ee.getMilliseconds()),t.selectedDates=[ee],t.latestSelectedDateObj=ee}Z!==void 0&&Z.type!=="blur"&&cl(Z);var he=t._input.value;c(),Dn(),t._input.value!==he&&t._debouncedChange()}function u(Z,ee){return Z%12+12*Zn(ee===t.l10n.amPM[1])}function f(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,ee=(parseInt(t.minuteElement.value,10)||0)%60,se=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=u(Z,t.amPM.textContent));var he=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Un(t.latestSelectedDateObj,t.config.minDate,!0)===0,qe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Un(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 le=Da(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Oe=Da(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Fe=Da(Z,ee,se);if(Fe>Oe&&Fe=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(se)))}function h(Z){var ee=zn(Z),se=parseInt(ee.value)+(Z.delta||0);(se/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(se.toString()))&&We(se)}function _(Z,ee,se,he){if(ee instanceof Array)return ee.forEach(function(qe){return _(Z,qe,se,he)});if(Z instanceof Array)return Z.forEach(function(qe){return _(qe,ee,se,he)});Z.addEventListener(ee,se,he),t._handlers.push({remove:function(){return Z.removeEventListener(ee,se,he)}})}function g(){Dt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(se){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+se+"]"),function(he){return _(he,"click",t[se])})}),t.isMobile){Sn();return}var Z=Qm(Me,50);if(t._debouncedChange=Qm(g,CE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(se){t.config.mode==="range"&&Ve(zn(se))}),_(t._input,"keydown",Ht),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Ht),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",Rl),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",Mn)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var ee=function(se){return zn(se).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",$),_([t.hourElement,t.minuteElement],["focus","click"],ee),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(se){a(se)})}t.config.allowInput&&_(t._input,"blur",at)}function S(Z,ee){var se=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var qe=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&&(!qe&&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 le=$t("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(Z,ee,se,he){var qe=rt(ee,!0),le=$t("span",Z,ee.getDate().toString());return le.dateObj=ee,le.$i=he,le.setAttribute("aria-label",t.formatDate(ee,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&Un(ee,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),qe?(le.tabIndex=-1,ul(ee)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&($n(le,"startRange",t.selectedDates[0]&&Un(ee,t.selectedDates[0],!0)===0),$n(le,"endRange",t.selectedDates[1]&&Un(ee,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(ee)&&!ul(ee)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&he%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(ee)+""),Dt("onDayCreate",le),le}function I(Z){Z.focus(),t.config.mode==="range"&&Ve(Z)}function L(Z){for(var ee=Z>0?0:t.config.showMonths-1,se=Z>0?t.config.showMonths:-1,he=ee;he!=se;he+=Z)for(var qe=t.daysContainer.children[he],le=Z>0?0:qe.children.length-1,Oe=Z>0?qe.children.length:-1,Fe=le;Fe!=Oe;Fe+=Z){var Je=qe.children[Fe];if(Je.className.indexOf("hidden")===-1&&rt(Je.dateObj))return Je}}function A(Z,ee){for(var se=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,he=ee>0?t.config.showMonths:-1,qe=ee>0?1:-1,le=se-t.currentMonth;le!=he;le+=qe)for(var Oe=t.daysContainer.children[le],Fe=se-t.currentMonth===le?Z.$i+ee:ee<0?Oe.children.length-1:0,Je=Oe.children.length,Pe=Fe;Pe>=0&&Pe0?Je:-1);Pe+=qe){var Ge=Oe.children[Pe];if(Ge.className.indexOf("hidden")===-1&&rt(Ge.dateObj)&&Math.abs(Z.$i-Pe)>=Math.abs(ee))return I(Ge)}t.changeMonth(qe),P(L(qe),0)}function P(Z,ee){var se=s(),he=Ze(se||document.body),qe=Z!==void 0?Z:he?se:t.selectedDateElem!==void 0&&Ze(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Ze(t.todayDateElem)?t.todayDateElem:L(ee>0?1:-1);qe===void 0?t._input.focus():he?A(qe,ee):I(qe)}function N(Z,ee){for(var se=(new Date(Z,ee,1).getDay()-t.l10n.firstDayOfWeek+7)%7,he=t.utils.getDaysInMonth((ee-1+12)%12,Z),qe=t.utils.getDaysInMonth(ee,Z),le=window.document.createDocumentFragment(),Oe=t.config.showMonths>1,Fe=Oe?"prevMonthDay hidden":"prevMonthDay",Je=Oe?"nextMonthDay hidden":"nextMonthDay",Pe=he+1-se,Ge=0;Pe<=he;Pe++,Ge++)le.appendChild(E("flatpickr-day "+Fe,new Date(Z,ee-1,Pe),Pe,Ge));for(Pe=1;Pe<=qe;Pe++,Ge++)le.appendChild(E("flatpickr-day",new Date(Z,ee,Pe),Pe,Ge));for(var ft=qe+1;ft<=42-se&&(t.config.showMonths===1||Ge%7!==0);ft++,Ge++)le.appendChild(E("flatpickr-day "+Je,new Date(Z,ee+1,ft%qe),ft,Ge));var Xt=$t("div","dayContainer");return Xt.appendChild(le),Xt}function R(){if(t.daysContainer!==void 0){Zo(t.daysContainer),t.weekNumbers&&Zo(t.weekNumbers);for(var Z=document.createDocumentFragment(),ee=0;ee1||t.config.monthSelectorType!=="dropdown")){var Z=function(he){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&het.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var ee=0;ee<12;ee++)if(Z(ee)){var se=$t("option","flatpickr-monthDropdown-month");se.value=new Date(t.currentYear,ee).getMonth().toString(),se.textContent=Cr(ee,t.config.shorthandCurrentMonth,t.l10n),se.tabIndex=-1,t.currentMonth===ee&&(se.selected=!0),t.monthsDropdownContainer.appendChild(se)}}}function F(){var Z=$t("div","flatpickr-month"),ee=window.document.createDocumentFragment(),se;t.config.showMonths>1||t.config.monthSelectorType==="static"?se=$t("span","cur-month"):(t.monthsDropdownContainer=$t("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Oe){var Fe=zn(Oe),Je=parseInt(Fe.value,10);t.changeMonth(Je-t.currentMonth),Dt("onMonthChange")}),z(),se=t.monthsDropdownContainer);var he=Go("cur-year",{tabindex:"-1"}),qe=he.getElementsByTagName("input")[0];qe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&qe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(qe.setAttribute("max",t.config.maxDate.getFullYear().toString()),qe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=$t("div","flatpickr-current-month");return le.appendChild(se),le.appendChild(he),ee.appendChild(le),Z.appendChild(ee),{container:Z,yearElement:qe,monthElement:se}}function U(){Zo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var ee=F();t.yearElements.push(ee.yearElement),t.monthElements.push(ee.monthElement),t.monthNav.appendChild(ee.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=$t("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=$t("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=$t("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&($n(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&($n(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function K(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Ia(t.config);t.timeContainer=$t("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var ee=$t("span","flatpickr-time-separator",":"),se=Go("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=se.getElementsByTagName("input")[0];var he=Go("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=he.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.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(se),t.timeContainer.appendChild(ee),t.timeContainer.appendChild(he),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var qe=Go("flatpickr-second");t.secondElement=qe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.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($t("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(qe)}return t.config.time_24hr||(t.amPM=$t("span","flatpickr-am-pm",t.l10n.amPM[Zn((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 x(){t.weekdayContainer?Zo(t.weekdayContainer):t.weekdayContainer=$t("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var ee=$t("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(ee)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,ee=xm(t.l10n.weekdays.shorthand);Z>0&&Z `+ee.join("")+` - `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var Z=$t("div","flatpickr-weekwrapper");Z.appendChild($t("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=$t("div","flatpickr-weeks");return Z.appendChild(ee),{weekWrapper:Z,weekNumbers:ee}}function Se(Z,ee){ee===void 0&&(ee=!0);var se=ee?Z:Z-t.currentMonth;se<0&&t._hidePrevMonthArrow===!0||se>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=se,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),z()),R(),Dt("onMonthChange"),Ui())}function ge(Z,ee){if(Z===void 0&&(Z=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var se=Ia(t.config),he=se.hours,qe=se.minutes,le=se.seconds;m(he,qe,le)}t.redraw(),Z&&Dt("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")),Dt("onClose")}function Ye(){t.config!==void 0&&Dt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].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 ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}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(se){try{delete t[se]}catch{}})}function nt(Z){return t.calendarContainer.contains(Z)}function xe(Z){if(t.isOpen&&!t.config.inline){var ee=zn(Z),se=nt(ee),he=ee===t.input||ee===t.altInput||t.element.contains(ee)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),qe=!he&&!se&&!nt(Z.relatedTarget),le=!t.config.ignoredFocusElements.some(function(Oe){return Oe.contains(ee)});qe&&le&&(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 We(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var ee=Z,se=t.currentYear!==ee;t.currentYear=ee||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)),se&&(t.redraw(),Dt("onYearChange"),z())}}function rt(Z,ee){var se;ee===void 0&&(ee=!0);var he=t.parseDate(Z,void 0,ee);if(t.config.minDate&&he&&Un(he,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&he&&Un(he,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(he===void 0)return!1;for(var qe=!!t.config.enable,le=(se=t.config.enable)!==null&&se!==void 0?se:t.config.disable,Oe=0,Fe=void 0;Oe=Fe.from.getTime()&&he.getTime()<=Fe.to.getTime())return qe}return!qe}function Ze(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function at(Z){var ee=Z.target===t._input,se=t._input.value.trimEnd()!==fl();ee&&se&&!(Z.relatedTarget&&nt(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ht(Z){var ee=zn(Z),se=t.config.wrap?n.contains(ee):ee===t._input,he=t.config.allowInput,qe=t.isOpen&&(!he||!se),le=t.config.inline&&se&&!he;if(Z.keyCode===13&&se){if(he)return t.setDate(t._input.value,!0,ee===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ee.blur();t.open()}else if(nt(ee)||qe||le){var Oe=!!t.timeContainer&&t.timeContainer.contains(ee);switch(Z.keyCode){case 13:Oe?(Z.preventDefault(),a(),on()):Mn(Z);break;case 27:Z.preventDefault(),on();break;case 8:case 46:se&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Oe&&!se){Z.preventDefault();var Fe=s();if(t.daysContainer!==void 0&&(he===!1||Fe&&Ze(Fe))){var Je=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),Se(Je),P(I(1),0)):P(void 0,Je)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Pe=Z.keyCode===40?1:-1;t.daysContainer&&ee.$i!==void 0||ee===t.input||ee===t.altInput?Z.ctrlKey?(Z.stopPropagation(),We(t.currentYear-Pe),P(I(1),0)):Oe||P(void 0,Pe*7):ee===t.currentYearElement?We(t.currentYear-Pe):t.config.enableTime&&(!Oe&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Oe){var Ge=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(mn){return mn}),ft=Ge.indexOf(ee);if(ft!==-1){var Gt=Ge[ft+(Z.shiftKey?-1:1)];Z.preventDefault(),(Gt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ee)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&ee===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dn();break}(se||nt(ee))&&Dt("onKeyDown",Z)}function Ve(Z,ee){if(ee===void 0&&(ee="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(ee)||Z.classList.contains("flatpickr-disabled")))){for(var se=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),he=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),qe=Math.min(se,t.selectedDates[0].getTime()),le=Math.max(se,t.selectedDates[0].getTime()),Oe=!1,Fe=0,Je=0,Pe=qe;Peqe&&PeFe)?Fe=Pe:Pe>he&&(!Je||Pe ."+ee));Ge.forEach(function(ft){var Gt=ft.dateObj,mn=Gt.getTime(),dl=Fe>0&&mn0&&mn>Je;if(dl){ft.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Mi){ft.classList.remove(Mi)});return}else if(Oe&&!dl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Mi){ft.classList.remove(Mi)}),Z!==void 0&&(Z.classList.add(se<=t.selectedDates[0].getTime()?"startRange":"endRange"),hese&&mn===he&&ft.classList.add("endRange"),mn>=Fe&&(Je===0||mn<=Je)&&yE(mn,he,se)&&ft.classList.add("inRange"))})}}function Me(){t.isOpen&&!t.config.static&&!t.config.inline&&ut()}function st(Z,ee){if(ee===void 0&&(ee=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var se=zn(Z);se&&se.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Dt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var he=t.isOpen;t.isOpen=!0,he||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Dt("onOpen"),ut(ee)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function De(Z){return function(ee){var se=t.config["_"+Z+"Date"]=t.parseDate(ee,t.config.dateFormat),he=t.config["_"+(Z==="min"?"max":"min")+"Date"];se!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=se.getHours()>0||se.getMinutes()>0||se.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(qe){return rt(qe)}),!t.selectedDates.length&&Z==="min"&&d(se),Dn()),t.daysContainer&&(ot(),se!==void 0?t.currentYearElement[Z]=se.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!he&&se!==void 0&&he.getFullYear()===se.getFullYear())}}function Be(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ee=_n(_n({},JSON.parse(JSON.stringify(n.dataset||{}))),e),se={};t.config.parseDate=ee.parseDate,t.config.formatDate=ee.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ge){t.config._enable=cn(Ge)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ge){t.config._disable=cn(Ge)}});var he=ee.mode==="time";if(!ee.dateFormat&&(ee.enableTime||he)){var qe=xt.defaultConfig.dateFormat||es.dateFormat;se.dateFormat=ee.noCalendar||he?"H:i"+(ee.enableSeconds?":S":""):qe+" H:i"+(ee.enableSeconds?":S":"")}if(ee.altInput&&(ee.enableTime||he)&&!ee.altFormat){var le=xt.defaultConfig.altFormat||es.altFormat;se.altFormat=ee.noCalendar||he?"h:i"+(ee.enableSeconds?":S K":" K"):le+(" h:i"+(ee.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:De("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:De("max")});var Oe=function(Ge){return function(ft){t.config[Ge==="min"?"_minTime":"_maxTime"]=t.parseDate(ft,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Oe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Oe("max")}),ee.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,se,ee);for(var Fe=0;Fe-1?t.config[Pe]=Ea(Je[Pe]).map(o).concat(t.config[Pe]):typeof ee[Pe]>"u"&&(t.config[Pe]=Je[Pe])}ee.altInputClass||(t.config.altInputClass=ve().className+" "+t.config.altInputClass),Dt("onParseConfig")}function ve(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ce(){typeof t.config.locale!="object"&&typeof xt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=_n(_n({},xt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?xt.l10ns[t.config.locale]:void 0),Sl.D="("+t.l10n.weekdays.shorthand.join("|")+")",Sl.l="("+t.l10n.weekdays.longhand.join("|")+")",Sl.M="("+t.l10n.months.shorthand.join("|")+")",Sl.F="("+t.l10n.months.longhand.join("|")+")",Sl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=_n(_n({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&xt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=rv(t),t.parseDate=au({config:t.config,l10n:t.l10n})}function ut(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){Dt("onPreCalendarPosition");var ee=Z||t._positionElement,se=Array.prototype.reduce.call(t.calendarContainer.children,function(_s,Vr){return _s+Vr.offsetHeight},0),he=t.calendarContainer.offsetWidth,qe=t.config.position.split(" "),le=qe[0],Oe=qe.length>1?qe[1]:null,Fe=ee.getBoundingClientRect(),Je=window.innerHeight-Fe.bottom,Pe=le==="above"||le!=="below"&&Jese,Ge=window.pageYOffset+Fe.top+(Pe?-se-2:ee.offsetHeight+2);if($n(t.calendarContainer,"arrowTop",!Pe),$n(t.calendarContainer,"arrowBottom",Pe),!t.config.inline){var ft=window.pageXOffset+Fe.left,Gt=!1,mn=!1;Oe==="center"?(ft-=(he-Fe.width)/2,Gt=!0):Oe==="right"&&(ft-=he-Fe.width,mn=!0),$n(t.calendarContainer,"arrowLeft",!Gt&&!mn),$n(t.calendarContainer,"arrowCenter",Gt),$n(t.calendarContainer,"arrowRight",mn);var dl=window.document.body.offsetWidth-(window.pageXOffset+Fe.right),Mi=ft+he>window.document.body.offsetWidth,bo=dl+he>window.document.body.offsetWidth;if($n(t.calendarContainer,"rightMost",Mi),!t.config.static)if(t.calendarContainer.style.top=Ge+"px",!Mi)t.calendarContainer.style.left=ft+"px",t.calendarContainer.style.right="auto";else if(!bo)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=dl+"px";else{var Fl=qt();if(Fl===void 0)return;var ko=window.document.body.offsetWidth,hs=Math.max(0,ko/2-he/2),Di=".flatpickr-calendar.centerMost:before",pl=".flatpickr-calendar.centerMost:after",ml=Fl.cssRules.length,ql="{left:"+Fe.left+"px;right:auto;}";$n(t.calendarContainer,"rightMost",!1),$n(t.calendarContainer,"centerMost",!0),Fl.insertRule(Di+","+pl+ql,ml),t.calendarContainer.style.left=hs+"px",t.calendarContainer.style.right="auto"}}}}function qt(){for(var Z=null,ee=0;eet.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=he,t.config.mode==="single")t.selectedDates=[qe];else if(t.config.mode==="multiple"){var Oe=ul(qe);Oe?t.selectedDates.splice(parseInt(Oe),1):t.selectedDates.push(qe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=qe,t.selectedDates.push(qe),Un(qe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ge,ft){return Ge.getTime()-ft.getTime()}));if(c(),le){var Fe=t.currentYear!==qe.getFullYear();t.currentYear=qe.getFullYear(),t.currentMonth=qe.getMonth(),Fe&&(Dt("onYearChange"),z()),Dt("onMonthChange")}if(Ui(),R(),Dn(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?L(he):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 Je=t.config.mode==="single"&&!t.config.enableTime,Pe=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Je||Pe)&&on()}g()}}var Re={locale:[Ce,X],showMonths:[U,r,x],minDate:[S],maxDate:[S],positionElement:[kt],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ft(Z,ee){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var se in Z)Re[se]!==void 0&&Re[se].forEach(function(he){return he()})}else t.config[Z]=ee,Re[Z]!==void 0?Re[Z].forEach(function(he){return he()}):Oa.indexOf(Z)>-1&&(t.config[Z]=Ea(ee));t.redraw(),Dn(!0)}function Vt(Z,ee){var se=[];if(Z instanceof Array)se=Z.map(function(he){return t.parseDate(he,ee)});else if(Z instanceof Date||typeof Z=="number")se=[t.parseDate(Z,ee)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":se=[t.parseDate(Z,ee)];break;case"multiple":se=Z.split(t.config.conjunction).map(function(he){return t.parseDate(he,ee)});break;case"range":se=Z.split(t.l10n.rangeSeparator).map(function(he){return t.parseDate(he,ee)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?se:se.filter(function(he){return he instanceof Date&&rt(he,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(he,qe){return he.getTime()-qe.getTime()})}function wn(Z,ee,se){if(ee===void 0&&(ee=!1),se===void 0&&(se=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(ee);Vt(Z,se),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,ee),d(),t.selectedDates.length===0&&t.clear(!1),Dn(ee),ee&&Dt("onChange")}function cn(Z){return Z.slice().map(function(ee){return typeof ee=="string"||typeof ee=="number"||ee instanceof Date?t.parseDate(ee,void 0,!0):ee&&typeof ee=="object"&&ee.from&&ee.to?{from:t.parseDate(ee.from,void 0),to:t.parseDate(ee.to,void 0)}:ee}).filter(function(ee){return ee})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Vt(Z,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 ii(){if(t.input=ve(),!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=$t(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"),kt()}function kt(){t._positionElement=t.config.positionElement||t._input}function Sn(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=$t("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(ee){t.setDate(zn(ee).value,!1,t.mobileFormatStr),Dt("onChange"),Dt("onClose")})}function ln(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function Dt(Z,ee){if(t.config!==void 0){var se=t.config[Z];if(se!==void 0&&se.length>0)for(var he=0;se[he]&&he=0&&Un(Z,t.selectedDates[1])<=0}function Ui(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,ee){var se=new Date(t.currentYear,t.currentMonth,1);se.setMonth(t.currentMonth+ee),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ee].textContent=Cr(se.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=se.getMonth().toString(),Z.value=se.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 fl(Z){var ee=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(se){return t.formatDate(se,ee)}).filter(function(se,he,qe){return t.config.mode!=="range"||t.config.enableTime||qe.indexOf(se)===he}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dn(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=fl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=fl(t.config.altFormat)),Z!==!1&&Dt("onValueUpdate")}function Rl(Z){var ee=zn(Z),se=t.prevMonthNav.contains(ee),he=t.nextMonthNav.contains(ee);se||he?Se(se?-1:1):t.yearElements.indexOf(ee)>=0?ee.select():ee.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ee.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(Z){Z.preventDefault();var ee=Z.type==="keydown",se=zn(Z),he=se;t.amPM!==void 0&&se===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Zn(t.amPM.textContent===t.l10n.amPM[0])]);var qe=parseFloat(he.getAttribute("min")),le=parseFloat(he.getAttribute("max")),Oe=parseFloat(he.getAttribute("step")),Fe=parseInt(he.value,10),Je=Z.delta||(ee?Z.which===38?1:-1:0),Pe=Fe+Oe*Je;if(typeof he.value<"u"&&he.value.length===2){var Ge=he===t.hourElement,ft=he===t.minuteElement;Pele&&(Pe=he===t.hourElement?Pe-le-Zn(!t.amPM):qe,ft&&T(void 0,1,t.hourElement)),t.amPM&&Ge&&(Oe===1?Pe+Fe===23:Math.abs(Pe-Fe)>Oe)&&(t.amPM.textContent=t.l10n.amPM[Zn(t.amPM.textContent===t.l10n.amPM[0])]),he.value=Ln(Pe)}}return l(),t}function ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function ME(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Zt(()=>{const T=f??h,O=k(d);return O.onReady.push((M,L,I)=>{a===void 0&&S(M,L,I),un().then(()=>{t(8,m=!0)})}),t(3,_=xt(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{_.destroy()}});const g=bt();function k(T={}){T=Object.assign({},T);for(const O of r){const M=(L,I,A)=>{g(EE(O),[L,I,A])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(M)):T[O]=[M]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,O,M){const L=eh(M,T);!th(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function $(T){ie[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=ze(ze({},e),Ut(T)),t(1,l=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,_=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(th(a,eh(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[T,O]of Object.entries(k(d)))_.set(T,O)},[h,l,a,_,u,f,c,d,m,o,s,$]}class tf extends we{constructor(e){super(),ye(this,e,ME,OE,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function DE(n){let e,t,i,l,s,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),s=new tf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],Te(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,Te(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function IE(n){let e,t,i,l,s,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),s=new tf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],Te(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,Te(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function LE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[DE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[IE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){y(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function AE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[LE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function PE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=s==null?void 0:s.min,a=s==null?void 0:s.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,s[O]=T.detail[1],s)}function f(T){r=T,t(2,r),t(0,s)}function c(T){n.$$.not_equal(s.min,T)&&(s.min=T,t(0,s))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,s)}function h(T){n.$$.not_equal(s.max,T)&&(s.max=T,t(0,s))}const _=T=>u(T,"max");function g(T){s=T,t(0,s)}function k(T){Ne.call(this,n,T)}function S(T){Ne.call(this,n,T)}function $(T){Ne.call(this,n,T)}return n.$$set=T=>{e=ze(ze({},e),Ut(T)),t(5,l=lt(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(s==null?void 0:s.min)&&t(2,r=s==null?void 0:s.min),n.$$.dirty&9&&a!=(s==null?void 0:s.max)&&t(3,a=s==null?void 0:s.max)},[s,o,r,a,u,l,f,c,d,m,h,_,g,k,S,$]}class NE extends we{constructor(e){super(),ye(this,e,PE,AE,_e,{field:0,key:1})}}function RE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){y(c,e,d),w(e,t),w(e,i),y(c,s,d),y(c,o,d),u||(f=B(o,"input",n[3]),u=!0)},p(c,d){d&512&&l!==(l=c[9])&&p(e,"for",l),d&512&&r!==(r=c[9])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function FE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){y(c,e,d),e.checked=n[0].convertURLs,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[4]),Ee(He.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].convertURLs),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function qE(n){let e,t,i,l;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[RE,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[FE,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name="fields."+s[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name="fields."+s[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function HE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[qE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function jE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=m=>t(0,s.maxSize=m.target.value<<0,s);function a(){s.convertURLs=this.checked,t(0,s)}function u(m){s=m,t(0,s)}function f(m){Ne.call(this,n,m)}function c(m){Ne.call(this,n,m)}function d(m){Ne.call(this,n,m)}return n.$$set=m=>{e=ze(ze({},e),Ut(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class zE extends we{constructor(e){super(),ye(this,e,jE,HE,_e,{field:0,key:1})}}function UE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!V.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(_.value=n[0].exceptDomains),r=new ps({props:_}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(f,"class","help-block")},m(g,k){y(g,e,k),w(e,t),w(e,i),w(e,l),y(g,o,k),q(r,g,k),y(g,u,k),y(g,f,k),c=!0,d||(m=Ee(He.call(null,l,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,k){(!c||k&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};k&512&&(S.id=g[9]),k&1&&(S.disabled=!V.isEmpty(g[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=g[0].exceptDomains,Te(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){D(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),H(r,g),d=!1,m()}}}function VE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new ps({props:_}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".onlyDomains"),p(f,"class","help-block")},m(g,k){y(g,e,k),w(e,t),w(e,i),w(e,l),y(g,o,k),q(r,g,k),y(g,u,k),y(g,f,k),c=!0,d||(m=Ee(He.call(null,l,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,k){(!c||k&512&&s!==(s=g[9]+".onlyDomains"))&&p(e,"for",s);const S={};k&512&&(S.id=g[9]+".onlyDomains"),k&1&&(S.disabled=!V.isEmpty(g[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=g[0].onlyDomains,Te(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){D(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),H(r,g),d=!1,m()}}}function BE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[UE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[VE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){y(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function WE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[BE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function YE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.exceptDomains,m)&&(s.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.onlyDomains,m)&&(s.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Ne.call(this,n,m)}function c(m){Ne.call(this,n,m)}function d(m){Ne.call(this,n,m)}return n.$$set=m=>{e=ze(ze({},e),Ut(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class av extends we{constructor(e){super(),ye(this,e,YE,WE,_e,{field:0,key:1})}}function KE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=C(),s=b("small"),r=W(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),y(a,s,u),w(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&re(i,t),u&1&&o!==(o=a[0].mimeType+"")&&re(r,o)},i:te,o:te,d(a){a&&(v(e),v(l),v(s))}}}function JE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class nh extends we{constructor(e){super(),ye(this,e,JE,KE,_e,{item:0})}}const ZE=[{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 GE(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XE(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[GE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){y(r,e,a),y(r,t,a),q(i,r,a),y(r,l,a),y(r,s,a),o=!0},p(r,a){const u={};a&16777216&&(u.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),H(i,r)}}}function QE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=C(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),y(f,s,c),y(f,o,c),y(f,r,c),a||(u=[B(e,"click",n[8]),B(i,"click",n[9]),B(s,"click",n[10]),B(r,"click",n[11])],a=!0)},p:te,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,Ie(u)}}}function xE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$;function T(M){n[7](M)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:nh,optionComponent:nh};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new Wn({props:O}),ie.push(()=>be(r,"keyOfSelected",T)),g=new jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[QE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),_=C(),j(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(M,L){y(M,e,L),w(e,t),w(e,i),w(e,l),y(M,o,L),q(r,M,L),y(M,u,L),y(M,f,L),w(f,c),w(c,d),w(c,m),w(c,h),w(c,_),q(g,c,null),k=!0,S||($=Ee(He.call(null,l,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,L){(!k||L&8388608&&s!==(s=M[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=M[23]),L&8&&(I.items=M[3]),!a&&L&1&&(a=!0,I.keyOfSelected=M[0].mimeTypes,Te(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:M}),g.$set(A)},i(M){k||(E(r.$$.fragment,M),E(g.$$.fragment,M),k=!0)},o(M){D(r.$$.fragment,M),D(g.$$.fragment,M),k=!1},d(M){M&&(v(e),v(o),v(u),v(f)),H(r,M),H(g),S=!1,$()}}}function eM(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var Z=$t("div","flatpickr-weekwrapper");Z.appendChild($t("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=$t("div","flatpickr-weeks");return Z.appendChild(ee),{weekWrapper:Z,weekNumbers:ee}}function Se(Z,ee){ee===void 0&&(ee=!0);var se=ee?Z:Z-t.currentMonth;se<0&&t._hidePrevMonthArrow===!0||se>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=se,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),z()),R(),Dt("onMonthChange"),Ui())}function ge(Z,ee){if(Z===void 0&&(Z=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var se=Ia(t.config),he=se.hours,qe=se.minutes,le=se.seconds;m(he,qe,le)}t.redraw(),Z&&Dt("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")),Dt("onClose")}function Ye(){t.config!==void 0&&Dt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].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 ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}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(se){try{delete t[se]}catch{}})}function nt(Z){return t.calendarContainer.contains(Z)}function xe(Z){if(t.isOpen&&!t.config.inline){var ee=zn(Z),se=nt(ee),he=ee===t.input||ee===t.altInput||t.element.contains(ee)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),qe=!he&&!se&&!nt(Z.relatedTarget),le=!t.config.ignoredFocusElements.some(function(Oe){return Oe.contains(ee)});qe&&le&&(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 We(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var ee=Z,se=t.currentYear!==ee;t.currentYear=ee||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)),se&&(t.redraw(),Dt("onYearChange"),z())}}function rt(Z,ee){var se;ee===void 0&&(ee=!0);var he=t.parseDate(Z,void 0,ee);if(t.config.minDate&&he&&Un(he,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&he&&Un(he,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(he===void 0)return!1;for(var qe=!!t.config.enable,le=(se=t.config.enable)!==null&&se!==void 0?se:t.config.disable,Oe=0,Fe=void 0;Oe=Fe.from.getTime()&&he.getTime()<=Fe.to.getTime())return qe}return!qe}function Ze(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function at(Z){var ee=Z.target===t._input,se=t._input.value.trimEnd()!==fl();ee&&se&&!(Z.relatedTarget&&nt(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ht(Z){var ee=zn(Z),se=t.config.wrap?n.contains(ee):ee===t._input,he=t.config.allowInput,qe=t.isOpen&&(!he||!se),le=t.config.inline&&se&&!he;if(Z.keyCode===13&&se){if(he)return t.setDate(t._input.value,!0,ee===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ee.blur();t.open()}else if(nt(ee)||qe||le){var Oe=!!t.timeContainer&&t.timeContainer.contains(ee);switch(Z.keyCode){case 13:Oe?(Z.preventDefault(),a(),on()):Mn(Z);break;case 27:Z.preventDefault(),on();break;case 8:case 46:se&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Oe&&!se){Z.preventDefault();var Fe=s();if(t.daysContainer!==void 0&&(he===!1||Fe&&Ze(Fe))){var Je=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),Se(Je),P(L(1),0)):P(void 0,Je)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Pe=Z.keyCode===40?1:-1;t.daysContainer&&ee.$i!==void 0||ee===t.input||ee===t.altInput?Z.ctrlKey?(Z.stopPropagation(),We(t.currentYear-Pe),P(L(1),0)):Oe||P(void 0,Pe*7):ee===t.currentYearElement?We(t.currentYear-Pe):t.config.enableTime&&(!Oe&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Oe){var Ge=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(mn){return mn}),ft=Ge.indexOf(ee);if(ft!==-1){var Xt=Ge[ft+(Z.shiftKey?-1:1)];Z.preventDefault(),(Xt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ee)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&ee===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dn();break}(se||nt(ee))&&Dt("onKeyDown",Z)}function Ve(Z,ee){if(ee===void 0&&(ee="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(ee)||Z.classList.contains("flatpickr-disabled")))){for(var se=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),he=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),qe=Math.min(se,t.selectedDates[0].getTime()),le=Math.max(se,t.selectedDates[0].getTime()),Oe=!1,Fe=0,Je=0,Pe=qe;Peqe&&PeFe)?Fe=Pe:Pe>he&&(!Je||Pe ."+ee));Ge.forEach(function(ft){var Xt=ft.dateObj,mn=Xt.getTime(),dl=Fe>0&&mn0&&mn>Je;if(dl){ft.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Mi){ft.classList.remove(Mi)});return}else if(Oe&&!dl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Mi){ft.classList.remove(Mi)}),Z!==void 0&&(Z.classList.add(se<=t.selectedDates[0].getTime()?"startRange":"endRange"),hese&&mn===he&&ft.classList.add("endRange"),mn>=Fe&&(Je===0||mn<=Je)&&SE(mn,he,se)&&ft.classList.add("inRange"))})}}function Me(){t.isOpen&&!t.config.static&&!t.config.inline&&ut()}function st(Z,ee){if(ee===void 0&&(ee=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var se=zn(Z);se&&se.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Dt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var he=t.isOpen;t.isOpen=!0,he||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Dt("onOpen"),ut(ee)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function De(Z){return function(ee){var se=t.config["_"+Z+"Date"]=t.parseDate(ee,t.config.dateFormat),he=t.config["_"+(Z==="min"?"max":"min")+"Date"];se!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=se.getHours()>0||se.getMinutes()>0||se.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(qe){return rt(qe)}),!t.selectedDates.length&&Z==="min"&&d(se),Dn()),t.daysContainer&&(ot(),se!==void 0?t.currentYearElement[Z]=se.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!he&&se!==void 0&&he.getFullYear()===se.getFullYear())}}function Be(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ee=_n(_n({},JSON.parse(JSON.stringify(n.dataset||{}))),e),se={};t.config.parseDate=ee.parseDate,t.config.formatDate=ee.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ge){t.config._enable=cn(Ge)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ge){t.config._disable=cn(Ge)}});var he=ee.mode==="time";if(!ee.dateFormat&&(ee.enableTime||he)){var qe=en.defaultConfig.dateFormat||es.dateFormat;se.dateFormat=ee.noCalendar||he?"H:i"+(ee.enableSeconds?":S":""):qe+" H:i"+(ee.enableSeconds?":S":"")}if(ee.altInput&&(ee.enableTime||he)&&!ee.altFormat){var le=en.defaultConfig.altFormat||es.altFormat;se.altFormat=ee.noCalendar||he?"h:i"+(ee.enableSeconds?":S K":" K"):le+(" h:i"+(ee.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:De("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:De("max")});var Oe=function(Ge){return function(ft){t.config[Ge==="min"?"_minTime":"_maxTime"]=t.parseDate(ft,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Oe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Oe("max")}),ee.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,se,ee);for(var Fe=0;Fe-1?t.config[Pe]=Ea(Je[Pe]).map(o).concat(t.config[Pe]):typeof ee[Pe]>"u"&&(t.config[Pe]=Je[Pe])}ee.altInputClass||(t.config.altInputClass=ve().className+" "+t.config.altInputClass),Dt("onParseConfig")}function ve(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ce(){typeof t.config.locale!="object"&&typeof en.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=_n(_n({},en.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?en.l10ns[t.config.locale]:void 0),Sl.D="("+t.l10n.weekdays.shorthand.join("|")+")",Sl.l="("+t.l10n.weekdays.longhand.join("|")+")",Sl.M="("+t.l10n.months.shorthand.join("|")+")",Sl.F="("+t.l10n.months.longhand.join("|")+")",Sl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=_n(_n({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&en.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=uv(t),t.parseDate=au({config:t.config,l10n:t.l10n})}function ut(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){Dt("onPreCalendarPosition");var ee=Z||t._positionElement,se=Array.prototype.reduce.call(t.calendarContainer.children,function(_s,Vr){return _s+Vr.offsetHeight},0),he=t.calendarContainer.offsetWidth,qe=t.config.position.split(" "),le=qe[0],Oe=qe.length>1?qe[1]:null,Fe=ee.getBoundingClientRect(),Je=window.innerHeight-Fe.bottom,Pe=le==="above"||le!=="below"&&Jese,Ge=window.pageYOffset+Fe.top+(Pe?-se-2:ee.offsetHeight+2);if($n(t.calendarContainer,"arrowTop",!Pe),$n(t.calendarContainer,"arrowBottom",Pe),!t.config.inline){var ft=window.pageXOffset+Fe.left,Xt=!1,mn=!1;Oe==="center"?(ft-=(he-Fe.width)/2,Xt=!0):Oe==="right"&&(ft-=he-Fe.width,mn=!0),$n(t.calendarContainer,"arrowLeft",!Xt&&!mn),$n(t.calendarContainer,"arrowCenter",Xt),$n(t.calendarContainer,"arrowRight",mn);var dl=window.document.body.offsetWidth-(window.pageXOffset+Fe.right),Mi=ft+he>window.document.body.offsetWidth,bo=dl+he>window.document.body.offsetWidth;if($n(t.calendarContainer,"rightMost",Mi),!t.config.static)if(t.calendarContainer.style.top=Ge+"px",!Mi)t.calendarContainer.style.left=ft+"px",t.calendarContainer.style.right="auto";else if(!bo)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=dl+"px";else{var Fl=qt();if(Fl===void 0)return;var ko=window.document.body.offsetWidth,hs=Math.max(0,ko/2-he/2),Di=".flatpickr-calendar.centerMost:before",pl=".flatpickr-calendar.centerMost:after",ml=Fl.cssRules.length,ql="{left:"+Fe.left+"px;right:auto;}";$n(t.calendarContainer,"rightMost",!1),$n(t.calendarContainer,"centerMost",!0),Fl.insertRule(Di+","+pl+ql,ml),t.calendarContainer.style.left=hs+"px",t.calendarContainer.style.right="auto"}}}}function qt(){for(var Z=null,ee=0;eet.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=he,t.config.mode==="single")t.selectedDates=[qe];else if(t.config.mode==="multiple"){var Oe=ul(qe);Oe?t.selectedDates.splice(parseInt(Oe),1):t.selectedDates.push(qe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=qe,t.selectedDates.push(qe),Un(qe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ge,ft){return Ge.getTime()-ft.getTime()}));if(c(),le){var Fe=t.currentYear!==qe.getFullYear();t.currentYear=qe.getFullYear(),t.currentMonth=qe.getMonth(),Fe&&(Dt("onYearChange"),z()),Dt("onMonthChange")}if(Ui(),R(),Dn(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?I(he):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 Je=t.config.mode==="single"&&!t.config.enableTime,Pe=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Je||Pe)&&on()}g()}}var Re={locale:[Ce,X],showMonths:[U,r,x],minDate:[S],maxDate:[S],positionElement:[kt],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ft(Z,ee){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var se in Z)Re[se]!==void 0&&Re[se].forEach(function(he){return he()})}else t.config[Z]=ee,Re[Z]!==void 0?Re[Z].forEach(function(he){return he()}):Oa.indexOf(Z)>-1&&(t.config[Z]=Ea(ee));t.redraw(),Dn(!0)}function Vt(Z,ee){var se=[];if(Z instanceof Array)se=Z.map(function(he){return t.parseDate(he,ee)});else if(Z instanceof Date||typeof Z=="number")se=[t.parseDate(Z,ee)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":se=[t.parseDate(Z,ee)];break;case"multiple":se=Z.split(t.config.conjunction).map(function(he){return t.parseDate(he,ee)});break;case"range":se=Z.split(t.l10n.rangeSeparator).map(function(he){return t.parseDate(he,ee)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?se:se.filter(function(he){return he instanceof Date&&rt(he,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(he,qe){return he.getTime()-qe.getTime()})}function wn(Z,ee,se){if(ee===void 0&&(ee=!1),se===void 0&&(se=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(ee);Vt(Z,se),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,ee),d(),t.selectedDates.length===0&&t.clear(!1),Dn(ee),ee&&Dt("onChange")}function cn(Z){return Z.slice().map(function(ee){return typeof ee=="string"||typeof ee=="number"||ee instanceof Date?t.parseDate(ee,void 0,!0):ee&&typeof ee=="object"&&ee.from&&ee.to?{from:t.parseDate(ee.from,void 0),to:t.parseDate(ee.to,void 0)}:ee}).filter(function(ee){return ee})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Vt(Z,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 ii(){if(t.input=ve(),!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=$t(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"),kt()}function kt(){t._positionElement=t.config.positionElement||t._input}function Sn(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=$t("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(ee){t.setDate(zn(ee).value,!1,t.mobileFormatStr),Dt("onChange"),Dt("onClose")})}function ln(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function Dt(Z,ee){if(t.config!==void 0){var se=t.config[Z];if(se!==void 0&&se.length>0)for(var he=0;se[he]&&he=0&&Un(Z,t.selectedDates[1])<=0}function Ui(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,ee){var se=new Date(t.currentYear,t.currentMonth,1);se.setMonth(t.currentMonth+ee),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ee].textContent=Cr(se.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=se.getMonth().toString(),Z.value=se.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 fl(Z){var ee=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(se){return t.formatDate(se,ee)}).filter(function(se,he,qe){return t.config.mode!=="range"||t.config.enableTime||qe.indexOf(se)===he}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dn(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=fl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=fl(t.config.altFormat)),Z!==!1&&Dt("onValueUpdate")}function Rl(Z){var ee=zn(Z),se=t.prevMonthNav.contains(ee),he=t.nextMonthNav.contains(ee);se||he?Se(se?-1:1):t.yearElements.indexOf(ee)>=0?ee.select():ee.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ee.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(Z){Z.preventDefault();var ee=Z.type==="keydown",se=zn(Z),he=se;t.amPM!==void 0&&se===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Zn(t.amPM.textContent===t.l10n.amPM[0])]);var qe=parseFloat(he.getAttribute("min")),le=parseFloat(he.getAttribute("max")),Oe=parseFloat(he.getAttribute("step")),Fe=parseInt(he.value,10),Je=Z.delta||(ee?Z.which===38?1:-1:0),Pe=Fe+Oe*Je;if(typeof he.value<"u"&&he.value.length===2){var Ge=he===t.hourElement,ft=he===t.minuteElement;Pele&&(Pe=he===t.hourElement?Pe-le-Zn(!t.amPM):qe,ft&&T(void 0,1,t.hourElement)),t.amPM&&Ge&&(Oe===1?Pe+Fe===23:Math.abs(Pe-Fe)>Oe)&&(t.amPM.textContent=t.l10n.amPM[Zn(t.amPM.textContent===t.l10n.amPM[0])]),he.value=Ln(Pe)}}return l(),t}function ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function IE(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Zt(()=>{const T=f??h,O=k(d);return O.onReady.push((E,I,L)=>{a===void 0&&S(E,I,L),un().then(()=>{t(8,m=!0)})}),t(3,_=en(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{_.destroy()}});const g=bt();function k(T={}){T=Object.assign({},T);for(const O of r){const E=(I,L,A)=>{g(DE(O),[I,L,A])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(E)):T[O]=[E]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,O,E){const I=eh(E,T);!th(a,I)&&(a||I)&&t(2,a=I),t(4,u=O)}function $(T){ie[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=ze(ze({},e),Ut(T)),t(1,l=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,_=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(th(a,eh(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[T,O]of Object.entries(k(d)))_.set(T,O)},[h,l,a,_,u,f,c,d,m,o,s,$]}class tf extends we{constructor(e){super(),ye(this,e,IE,ME,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function LE(n){let e,t,i,l,s,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),s=new tf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=B("Min date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],Te(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,Te(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function AE(n){let e,t,i,l,s,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),s=new tf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=B("Max date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],Te(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,Te(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function PE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[LE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[AE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){y(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function NE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[PE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function RE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=s==null?void 0:s.min,a=s==null?void 0:s.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,s[O]=T.detail[1],s)}function f(T){r=T,t(2,r),t(0,s)}function c(T){n.$$.not_equal(s.min,T)&&(s.min=T,t(0,s))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,s)}function h(T){n.$$.not_equal(s.max,T)&&(s.max=T,t(0,s))}const _=T=>u(T,"max");function g(T){s=T,t(0,s)}function k(T){Ne.call(this,n,T)}function S(T){Ne.call(this,n,T)}function $(T){Ne.call(this,n,T)}return n.$$set=T=>{e=ze(ze({},e),Ut(T)),t(5,l=lt(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(s==null?void 0:s.min)&&t(2,r=s==null?void 0:s.min),n.$$.dirty&9&&a!=(s==null?void 0:s.max)&&t(3,a=s==null?void 0:s.max)},[s,o,r,a,u,l,f,c,d,m,h,_,g,k,S,$]}class FE extends we{constructor(e){super(),ye(this,e,RE,NE,_e,{field:0,key:1})}}function qE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){y(c,e,d),w(e,t),w(e,i),y(c,s,d),y(c,o,d),u||(f=W(o,"input",n[3]),u=!0)},p(c,d){d&512&&l!==(l=c[9])&&p(e,"for",l),d&512&&r!==(r=c[9])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function HE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){y(c,e,d),e.checked=n[0].convertURLs,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[4]),Ee(He.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].convertURLs),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function jE(n){let e,t,i,l;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[qE,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[HE,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name="fields."+s[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name="fields."+s[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function zE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[jE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function UE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=m=>t(0,s.maxSize=m.target.value<<0,s);function a(){s.convertURLs=this.checked,t(0,s)}function u(m){s=m,t(0,s)}function f(m){Ne.call(this,n,m)}function c(m){Ne.call(this,n,m)}function d(m){Ne.call(this,n,m)}return n.$$set=m=>{e=ze(ze({},e),Ut(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class VE extends we{constructor(e){super(),ye(this,e,UE,zE,_e,{field:0,key:1})}}function BE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!V.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(_.value=n[0].exceptDomains),r=new ps({props:_}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(f,"class","help-block")},m(g,k){y(g,e,k),w(e,t),w(e,i),w(e,l),y(g,o,k),q(r,g,k),y(g,u,k),y(g,f,k),c=!0,d||(m=Ee(He.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,k){(!c||k&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};k&512&&(S.id=g[9]),k&1&&(S.disabled=!V.isEmpty(g[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=g[0].exceptDomains,Te(()=>a=!1)),r.$set(S)},i(g){c||(M(r.$$.fragment,g),c=!0)},o(g){D(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),H(r,g),d=!1,m()}}}function WE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new ps({props:_}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".onlyDomains"),p(f,"class","help-block")},m(g,k){y(g,e,k),w(e,t),w(e,i),w(e,l),y(g,o,k),q(r,g,k),y(g,u,k),y(g,f,k),c=!0,d||(m=Ee(He.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,k){(!c||k&512&&s!==(s=g[9]+".onlyDomains"))&&p(e,"for",s);const S={};k&512&&(S.id=g[9]+".onlyDomains"),k&1&&(S.disabled=!V.isEmpty(g[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=g[0].onlyDomains,Te(()=>a=!1)),r.$set(S)},i(g){c||(M(r.$$.fragment,g),c=!0)},o(g){D(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),H(r,g),d=!1,m()}}}function YE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[BE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[WE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){y(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function KE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[YE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function JE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.exceptDomains,m)&&(s.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.onlyDomains,m)&&(s.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Ne.call(this,n,m)}function c(m){Ne.call(this,n,m)}function d(m){Ne.call(this,n,m)}return n.$$set=m=>{e=ze(ze({},e),Ut(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class fv extends we{constructor(e){super(),ye(this,e,JE,KE,_e,{field:0,key:1})}}function ZE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=B(t),l=C(),s=b("small"),r=B(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),y(a,s,u),w(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&re(i,t),u&1&&o!==(o=a[0].mimeType+"")&&re(r,o)},i:te,o:te,d(a){a&&(v(e),v(l),v(s))}}}function GE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class nh extends we{constructor(e){super(),ye(this,e,GE,ZE,_e,{item:0})}}const XE=[{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 QE(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xE(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[QE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){y(r,e,a),y(r,t,a),q(i,r,a),y(r,l,a),y(r,s,a),o=!0},p(r,a){const u={};a&16777216&&(u.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),H(i,r)}}}function eM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=C(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),y(f,s,c),y(f,o,c),y(f,r,c),a||(u=[W(e,"click",n[8]),W(i,"click",n[9]),W(s,"click",n[10]),W(r,"click",n[11])],a=!0)},p:te,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,Ie(u)}}}function tM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:nh,optionComponent:nh};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new Wn({props:O}),ie.push(()=>be(r,"keyOfSelected",T)),g=new jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[eM]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),_=C(),j(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,I){y(E,e,I),w(e,t),w(e,i),w(e,l),y(E,o,I),q(r,E,I),y(E,u,I),y(E,f,I),w(f,c),w(c,d),w(c,m),w(c,h),w(c,_),q(g,c,null),k=!0,S||($=Ee(He.call(null,l,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,I){(!k||I&8388608&&s!==(s=E[23]))&&p(e,"for",s);const L={};I&8388608&&(L.id=E[23]),I&8&&(L.items=E[3]),!a&&I&1&&(a=!0,L.keyOfSelected=E[0].mimeTypes,Te(()=>a=!1)),r.$set(L);const A={};I&33554433&&(A.$$scope={dirty:I,ctx:E}),g.$set(A)},i(E){k||(M(r.$$.fragment,E),M(g.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(g.$$.fragment,E),k=!1},d(E){E&&(v(e),v(o),v(u),v(f)),H(r,E),H(g),S=!1,$()}}}function nM(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (e.g. 100x50) - crop to WxH viewbox (from center)
  • WxHt (e.g. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (e.g. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (e.g. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (e.g. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (e.g. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function tM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O;function M(I){n[12](I)}let L={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(L.value=n[0].thumbs),r=new ps({props:L}),ie.push(()=>be(r,"value",M)),S=new jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[eM]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=C(),g=b("i"),k=C(),j(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){y(I,e,A),w(e,t),w(e,i),w(e,l),y(I,o,A),q(r,I,A),y(I,u,A),y(I,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,_),w(m,g),w(m,k),q(S,m,null),$=!0,T||(O=Ee(He.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!$||A&8388608&&s!==(s=I[23]))&&p(e,"for",s);const P={};A&8388608&&(P.id=I[23]),!a&&A&1&&(a=!0,P.value=I[0].thumbs,Te(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){$||(E(r.$$.fragment,I),E(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(v(e),v(o),v(u),v(f)),H(r,I),H(S),T=!1,O()}}}function nM(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),l=C(),s=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),s.value=r=n[0].maxSize||"",p(s,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),y(d,a,m),y(d,u,m),f||(c=B(s,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(s,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&s.value!==r&&(s.value=r)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function ih(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[iM,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function iM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0,p(s,"placeholder","Default to single")},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].maxSelect),r||(a=B(s,"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(s,"id",o),f&1&>(s.value)!==u[0].maxSelect&&ce(s,u[0].maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function lM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible - (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){y(c,e,d),e.checked=n[0].protected,y(c,i,d),y(c,l,d),w(l,s),y(c,r,d),y(c,a,d),u||(f=B(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function sM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[xE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[tM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[nM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let g=!n[2]&&ih(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[lM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),d=C(),g&&g.c(),m=C(),j(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"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(k,S){y(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,a),w(e,u),q(f,u,null),w(e,d),g&&g.m(e,null),w(e,m),q(h,e,null),_=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!_||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!_||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?g&&(ae(),D(g,1,1,()=>{g=null}),ue()):g?(g.p(k,S),S&4&&E(g,1)):(g=ih(k),g.c(),E(g,1),g.m(e,m));const M={};S&2&&(M.name="fields."+k[1]+".protected"),S&41943041&&(M.$$scope={dirty:S,ctx:k}),h.$set(M)},i(k){_||(E(i.$$.fragment,k),E(o.$$.fragment,k),E(f.$$.fragment,k),E(g),E(h.$$.fragment,k),_=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(g),D(h.$$.fragment,k),_=!1},d(k){k&&v(e),H(i),H(o),H(f),g&&g.d(),H(h)}}}function oM(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[sM],default:[XE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function rM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=ZE.slice(),u=s.maxSelect<=1,f=u;function c(){t(0,s.maxSelect=1,s),t(0,s.thumbs=[],s),t(0,s.mimeTypes=[],s),t(2,u=!0),t(6,f=u)}function d(){if(V.isEmpty(s.mimeTypes))return;const N=[];for(const R of s.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(s.mimeTypes,N)&&(s.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},_=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},g=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},k=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function S(N){n.$$.not_equal(s.thumbs,N)&&(s.thumbs=N,t(0,s),t(6,f),t(2,u))}const $=N=>t(0,s.maxSize=N.target.value<<0,s);function T(){s.maxSelect=gt(this.value),t(0,s),t(6,f),t(2,u)}function O(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function M(N){u=N,t(2,u)}function L(N){s=N,t(0,s),t(6,f),t(2,u)}function I(N){Ne.call(this,n,N)}function A(N){Ne.call(this,n,N)}function P(N){Ne.call(this,n,N)}return n.$$set=N=>{e=ze(ze({},e),Ut(N)),t(5,l=lt(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,s.maxSelect=1,s):t(0,s.maxSelect=99,s)),n.$$.dirty&1&&(typeof s.maxSelect>"u"?c():d())},[s,o,u,a,r,l,f,m,h,_,g,k,S,$,T,O,M,L,I,A,P]}class aM extends we{constructor(e){super(),ye(this,e,rM,oM,_e,{field:0,key:1})}}function uM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){y(c,e,d),w(e,t),w(e,i),y(c,s,d),y(c,o,d),u||(f=B(o,"input",n[4]),u=!0)},p(c,d){d&1024&&l!==(l=c[10])&&p(e,"for",l),d&1024&&r!==(r=c[10])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function fM(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function cM(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function lh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L='"{"a":1,"b":2}"',I,A,P,N,R,z,F,U,J,K,x,X,oe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=W("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=W(` and - `),r=b("code"),r.textContent="multipart/form-data",a=W(` - requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=W(` field + (e.g. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function iM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O;function E(L){n[12](L)}let I={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(I.value=n[0].thumbs),r=new ps({props:I}),ie.push(()=>be(r,"value",E)),S=new jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[nM]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=C(),g=b("i"),k=C(),j(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(L,A){y(L,e,A),w(e,t),w(e,i),w(e,l),y(L,o,A),q(r,L,A),y(L,u,A),y(L,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,_),w(m,g),w(m,k),q(S,m,null),$=!0,T||(O=Ee(He.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(L,A){(!$||A&8388608&&s!==(s=L[23]))&&p(e,"for",s);const P={};A&8388608&&(P.id=L[23]),!a&&A&1&&(a=!0,P.value=L[0].thumbs,Te(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:L}),S.$set(N)},i(L){$||(M(r.$$.fragment,L),M(S.$$.fragment,L),$=!0)},o(L){D(r.$$.fragment,L),D(S.$$.fragment,L),$=!1},d(L){L&&(v(e),v(o),v(u),v(f)),H(r,L),H(S),T=!1,O()}}}function lM(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Max file size"),l=C(),s=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),s.value=r=n[0].maxSize||"",p(s,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),y(d,a,m),y(d,u,m),f||(c=W(s,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(s,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&s.value!==r&&(s.value=r)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function ih(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[sM,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function sM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0,p(s,"placeholder","Default to single")},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].maxSelect),r||(a=W(s,"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(s,"id",o),f&1&>(s.value)!==u[0].maxSelect&&ce(s,u[0].maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible + (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){y(c,e,d),e.checked=n[0].protected,y(c,i,d),y(c,l,d),w(l,s),y(c,r,d),y(c,a,d),u||(f=W(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function rM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[tM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[iM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[lM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let g=!n[2]&&ih(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[oM,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),d=C(),g&&g.c(),m=C(),j(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"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(k,S){y(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,a),w(e,u),q(f,u,null),w(e,d),g&&g.m(e,null),w(e,m),q(h,e,null),_=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!_||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!_||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?g&&(ae(),D(g,1,1,()=>{g=null}),ue()):g?(g.p(k,S),S&4&&M(g,1)):(g=ih(k),g.c(),M(g,1),g.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){_||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(g),M(h.$$.fragment,k),_=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(g),D(h.$$.fragment,k),_=!1},d(k){k&&v(e),H(i),H(o),H(f),g&&g.d(),H(h)}}}function aM(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[rM],default:[xE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function uM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=XE.slice(),u=s.maxSelect<=1,f=u;function c(){t(0,s.maxSelect=1,s),t(0,s.thumbs=[],s),t(0,s.mimeTypes=[],s),t(2,u=!0),t(6,f=u)}function d(){if(V.isEmpty(s.mimeTypes))return;const N=[];for(const R of s.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(s.mimeTypes,N)&&(s.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},_=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},g=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},k=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function S(N){n.$$.not_equal(s.thumbs,N)&&(s.thumbs=N,t(0,s),t(6,f),t(2,u))}const $=N=>t(0,s.maxSize=N.target.value<<0,s);function T(){s.maxSelect=gt(this.value),t(0,s),t(6,f),t(2,u)}function O(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function I(N){s=N,t(0,s),t(6,f),t(2,u)}function L(N){Ne.call(this,n,N)}function A(N){Ne.call(this,n,N)}function P(N){Ne.call(this,n,N)}return n.$$set=N=>{e=ze(ze({},e),Ut(N)),t(5,l=lt(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,s.maxSelect=1,s):t(0,s.maxSelect=99,s)),n.$$.dirty&1&&(typeof s.maxSelect>"u"?c():d())},[s,o,u,a,r,l,f,m,h,_,g,k,S,$,T,O,E,I,L,A,P]}class fM extends we{constructor(e){super(),ye(this,e,uM,aM,_e,{field:0,key:1})}}function cM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){y(c,e,d),w(e,t),w(e,i),y(c,s,d),y(c,o,d),u||(f=W(o,"input",n[4]),u=!0)},p(c,d){d&1024&&l!==(l=c[10])&&p(e,"for",l),d&1024&&r!==(r=c[10])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function dM(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function pM(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function lh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I='"{"a":1,"b":2}"',L,A,P,N,R,z,F,U,J,K,x,X,oe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=B("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=B(` and + `),r=b("code"),r.textContent="multipart/form-data",a=B(` + requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=B(` field is a - `),c=b("strong"),c.textContent="plain string",d=W(`: - `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",_=C(),g=b("li"),g.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),M=b("li"),I=W(L),A=W(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",U=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",K=W(` + `),c=b("strong"),c.textContent="plain string",d=B(`: + `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",_=C(),g=b("li"),g.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),E=b("li"),L=B(I),A=B(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",U=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",K=B(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),x=b("code"),x.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Se,ge){y(Se,e,ge),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(m,h),w(m,_),w(m,g),w(m,k),w(m,S),w(m,$),w(m,T),w(m,O),w(m,M),w(M,I),w(M,A),w(M,P),w(m,N),w(m,R),w(m,z),w(m,F),w(m,U),w(m,J),w(i,K),w(i,x),oe=!0},i(Se){oe||(Se&&tt(()=>{oe&&(X||(X=je(e,mt,{duration:150},!0)),X.run(1))}),oe=!0)},o(Se){Se&&(X||(X=je(e,mt,{duration:150},!1)),X.run(0)),oe=!1},d(Se){Se&&v(e),Se&&X&&X.end()}}}function dM(n){let e,t,i,l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[uM,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}});function d(g,k){return g[2]?cM:fM}let m=d(n),h=m(n),_=n[2]&&lh();return{c(){j(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),_&&_.c(),a=ke(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,k){q(e,g,k),y(g,t,k),y(g,i,k),w(i,l),w(i,s),h.m(i,null),y(g,r,k),_&&_.m(g,k),y(g,a,k),u=!0,f||(c=B(i,"click",n[5]),f=!0)},p(g,k){const S={};k&2&&(S.name="fields."+g[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?k&4&&E(_,1):(_=lh(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(ae(),D(_,1,1,()=>{_=null}),ue())},i(g){u||(E(e.$$.fragment,g),E(_),u=!0)},o(g){D(e.$$.fragment,g),D(_),u=!1},d(g){g&&(v(t),v(i),v(r),v(a)),H(e,g),h.d(),_&&_.d(g),f=!1,c()}}}function pM(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[dM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Rt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function mM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=h=>t(0,s.maxSize=h.target.value<<0,s),u=()=>{t(2,r=!r)};function f(h){s=h,t(0,s)}function c(h){Ne.call(this,n,h)}function d(h){Ne.call(this,n,h)}function m(h){Ne.call(this,n,h)}return n.$$set=h=>{e=ze(ze({},e),Ut(h)),t(3,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,r,l,a,u,f,c,d,m]}class hM extends we{constructor(e){super(),ye(this,e,mM,pM,_e,{field:0,key:1})}}function _M(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].min),r||(a=B(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&>(s.value)!==u[0].min&&ce(s,u[0].min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function gM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].min)},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),ce(s,n[0].max),a||(u=B(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].min)&&p(s,"min",r),c&1&>(s.value)!==f[0].max&&ce(s,f[0].max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function bM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[_M,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[gM,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){y(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function kM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){y(c,e,d),e.checked=n[0].onlyInt,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[3]),Ee(He.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].onlyInt),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function vM(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[kM,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".onlyInt"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[vM],options:[bM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function wM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){s.onlyInt=this.checked,t(0,s)}function a(){s.min=gt(this.value),t(0,s)}function u(){s.max=gt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Ne.call(this,n,h)}function d(h){Ne.call(this,n,h)}function m(h){Ne.call(this,n,h)}return n.$$set=h=>{e=ze(ze({},e),Ut(h)),t(2,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,u,f,c,d,m]}class SM extends we{constructor(e){super(),ye(this,e,wM,yM,_e,{field:0,key:1})}}function TM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Min length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].min||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=B(s,"input",n[3]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].min||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function $M(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"placeholder","Up to 71 chars"),p(s,"min",r=n[0].min||0),p(s,"max","71"),s.value=a=n[0].max||""},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),u||(f=B(s,"input",n[4]),u=!0)},p(c,d){d&4096&&i!==(i=c[12])&&p(e,"for",i),d&4096&&o!==(o=c[12])&&p(s,"id",o),d&1&&r!==(r=c[0].min||0)&&p(s,"min",r),d&1&&a!==(a=c[0].max||"")&&s.value!==a&&(s.value=a)},d(c){c&&(v(e),v(l),v(s)),u=!1,f()}}}function CM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Bcrypt cost"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"placeholder","Default to 10"),p(s,"step","1"),p(s,"min","6"),p(s,"max","31"),s.value=r=n[0].cost||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=B(s,"input",n[5]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].cost||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function OM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Validation pattern"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","text"),p(s,"id",o=n[12]),p(s,"placeholder","ex. ^\\w+$")},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].pattern),r||(a=B(s,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(s,"id",o),f&1&&s.value!==u[0].pattern&&ce(s,u[0].pattern)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function EM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[TM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[$M,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[CM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[OM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,_){y(h,e,_),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,_){const g={};_&2&&(g.name="fields."+h[1]+".min"),_&12289&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const k={};_&2&&(k.name="fields."+h[1]+".max"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const S={};_&2&&(S.name="fields."+h[1]+".cost"),_&12289&&(S.$$scope={dirty:_,ctx:h}),u.$set(S);const $={};_&2&&($.name="fields."+h[1]+".pattern"),_&12289&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),E(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&v(e),H(i),H(o),H(u),H(d)}}}function MM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[EM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function DM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.cost=11,s)}const a=g=>t(0,s.min=g.target.value<<0,s),u=g=>t(0,s.max=g.target.value<<0,s),f=g=>t(0,s.cost=g.target.value<<0,s);function c(){s.pattern=this.value,t(0,s)}function d(g){s=g,t(0,s)}function m(g){Ne.call(this,n,g)}function h(g){Ne.call(this,n,g)}function _(g){Ne.call(this,n,g)}return n.$$set=g=>{e=ze(ze({},e),Ut(g)),t(2,l=lt(e,i)),"field"in g&&t(0,s=g.field),"key"in g&&t(1,o=g.key)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,_]}class IM extends we{constructor(e){super(),ye(this,e,DM,MM,_e,{field:0,key:1})}}function LM(n){let e,t,i,l,s;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=B(i,"click",n[14]),l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function AM(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[LM]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function PM(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function NM(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[AM,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[PM,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){y(c,e,d),y(c,t,d),q(i,c,d),y(c,l,d),y(c,s,d),y(c,o,d),q(r,c,d),y(c,a,d),y(c,u,d),f=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(E(i.$$.fragment,c),E(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),H(i,c),H(r,c)}}}function sh(n){let e,t,i,l,s,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[RM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[FM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),j(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){y(r,e,a),q(t,e,null),y(r,i,a),y(r,l,a),q(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),H(t),H(s)}}}function RM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Min select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].minSelect||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=B(s,"input",n[11]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function FM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","Default to single"),p(s,"min",r=n[0].minSelect||1)},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),ce(s,n[0].maxSelect),a||(u=B(s,"input",n[12]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(s,"min",r),c&1&>(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function qM(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new Wn({props:h}),ie.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),l=b("i"),r=C(),j(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var k,S;y(_,e,g),w(e,t),w(e,i),w(e,l),y(_,r,g),q(a,_,g),f=!0,c||(d=Ee(s=He.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + data inside an object, eg.`),x=b("code"),x.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Se,ge){y(Se,e,ge),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(m,h),w(m,_),w(m,g),w(m,k),w(m,S),w(m,$),w(m,T),w(m,O),w(m,E),w(E,L),w(E,A),w(E,P),w(m,N),w(m,R),w(m,z),w(m,F),w(m,U),w(m,J),w(i,K),w(i,x),oe=!0},i(Se){oe||(Se&&tt(()=>{oe&&(X||(X=je(e,mt,{duration:150},!0)),X.run(1))}),oe=!0)},o(Se){Se&&(X||(X=je(e,mt,{duration:150},!1)),X.run(0)),oe=!1},d(Se){Se&&v(e),Se&&X&&X.end()}}}function mM(n){let e,t,i,l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[cM,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}});function d(g,k){return g[2]?pM:dM}let m=d(n),h=m(n),_=n[2]&&lh();return{c(){j(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),_&&_.c(),a=ke(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,k){q(e,g,k),y(g,t,k),y(g,i,k),w(i,l),w(i,s),h.m(i,null),y(g,r,k),_&&_.m(g,k),y(g,a,k),u=!0,f||(c=W(i,"click",n[5]),f=!0)},p(g,k){const S={};k&2&&(S.name="fields."+g[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?k&4&&M(_,1):(_=lh(),_.c(),M(_,1),_.m(a.parentNode,a)):_&&(ae(),D(_,1,1,()=>{_=null}),ue())},i(g){u||(M(e.$$.fragment,g),M(_),u=!0)},o(g){D(e.$$.fragment,g),D(_),u=!1},d(g){g&&(v(t),v(i),v(r),v(a)),H(e,g),h.d(),_&&_.d(g),f=!1,c()}}}function hM(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[mM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Rt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function _M(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=h=>t(0,s.maxSize=h.target.value<<0,s),u=()=>{t(2,r=!r)};function f(h){s=h,t(0,s)}function c(h){Ne.call(this,n,h)}function d(h){Ne.call(this,n,h)}function m(h){Ne.call(this,n,h)}return n.$$set=h=>{e=ze(ze({},e),Ut(h)),t(3,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,r,l,a,u,f,c,d,m]}class gM extends we{constructor(e){super(),ye(this,e,_M,hM,_e,{field:0,key:1})}}function bM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Min"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].min),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&>(s.value)!==u[0].min&&ce(s,u[0].min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function kM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].min)},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),ce(s,n[0].max),a||(u=W(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].min)&&p(s,"min",r),c&1&>(s.value)!==f[0].max&&ce(s,f[0].max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function vM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[bM,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[kM,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){y(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function yM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){y(c,e,d),e.checked=n[0].onlyInt,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[3]),Ee(He.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].onlyInt),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function wM(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[yM,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".onlyInt"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[wM],options:[vM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function TM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){s.onlyInt=this.checked,t(0,s)}function a(){s.min=gt(this.value),t(0,s)}function u(){s.max=gt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Ne.call(this,n,h)}function d(h){Ne.call(this,n,h)}function m(h){Ne.call(this,n,h)}return n.$$set=h=>{e=ze(ze({},e),Ut(h)),t(2,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,u,f,c,d,m]}class $M extends we{constructor(e){super(),ye(this,e,TM,SM,_e,{field:0,key:1})}}function CM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Min length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].min||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=W(s,"input",n[3]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].min||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function OM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"placeholder","Up to 71 chars"),p(s,"min",r=n[0].min||0),p(s,"max","71"),s.value=a=n[0].max||""},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),u||(f=W(s,"input",n[4]),u=!0)},p(c,d){d&4096&&i!==(i=c[12])&&p(e,"for",i),d&4096&&o!==(o=c[12])&&p(s,"id",o),d&1&&r!==(r=c[0].min||0)&&p(s,"min",r),d&1&&a!==(a=c[0].max||"")&&s.value!==a&&(s.value=a)},d(c){c&&(v(e),v(l),v(s)),u=!1,f()}}}function EM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Bcrypt cost"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"placeholder","Default to 10"),p(s,"step","1"),p(s,"min","6"),p(s,"max","31"),s.value=r=n[0].cost||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=W(s,"input",n[5]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].cost||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function MM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Validation pattern"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","text"),p(s,"id",o=n[12]),p(s,"placeholder","ex. ^\\w+$")},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].pattern),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(s,"id",o),f&1&&s.value!==u[0].pattern&&ce(s,u[0].pattern)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function DM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[CM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[OM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[EM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[MM,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,_){y(h,e,_),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,_){const g={};_&2&&(g.name="fields."+h[1]+".min"),_&12289&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const k={};_&2&&(k.name="fields."+h[1]+".max"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const S={};_&2&&(S.name="fields."+h[1]+".cost"),_&12289&&(S.$$scope={dirty:_,ctx:h}),u.$set(S);const $={};_&2&&($.name="fields."+h[1]+".pattern"),_&12289&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&v(e),H(i),H(o),H(u),H(d)}}}function IM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[DM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function LM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.cost=11,s)}const a=g=>t(0,s.min=g.target.value<<0,s),u=g=>t(0,s.max=g.target.value<<0,s),f=g=>t(0,s.cost=g.target.value<<0,s);function c(){s.pattern=this.value,t(0,s)}function d(g){s=g,t(0,s)}function m(g){Ne.call(this,n,g)}function h(g){Ne.call(this,n,g)}function _(g){Ne.call(this,n,g)}return n.$$set=g=>{e=ze(ze({},e),Ut(g)),t(2,l=lt(e,i)),"field"in g&&t(0,s=g.field),"key"in g&&t(1,o=g.key)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,_]}class AM extends we{constructor(e){super(),ye(this,e,LM,IM,_e,{field:0,key:1})}}function PM(n){let e,t,i,l,s;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=W(i,"click",n[14]),l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function NM(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[PM]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function RM(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function FM(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[NM,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[RM,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){y(c,e,d),y(c,t,d),q(i,c,d),y(c,l,d),y(c,s,d),y(c,o,d),q(r,c,d),y(c,a,d),y(c,u,d),f=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),H(i,c),H(r,c)}}}function sh(n){let e,t,i,l,s,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[qM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[HM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),j(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){y(r,e,a),q(t,e,null),y(r,i,a),y(r,l,a),q(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(t.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),H(t),H(s)}}}function qM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Min select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].minSelect||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=W(s,"input",n[11]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function HM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","Default to single"),p(s,"min",r=n[0].minSelect||1)},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),ce(s,n[0].maxSelect),a||(u=W(s,"input",n[12]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(s,"min",r),c&1&>(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function jM(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new Wn({props:h}),ie.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),l=b("i"),r=C(),j(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var k,S;y(_,e,g),w(e,t),w(e,i),w(e,l),y(_,r,g),q(a,_,g),f=!0,c||(d=Ee(s=He.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"})),c=!0)},p(_,g){var S,$;s&&Nt(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=_[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!f||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const k={};g&16777216&&(k.id=_[24]),!u&&g&1&&(u=!0,k.keyOfSelected=_[0].cascadeDelete,Te(()=>u=!1)),a.$set(k)},i(_){f||(E(a.$$.fragment,_),f=!0)},o(_){D(a.$$.fragment,_),f=!1},d(_){_&&(v(e),v(r)),H(a,_),c=!1,d()}}}function HM(n){let e,t,i,l,s,o=!n[2]&&sh(n);return l=new fe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[qM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),j(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){y(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),q(l,i,null),s=!0},p(r,a){r[2]?o&&(ae(),D(o,1,1,()=>{o=null}),ue()):o?(o.p(r,a),a&4&&E(o,1)):(o=sh(r),o.c(),E(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),H(l)}}}function jM(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[HM],default:[NM,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;fbe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new nf({props:u}),n[21](l),l.$on("save",n[22]),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment)},m(f,c){q(e,f,c),y(f,i,c),q(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Rt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],Te(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(E(e.$$.fragment,f),E(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&v(i),H(e,f),n[21](null),H(l,f)}}}function zM(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,En,R=>t(10,r=R));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}];let d=null,m=a.maxSelect<=1,h=m;function _(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const g=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function M(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Ne.call(this,n,R)}function I(R){Ne.call(this,n,R)}function A(R){Ne.call(this,n,R)}function P(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=ze(ze({},e),Ut(R)),t(8,o=lt(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&_(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,g,k,S,$,T,O,M,L,I,A,P,N]}class UM extends we{constructor(e){super(),ye(this,e,zM,jM,_e,{field:0,key:1})}}function VM(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].values!==void 0&&(a.value=n[0].values),t=new ps({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){y(u,e,f),q(t,e,null),l=!0,s||(o=Ee(He.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&16384&&(c.id=u[14]),f&32768&&(c.readonly=!u[15]),!i&&f&1&&(i=!0,c.value=u[0].values,Te(()=>i=!1)),t.$set(c)},i(u){l||(E(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&v(e),H(t),s=!1,o()}}}function BM(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WM(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".values",$$slots:{default:[VM,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[BM,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){y(c,e,d),y(c,t,d),q(i,c,d),y(c,l,d),y(c,s,d),y(c,o,d),q(r,c,d),y(c,a,d),y(c,u,d),f=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(E(i.$$.fragment,c),E(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),H(i,c),H(r,c)}}}function oh(n){let e,t;return e=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[YM,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),l=C(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),p(s,"max",r=n[0].values.length),p(s,"placeholder","Default to single")},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),ce(s,n[0].maxSelect),a||(u=B(s,"input",n[6]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(s,"id",o),c&1&&r!==(r=f[0].values.length)&&p(s,"max",r),c&1&>(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function KM(n){let e,t,i=!n[2]&&oh(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),y(l,e,s),t=!0},p(l,s){l[2]?i&&(ae(),D(i,1,1,()=>{i=null}),ue()):i?(i.p(l,s),s&4&&E(i,1)):(i=oh(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){D(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function JM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[KM],default:[WM,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function ZM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=s.maxSelect<=1,u=a;function f(){t(0,s.maxSelect=1,s),t(0,s.values=[],s),t(2,a=!0),t(5,u=a)}function c(){s.maxSelect=gt(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.values,S)&&(s.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function h(S){s=S,t(0,s),t(5,u),t(2,a)}function _(S){Ne.call(this,n,S)}function g(S){Ne.call(this,n,S)}function k(S){Ne.call(this,n,S)}return n.$$set=S=>{e=ze(ze({},e),Ut(S)),t(4,l=lt(e,i)),"field"in S&&t(0,s=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,s.maxSelect=1,s):t(0,s.maxSelect=((S=s.values)==null?void 0:S.length)||2,s)),n.$$.dirty&1&&typeof s.maxSelect>"u"&&f()},[s,o,a,r,l,u,c,d,m,h,_,g,k]}class GM extends we{constructor(e){super(),ye(this,e,ZM,JM,_e,{field:0,key:1})}}function XM(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=b("span"),t.textContent="Min length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"min","0"),p(r,"placeholder","No min limit"),r.value=u=n[0].min||""},m(d,m){y(d,e,m),w(e,t),w(e,i),w(e,l),y(d,o,m),y(d,r,m),f||(c=[Ee(He.call(null,l,"Clear the field or set it to 0 for no limit.")),B(r,"input",n[3])],f=!0)},p(d,m){m&2048&&s!==(s=d[11])&&p(e,"for",s),m&2048&&a!==(a=d[11])&&p(r,"id",a),m&1&&u!==(u=d[0].min||"")&&r.value!==u&&(r.value=u)},d(d){d&&(v(e),v(o),v(r)),f=!1,Ie(c)}}}function QM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("span"),t.textContent="Max length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"placeholder","Default to max 5000 characters"),p(r,"min",u=n[0].min||0),r.value=f=n[0].max||""},m(m,h){y(m,e,h),w(e,t),w(e,i),w(e,l),y(m,o,h),y(m,r,h),c||(d=[Ee(He.call(null,l,"Clear the field or set it to 0 to fallback to the default limit.")),B(r,"input",n[4])],c=!0)},p(m,h){h&2048&&s!==(s=m[11])&&p(e,"for",s),h&2048&&a!==(a=m[11])&&p(r,"id",a),h&1&&u!==(u=m[0].min||0)&&p(r,"min",u),h&1&&f!==(f=m[0].max||"")&&r.value!==f&&(r.value=f)},d(m){m&&(v(e),v(o),v(r)),c=!1,Ie(d)}}}function xM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=W("Validation pattern"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("p"),f=W("Ex. "),c=b("code"),c.textContent="^[a-z0-9]+$",p(e,"for",i=n[11]),p(s,"type","text"),p(s,"id",o=n[11]),p(a,"class","help-block")},m(h,_){y(h,e,_),w(e,t),y(h,l,_),y(h,s,_),ce(s,n[0].pattern),y(h,r,_),y(h,a,_),w(a,u),w(u,f),w(u,c),d||(m=B(s,"input",n[5]),d=!0)},p(h,_){_&2048&&i!==(i=h[11])&&p(e,"for",i),_&2048&&o!==(o=h[11])&&p(s,"id",o),_&1&&s.value!==h[0].pattern&&ce(s,h[0].pattern)},d(h){h&&(v(e),v(l),v(s),v(r),v(a)),d=!1,m()}}}function eD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("span"),t.textContent="Autogenerate pattern",i=C(),l=b("i"),o=C(),r=b("input"),u=C(),f=b("div"),c=b("p"),d=W("Ex. "),m=b("code"),m.textContent="[a-z0-9]{30}",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","text"),p(r,"id",a=n[11]),p(f,"class","help-block")},m(g,k){y(g,e,k),w(e,t),w(e,i),w(e,l),y(g,o,k),y(g,r,k),ce(r,n[0].autogeneratePattern),y(g,u,k),y(g,f,k),w(f,c),w(c,d),w(c,m),h||(_=[Ee(He.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),B(r,"input",n[6])],h=!0)},p(g,k){k&2048&&s!==(s=g[11])&&p(e,"for",s),k&2048&&a!==(a=g[11])&&p(r,"id",a),k&1&&r.value!==g[0].autogeneratePattern&&ce(r,g[0].autogeneratePattern)},d(g){g&&(v(e),v(o),v(r),v(u),v(f)),h=!1,Ie(_)}}}function tD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[XM,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[QM,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[xM,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[eD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,_){y(h,e,_),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,_){const g={};_&2&&(g.name="fields."+h[1]+".min"),_&6145&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const k={};_&2&&(k.name="fields."+h[1]+".max"),_&6145&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const S={};_&2&&(S.name="fields."+h[1]+".pattern"),_&6145&&(S.$$scope={dirty:_,ctx:h}),u.$set(S);const $={};_&2&&($.name="fields."+h[1]+".pattern"),_&6145&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),E(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&v(e),H(i),H(o),H(u),H(d)}}}function nD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[tD]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function iD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=_=>t(0,s.min=_.target.value<<0,s),a=_=>t(0,s.max=_.target.value<<0,s);function u(){s.pattern=this.value,t(0,s)}function f(){s.autogeneratePattern=this.value,t(0,s)}function c(_){s=_,t(0,s)}function d(_){Ne.call(this,n,_)}function m(_){Ne.call(this,n,_)}function h(_){Ne.call(this,n,_)}return n.$$set=_=>{e=ze(ze({},e),Ut(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},[s,o,l,r,a,u,f,c,d,m,h]}class lD extends we{constructor(e){super(),ye(this,e,iD,nD,_e,{field:0,key:1})}}function sD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function oD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ne.call(this,n,c)}function u(c){Ne.call(this,n,c)}function f(c){Ne.call(this,n,c)}return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class rD extends we{constructor(e){super(),ye(this,e,oD,sD,_e,{field:0,key:1})}}function rh(n,e,t){const i=n.slice();return i[24]=e[t],i[25]=e,i[26]=t,i}function aD(n){let e,t,i,l;function s(f){n[8](f,n[24],n[25],n[26])}function o(){return n[9](n[26])}function r(){return n[10](n[26])}var a=n[1][n[24].type];function u(f,c){let d={key:f[5](f[24]),collection:f[0]};return f[24]!==void 0&&(d.field=f[24]),{props:d}}return a&&(e=jt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&j(e.$$.fragment),i=C()},m(f,c){e&&q(e,f,c),y(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[24].type])){if(e){ae();const d=e;D(d.$$.fragment,1,0,()=>{H(d,1)}),ue()}a?(e=jt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),j(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[24])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[24],Te(()=>t=!1)),e.$set(d)}},i(f){l||(e&&E(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&v(i),e&&H(e,f)}}}function ah(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[26],disabled:e[24]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[aD]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new go({props:r}),ie.push(()=>be(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[26]),u&1&&(f.disabled=e[24]._toDelete),u&134217729&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function uD(n){let e,t=[],i=new Map,l,s,o,r,a,u,f,c,d,m=pe(n[0].fields);const h=k=>k[24];for(let k=0;kbe(f,"collection",_)),{c(){e=b("div");for(let k=0;kc=!1)),f.$set($)},i(k){if(!d){for(let S=0;St(18,l=N));let{collection:s}=e,o;const r={text:lD,number:SM,bool:kE,email:av,url:rD,editor:zE,date:NE,select:GM,json:hM,file:aM,relation:UM,password:IM,autodate:_E};function a(N){s.fields[N]&&(s.fields.splice(N,1),t(0,s))}function u(N){const R=s.fields[N];if(!R)return;R.onMountSelect=!1;const z=structuredClone(R);z.id="",z.system=!1,z.name=c(z.name+"_copy"),z.onMountSelect=!0,s.fields.splice(N+1,0,z),t(0,s)}function f(N="text"){const R=V.initSchemaField({name:c(),type:N});R.onMountSelect=!0;const z=s.fields.findLastIndex(F=>F.type!="autodate");R.type!="autodate"&&z>=0?s.fields.splice(z+1,0,R):s.fields.push(R),t(0,s)}function c(N="field"){var J;let R=N,z=2,F=((J=N.match(/\d+$/))==null?void 0:J[0])||"",U=F?N.substring(0,N.length-F.length):N;for(;d(R);)R=U+((F<<0)+z),z++;return R}function d(N){var R;return!!((R=s==null?void 0:s.fields)!=null&&R.find(z=>z.name===N))}function m(N){return i.findIndex(R=>R===N)}function h(N,R){var z,F;!((z=s==null?void 0:s.fields)!=null&&z.length)||N===R||!R||(F=s==null?void 0:s.fields)!=null&&F.find(U=>U.name==N&&!U._toDelete)||t(0,s.indexes=s.indexes.map(U=>V.replaceIndexColumn(U,N,R)),s)}function _(){const N=s.fields||[],R=N.filter(F=>!F.system),z=structuredClone(l[s.type]);t(0,s.fields=z.fields,s);for(let F of N){if(!F.system)continue;const U=s.fields.findIndex(J=>J.name==F.name);U<0||t(0,s.fields[U]=Object.assign(s.fields[U],F),s)}for(let F of R)s.fields.push(F)}function g(N,R){var F;if(N===R||!R)return;let z=((F=s.passwordAuth)==null?void 0:F.identityFields)||[];for(let U=0;Ua(N),T=N=>u(N),O=N=>k(N.detail.oldName,N.detail.newName);function M(N){n.$$.not_equal(s.fields,N)&&(s.fields=N,t(0,s))}const L=N=>{if(!N.detail)return;const R=N.detail.target;R.style.opacity=0,setTimeout(()=>{var z;(z=R==null?void 0:R.style)==null||z.removeProperty("opacity")},0),N.detail.dataTransfer.setDragImage(R,0,0)},I=()=>{Yt({})},A=N=>f(N.detail);function P(N){s=N,t(0,s)}return n.$$set=N=>{"collection"in N&&t(0,s=N.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.fields>"u"&&t(0,s.fields=[],s),n.$$.dirty&129&&!s.id&&o!=s.type&&(t(7,o=s.type),_()),n.$$.dirty&1&&(i=s.fields.filter(N=>!N._toDelete))},[s,r,a,u,f,m,k,o,S,$,T,O,M,L,I,A,P]}class cD extends we{constructor(e){super(),ye(this,e,fD,uD,_e,{collection:0})}}function uh(n,e,t){const i=n.slice();return i[9]=e[t],i}function dD(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].viewQuery!==void 0&&(f.value=a[0].viewQuery),{props:f}}return o&&(e=jt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){ae();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("change",a[6]),j(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].viewQuery,Te(()=>t=!1)),e.$set(f)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function pD(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function fh(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. +`),position:"top"}),(!f||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const k={};g&16777216&&(k.id=_[24]),!u&&g&1&&(u=!0,k.keyOfSelected=_[0].cascadeDelete,Te(()=>u=!1)),a.$set(k)},i(_){f||(M(a.$$.fragment,_),f=!0)},o(_){D(a.$$.fragment,_),f=!1},d(_){_&&(v(e),v(r)),H(a,_),c=!1,d()}}}function zM(n){let e,t,i,l,s,o=!n[2]&&sh(n);return l=new fe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[jM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),j(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){y(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),q(l,i,null),s=!0},p(r,a){r[2]?o&&(ae(),D(o,1,1,()=>{o=null}),ue()):o?(o.p(r,a),a&4&&M(o,1)):(o=sh(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(M(o),M(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),H(l)}}}function UM(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[zM],default:[FM,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;fbe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new nf({props:u}),n[21](l),l.$on("save",n[22]),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment)},m(f,c){q(e,f,c),y(f,i,c),q(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Rt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],Te(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(M(e.$$.fragment,f),M(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&v(i),H(e,f),n[21](null),H(l,f)}}}function VM(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,En,R=>t(10,r=R));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}];let d=null,m=a.maxSelect<=1,h=m;function _(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const g=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function I(R){Ne.call(this,n,R)}function L(R){Ne.call(this,n,R)}function A(R){Ne.call(this,n,R)}function P(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=ze(ze({},e),Ut(R)),t(8,o=lt(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&_(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,g,k,S,$,T,O,E,I,L,A,P,N]}class BM extends we{constructor(e){super(),ye(this,e,VM,UM,_e,{field:0,key:1})}}function WM(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].values!==void 0&&(a.value=n[0].values),t=new ps({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){y(u,e,f),q(t,e,null),l=!0,s||(o=Ee(He.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&16384&&(c.id=u[14]),f&32768&&(c.readonly=!u[15]),!i&&f&1&&(i=!0,c.value=u[0].values,Te(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&v(e),H(t),s=!1,o()}}}function YM(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KM(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".values",$$slots:{default:[WM,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[YM,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){y(c,e,d),y(c,t,d),q(i,c,d),y(c,l,d),y(c,s,d),y(c,o,d),q(r,c,d),y(c,a,d),y(c,u,d),f=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),H(i,c),H(r,c)}}}function oh(n){let e,t;return e=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[JM,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),p(s,"max",r=n[0].values.length),p(s,"placeholder","Default to single")},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),ce(s,n[0].maxSelect),a||(u=W(s,"input",n[6]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(s,"id",o),c&1&&r!==(r=f[0].values.length)&&p(s,"max",r),c&1&>(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function ZM(n){let e,t,i=!n[2]&&oh(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),y(l,e,s),t=!0},p(l,s){l[2]?i&&(ae(),D(i,1,1,()=>{i=null}),ue()):i?(i.p(l,s),s&4&&M(i,1)):(i=oh(l),i.c(),M(i,1),i.m(e.parentNode,e))},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function GM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[ZM],default:[KM,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function XM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=s.maxSelect<=1,u=a;function f(){t(0,s.maxSelect=1,s),t(0,s.values=[],s),t(2,a=!0),t(5,u=a)}function c(){s.maxSelect=gt(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.values,S)&&(s.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function h(S){s=S,t(0,s),t(5,u),t(2,a)}function _(S){Ne.call(this,n,S)}function g(S){Ne.call(this,n,S)}function k(S){Ne.call(this,n,S)}return n.$$set=S=>{e=ze(ze({},e),Ut(S)),t(4,l=lt(e,i)),"field"in S&&t(0,s=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,s.maxSelect=1,s):t(0,s.maxSelect=((S=s.values)==null?void 0:S.length)||2,s)),n.$$.dirty&1&&typeof s.maxSelect>"u"&&f()},[s,o,a,r,l,u,c,d,m,h,_,g,k]}class QM extends we{constructor(e){super(),ye(this,e,XM,GM,_e,{field:0,key:1})}}function xM(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=b("span"),t.textContent="Min length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"min","0"),p(r,"placeholder","No min limit"),r.value=u=n[0].min||""},m(d,m){y(d,e,m),w(e,t),w(e,i),w(e,l),y(d,o,m),y(d,r,m),f||(c=[Ee(He.call(null,l,"Clear the field or set it to 0 for no limit.")),W(r,"input",n[3])],f=!0)},p(d,m){m&2048&&s!==(s=d[11])&&p(e,"for",s),m&2048&&a!==(a=d[11])&&p(r,"id",a),m&1&&u!==(u=d[0].min||"")&&r.value!==u&&(r.value=u)},d(d){d&&(v(e),v(o),v(r)),f=!1,Ie(c)}}}function eD(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("span"),t.textContent="Max length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"placeholder","Default to max 5000 characters"),p(r,"min",u=n[0].min||0),r.value=f=n[0].max||""},m(m,h){y(m,e,h),w(e,t),w(e,i),w(e,l),y(m,o,h),y(m,r,h),c||(d=[Ee(He.call(null,l,"Clear the field or set it to 0 to fallback to the default limit.")),W(r,"input",n[4])],c=!0)},p(m,h){h&2048&&s!==(s=m[11])&&p(e,"for",s),h&2048&&a!==(a=m[11])&&p(r,"id",a),h&1&&u!==(u=m[0].min||0)&&p(r,"min",u),h&1&&f!==(f=m[0].max||"")&&r.value!==f&&(r.value=f)},d(m){m&&(v(e),v(o),v(r)),c=!1,Ie(d)}}}function tD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=B("Validation pattern"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("p"),f=B("Ex. "),c=b("code"),c.textContent="^[a-z0-9]+$",p(e,"for",i=n[11]),p(s,"type","text"),p(s,"id",o=n[11]),p(a,"class","help-block")},m(h,_){y(h,e,_),w(e,t),y(h,l,_),y(h,s,_),ce(s,n[0].pattern),y(h,r,_),y(h,a,_),w(a,u),w(u,f),w(u,c),d||(m=W(s,"input",n[5]),d=!0)},p(h,_){_&2048&&i!==(i=h[11])&&p(e,"for",i),_&2048&&o!==(o=h[11])&&p(s,"id",o),_&1&&s.value!==h[0].pattern&&ce(s,h[0].pattern)},d(h){h&&(v(e),v(l),v(s),v(r),v(a)),d=!1,m()}}}function nD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("span"),t.textContent="Autogenerate pattern",i=C(),l=b("i"),o=C(),r=b("input"),u=C(),f=b("div"),c=b("p"),d=B("Ex. "),m=b("code"),m.textContent="[a-z0-9]{30}",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","text"),p(r,"id",a=n[11]),p(f,"class","help-block")},m(g,k){y(g,e,k),w(e,t),w(e,i),w(e,l),y(g,o,k),y(g,r,k),ce(r,n[0].autogeneratePattern),y(g,u,k),y(g,f,k),w(f,c),w(c,d),w(c,m),h||(_=[Ee(He.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),W(r,"input",n[6])],h=!0)},p(g,k){k&2048&&s!==(s=g[11])&&p(e,"for",s),k&2048&&a!==(a=g[11])&&p(r,"id",a),k&1&&r.value!==g[0].autogeneratePattern&&ce(r,g[0].autogeneratePattern)},d(g){g&&(v(e),v(o),v(r),v(u),v(f)),h=!1,Ie(_)}}}function iD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[xM,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[eD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[tD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[nD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,_){y(h,e,_),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,_){const g={};_&2&&(g.name="fields."+h[1]+".min"),_&6145&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const k={};_&2&&(k.name="fields."+h[1]+".max"),_&6145&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const S={};_&2&&(S.name="fields."+h[1]+".pattern"),_&6145&&(S.$$scope={dirty:_,ctx:h}),u.$set(S);const $={};_&2&&($.name="fields."+h[1]+".pattern"),_&6145&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&v(e),H(i),H(o),H(u),H(d)}}}function lD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[iD]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function sD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=_=>t(0,s.min=_.target.value<<0,s),a=_=>t(0,s.max=_.target.value<<0,s);function u(){s.pattern=this.value,t(0,s)}function f(){s.autogeneratePattern=this.value,t(0,s)}function c(_){s=_,t(0,s)}function d(_){Ne.call(this,n,_)}function m(_){Ne.call(this,n,_)}function h(_){Ne.call(this,n,_)}return n.$$set=_=>{e=ze(ze({},e),Ut(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},[s,o,l,r,a,u,f,c,d,m,h]}class oD extends we{constructor(e){super(),ye(this,e,sD,lD,_e,{field:0,key:1})}}function rD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Te(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function aD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ne.call(this,n,c)}function u(c){Ne.call(this,n,c)}function f(c){Ne.call(this,n,c)}return n.$$set=c=>{e=ze(ze({},e),Ut(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class uD extends we{constructor(e){super(),ye(this,e,aD,rD,_e,{field:0,key:1})}}function rh(n,e,t){const i=n.slice();return i[24]=e[t],i[25]=e,i[26]=t,i}function fD(n){let e,t,i,l;function s(f){n[8](f,n[24],n[25],n[26])}function o(){return n[9](n[26])}function r(){return n[10](n[26])}var a=n[1][n[24].type];function u(f,c){let d={key:f[5](f[24]),collection:f[0]};return f[24]!==void 0&&(d.field=f[24]),{props:d}}return a&&(e=jt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&j(e.$$.fragment),i=C()},m(f,c){e&&q(e,f,c),y(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[24].type])){if(e){ae();const d=e;D(d.$$.fragment,1,0,()=>{H(d,1)}),ue()}a?(e=jt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[24])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[24],Te(()=>t=!1)),e.$set(d)}},i(f){l||(e&&M(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&v(i),e&&H(e,f)}}}function ah(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[26],disabled:e[24]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[fD]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new go({props:r}),ie.push(()=>be(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[26]),u&1&&(f.disabled=e[24]._toDelete),u&134217729&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function cD(n){let e,t=[],i=new Map,l,s,o,r,a,u,f,c,d,m=de(n[0].fields);const h=k=>k[24];for(let k=0;kbe(f,"collection",_)),{c(){e=b("div");for(let k=0;kc=!1)),f.$set($)},i(k){if(!d){for(let S=0;St(18,l=N));let{collection:s}=e,o;const r={text:oD,number:$M,bool:yE,email:fv,url:uD,editor:VE,date:FE,select:QM,json:gM,file:fM,relation:BM,password:AM,autodate:bE};function a(N){s.fields[N]&&(s.fields.splice(N,1),t(0,s))}function u(N){const R=s.fields[N];if(!R)return;R.onMountSelect=!1;const z=structuredClone(R);z.id="",z.system=!1,z.name=c(z.name+"_copy"),z.onMountSelect=!0,s.fields.splice(N+1,0,z),t(0,s)}function f(N="text"){const R=V.initSchemaField({name:c(),type:N});R.onMountSelect=!0;const z=s.fields.findLastIndex(F=>F.type!="autodate");R.type!="autodate"&&z>=0?s.fields.splice(z+1,0,R):s.fields.push(R),t(0,s)}function c(N="field"){var J;let R=N,z=2,F=((J=N.match(/\d+$/))==null?void 0:J[0])||"",U=F?N.substring(0,N.length-F.length):N;for(;d(R);)R=U+((F<<0)+z),z++;return R}function d(N){var R;return!!((R=s==null?void 0:s.fields)!=null&&R.find(z=>z.name===N))}function m(N){return i.findIndex(R=>R===N)}function h(N,R){var z,F;!((z=s==null?void 0:s.fields)!=null&&z.length)||N===R||!R||(F=s==null?void 0:s.fields)!=null&&F.find(U=>U.name==N&&!U._toDelete)||t(0,s.indexes=s.indexes.map(U=>V.replaceIndexColumn(U,N,R)),s)}function _(){const N=s.fields||[],R=N.filter(F=>!F.system),z=structuredClone(l[s.type]);t(0,s.fields=z.fields,s);for(let F of N){if(!F.system)continue;const U=s.fields.findIndex(J=>J.name==F.name);U<0||t(0,s.fields[U]=Object.assign(s.fields[U],F),s)}for(let F of R)s.fields.push(F)}function g(N,R){var F;if(N===R||!R)return;let z=((F=s.passwordAuth)==null?void 0:F.identityFields)||[];for(let U=0;Ua(N),T=N=>u(N),O=N=>k(N.detail.oldName,N.detail.newName);function E(N){n.$$.not_equal(s.fields,N)&&(s.fields=N,t(0,s))}const I=N=>{if(!N.detail)return;const R=N.detail.target;R.style.opacity=0,setTimeout(()=>{var z;(z=R==null?void 0:R.style)==null||z.removeProperty("opacity")},0),N.detail.dataTransfer.setDragImage(R,0,0)},L=()=>{Yt({})},A=N=>f(N.detail);function P(N){s=N,t(0,s)}return n.$$set=N=>{"collection"in N&&t(0,s=N.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.fields>"u"&&t(0,s.fields=[],s),n.$$.dirty&129&&!s.id&&o!=s.type&&(t(7,o=s.type),_()),n.$$.dirty&1&&(i=s.fields.filter(N=>!N._toDelete))},[s,r,a,u,f,m,k,o,S,$,T,O,E,I,L,A,P]}class pD extends we{constructor(e){super(),ye(this,e,dD,cD,_e,{collection:0})}}function uh(n,e,t){const i=n.slice();return i[9]=e[t],i}function mD(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].viewQuery!==void 0&&(f.value=a[0].viewQuery),{props:f}}return o&&(e=jt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&j(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),y(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){ae();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("change",a[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].viewQuery,Te(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function hD(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function fh(n){let e,t,i=de(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name, e.g. MAX(balance) as maxBalance.
  • Combined/multi-spaced expressions must be wrapped in parenthesis, e.g. - (MAX(balance) + 1) as maxBalance.
  • `,u=C(),_&&_.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,k){y(g,e,k),w(e,t),y(g,l,k),m[s].m(g,k),y(g,r,k),y(g,a,k),y(g,u,k),_&&_.m(g,k),y(g,f,k),c=!0},p(g,k){(!c||k&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,k):(ae(),D(m[S],1,1,()=>{m[S]=null}),ue(),o=m[s],o?o.p(g,k):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,k):(_=fh(g),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){D(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(g),_&&_.d(g)}}}function hD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[mD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _D(n,e,t){let i;Qe(n,yn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=V.getNestedVal(c,"fields",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery(l==null?void 0:l.viewQuery);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let _ in d[h]){const g=d[h][_].message,k=m[h]||h;r.push(V.sentenize(k+": "+g))}}Zt(async()=>{t(2,o=!0);try{t(1,s=(await Ct(async()=>{const{default:c}=await import("./CodeEditor-DKQxSBo9.js");return{default:c}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&di("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class gD extends we{constructor(e){super(),ye(this,e,_D,hD,_e,{collection:0})}}function dh(n,e,t){const i=n.slice();return i[15]=e[t],i}function ph(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A=pe(n[4]),P=[];for(let N=0;N@request

    Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth methods (otp, identity/password, oauth2) before issuing an auth token. - (Learn more) .

    filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),_=C(),g=b("p"),g.innerHTML=`You could also add constraints and query other collections using the - @collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),O=C(),M=b("p"),M.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,R){y(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z{I&&(L||(L=je(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=je(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&v(e),pt(P,N),N&&L&&L.end()}}}function mh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&re(i,t)},d(l){l&&v(e)}}}function hh(n){let e=!n[3].includes(n[15]),t,i=e&&mh(n);return{c(){i&&i.c(),t=ke()},m(l,s){i&&i.m(l,s),y(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[15])),e?i?i.p(l,s):(i=mh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&v(t),i&&i.d(l)}}}function _h(n){let e,t,i,l,s,o,r,a,u;function f(g){n[8](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[bD,({isSuperuserOnly:g})=>({14:g}),({isSuperuserOnly:g})=>g?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(e,"rule",f));function d(g){n[9](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new il({props:m}),ie.push(()=>be(l,"rule",d));function h(g){n[10](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new il({props:_}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment),o=C(),j(r.$$.fragment)},m(g,k){q(e,g,k),y(g,i,k),q(l,g,k),y(g,o,k),q(r,g,k),u=!0},p(g,k){const S={};k&1&&(S.collection=g[0]),k&278528&&(S.$$scope={dirty:k,ctx:g}),!t&&k&1&&(t=!0,S.rule=g[0].createRule,Te(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=g[0]),!s&&k&1&&(s=!0,$.rule=g[0].updateRule,Te(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=g[0]),!a&&k&1&&(a=!0,T.rule=g[0].deleteRule,Te(()=>a=!1)),r.$set(T)},i(g){u||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),u=!0)},o(g){D(e.$$.fragment,g),D(l.$$.fragment,g),D(r.$$.fragment,g),u=!1},d(g){g&&(v(i),v(o)),H(e,g),H(l,g),H(r,g)}}}function gh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function bD(n){let e,t=!n[14]&&gh();return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=gh(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function bh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(g,k){return g[2]?vD:kD}let m=d(n),h=m(n),_=n[2]&&kh(n);return{c(){e=b("hr"),t=C(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=C(),h.c(),r=C(),_&&_.c(),a=ke(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,k){y(g,e,k),y(g,t,k),y(g,i,k),w(i,l),w(i,s),h.m(i,null),y(g,r,k),_&&_.m(g,k),y(g,a,k),u=!0,f||(c=B(i,"click",n[11]),f=!0)},p(g,k){m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?(_.p(g,k),k&4&&E(_,1)):(_=kh(g),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(ae(),D(_,1,1,()=>{_=null}),ue())},i(g){u||(E(_),u=!0)},o(g){D(_),u=!1},d(g){g&&(v(e),v(t),v(i),v(r),v(a)),h.d(),_&&_.d(g),f=!1,c()}}}function kD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function vD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function kh(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[yD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[wD]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","block")},m(m,h){y(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const _={};h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,_.rule=m[0].authRule,Te(()=>i=!1)),t.$set(_);const g={};h&1&&(g.required=m[0].manageRule!==null),h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,g.rule=m[0].manageRule,Te(()=>o=!1)),s.$set(g)},i(m){a||(E(t.$$.fragment,m),E(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=je(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=je(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&v(e),H(t),H(s),m&&r&&r.end()}}}function yD(n){let e,t,i,l,s,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who + (MAX(balance) + 1) as maxBalance.`,u=C(),_&&_.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,k){y(g,e,k),w(e,t),y(g,l,k),m[s].m(g,k),y(g,r,k),y(g,a,k),y(g,u,k),_&&_.m(g,k),y(g,f,k),c=!0},p(g,k){(!c||k&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,k):(ae(),D(m[S],1,1,()=>{m[S]=null}),ue(),o=m[s],o?o.p(g,k):(o=m[s]=d[s](g),o.c()),M(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,k):(_=fh(g),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(g){c||(M(o),c=!0)},o(g){D(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(g),_&&_.d(g)}}}function gD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[_D,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bD(n,e,t){let i;Qe(n,yn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=V.getNestedVal(c,"fields",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery(l==null?void 0:l.viewQuery);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let _ in d[h]){const g=d[h][_].message,k=m[h]||h;r.push(V.sentenize(k+": "+g))}}Zt(async()=>{t(2,o=!0);try{t(1,s=(await Ct(async()=>{const{default:c}=await import("./CodeEditor-pEpUQJ5v.js");return{default:c}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&di("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class kD extends we{constructor(e){super(),ye(this,e,bD,gD,_e,{collection:0})}}function dh(n,e,t){const i=n.slice();return i[15]=e[t],i}function ph(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A=de(n[4]),P=[];for(let N=0;N@request
    filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),_=C(),g=b("p"),g.innerHTML=`You could also add constraints and query other collections using the + @collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),O=C(),E=b("p"),E.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,R){y(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z{L&&(I||(I=je(e,mt,{duration:150},!0)),I.run(1))}),L=!0)},o(N){N&&(I||(I=je(e,mt,{duration:150},!1)),I.run(0)),L=!1},d(N){N&&v(e),dt(P,N),N&&I&&I.end()}}}function mh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=B(t)},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&re(i,t)},d(l){l&&v(e)}}}function hh(n){let e=!n[3].includes(n[15]),t,i=e&&mh(n);return{c(){i&&i.c(),t=ke()},m(l,s){i&&i.m(l,s),y(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[15])),e?i?i.p(l,s):(i=mh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&v(t),i&&i.d(l)}}}function _h(n){let e,t,i,l,s,o,r,a,u;function f(g){n[8](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[vD,({isSuperuserOnly:g})=>({14:g}),({isSuperuserOnly:g})=>g?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(e,"rule",f));function d(g){n[9](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new il({props:m}),ie.push(()=>be(l,"rule",d));function h(g){n[10](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new il({props:_}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment),o=C(),j(r.$$.fragment)},m(g,k){q(e,g,k),y(g,i,k),q(l,g,k),y(g,o,k),q(r,g,k),u=!0},p(g,k){const S={};k&1&&(S.collection=g[0]),k&278528&&(S.$$scope={dirty:k,ctx:g}),!t&&k&1&&(t=!0,S.rule=g[0].createRule,Te(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=g[0]),!s&&k&1&&(s=!0,$.rule=g[0].updateRule,Te(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=g[0]),!a&&k&1&&(a=!0,T.rule=g[0].deleteRule,Te(()=>a=!1)),r.$set(T)},i(g){u||(M(e.$$.fragment,g),M(l.$$.fragment,g),M(r.$$.fragment,g),u=!0)},o(g){D(e.$$.fragment,g),D(l.$$.fragment,g),D(r.$$.fragment,g),u=!1},d(g){g&&(v(i),v(o)),H(e,g),H(l,g),H(r,g)}}}function gh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function vD(n){let e,t=!n[14]&&gh();return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=gh(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function bh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(g,k){return g[2]?wD:yD}let m=d(n),h=m(n),_=n[2]&&kh(n);return{c(){e=b("hr"),t=C(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=C(),h.c(),r=C(),_&&_.c(),a=ke(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,k){y(g,e,k),y(g,t,k),y(g,i,k),w(i,l),w(i,s),h.m(i,null),y(g,r,k),_&&_.m(g,k),y(g,a,k),u=!0,f||(c=W(i,"click",n[11]),f=!0)},p(g,k){m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?(_.p(g,k),k&4&&M(_,1)):(_=kh(g),_.c(),M(_,1),_.m(a.parentNode,a)):_&&(ae(),D(_,1,1,()=>{_=null}),ue())},i(g){u||(M(_),u=!0)},o(g){D(_),u=!1},d(g){g&&(v(e),v(t),v(i),v(r),v(a)),h.d(),_&&_.d(g),f=!1,c()}}}function yD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function wD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function kh(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[SD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[TD]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","block")},m(m,h){y(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const _={};h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,_.rule=m[0].authRule,Te(()=>i=!1)),t.$set(_);const g={};h&1&&(g.required=m[0].manageRule!==null),h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,g.rule=m[0].manageRule,Te(()=>o=!1)),s.$set(g)},i(m){a||(M(t.$$.fragment,m),M(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=je(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=je(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&v(e),H(t),H(s),m&&r&&r.end()}}}function SD(n){let e,t,i,l,s,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who can authenticate.`,t=C(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to - verified = true.`,l=C(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),y(a,l,u),y(a,s,u),y(a,o,u),y(a,r,u)},p:te,d(a){a&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r))}}}function wD(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the create and update API + verified = true.`,l=C(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),y(a,l,u),y(a,s,u),y(a,o,u),y(a,r,u)},p:te,d(a){a&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r))}}}function TD(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the create and update API rules.`,t=C(),i=b("p"),i.textContent=`It enables superuser-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.`},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},p:te,d(l){l&&(v(e),v(t),v(i))}}}function SD(n){var R,z;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,g,k,S,$,T,O=n[1]&&ph(n);function M(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new il({props:L}),ie.push(()=>be(f,"rule",M));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new il({props:A}),ie.push(()=>be(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&_h(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&bh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + verified state or email, etc.`},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},p:te,d(l){l&&(v(e),v(t),v(i))}}}function $D(n){var R,z;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,g,k,S,$,T,O=n[1]&&ph(n);function E(F){n[6](F)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new il({props:I}),ie.push(()=>be(f,"rule",E));function L(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new il({props:A}),ie.push(()=>be(m,"rule",L));let P=((R=n[0])==null?void 0:R.type)!=="view"&&_h(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&bh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the PocketBase filter syntax and operators - .`,l=C(),s=b("button"),r=W(o),a=C(),O&&O.c(),u=C(),j(f.$$.fragment),d=C(),j(m.$$.fragment),_=C(),P&&P.c(),g=C(),N&&N.c(),k=ke(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(F,U){y(F,e,U),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),O&&O.m(e,null),y(F,u,U),q(f,F,U),y(F,d,U),q(m,F,U),y(F,_,U),P&&P.m(F,U),y(F,g,U),N&&N.m(F,U),y(F,k,U),S=!0,$||(T=B(s,"click",n[5]),$=!0)},p(F,[U]){var x,X;(!S||U&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&re(r,o),F[1]?O?(O.p(F,U),U&2&&E(O,1)):(O=ph(F),O.c(),E(O,1),O.m(e,null)):O&&(ae(),D(O,1,1,()=>{O=null}),ue());const J={};U&1&&(J.collection=F[0]),!c&&U&1&&(c=!0,J.rule=F[0].listRule,Te(()=>c=!1)),f.$set(J);const K={};U&1&&(K.collection=F[0]),!h&&U&1&&(h=!0,K.rule=F[0].viewRule,Te(()=>h=!1)),m.$set(K),((x=F[0])==null?void 0:x.type)!=="view"?P?(P.p(F,U),U&1&&E(P,1)):(P=_h(F),P.c(),E(P,1),P.m(g.parentNode,g)):P&&(ae(),D(P,1,1,()=>{P=null}),ue()),((X=F[0])==null?void 0:X.type)==="auth"?N?(N.p(F,U),U&1&&E(N,1)):(N=bh(F),N.c(),E(N,1),N.m(k.parentNode,k)):N&&(ae(),D(N,1,1,()=>{N=null}),ue())},i(F){S||(E(O),E(f.$$.fragment,F),E(m.$$.fragment,F),E(P),E(N),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(v(e),v(u),v(d),v(_),v(g),v(k)),O&&O.d(),H(f,F),H(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function TD(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(s.listRule,k)&&(s.listRule=k,t(0,s))}function f(k){n.$$.not_equal(s.viewRule,k)&&(s.viewRule=k,t(0,s))}function c(k){n.$$.not_equal(s.createRule,k)&&(s.createRule=k,t(0,s))}function d(k){n.$$.not_equal(s.updateRule,k)&&(s.updateRule=k,t(0,s))}function m(k){n.$$.not_equal(s.deleteRule,k)&&(s.deleteRule=k,t(0,s))}const h=()=>{t(2,r=!r)};function _(k){n.$$.not_equal(s.authRule,k)&&(s.authRule=k,t(0,s))}function g(k){n.$$.not_equal(s.manageRule,k)&&(s.manageRule=k,t(0,s))}return n.$$set=k=>{"collection"in k&&t(0,s=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=V.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(k=s.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,_,g]}class $D extends we{constructor(e){super(),ye(this,e,TD,SD,_e,{collection:0})}}function vh(n,e,t){const i=n.slice();return i[24]=e[t],i}function yh(n,e,t){const i=n.slice();return i[27]=e[t],i}function wh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Th(n){let e,t,i,l,s,o,r=n[8].length&&$h();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=C(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){y(a,e,u),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),r&&r.m(l,null)},p(a,u){a[8].length?r||(r=$h(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&v(e),r&&r.d()}}}function $h(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Ch(n){let e,t,i,l,s,o=n[3]&&Oh(n),r=!n[4]&&Eh(n),a=pe(n[6]),u=[];for(let f=0;f.`,l=C(),s=b("button"),r=B(o),a=C(),O&&O.c(),u=C(),j(f.$$.fragment),d=C(),j(m.$$.fragment),_=C(),P&&P.c(),g=C(),N&&N.c(),k=ke(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(F,U){y(F,e,U),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),O&&O.m(e,null),y(F,u,U),q(f,F,U),y(F,d,U),q(m,F,U),y(F,_,U),P&&P.m(F,U),y(F,g,U),N&&N.m(F,U),y(F,k,U),S=!0,$||(T=W(s,"click",n[5]),$=!0)},p(F,[U]){var x,X;(!S||U&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&re(r,o),F[1]?O?(O.p(F,U),U&2&&M(O,1)):(O=ph(F),O.c(),M(O,1),O.m(e,null)):O&&(ae(),D(O,1,1,()=>{O=null}),ue());const J={};U&1&&(J.collection=F[0]),!c&&U&1&&(c=!0,J.rule=F[0].listRule,Te(()=>c=!1)),f.$set(J);const K={};U&1&&(K.collection=F[0]),!h&&U&1&&(h=!0,K.rule=F[0].viewRule,Te(()=>h=!1)),m.$set(K),((x=F[0])==null?void 0:x.type)!=="view"?P?(P.p(F,U),U&1&&M(P,1)):(P=_h(F),P.c(),M(P,1),P.m(g.parentNode,g)):P&&(ae(),D(P,1,1,()=>{P=null}),ue()),((X=F[0])==null?void 0:X.type)==="auth"?N?(N.p(F,U),U&1&&M(N,1)):(N=bh(F),N.c(),M(N,1),N.m(k.parentNode,k)):N&&(ae(),D(N,1,1,()=>{N=null}),ue())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(P),M(N),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(v(e),v(u),v(d),v(_),v(g),v(k)),O&&O.d(),H(f,F),H(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function CD(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(s.listRule,k)&&(s.listRule=k,t(0,s))}function f(k){n.$$.not_equal(s.viewRule,k)&&(s.viewRule=k,t(0,s))}function c(k){n.$$.not_equal(s.createRule,k)&&(s.createRule=k,t(0,s))}function d(k){n.$$.not_equal(s.updateRule,k)&&(s.updateRule=k,t(0,s))}function m(k){n.$$.not_equal(s.deleteRule,k)&&(s.deleteRule=k,t(0,s))}const h=()=>{t(2,r=!r)};function _(k){n.$$.not_equal(s.authRule,k)&&(s.authRule=k,t(0,s))}function g(k){n.$$.not_equal(s.manageRule,k)&&(s.manageRule=k,t(0,s))}return n.$$set=k=>{"collection"in k&&t(0,s=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=V.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(k=s.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,_,g]}class OD extends we{constructor(e){super(),ye(this,e,CD,$D,_e,{collection:0})}}function vh(n,e,t){const i=n.slice();return i[24]=e[t],i}function yh(n,e,t){const i=n.slice();return i[27]=e[t],i}function wh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Th(n){let e,t,i,l,s,o,r=n[8].length&&$h();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=C(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){y(a,e,u),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),r&&r.m(l,null)},p(a,u){a[8].length?r||(r=$h(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&v(e),r&&r.d()}}}function $h(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Ch(n){let e,t,i,l,s,o=n[3]&&Oh(n),r=!n[4]&&Eh(n),a=de(n[6]),u=[];for(let f=0;fCancel',t=C(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),e.focus(),l||(s=[B(e,"click",n[14]),B(i,"click",n[15])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,Ie(s)}}}function MD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[ED],header:[OD],default:[CD]},$$scope:{ctx:n}};return e=new nn({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&2014|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function DD(n,e,t){let i,l,s,o,r,a;const u=bt();let f,c,d,m,h=[];async function _(N,R,z=!0){t(1,c=N),t(2,d=R),m=z,await $(),await un(),i||s.length||o.length||r.length||h.length?f==null||f.show():k()}function g(){f==null||f.hide()}function k(){g(),u("confirm",m)}const S=["oidc","oidc2","oidc3"];async function $(){var N,R,z,F;t(6,h=[]);for(let U of S){let J=(R=(N=c==null?void 0:c.oauth2)==null?void 0:N.providers)==null?void 0:R.find(oe=>oe.name==U),K=(F=(z=d==null?void 0:d.oauth2)==null?void 0:z.providers)==null?void 0:F.find(oe=>oe.name==U);if(!J||!K)continue;let x=new URL(J.authURL).host,X=new URL(K.authURL).host;x!=X&&await T(U)&&h.push({name:U,oldHost:x,newHost:X})}}async function T(N){try{return await me.collection("_externalAuths").getFirstListItem(me.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:d==null?void 0:d.id,provider:N})),!0}catch{}return!1}function O(N){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${d==null?void 0:d.id}%22+%26%26+provider%3D%22${N}%22`}const M=()=>g(),L=()=>k();function I(N){ie[N?"unshift":"push"](()=>{f=N,t(5,f)})}function A(N){Ne.call(this,n,N)}function P(N){Ne.call(this,n,N)}return n.$$.update=()=>{var N,R,z;n.$$.dirty[0]&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty[0]&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty[0]&4&&t(9,s=((N=d==null?void 0:d.fields)==null?void 0:N.filter(F=>F.id&&!F._toDelete&&F._originalName!=F.name))||[]),n.$$.dirty[0]&4&&t(8,o=((R=d==null?void 0:d.fields)==null?void 0:R.filter(F=>F.id&&F._toDelete))||[]),n.$$.dirty[0]&6&&t(7,r=((z=d==null?void 0:d.fields)==null?void 0:z.filter(F=>{var J;const U=(J=c==null?void 0:c.fields)==null?void 0:J.find(K=>K.id==F.id);return U?U.maxSelect!=1&&F.maxSelect==1:!1}))||[]),n.$$.dirty[0]&24&&t(10,a=!l||i)},[g,c,d,i,l,f,h,r,o,s,a,k,O,_,M,L,I,A,P]}class ID extends we{constructor(e){super(),ye(this,e,DD,MD,_e,{show:13,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[13]}get hide(){return this.$$.ctx[0]}}function Ah(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function LD(n){let e,t,i;function l(o){n[44](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new cD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function AD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new gD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Ph(n){let e,t,i,l;function s(r){n[45](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new $D({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){y(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Te(()=>i=!1)),t.$set(u)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&v(e),H(t)}}}function Nh(n){let e,t,i,l;function s(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LO({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===ss)},m(r,a){y(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Te(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&Q(e,"active",r[3]===ss)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&v(e),H(t)}}}function PD(n){let e,t,i,l,s,o,r;const a=[AD,LD],u=[];function f(m,h){return m[17]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[15]&&n[3]===io&&Ph(n),d=n[18]&&Nh(n);return{c(){e=b("div"),t=b("div"),l.c(),s=C(),c&&c.c(),o=C(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===xi),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){y(m,e,h),w(e,t),u[i].m(t,null),w(e,s),c&&c.m(e,null),w(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(ae(),D(u[_],1,1,()=>{u[_]=null}),ue(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===xi),!m[15]&&m[3]===io?c?(c.p(m,h),h[0]&32776&&E(c,1)):(c=Ph(m),c.c(),E(c,1),c.m(e,o)):c&&(ae(),D(c,1,1,()=>{c=null}),ue()),m[18]?d?(d.p(m,h),h[0]&262144&&E(d,1)):(d=Nh(m),d.c(),E(d,1),d.m(e,null)):d&&(ae(),D(d,1,1,()=>{d=null}),ue())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){D(l),D(c),D(d),r=!1},d(m){m&&v(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Rh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[ND]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&131072|u[2]&2&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),H(o)}}}function Fh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Truncate',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[35]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function ND(n){let e,t,i,l,s,o,r,a,u=!n[17]&&Fh(n);return{c(){e=b("button"),e.innerHTML=' Duplicate',t=C(),i=b("hr"),l=C(),u&&u.c(),s=C(),o=b("button"),o.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(o,"type","button"),p(o,"class","dropdown-item txt-danger"),p(o,"role","menuitem")},m(f,c){y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),u&&u.m(f,c),y(f,s,c),y(f,o,c),r||(a=[B(e,"click",n[34]),B(o,"click",On(et(n[36])))],r=!0)},p(f,c){f[17]?u&&(u.d(1),u=null):u?u.p(f,c):(u=Fh(f),u.c(),u.m(s.parentNode,s))},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o)),u&&u.d(f),r=!1,Ie(a)}}}function qh(n){let e,t,i,l;return i=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[RD]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),j(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){y(s,e,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),H(i,s)}}}function Hh(n){let e,t,i,l,s,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),l=C(),s=b("span"),r=W(o),a=W(" collection"),u=C(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[59]==n[2].type)},m(m,h){y(m,e,h),w(e,t),w(e,l),w(e,s),w(s,r),w(s,a),w(e,u),f||(c=B(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&re(r,o),h[0]&68&&Q(e,"selected",n[59]==n[2].type)},d(m){m&&v(e),f=!1,c()}}}function RD(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l{R=null}),ue()):R?(R.p(F,U),U[0]&4&&E(R,1)):(R=qh(F),R.c(),E(R,1),R.m(d,null)),(!A||U[0]&4&&T!==(T=F[2].id?-1:0))&&p(d,"tabindex",T),(!A||U[0]&4&&O!==(O=F[2].id?"":"button"))&&p(d,"role",O),(!A||U[0]&4&&M!==(M="btn btn-sm p-r-10 p-l-10 "+(F[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",M),(!A||U[0]&4)&&Q(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=jh(),z.c(),z.m(I.parentNode,I)):z&&(z.d(1),z=null)},i(F){A||(E(R),A=!0)},o(F){D(R),A=!1},d(F){F&&(v(e),v(l),v(s),v(f),v(c),v(L),v(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function zh(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){y(r,e,a),l=!0,s||(o=Ee(t=He.call(null,e,n[12])),s=!0)},p(r,a){t&&Nt(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){l||(r&&tt(()=>{l&&(i||(i=je(e,Mt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=je(e,Mt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function Uh(n){var a,u,f,c,d,m,h;let e,t,i,l=!V.isEmpty((a=n[5])==null?void 0:a.listRule)||!V.isEmpty((u=n[5])==null?void 0:u.viewRule)||!V.isEmpty((f=n[5])==null?void 0:f.createRule)||!V.isEmpty((c=n[5])==null?void 0:c.updateRule)||!V.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!V.isEmpty((m=n[5])==null?void 0:m.authRule)||!V.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Vh();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===io)},m(_,g){y(_,e,g),w(e,t),w(e,i),r&&r.m(e,null),s||(o=B(e,"click",n[41]),s=!0)},p(_,g){var k,S,$,T,O,M,L;g[0]&32&&(l=!V.isEmpty((k=_[5])==null?void 0:k.listRule)||!V.isEmpty((S=_[5])==null?void 0:S.viewRule)||!V.isEmpty(($=_[5])==null?void 0:$.createRule)||!V.isEmpty((T=_[5])==null?void 0:T.updateRule)||!V.isEmpty((O=_[5])==null?void 0:O.deleteRule)||!V.isEmpty((M=_[5])==null?void 0:M.authRule)||!V.isEmpty((L=_[5])==null?void 0:L.manageRule)),l?r?g[0]&32&&E(r,1):(r=Vh(),r.c(),E(r,1),r.m(e,null)):r&&(ae(),D(r,1,1,()=>{r=null}),ue()),g[0]&8&&Q(e,"active",_[3]===io)},d(_){_&&v(e),r&&r.d(),s=!1,o()}}}function Vh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Bh(n){let e,t,i,l=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),s,o,r=l&&Wh();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===ss)},m(a,u){y(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=B(e,"click",n[42]),s=!0)},p(a,u){u[0]&8224&&(l=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),l?r?u[0]&8224&&E(r,1):(r=Wh(),r.c(),E(r,1),r.m(e,null)):r&&(ae(),D(r,1,1,()=>{r=null}),ue()),u[0]&8&&Q(e,"active",a[3]===ss)},d(a){a&&v(e),r&&r.d(),s=!1,o()}}}function Wh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function qD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",_,g,k=!V.isEmpty(n[12]),S,$,T,O,M,L=!!n[2].id&&!n[2].system&&Rh(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[FD,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=k&&zh(n),A=!n[15]&&Uh(n),P=n[18]&&Bh(n);return{c(){e=b("h4"),i=W(t),l=C(),L&&L.c(),s=C(),o=b("form"),j(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),_=W(h),g=C(),I&&I.c(),S=C(),A&&A.c(),$=C(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),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]===xi),p(c,"class","tabs-header stretched")},m(N,R){y(N,e,R),w(e,i),y(N,l,R),L&&L.m(N,R),y(N,s,R),y(N,o,R),q(r,o,null),w(o,a),w(o,u),y(N,f,R),y(N,c,R),w(c,d),w(d,m),w(m,_),w(d,g),I&&I.m(d,null),w(c,S),A&&A.m(c,null),w(c,$),P&&P.m(c,null),T=!0,O||(M=[B(o,"submit",et(n[39])),B(d,"click",n[40])],O=!0)},p(N,R){(!T||R[0]&4)&&t!==(t=N[2].id?"Edit collection":"New collection")&&re(i,t),N[2].id&&!N[2].system?L?(L.p(N,R),R[0]&4&&E(L,1)):(L=Rh(N),L.c(),E(L,1),L.m(s.parentNode,s)):L&&(ae(),D(L,1,1,()=>{L=null}),ue());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&h!==(h=N[17]?"Query":"Fields")&&re(_,h),R[0]&4096&&(k=!V.isEmpty(N[12])),k?I?(I.p(N,R),R[0]&4096&&E(I,1)):(I=zh(N),I.c(),E(I,1),I.m(d,null)):I&&(ae(),D(I,1,1,()=>{I=null}),ue()),(!T||R[0]&8)&&Q(d,"active",N[3]===xi),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=Uh(N),A.c(),A.m(c,$)),N[18]?P?P.p(N,R):(P=Bh(N),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(N){T||(E(L),E(r.$$.fragment,N),E(I),T=!0)},o(N){D(L),D(r.$$.fragment,N),D(I),T=!1},d(N){N&&(v(e),v(l),v(s),v(o),v(f),v(c)),L&&L.d(N),H(r),I&&I.d(),A&&A.d(),P&&P.d(),O=!1,Ie(M)}}}function Yh(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[HD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[14]||n[9]||n[10]},m(r,a){y(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&17920&&s!==(s=!r[14]||r[9]||r[10]))&&(e.disabled=s)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&v(e),H(l)}}}function HD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[33]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function jD(n){let e,t,i,l,s,o,r=n[2].id?"Save changes":"Create",a,u,f,c,d,m,h=n[2].id&&Yh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("div"),s=b("button"),o=b("span"),a=W(r),f=C(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(s,"type","button"),p(s,"title","Save and close"),p(s,"class","btn"),s.disabled=u=!n[14]||n[9]||n[10],Q(s,"btn-expanded",!n[2].id),Q(s,"btn-expanded-sm",!!n[2].id),Q(s,"btn-loading",n[9]||n[10]),p(l,"class","btns-group no-gap")},m(_,g){y(_,e,g),w(e,t),y(_,i,g),y(_,l,g),w(l,s),w(s,o),w(o,a),w(l,f),h&&h.m(l,null),c=!0,d||(m=[B(e,"click",n[31]),B(s,"click",n[32])],d=!0)},p(_,g){(!c||g[0]&512)&&(e.disabled=_[9]),(!c||g[0]&4)&&r!==(r=_[2].id?"Save changes":"Create")&&re(a,r),(!c||g[0]&17920&&u!==(u=!_[14]||_[9]||_[10]))&&(s.disabled=u),(!c||g[0]&4)&&Q(s,"btn-expanded",!_[2].id),(!c||g[0]&4)&&Q(s,"btn-expanded-sm",!!_[2].id),(!c||g[0]&1536)&&Q(s,"btn-loading",_[9]||_[10]),_[2].id?h?(h.p(_,g),g[0]&4&&E(h,1)):(h=Yh(_),h.c(),E(h,1),h.m(l,null)):h&&(ae(),D(h,1,1,()=>{h=null}),ue())},i(_){c||(E(h),c=!0)},o(_){D(h),c=!1},d(_){_&&(v(e),v(i),v(l)),h&&h.d(),d=!1,Ie(m)}}}function zD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[jD],header:[qD],default:[PD]},$$scope:{ctx:n}};e=new nn({props:s}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new ID({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),y(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&2064&&(u.beforeHide=r[47]),a[0]&521836|a[2]&2&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[48](null),H(e,r),n[51](null),H(i,r)}}}const xi="schema",io="api_rules",ss="options",UD="base",Kh="auth",Jh="view";function La(n){return JSON.stringify(n)}function VD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Mu,Re=>t(30,u=Re)),Qe(n,ei,Re=>t(53,f=Re)),Qe(n,yn,Re=>t(5,c=Re));const d={};d[UD]="Base",d[Jh]="View",d[Kh]="Auth";const m=bt();let h,_,g=null,k={},S=!1,$=!1,T=!1,O=xi,M=La(k),L="",I=[];function A(Re){t(3,O=Re)}function P(Re){return z(Re),t(11,T=!0),t(10,$=!1),t(9,S=!1),A(xi),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function R(){t(11,T=!1),N()}async function z(Re){Yt({}),typeof Re<"u"?(t(28,g=Re),t(2,k=structuredClone(Re))):(t(28,g=null),t(2,k=structuredClone(u.base)),k.fields.push({type:"autodate",name:"created",onCreate:!0}),k.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,k.fields=k.fields||[],k),t(2,k._originalName=k.name||"",k),await un(),t(29,M=La(k))}async function F(Re=!0){if(!$){t(10,$=!0);try{k.id?await(_==null?void 0:_.show(g,k,Re)):await U(Re)}catch{}t(10,$=!1)}}function U(Re=!0){if(S)return;t(9,S=!0);const Ft=J(),Vt=!k.id;let wn;return Vt?wn=me.collections.create(Ft):wn=me.collections.update(k.id,Ft),wn.then(cn=>{Is(),Aw(cn),Re?(t(11,T=!1),N()):z(cn),en(k.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Vt,collection:cn}),Vt&&Rn(ei,f=cn,f)}).catch(cn=>{me.error(cn)}).finally(()=>{t(9,S=!1)})}function J(){const Re=Object.assign({},k);Re.fields=Re.fields.slice(0);for(let Ft=Re.fields.length-1;Ft>=0;Ft--)Re.fields[Ft]._toDelete&&Re.fields.splice(Ft,1);return Re}function K(){g!=null&&g.id&&pn(`Do you really want to delete all "${g.name}" records, including their cascade delete references and files?`,()=>me.collections.truncate(g.id).then(()=>{R(),en(`Successfully truncated collection "${g.name}".`),m("truncate")}).catch(Re=>{me.error(Re)}))}function x(){g!=null&&g.id&&pn(`Do you really want to delete collection "${g.name}" and all its records?`,()=>me.collections.delete(g.id).then(()=>{R(),en(`Successfully deleted collection "${g.name}".`),m("delete",g),Pw(g)}).catch(Re=>{me.error(Re)}))}function X(Re){t(2,k.type=Re,k),t(2,k=Object.assign(structuredClone(u[Re]),k)),di("fields")}function oe(){r?pn("You have unsaved changes. Do you really want to discard them?",()=>{Se()}):Se()}async function Se(){const Re=g?structuredClone(g):null;if(Re){if(Re.id="",Re.created="",Re.updated="",Re.name+="_duplicate",!V.isEmpty(Re.fields))for(const Ft of Re.fields)Ft.id="";if(!V.isEmpty(Re.indexes))for(let Ft=0;FtN(),Ye=()=>F(),nt=()=>F(!1),xe=()=>oe(),We=()=>K(),rt=()=>x(),Ze=Re=>{t(2,k.name=V.slugify(Re.target.value),k),Re.target.value=k.name},at=Re=>X(Re),Ht=()=>{a&&F()},Ve=()=>A(xi),Me=()=>A(io),st=()=>A(ss);function De(Re){k=Re,t(2,k),t(28,g)}function Be(Re){k=Re,t(2,k),t(28,g)}function ve(Re){k=Re,t(2,k),t(28,g)}function Ce(Re){k=Re,t(2,k),t(28,g)}const ut=()=>r&&T?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function qt(Re){ie[Re?"unshift":"push"](()=>{h=Re,t(7,h)})}function Le(Re){Ne.call(this,n,Re)}function ot(Re){Ne.call(this,n,Re)}function on(Re){ie[Re?"unshift":"push"](()=>{_=Re,t(8,_)})}const Mn=Re=>U(Re.detail);return n.$$.update=()=>{var Re;n.$$.dirty[0]&1073741824&&t(13,I=Object.keys(u.base||{})),n.$$.dirty[0]&4&&k.type==="view"&&(t(2,k.createRule=null,k),t(2,k.updateRule=null,k),t(2,k.deleteRule=null,k),t(2,k.indexes=[],k)),n.$$.dirty[0]&268435460&&k.name&&(g==null?void 0:g.name)!=k.name&&k.indexes.length>0&&t(2,k.indexes=(Re=k.indexes)==null?void 0:Re.map(Ft=>V.replaceIndexTableName(Ft,k.name)),k),n.$$.dirty[0]&4&&t(18,i=k.type===Kh),n.$$.dirty[0]&4&&t(17,l=k.type===Jh),n.$$.dirty[0]&32&&(c.fields||c.viewQuery||c.indexes?t(12,L=V.getNestedVal(c,"fields.message")||"Has errors"):t(12,L="")),n.$$.dirty[0]&4&&t(16,s=!!k.id&&k.system),n.$$.dirty[0]&4&&t(15,o=!!k.id&&k.system&&k.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=M!=La(k)),n.$$.dirty[0]&20&&t(14,a=!k.id||r),n.$$.dirty[0]&12&&O===ss&&k.type!=="auth"&&A(xi)},[A,N,k,O,r,c,d,h,_,S,$,T,L,I,a,o,s,l,i,F,U,K,x,X,oe,ge,P,R,g,M,u,$e,Ye,nt,xe,We,rt,Ze,at,Ht,Ve,Me,st,De,Be,ve,Ce,ut,qt,Le,ot,on,Mn]}class nf extends we{constructor(e){super(),ye(this,e,VD,zD,_e,{changeTab:0,show:26,hide:1,forceHide:27},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[26]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[27]}}function BD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),Q(e,"dragging",n[1])},m(l,s){y(l,e,s),n[4](e),t||(i=[B(e,"mousedown",n[5]),B(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&Q(e,"dragging",l[1])},i:te,o:te,d(l){l&&v(e),n[4](null),t=!1,Ie(i)}}}function WD(n,e,t){const i=bt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,u=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){f&&(g.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let k=g.clientX-o,S=g.clientY-r,$=g.clientX-a,T=g.clientY-u;!f&&Math.abs($-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,f,c,l,h,_]}class YD extends we{constructor(e){super(),ye(this,e,WD,BD,_e,{tolerance:3})}}function KD(n){let e,t,i,l,s;const o=n[5].default,r=It(o,n,n[4],null);return l=new YD({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),j(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){y(a,e,u),r&&r.m(e,null),n[6](e),y(a,i,u),q(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&At(r,o,a,a[4],s?Lt(o,a[4],u,null):Pt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){D(r,a),D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),H(l,a)}}}const Zh="@superuserSidebarWidth";function JD(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Zh)||null;function u(m){ie[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{V.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Zh,a))},[s,o,a,r,l,i,u,f,c,d]}class uv extends we{constructor(e){super(),ye(this,e,JD,KD,_e,{class:0})}}function Gh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"title",""),p(e,"aria-hidden","true")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function ZD(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function GD(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function XD(n){var T,O;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,_,g=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&Gh();function k(M,L){return M[1]?GD:ZD}let S=k(n),$=S(n);return{c(){var M;e=b("a"),t=b("i"),l=C(),s=b("span"),r=W(o),a=C(),g&&g.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),Q(e,"active",((M=n[2])==null?void 0:M.id)===n[0].id)},m(M,L){y(M,e,L),w(e,t),w(e,l),w(e,s),w(s,r),w(e,a),g&&g.m(e,null),w(e,u),w(e,f),$.m(f,null),h||(_=[Ee(c=He.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),B(f,"click",On(et(n[5]))),Ee(Vn.call(null,e))],h=!0)},p(M,[L]){var I,A,P;L&1&&i!==(i=zs(V.getCollectionTypeIcon(M[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=M[0].name+"")&&re(r,o),M[0].type=="auth"&&((I=M[0].oauth2)!=null&&I.enabled)&&!((A=M[0].oauth2.providers)!=null&&A.length)?g||(g=Gh(),g.c(),g.m(e,u)):g&&(g.d(1),g=null),S!==(S=k(M))&&($.d(1),$=S(M),$&&($.c(),$.m(f,null))),c&&Nt(c.update)&&L&2&&c.update.call(null,{position:"right",text:(M[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collection="+M[0].id)&&p(e,"href",d),L&1&&m!==(m=M[0].name)&&p(e,"title",m),L&5&&Q(e,"active",((P=M[2])==null?void 0:P.id)===M[0].id)},i:te,o:te,d(M){M&&v(e),g&&g.d(),$.d(),h=!1,Ie(_)}}}function QD(n,e,t){let i,l;Qe(n,ei,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?V.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class lf extends we{constructor(e){super(),ye(this,e,QD,XD,_e,{collection:0,pinnedIds:4})}}function Xh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[25]=e[t],i}function xh(n,e,t){const i=n.slice();return i[25]=e[t],i}function e_(n){let e,t,i=[],l=new Map,s,o,r=pe(n[2]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function n_(n){let e,t=[],i=new Map,l,s,o=n[2].length&&i_(),r=pe(n[8]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function s_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&o_(n),m=(n[6]||n[4].length)&&r_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","sidebar-title m-b-xs"),p(e,"aria-label",l=n[6]?"Expand system collections":"Collapse system collections"),p(e,"aria-expanded",s=n[6]||n[4].length),e.disabled=o=n[4].length,Q(e,"link-hint",!n[4].length)},m(h,_){y(h,e,_),w(e,t),w(e,i),d&&d.m(e,null),y(h,r,_),m&&m.m(h,_),y(h,a,_),u=!0,f||(c=B(e,"click",n[19]),f=!0)},p(h,_){h[4].length?d&&(d.d(1),d=null):d?d.p(h,_):(d=o_(h),d.c(),d.m(e,null)),(!u||_[0]&64&&l!==(l=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",l),(!u||_[0]&80&&s!==(s=h[6]||h[4].length))&&p(e,"aria-expanded",s),(!u||_[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||_[0]&16)&&Q(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,_),_[0]&80&&E(m,1)):(m=r_(h),m.c(),E(m,1),m.m(a.parentNode,a)):m&&(ae(),D(m,1,1,()=>{m=null}),ue())},i(h){u||(E(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(v(e),v(r),v(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function o_(n){let e,t;return{c(){e=b("i"),p(e,"class",t="ri-arrow-"+(n[6]?"up":"down")+"-s-line"),p(e,"aria-hidden","true")},m(i,l){y(i,e,l)},p(i,l){l[0]&64&&t!==(t="ri-arrow-"+(i[6]?"up":"down")+"-s-line")&&p(e,"class",t)},d(i){i&&v(e)}}}function r_(n){let e=[],t=new Map,i,l,s=pe(n[7]);const o=r=>r[25].id;for(let r=0;rbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function u_(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function f_(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){y(s,e,o),w(e,t),i||(l=B(t,"click",n[21]),i=!0)},p:te,d(s){s&&v(e),i=!1,l()}}}function xD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$=n[2].length&&e_(n),T=n[8].length&&n_(n),O=n[7].length&&s_(n),M=n[4].length&&!n[3].length&&u_(),L=!n[11]&&f_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),$&&$.c(),c=C(),T&&T.c(),d=C(),O&&O.c(),m=C(),M&&M.c(),h=C(),L&&L.c(),_=ke(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[9]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),Q(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),Q(f,"fade",n[10]),Q(f,"sidebar-content-compact",n[3].length>20)},m(I,A){y(I,e,A),w(e,t),w(t,i),w(i,l),w(t,s),w(t,o),ce(o,n[0]),y(I,r,A),y(I,a,A),y(I,u,A),y(I,f,A),$&&$.m(f,null),w(f,c),T&&T.m(f,null),w(f,d),O&&O.m(f,null),w(f,m),M&&M.m(f,null),y(I,h,A),L&&L.m(I,A),y(I,_,A),g=!0,k||(S=[B(l,"click",n[15]),B(o,"input",n[16])],k=!0)},p(I,A){(!g||A[0]&512)&&Q(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&ce(o,I[0]),(!g||A[0]&512)&&Q(t,"active",I[9]),I[2].length?$?($.p(I,A),A[0]&4&&E($,1)):($=e_(I),$.c(),E($,1),$.m(f,c)):$&&(ae(),D($,1,1,()=>{$=null}),ue()),I[8].length?T?(T.p(I,A),A[0]&256&&E(T,1)):(T=n_(I),T.c(),E(T,1),T.m(f,d)):T&&(ae(),D(T,1,1,()=>{T=null}),ue()),I[7].length?O?(O.p(I,A),A[0]&128&&E(O,1)):(O=s_(I),O.c(),E(O,1),O.m(f,m)):O&&(ae(),D(O,1,1,()=>{O=null}),ue()),I[4].length&&!I[3].length?M||(M=u_(),M.c(),M.m(f,null)):M&&(M.d(1),M=null),(!g||A[0]&1024)&&Q(f,"fade",I[10]),(!g||A[0]&8)&&Q(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=f_(I),L.c(),L.m(_.parentNode,_))},i(I){g||(E($),E(T),E(O),g=!0)},o(I){D($),D(T),D(O),g=!1},d(I){I&&(v(e),v(r),v(a),v(u),v(f),v(h),v(_)),$&&$.d(),T&&T.d(),O&&O.d(),M&&M.d(),L&&L.d(I),k=!1,Ie(S)}}}function eI(n){let e,t,i,l;e=new uv({props:{class:"collection-sidebar",$$slots:{default:[xD]},$$scope:{ctx:n}}});let s={};return i=new nf({props:s}),n[22](i),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),y(o,t,r),q(i,o,r),l=!0},p(o,r){const a={};r[0]&4095|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&v(t),H(e,o),n[22](null),H(i,o)}}}const c_="@pinnedCollections";function tI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function nI(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,En,R=>t(13,u=R)),Qe(n,ei,R=>t(14,f=R)),Qe(n,Js,R=>t(10,c=R)),Qe(n,Dl,R=>t(11,d=R));let m,h="",_=[],g=!1,k;S();function S(){t(1,_=[]);try{const R=localStorage.getItem(c_);R&&t(1,_=JSON.parse(R)||[])}catch{}}function $(){t(1,_=_.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,h="");function O(){h=this.value,t(0,h)}function M(R){_=R,t(1,_)}function L(R){_=R,t(1,_)}const I=()=>{i.length||t(6,g=!g)};function A(R){_=R,t(1,_)}const P=()=>m==null?void 0:m.show();function N(R){ie[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&($(),tI()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,l=h!==""),n.$$.dirty[0]&2&&_&&localStorage.setItem(c_,JSON.stringify(_)),n.$$.dirty[0]&8209&&t(3,s=u.filter(R=>{var z,F,U;return R.id==h||((U=(F=(z=R.name)==null?void 0:z.replace(/\s+/g,""))==null?void 0:F.toLowerCase())==null?void 0:U.includes(i))})),n.$$.dirty[0]&10&&t(2,o=s.filter(R=>_.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(R=>!R.system&&!_.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(R=>R.system&&!_.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&k!=f.id&&(t(12,k=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,g=!0):t(6,g=!1))},[h,_,o,s,i,m,g,a,r,l,c,d,k,u,f,T,O,M,L,I,A,P,N]}class iI extends we{constructor(e){super(),ye(this,e,nI,eI,_e,{},null,[-1,-1])}}function lI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function sI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=W(n[2]),l=C(),s=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){y(f,e,c),w(e,t),w(t,i),w(e,l),w(e,s),w(s,o),w(s,r),a||(u=Ee(He.call(null,e,n[3])),a=!0)},p(f,c){c&4&&re(i,f[2]),c&2&&re(o,f[1])},d(f){f&&v(e),a=!1,u()}}}function oI(n){let e;function t(s,o){return s[0]?sI:lI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function rI(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return V.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class sf extends we{constructor(e){super(),ye(this,e,rI,oI,_e,{date:0})}}function d_(n){let e;function t(s,o){return s[4]==="image"?uI:aI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function aI(n){let e,t;return{c(){e=b("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){y(i,e,l),w(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function uI(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){y(l,e,s)},p(l,s){s&2&&!kn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function fI(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&d_(n);return{c(){i&&i.c(),t=ke()},m(s,o){i&&i.m(s,o),y(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=d_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function cI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){y(l,e,s),t||(i=B(e,"click",et(n[0])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function dI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=W(n[2]),i=C(),l=b("i"),s=C(),o=b("div"),r=C(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,s,d),y(c,o,d),y(c,r,d),y(c,a,d),u||(f=B(a,"click",n[0]),u=!0)},p(c,d){d&4&&re(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),u=!1,f()}}}function pI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[dI],header:[cI],default:[fI]},$$scope:{ctx:n}};return e=new nn({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[7](null),H(e,l)}}}function mI(n,e,t){let i,l,s,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){ie[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ne.call(this,n,m)}function d(m){Ne.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=V.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class hI extends we{constructor(e){super(),ye(this,e,mI,pI,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function _I(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?vI:u[3]==="video"||u[3]==="audio"?kI:bI}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){y(u,e,f),a.m(e,null),l||(s=B(e,"click",On(n[11])),l=!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&&v(e),a.d(),l=!1,s()}}}function gI(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){y(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function bI(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function kI(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function vI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),kn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){y(o,e,r),l||(s=B(e,"error",n[8]),l=!0)},p(o,r){r&32&&!kn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function p_(n){let e,t,i={};return e=new hI({props:i}),n[12](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[12](null),H(e,l)}}}function yI(n){let e,t,i;function l(a,u){return a[2]?gI:_I}let s=l(n),o=s(n),r=n[7]&&p_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ke()},m(a,u){o.m(a,u),y(a,e,u),r&&r.m(a,u),y(a,t,u),i=!0},p(a,[u]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&E(r,1)):(r=p_(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(ae(),D(r,1,1,()=>{r=null}),ue())},i(a){i||(E(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function wI(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await me.getSuperuserFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function h(){t(5,u="")}const _=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function g(k){ie[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=V.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":me.files.getURL(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":me.files.getURL(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,h,s,c,_,g]}class of extends we{constructor(e){super(),ye(this,e,wI,yI,_e,{record:9,filename:0,size:1})}}function m_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function h_(n,e,t){const i=n.slice();i[7]=e[t];const l=V.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function __(n,e,t){const i=n.slice();return i[13]=e[t],i}function g_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[13]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function b_(n){let e=!V.isEmpty(n[13]),t,i,l=e&&g_(n);return{c(){l&&l.c(),t=ke()},m(s,o){l&&l.m(s,o),y(s,t,o),i=!0},p(s,o){o&3&&(e=!V.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&E(l,1)):(l=g_(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(ae(),D(l,1,1,()=>{l=null}),ue())},i(s){i||(E(l),i=!0)},o(s){D(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function k_(n){let e,t,i=pe(n[10]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;obe(e,"record",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&5&&(t=!0,a.record=n[0].expand[n[7].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function y_(n){let e,t,i,l,s,o=n[9]>0&&SI();const r=[$I,TI],a=[];function u(f,c){var d;return f[7].type=="relation"&&((d=f[0].expand)!=null&&d[f[7].name])?0:1}return t=u(n),i=a[t]=r[t](n),{c(){o&&o.c(),e=C(),i.c(),l=ke()},m(f,c){o&&o.m(f,c),y(f,e,c),a[t].m(f,c),y(f,l,c),s=!0},p(f,c){let d=t;t=u(f),t===d?a[t].p(f,c):(ae(),D(a[d],1,1,()=>{a[d]=null}),ue(),i=a[t],i?i.p(f,c):(i=a[t]=r[t](f),i.c()),E(i,1),i.m(l.parentNode,l))},i(f){s||(E(i),s=!0)},o(f){D(i),s=!1},d(f){f&&(v(e),v(l)),o&&o.d(f),a[t].d(f)}}}function CI(n){let e,t,i,l=pe(n[1]),s=[];for(let c=0;cD(s[c],1,1,()=>{s[c]=null});let r=pe(n[2]),a=[];for(let c=0;cD(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=v_(n)),{c(){for(let c=0;ct(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.fields)||[];if(t(1,o=f.filter(c=>!c.hidden&&c.presentable&&c.type=="file")),t(2,r=f.filter(c=>!c.hidden&&c.presentable&&c.type!="file")),!o.length&&!r.length){const c=f.find(d=>{var m;return!d.hidden&&d.type=="file"&&d.maxSelect==1&&((m=d.mimeTypes)==null?void 0:m.find(h=>h.startsWith("image/")))});c&&o.push(c)}}function u(f,c){n.$$.not_equal(s.expand[c.name],f)&&(s.expand[c.name]=f,t(0,s))}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l,u]}class fv extends we{constructor(e){super(),ye(this,e,OI,CI,_e,{record:0})}}function EI(n){let e,t,i,l,s,o,r,a,u,f;return t=new fv({props:{record:n[0]}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(l,"target","_blank"),p(l,"class","inline-flex link-hint"),p(l,"rel","noopener noreferrer"),p(e,"class","record-info svelte-69icne")},m(c,d){y(c,e,d),q(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Ee(r=He.call(null,l,{text:`Open relation record in new tab: -`+V.truncate(JSON.stringify(V.truncateObject(w_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),B(l,"click",On(n[1])),B(l,"keydown",On(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&Nt(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab: -`+V.truncate(JSON.stringify(V.truncateObject(w_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(E(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&v(e),H(t),u=!1,Ie(f)}}}function w_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function MI(n,e,t){let{record:i}=e;function l(o){Ne.call(this,n,o)}function s(o){Ne.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Ur extends we{constructor(e){super(),ye(this,e,MI,EI,_e,{record:0})}}function S_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function T_(n,e,t){const i=n.slice();return i[14]=e[t],i}function $_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function C_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function DI(n){const e=n.slice(),t=V.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function II(n){var s,o;const e=n.slice(),t=V.toArray(e[3]);e[10]=t;const i=V.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[11]=i;const l=e[2]?20:500;return e[12]=l,e}function LI(n){const e=n.slice(),t=V.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function AI(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l&8&&re(t,i[3])},i:te,o:te,d(i){i&&v(e)}}}function PI(n){let e,t=V.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=V.truncate(n[3]))},m(s,o){y(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=V.truncate(s[3])+"")&&re(i,t),o&8&&l!==(l=V.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&v(e)}}}function NI(n){let e,t=[],i=new Map,l,s,o=pe(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;un[18]&&E_();return{c(){e=b("div");for(let u=0;uu[18]?a||(a=E_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&Q(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;fn[12]&&I_();return{c(){e=b("div"),i.c(),l=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){y(f,e,c),r[t].m(e,null),w(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ae(),D(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),E(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=I_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(E(i),s=!0)},o(f){D(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function FI(n){let e,t=[],i=new Map,l=pe(V.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function jI(n){let e,t=V.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){y(o,e,r),w(e,i),l||(s=[Ee(He.call(null,e,"Open in new tab")),B(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=V.truncate(o[3])+"")&&re(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&v(e),l=!1,Ie(s)}}}function zI(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l&8&&re(t,i[3])},i:te,o:te,d(i){i&&v(e)}}}function UI(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","label"),Q(e,"label-success",!!n[3])},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&re(i,t),s&8&&Q(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&v(e)}}}function VI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function BI(n){let e,t,i,l;const s=[XI,GI],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function WI(n){let e,t,i,l,s,o,r,a;t=new fi({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&P_();return{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),s=W(n[3]),o=C(),u&&u.c(),r=ke(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){y(f,e,c),q(t,e,null),w(e,i),w(e,l),w(l,s),y(f,o,c),u&&u.m(f,c),y(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&re(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=P_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(E(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(v(e),v(o),v(r)),H(t),u&&u.d(f)}}}function O_(n,e){let t,i,l;return i=new of({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(s,o){y(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(i,s)}}}function E_(n){let e;return{c(){e=W("...")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function YI(n){let e,t=pe(n[10].slice(0,n[12])),i=[];for(let l=0;lr[9]+r[7];for(let r=0;r500&&A_(n);return{c(){e=b("span"),i=W(t),l=C(),r&&r.c(),s=ke(),p(e,"class","txt")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),r&&r.m(a,u),y(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=V.truncate(a[6],500,!0)+"")&&re(i,t),a[6].length>500?r?(r.p(a,u),u&8&&E(r,1)):(r=A_(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(ae(),D(r,1,1,()=>{r=null}),ue())},i(a){o||(E(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function XI(n){let e,t=V.truncate(n[6])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=V.truncate(l[6])+"")&&re(i,t)},i:te,o:te,d(l){l&&v(e)}}}function A_(n){let e,t;return e=new fi({props:{value:JSON.stringify(n[3],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function P_(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function QI(n){let e,t,i,l,s;const o=[WI,BI,VI,UI,zI,jI,HI,qI,FI,RI,NI,PI,AI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!V.isEmpty(f[3])),e?2:f[1].type==="bool"?3:f[1].type==="number"?4:f[1].type==="url"?5:f[1].type==="editor"?6:f[1].type==="date"||f[1].type==="autodate"?7:f[1].type==="select"?8:f[1].type==="relation"?9:f[1].type==="file"?10:f[2]?11:12)}function u(f,c){return c===1?LI(f):c===9?II(f):c===10?DI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ke()},m(f,c){r[t].m(f,c),y(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ae(),D(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()),E(i,1),i.m(l.parentNode,l))},i(f){s||(E(i),s=!0)},o(f){D(i),s=!1},d(f){f&&v(l),r[t].d(f)}}}function xI(n,e,t){let i,l;Qe(n,Fr,u=>t(4,l=u));let{record:s}=e,{field:o}=e,{short:r=!1}=e;function a(u){Ne.call(this,n,u)}return n.$$set=u=>{"record"in u&&t(0,s=u.record),"field"in u&&t(1,o=u.field),"short"in u&&t(2,r=u.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[o.name])},[s,o,r,i,l,a]}class cv extends we{constructor(e){super(),ye(this,e,xI,QI,_e,{record:0,field:1,short:2})}}function N_(n,e,t){const i=n.slice();return i[13]=e[t],i}function R_(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new cv({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=W(i),s=C(),o=b("td"),j(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){y(u,e,f),w(e,t),w(t,l),w(e,s),w(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&re(l,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(E(r.$$.fragment,u),a=!0)},o(u){D(r.$$.fragment,u),a=!1},d(u){u&&v(e),H(r)}}}function F_(n){let e,t,i,l,s,o;return s=new sf({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=C(),l=b("td"),j(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),q(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&v(e),H(s)}}}function q_(n){let e,t,i,l,s,o;return s=new sf({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=C(),l=b("td"),j(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),q(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&v(e),H(s)}}}function eL(n){var M;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,h,_,g;a=new fi({props:{value:n[3].id}});let k=pe((M=n[0])==null?void 0:M.fields),S=[];for(let L=0;LD(S[L],1,1,()=>{S[L]=null});let T=n[3].created&&F_(n),O=n[3].updated&&q_(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("div"),j(a.$$.fragment),u=C(),f=b("span"),d=W(c),m=C();for(let L=0;L{T=null}),ue()),L[3].updated?O?(O.p(L,I),I&8&&E(O,1)):(O=q_(L),O.c(),E(O,1),O.m(t,null)):O&&(ae(),D(O,1,1,()=>{O=null}),ue()),(!g||I&16)&&Q(e,"table-loading",L[4])},i(L){if(!g){E(a.$$.fragment,L);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[7]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function iL(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[nL],header:[tL],default:[eL]},$$scope:{ctx:n}};return e=new nn({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function lL(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return f(g),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await me.collection(l.id).getOne(g)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),Ci(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>u();function m(g){ie[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ne.call(this,n,g)}function _(g){Ne.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.fields)!=null&&g.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,h,_]}class sL extends we{constructor(e){super(),ye(this,e,lL,iL,_e,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function oL(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){y(s,e,o),i||(l=Ee(t=He.call(null,e,{text:n[0].join(` + `),L=b("a"),A=B("Review existing "),P=b("code"),P.textContent="_externalAuths",N=B(` records + `),R=b("i"),z=C(),U=B("."),J=C(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(P,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(L,"href",F=n[12](n[24].name)),p(L,"target","_blank"),p(T,"class","txt-hint"),p(e,"class","svelte-xqpcsf")},m(K,x){y(K,e,x),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(r,c),w(r,d),w(r,m),w(r,h),w(h,g),w(e,k),w(e,S),w(e,$),w(e,T),w(T,O),w(T,E),w(T,I),w(T,L),w(L,A),w(L,P),w(L,N),w(L,R),w(L,z),w(T,U),w(e,J)},p(K,x){x[0]&64&&l!==(l=K[24].name+"")&&re(s,l),x[0]&64&&u!==(u=K[24].oldHost+"")&&re(f,u),x[0]&64&&_!==(_=K[24].newHost+"")&&re(g,_),x[0]&64&&F!==(F=K[12](K[24].name))&&p(L,"href",F)},d(K){K&&v(e)}}}function ED(n){let e,t,i=(n[3]||n[8].length||n[9].length)&&Th(n),l=n[10]&&Ch(n);return{c(){i&&i.c(),e=C(),l&&l.c(),t=ke()},m(s,o){i&&i.m(s,o),y(s,e,o),l&&l.m(s,o),y(s,t,o)},p(s,o){s[3]||s[8].length||s[9].length?i?i.p(s,o):(i=Th(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s[10]?l?l.p(s,o):(l=Ch(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(s){s&&(v(e),v(t)),i&&i.d(s),l&&l.d(s)}}}function MD(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function DD(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=C(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),e.focus(),l||(s=[W(e,"click",n[14]),W(i,"click",n[15])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,Ie(s)}}}function ID(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[DD],header:[MD],default:[ED]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&2014|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function LD(n,e,t){let i,l,s,o,r,a;const u=bt();let f,c,d,m,h=[];async function _(N,R,z=!0){t(1,c=N),t(2,d=R),m=z,await $(),await un(),i||s.length||o.length||r.length||h.length?f==null||f.show():k()}function g(){f==null||f.hide()}function k(){g(),u("confirm",m)}const S=["oidc","oidc2","oidc3"];async function $(){var N,R,z,F;t(6,h=[]);for(let U of S){let J=(R=(N=c==null?void 0:c.oauth2)==null?void 0:N.providers)==null?void 0:R.find(oe=>oe.name==U),K=(F=(z=d==null?void 0:d.oauth2)==null?void 0:z.providers)==null?void 0:F.find(oe=>oe.name==U);if(!J||!K)continue;let x=new URL(J.authURL).host,X=new URL(K.authURL).host;x!=X&&await T(U)&&h.push({name:U,oldHost:x,newHost:X})}}async function T(N){try{return await me.collection("_externalAuths").getFirstListItem(me.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:d==null?void 0:d.id,provider:N})),!0}catch{}return!1}function O(N){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${d==null?void 0:d.id}%22+%26%26+provider%3D%22${N}%22`}const E=()=>g(),I=()=>k();function L(N){ie[N?"unshift":"push"](()=>{f=N,t(5,f)})}function A(N){Ne.call(this,n,N)}function P(N){Ne.call(this,n,N)}return n.$$.update=()=>{var N,R,z;n.$$.dirty[0]&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty[0]&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty[0]&4&&t(9,s=((N=d==null?void 0:d.fields)==null?void 0:N.filter(F=>F.id&&!F._toDelete&&F._originalName!=F.name))||[]),n.$$.dirty[0]&4&&t(8,o=((R=d==null?void 0:d.fields)==null?void 0:R.filter(F=>F.id&&F._toDelete))||[]),n.$$.dirty[0]&6&&t(7,r=((z=d==null?void 0:d.fields)==null?void 0:z.filter(F=>{var J;const U=(J=c==null?void 0:c.fields)==null?void 0:J.find(K=>K.id==F.id);return U?U.maxSelect!=1&&F.maxSelect==1:!1}))||[]),n.$$.dirty[0]&24&&t(10,a=!l||i)},[g,c,d,i,l,f,h,r,o,s,a,k,O,_,E,I,L,A,P]}class AD extends we{constructor(e){super(),ye(this,e,LD,ID,_e,{show:13,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[13]}get hide(){return this.$$.ctx[0]}}function Ah(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function PD(n){let e,t,i;function l(o){n[44](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new pD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ND(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new kD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Ph(n){let e,t,i,l;function s(r){n[45](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new OD({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){y(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Te(()=>i=!1)),t.$set(u)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&v(e),H(t)}}}function Nh(n){let e,t,i,l;function s(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new PO({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===ss)},m(r,a){y(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Te(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&Q(e,"active",r[3]===ss)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&v(e),H(t)}}}function RD(n){let e,t,i,l,s,o,r;const a=[ND,PD],u=[];function f(m,h){return m[17]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[15]&&n[3]===io&&Ph(n),d=n[18]&&Nh(n);return{c(){e=b("div"),t=b("div"),l.c(),s=C(),c&&c.c(),o=C(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===xi),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){y(m,e,h),w(e,t),u[i].m(t,null),w(e,s),c&&c.m(e,null),w(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(ae(),D(u[_],1,1,()=>{u[_]=null}),ue(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),M(l,1),l.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===xi),!m[15]&&m[3]===io?c?(c.p(m,h),h[0]&32776&&M(c,1)):(c=Ph(m),c.c(),M(c,1),c.m(e,o)):c&&(ae(),D(c,1,1,()=>{c=null}),ue()),m[18]?d?(d.p(m,h),h[0]&262144&&M(d,1)):(d=Nh(m),d.c(),M(d,1),d.m(e,null)):d&&(ae(),D(d,1,1,()=>{d=null}),ue())},i(m){r||(M(l),M(c),M(d),r=!0)},o(m){D(l),D(c),D(d),r=!1},d(m){m&&v(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Rh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[FD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&131072|u[2]&2&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),H(o)}}}function Fh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Truncate',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function FD(n){let e,t,i,l,s,o,r,a,u=!n[17]&&Fh(n);return{c(){e=b("button"),e.innerHTML=' Duplicate',t=C(),i=b("hr"),l=C(),u&&u.c(),s=C(),o=b("button"),o.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(o,"type","button"),p(o,"class","dropdown-item txt-danger"),p(o,"role","menuitem")},m(f,c){y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),u&&u.m(f,c),y(f,s,c),y(f,o,c),r||(a=[W(e,"click",n[34]),W(o,"click",On(et(n[36])))],r=!0)},p(f,c){f[17]?u&&(u.d(1),u=null):u?u.p(f,c):(u=Fh(f),u.c(),u.m(s.parentNode,s))},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o)),u&&u.d(f),r=!1,Ie(a)}}}function qh(n){let e,t,i,l;return i=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[qD]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),j(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){y(s,e,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),H(i,s)}}}function Hh(n){let e,t,i,l,s,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),l=C(),s=b("span"),r=B(o),a=B(" collection"),u=C(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[59]==n[2].type)},m(m,h){y(m,e,h),w(e,t),w(e,l),w(e,s),w(s,r),w(s,a),w(e,u),f||(c=W(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&re(r,o),h[0]&68&&Q(e,"selected",n[59]==n[2].type)},d(m){m&&v(e),f=!1,c()}}}function qD(n){let e,t=de(Object.entries(n[6])),i=[];for(let l=0;l{R=null}),ue()):R?(R.p(F,U),U[0]&4&&M(R,1)):(R=qh(F),R.c(),M(R,1),R.m(d,null)),(!A||U[0]&4&&T!==(T=F[2].id?-1:0))&&p(d,"tabindex",T),(!A||U[0]&4&&O!==(O=F[2].id?"":"button"))&&p(d,"role",O),(!A||U[0]&4&&E!==(E="btn btn-sm p-r-10 p-l-10 "+(F[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",E),(!A||U[0]&4)&&Q(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=jh(),z.c(),z.m(L.parentNode,L)):z&&(z.d(1),z=null)},i(F){A||(M(R),A=!0)},o(F){D(R),A=!1},d(F){F&&(v(e),v(l),v(s),v(f),v(c),v(I),v(L)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function zh(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){y(r,e,a),l=!0,s||(o=Ee(t=He.call(null,e,n[12])),s=!0)},p(r,a){t&&Nt(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){l||(r&&tt(()=>{l&&(i||(i=je(e,Mt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=je(e,Mt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function Uh(n){var a,u,f,c,d,m,h;let e,t,i,l=!V.isEmpty((a=n[5])==null?void 0:a.listRule)||!V.isEmpty((u=n[5])==null?void 0:u.viewRule)||!V.isEmpty((f=n[5])==null?void 0:f.createRule)||!V.isEmpty((c=n[5])==null?void 0:c.updateRule)||!V.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!V.isEmpty((m=n[5])==null?void 0:m.authRule)||!V.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Vh();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===io)},m(_,g){y(_,e,g),w(e,t),w(e,i),r&&r.m(e,null),s||(o=W(e,"click",n[41]),s=!0)},p(_,g){var k,S,$,T,O,E,I;g[0]&32&&(l=!V.isEmpty((k=_[5])==null?void 0:k.listRule)||!V.isEmpty((S=_[5])==null?void 0:S.viewRule)||!V.isEmpty(($=_[5])==null?void 0:$.createRule)||!V.isEmpty((T=_[5])==null?void 0:T.updateRule)||!V.isEmpty((O=_[5])==null?void 0:O.deleteRule)||!V.isEmpty((E=_[5])==null?void 0:E.authRule)||!V.isEmpty((I=_[5])==null?void 0:I.manageRule)),l?r?g[0]&32&&M(r,1):(r=Vh(),r.c(),M(r,1),r.m(e,null)):r&&(ae(),D(r,1,1,()=>{r=null}),ue()),g[0]&8&&Q(e,"active",_[3]===io)},d(_){_&&v(e),r&&r.d(),s=!1,o()}}}function Vh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Bh(n){let e,t,i,l=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),s,o,r=l&&Wh();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===ss)},m(a,u){y(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=W(e,"click",n[42]),s=!0)},p(a,u){u[0]&8224&&(l=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),l?r?u[0]&8224&&M(r,1):(r=Wh(),r.c(),M(r,1),r.m(e,null)):r&&(ae(),D(r,1,1,()=>{r=null}),ue()),u[0]&8&&Q(e,"active",a[3]===ss)},d(a){a&&v(e),r&&r.d(),s=!1,o()}}}function Wh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function jD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",_,g,k=!V.isEmpty(n[12]),S,$,T,O,E,I=!!n[2].id&&!n[2].system&&Rh(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[HD,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let L=k&&zh(n),A=!n[15]&&Uh(n),P=n[18]&&Bh(n);return{c(){e=b("h4"),i=B(t),l=C(),I&&I.c(),s=C(),o=b("form"),j(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),_=B(h),g=C(),L&&L.c(),S=C(),A&&A.c(),$=C(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),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]===xi),p(c,"class","tabs-header stretched")},m(N,R){y(N,e,R),w(e,i),y(N,l,R),I&&I.m(N,R),y(N,s,R),y(N,o,R),q(r,o,null),w(o,a),w(o,u),y(N,f,R),y(N,c,R),w(c,d),w(d,m),w(m,_),w(d,g),L&&L.m(d,null),w(c,S),A&&A.m(c,null),w(c,$),P&&P.m(c,null),T=!0,O||(E=[W(o,"submit",et(n[39])),W(d,"click",n[40])],O=!0)},p(N,R){(!T||R[0]&4)&&t!==(t=N[2].id?"Edit collection":"New collection")&&re(i,t),N[2].id&&!N[2].system?I?(I.p(N,R),R[0]&4&&M(I,1)):(I=Rh(N),I.c(),M(I,1),I.m(s.parentNode,s)):I&&(ae(),D(I,1,1,()=>{I=null}),ue());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&h!==(h=N[17]?"Query":"Fields")&&re(_,h),R[0]&4096&&(k=!V.isEmpty(N[12])),k?L?(L.p(N,R),R[0]&4096&&M(L,1)):(L=zh(N),L.c(),M(L,1),L.m(d,null)):L&&(ae(),D(L,1,1,()=>{L=null}),ue()),(!T||R[0]&8)&&Q(d,"active",N[3]===xi),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=Uh(N),A.c(),A.m(c,$)),N[18]?P?P.p(N,R):(P=Bh(N),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(N){T||(M(I),M(r.$$.fragment,N),M(L),T=!0)},o(N){D(I),D(r.$$.fragment,N),D(L),T=!1},d(N){N&&(v(e),v(l),v(s),v(o),v(f),v(c)),I&&I.d(N),H(r),L&&L.d(),A&&A.d(),P&&P.d(),O=!1,Ie(E)}}}function Yh(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[zD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[14]||n[9]||n[10]},m(r,a){y(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&17920&&s!==(s=!r[14]||r[9]||r[10]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&v(e),H(l)}}}function zD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[33]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function UD(n){let e,t,i,l,s,o,r=n[2].id?"Save changes":"Create",a,u,f,c,d,m,h=n[2].id&&Yh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("div"),s=b("button"),o=b("span"),a=B(r),f=C(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(s,"type","button"),p(s,"title","Save and close"),p(s,"class","btn"),s.disabled=u=!n[14]||n[9]||n[10],Q(s,"btn-expanded",!n[2].id),Q(s,"btn-expanded-sm",!!n[2].id),Q(s,"btn-loading",n[9]||n[10]),p(l,"class","btns-group no-gap")},m(_,g){y(_,e,g),w(e,t),y(_,i,g),y(_,l,g),w(l,s),w(s,o),w(o,a),w(l,f),h&&h.m(l,null),c=!0,d||(m=[W(e,"click",n[31]),W(s,"click",n[32])],d=!0)},p(_,g){(!c||g[0]&512)&&(e.disabled=_[9]),(!c||g[0]&4)&&r!==(r=_[2].id?"Save changes":"Create")&&re(a,r),(!c||g[0]&17920&&u!==(u=!_[14]||_[9]||_[10]))&&(s.disabled=u),(!c||g[0]&4)&&Q(s,"btn-expanded",!_[2].id),(!c||g[0]&4)&&Q(s,"btn-expanded-sm",!!_[2].id),(!c||g[0]&1536)&&Q(s,"btn-loading",_[9]||_[10]),_[2].id?h?(h.p(_,g),g[0]&4&&M(h,1)):(h=Yh(_),h.c(),M(h,1),h.m(l,null)):h&&(ae(),D(h,1,1,()=>{h=null}),ue())},i(_){c||(M(h),c=!0)},o(_){D(h),c=!1},d(_){_&&(v(e),v(i),v(l)),h&&h.d(),d=!1,Ie(m)}}}function VD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[UD],header:[jD],default:[RD]},$$scope:{ctx:n}};e=new Gt({props:s}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new AD({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),y(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&2064&&(u.beforeHide=r[47]),a[0]&521836|a[2]&2&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[48](null),H(e,r),n[51](null),H(i,r)}}}const xi="schema",io="api_rules",ss="options",BD="base",Kh="auth",Jh="view";function La(n){return JSON.stringify(n)}function WD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Mu,Re=>t(30,u=Re)),Qe(n,ei,Re=>t(53,f=Re)),Qe(n,yn,Re=>t(5,c=Re));const d={};d[BD]="Base",d[Jh]="View",d[Kh]="Auth";const m=bt();let h,_,g=null,k={},S=!1,$=!1,T=!1,O=xi,E=La(k),I="",L=[];function A(Re){t(3,O=Re)}function P(Re){return z(Re),t(11,T=!0),t(10,$=!1),t(9,S=!1),A(xi),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function R(){t(11,T=!1),N()}async function z(Re){Yt({}),typeof Re<"u"?(t(28,g=Re),t(2,k=structuredClone(Re))):(t(28,g=null),t(2,k=structuredClone(u.base)),k.fields.push({type:"autodate",name:"created",onCreate:!0}),k.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,k.fields=k.fields||[],k),t(2,k._originalName=k.name||"",k),await un(),t(29,E=La(k))}async function F(Re=!0){if(!$){t(10,$=!0);try{k.id?await(_==null?void 0:_.show(g,k,Re)):await U(Re)}catch{}t(10,$=!1)}}function U(Re=!0){if(S)return;t(9,S=!0);const Ft=J(),Vt=!k.id;let wn;return Vt?wn=me.collections.create(Ft):wn=me.collections.update(k.id,Ft),wn.then(cn=>{Is(),Nw(cn),Re?(t(11,T=!1),N()):z(cn),tn(k.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Vt,collection:cn}),Vt&&Rn(ei,f=cn,f)}).catch(cn=>{me.error(cn)}).finally(()=>{t(9,S=!1)})}function J(){const Re=Object.assign({},k);Re.fields=Re.fields.slice(0);for(let Ft=Re.fields.length-1;Ft>=0;Ft--)Re.fields[Ft]._toDelete&&Re.fields.splice(Ft,1);return Re}function K(){g!=null&&g.id&&pn(`Do you really want to delete all "${g.name}" records, including their cascade delete references and files?`,()=>me.collections.truncate(g.id).then(()=>{R(),tn(`Successfully truncated collection "${g.name}".`),m("truncate")}).catch(Re=>{me.error(Re)}))}function x(){g!=null&&g.id&&pn(`Do you really want to delete collection "${g.name}" and all its records?`,()=>me.collections.delete(g.id).then(()=>{R(),tn(`Successfully deleted collection "${g.name}".`),m("delete",g),Rw(g)}).catch(Re=>{me.error(Re)}))}function X(Re){t(2,k.type=Re,k),t(2,k=Object.assign(structuredClone(u[Re]),k)),di("fields")}function oe(){r?pn("You have unsaved changes. Do you really want to discard them?",()=>{Se()}):Se()}async function Se(){const Re=g?structuredClone(g):null;if(Re){if(Re.id="",Re.created="",Re.updated="",Re.name+="_duplicate",!V.isEmpty(Re.fields))for(const Ft of Re.fields)Ft.id="";if(!V.isEmpty(Re.indexes))for(let Ft=0;FtN(),Ye=()=>F(),nt=()=>F(!1),xe=()=>oe(),We=()=>K(),rt=()=>x(),Ze=Re=>{t(2,k.name=V.slugify(Re.target.value),k),Re.target.value=k.name},at=Re=>X(Re),Ht=()=>{a&&F()},Ve=()=>A(xi),Me=()=>A(io),st=()=>A(ss);function De(Re){k=Re,t(2,k),t(28,g)}function Be(Re){k=Re,t(2,k),t(28,g)}function ve(Re){k=Re,t(2,k),t(28,g)}function Ce(Re){k=Re,t(2,k),t(28,g)}const ut=()=>r&&T?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function qt(Re){ie[Re?"unshift":"push"](()=>{h=Re,t(7,h)})}function Le(Re){Ne.call(this,n,Re)}function ot(Re){Ne.call(this,n,Re)}function on(Re){ie[Re?"unshift":"push"](()=>{_=Re,t(8,_)})}const Mn=Re=>U(Re.detail);return n.$$.update=()=>{var Re;n.$$.dirty[0]&1073741824&&t(13,L=Object.keys(u.base||{})),n.$$.dirty[0]&4&&k.type==="view"&&(t(2,k.createRule=null,k),t(2,k.updateRule=null,k),t(2,k.deleteRule=null,k),t(2,k.indexes=[],k)),n.$$.dirty[0]&268435460&&k.name&&(g==null?void 0:g.name)!=k.name&&k.indexes.length>0&&t(2,k.indexes=(Re=k.indexes)==null?void 0:Re.map(Ft=>V.replaceIndexTableName(Ft,k.name)),k),n.$$.dirty[0]&4&&t(18,i=k.type===Kh),n.$$.dirty[0]&4&&t(17,l=k.type===Jh),n.$$.dirty[0]&32&&(c.fields||c.viewQuery||c.indexes?t(12,I=V.getNestedVal(c,"fields.message")||"Has errors"):t(12,I="")),n.$$.dirty[0]&4&&t(16,s=!!k.id&&k.system),n.$$.dirty[0]&4&&t(15,o=!!k.id&&k.system&&k.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=La(k)),n.$$.dirty[0]&20&&t(14,a=!k.id||r),n.$$.dirty[0]&12&&O===ss&&k.type!=="auth"&&A(xi)},[A,N,k,O,r,c,d,h,_,S,$,T,I,L,a,o,s,l,i,F,U,K,x,X,oe,ge,P,R,g,E,u,$e,Ye,nt,xe,We,rt,Ze,at,Ht,Ve,Me,st,De,Be,ve,Ce,ut,qt,Le,ot,on,Mn]}class nf extends we{constructor(e){super(),ye(this,e,WD,VD,_e,{changeTab:0,show:26,hide:1,forceHide:27},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[26]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[27]}}function YD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),Q(e,"dragging",n[1])},m(l,s){y(l,e,s),n[4](e),t||(i=[W(e,"mousedown",n[5]),W(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&Q(e,"dragging",l[1])},i:te,o:te,d(l){l&&v(e),n[4](null),t=!1,Ie(i)}}}function KD(n,e,t){const i=bt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,u=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){f&&(g.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let k=g.clientX-o,S=g.clientY-r,$=g.clientX-a,T=g.clientY-u;!f&&Math.abs($-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,f,c,l,h,_]}class JD extends we{constructor(e){super(),ye(this,e,KD,YD,_e,{tolerance:3})}}function ZD(n){let e,t,i,l,s;const o=n[5].default,r=It(o,n,n[4],null);return l=new JD({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),j(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){y(a,e,u),r&&r.m(e,null),n[6](e),y(a,i,u),q(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&At(r,o,a,a[4],s?Lt(o,a[4],u,null):Pt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(M(r,a),M(l.$$.fragment,a),s=!0)},o(a){D(r,a),D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),H(l,a)}}}const Zh="@superuserSidebarWidth";function GD(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Zh)||null;function u(m){ie[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{V.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Zh,a))},[s,o,a,r,l,i,u,f,c,d]}class cv extends we{constructor(e){super(),ye(this,e,GD,ZD,_e,{class:0})}}function Gh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"title",""),p(e,"aria-hidden","true")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function XD(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function QD(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function xD(n){var T,O;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,_,g=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&Gh();function k(E,I){return E[1]?QD:XD}let S=k(n),$=S(n);return{c(){var E;e=b("a"),t=b("i"),l=C(),s=b("span"),r=B(o),a=C(),g&&g.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),Q(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,I){y(E,e,I),w(e,t),w(e,l),w(e,s),w(s,r),w(e,a),g&&g.m(e,null),w(e,u),w(e,f),$.m(f,null),h||(_=[Ee(c=He.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),W(f,"click",On(et(n[5]))),Ee(Vn.call(null,e))],h=!0)},p(E,[I]){var L,A,P;I&1&&i!==(i=zs(V.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),I&1&&o!==(o=E[0].name+"")&&re(r,o),E[0].type=="auth"&&((L=E[0].oauth2)!=null&&L.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?g||(g=Gh(),g.c(),g.m(e,u)):g&&(g.d(1),g=null),S!==(S=k(E))&&($.d(1),$=S(E),$&&($.c(),$.m(f,null))),c&&Nt(c.update)&&I&2&&c.update.call(null,{position:"right",text:(E[1]?"Unpin":"Pin")+" collection"}),I&1&&d!==(d="/collections?collection="+E[0].id)&&p(e,"href",d),I&1&&m!==(m=E[0].name)&&p(e,"title",m),I&5&&Q(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&v(e),g&&g.d(),$.d(),h=!1,Ie(_)}}}function eI(n,e,t){let i,l;Qe(n,ei,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?V.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class lf extends we{constructor(e){super(),ye(this,e,eI,xD,_e,{collection:0,pinnedIds:4})}}function Xh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[25]=e[t],i}function xh(n,e,t){const i=n.slice();return i[25]=e[t],i}function e_(n){let e,t,i=[],l=new Map,s,o,r=de(n[2]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function n_(n){let e,t=[],i=new Map,l,s,o=n[2].length&&i_(),r=de(n[8]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function s_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&o_(n),m=(n[6]||n[4].length)&&r_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","sidebar-title m-b-xs"),p(e,"aria-label",l=n[6]?"Expand system collections":"Collapse system collections"),p(e,"aria-expanded",s=n[6]||n[4].length),e.disabled=o=n[4].length,Q(e,"link-hint",!n[4].length)},m(h,_){y(h,e,_),w(e,t),w(e,i),d&&d.m(e,null),y(h,r,_),m&&m.m(h,_),y(h,a,_),u=!0,f||(c=W(e,"click",n[19]),f=!0)},p(h,_){h[4].length?d&&(d.d(1),d=null):d?d.p(h,_):(d=o_(h),d.c(),d.m(e,null)),(!u||_[0]&64&&l!==(l=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",l),(!u||_[0]&80&&s!==(s=h[6]||h[4].length))&&p(e,"aria-expanded",s),(!u||_[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||_[0]&16)&&Q(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,_),_[0]&80&&M(m,1)):(m=r_(h),m.c(),M(m,1),m.m(a.parentNode,a)):m&&(ae(),D(m,1,1,()=>{m=null}),ue())},i(h){u||(M(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(v(e),v(r),v(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function o_(n){let e,t;return{c(){e=b("i"),p(e,"class",t="ri-arrow-"+(n[6]?"up":"down")+"-s-line"),p(e,"aria-hidden","true")},m(i,l){y(i,e,l)},p(i,l){l[0]&64&&t!==(t="ri-arrow-"+(i[6]?"up":"down")+"-s-line")&&p(e,"class",t)},d(i){i&&v(e)}}}function r_(n){let e=[],t=new Map,i,l,s=de(n[7]);const o=r=>r[25].id;for(let r=0;rbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function u_(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function f_(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){y(s,e,o),w(e,t),i||(l=W(t,"click",n[21]),i=!0)},p:te,d(s){s&&v(e),i=!1,l()}}}function tI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$=n[2].length&&e_(n),T=n[8].length&&n_(n),O=n[7].length&&s_(n),E=n[4].length&&!n[3].length&&u_(),I=!n[11]&&f_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),$&&$.c(),c=C(),T&&T.c(),d=C(),O&&O.c(),m=C(),E&&E.c(),h=C(),I&&I.c(),_=ke(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[9]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),Q(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),Q(f,"fade",n[10]),Q(f,"sidebar-content-compact",n[3].length>20)},m(L,A){y(L,e,A),w(e,t),w(t,i),w(i,l),w(t,s),w(t,o),ce(o,n[0]),y(L,r,A),y(L,a,A),y(L,u,A),y(L,f,A),$&&$.m(f,null),w(f,c),T&&T.m(f,null),w(f,d),O&&O.m(f,null),w(f,m),E&&E.m(f,null),y(L,h,A),I&&I.m(L,A),y(L,_,A),g=!0,k||(S=[W(l,"click",n[15]),W(o,"input",n[16])],k=!0)},p(L,A){(!g||A[0]&512)&&Q(l,"hidden",!L[9]),A[0]&1&&o.value!==L[0]&&ce(o,L[0]),(!g||A[0]&512)&&Q(t,"active",L[9]),L[2].length?$?($.p(L,A),A[0]&4&&M($,1)):($=e_(L),$.c(),M($,1),$.m(f,c)):$&&(ae(),D($,1,1,()=>{$=null}),ue()),L[8].length?T?(T.p(L,A),A[0]&256&&M(T,1)):(T=n_(L),T.c(),M(T,1),T.m(f,d)):T&&(ae(),D(T,1,1,()=>{T=null}),ue()),L[7].length?O?(O.p(L,A),A[0]&128&&M(O,1)):(O=s_(L),O.c(),M(O,1),O.m(f,m)):O&&(ae(),D(O,1,1,()=>{O=null}),ue()),L[4].length&&!L[3].length?E||(E=u_(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!g||A[0]&1024)&&Q(f,"fade",L[10]),(!g||A[0]&8)&&Q(f,"sidebar-content-compact",L[3].length>20),L[11]?I&&(I.d(1),I=null):I?I.p(L,A):(I=f_(L),I.c(),I.m(_.parentNode,_))},i(L){g||(M($),M(T),M(O),g=!0)},o(L){D($),D(T),D(O),g=!1},d(L){L&&(v(e),v(r),v(a),v(u),v(f),v(h),v(_)),$&&$.d(),T&&T.d(),O&&O.d(),E&&E.d(),I&&I.d(L),k=!1,Ie(S)}}}function nI(n){let e,t,i,l;e=new cv({props:{class:"collection-sidebar",$$slots:{default:[tI]},$$scope:{ctx:n}}});let s={};return i=new nf({props:s}),n[22](i),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),y(o,t,r),q(i,o,r),l=!0},p(o,r){const a={};r[0]&4095|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&v(t),H(e,o),n[22](null),H(i,o)}}}const c_="@pinnedCollections";function iI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function lI(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,En,R=>t(13,u=R)),Qe(n,ei,R=>t(14,f=R)),Qe(n,Js,R=>t(10,c=R)),Qe(n,Dl,R=>t(11,d=R));let m,h="",_=[],g=!1,k;S();function S(){t(1,_=[]);try{const R=localStorage.getItem(c_);R&&t(1,_=JSON.parse(R)||[])}catch{}}function $(){t(1,_=_.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,h="");function O(){h=this.value,t(0,h)}function E(R){_=R,t(1,_)}function I(R){_=R,t(1,_)}const L=()=>{i.length||t(6,g=!g)};function A(R){_=R,t(1,_)}const P=()=>m==null?void 0:m.show();function N(R){ie[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&($(),iI()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,l=h!==""),n.$$.dirty[0]&2&&_&&localStorage.setItem(c_,JSON.stringify(_)),n.$$.dirty[0]&8209&&t(3,s=u.filter(R=>{var z,F,U;return R.id==h||((U=(F=(z=R.name)==null?void 0:z.replace(/\s+/g,""))==null?void 0:F.toLowerCase())==null?void 0:U.includes(i))})),n.$$.dirty[0]&10&&t(2,o=s.filter(R=>_.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(R=>!R.system&&!_.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(R=>R.system&&!_.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&k!=f.id&&(t(12,k=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,g=!0):t(6,g=!1))},[h,_,o,s,i,m,g,a,r,l,c,d,k,u,f,T,O,E,I,L,A,P,N]}class sI extends we{constructor(e){super(),ye(this,e,lI,nI,_e,{},null,[-1,-1])}}function oI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function rI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=B(n[2]),l=C(),s=b("div"),o=B(n[1]),r=B(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){y(f,e,c),w(e,t),w(t,i),w(e,l),w(e,s),w(s,o),w(s,r),a||(u=Ee(He.call(null,e,n[3])),a=!0)},p(f,c){c&4&&re(i,f[2]),c&2&&re(o,f[1])},d(f){f&&v(e),a=!1,u()}}}function aI(n){let e;function t(s,o){return s[0]?rI:oI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function uI(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return V.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class sf extends we{constructor(e){super(),ye(this,e,uI,aI,_e,{date:0})}}function d_(n){let e;function t(s,o){return s[4]==="image"?cI:fI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function fI(n){let e,t;return{c(){e=b("object"),t=B("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){y(i,e,l),w(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function cI(n){let e,t,i;return{c(){e=b("img"),kn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){y(l,e,s)},p(l,s){s&2&&!kn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function dI(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&d_(n);return{c(){i&&i.c(),t=ke()},m(s,o){i&&i.m(s,o),y(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=d_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function pI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){y(l,e,s),t||(i=W(e,"click",et(n[0])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function mI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=B(n[2]),i=C(),l=b("i"),s=C(),o=b("div"),r=C(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,s,d),y(c,o,d),y(c,r,d),y(c,a,d),u||(f=W(a,"click",n[0]),u=!0)},p(c,d){d&4&&re(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),u=!1,f()}}}function hI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[mI],header:[pI],default:[dI]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[7](null),H(e,l)}}}function _I(n,e,t){let i,l,s,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){ie[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ne.call(this,n,m)}function d(m){Ne.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=V.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class gI extends we{constructor(e){super(),ye(this,e,_I,hI,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function bI(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?wI:u[3]==="video"||u[3]==="audio"?yI:vI}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){y(u,e,f),a.m(e,null),l||(s=W(e,"click",On(n[11])),l=!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&&v(e),a.d(),l=!1,s()}}}function kI(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){y(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function vI(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function yI(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function wI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),kn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){y(o,e,r),l||(s=W(e,"error",n[8]),l=!0)},p(o,r){r&32&&!kn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function p_(n){let e,t,i={};return e=new gI({props:i}),n[12](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[12](null),H(e,l)}}}function SI(n){let e,t,i;function l(a,u){return a[2]?kI:bI}let s=l(n),o=s(n),r=n[7]&&p_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ke()},m(a,u){o.m(a,u),y(a,e,u),r&&r.m(a,u),y(a,t,u),i=!0},p(a,[u]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&M(r,1)):(r=p_(a),r.c(),M(r,1),r.m(t.parentNode,t)):r&&(ae(),D(r,1,1,()=>{r=null}),ue())},i(a){i||(M(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function TI(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await me.getSuperuserFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function h(){t(5,u="")}const _=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function g(k){ie[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=V.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":me.files.getURL(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":me.files.getURL(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,h,s,c,_,g]}class of extends we{constructor(e){super(),ye(this,e,TI,SI,_e,{record:9,filename:0,size:1})}}function m_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function h_(n,e,t){const i=n.slice();i[7]=e[t];const l=V.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function __(n,e,t){const i=n.slice();return i[13]=e[t],i}function g_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[13]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function b_(n){let e=!V.isEmpty(n[13]),t,i,l=e&&g_(n);return{c(){l&&l.c(),t=ke()},m(s,o){l&&l.m(s,o),y(s,t,o),i=!0},p(s,o){o&3&&(e=!V.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&M(l,1)):(l=g_(s),l.c(),M(l,1),l.m(t.parentNode,t)):l&&(ae(),D(l,1,1,()=>{l=null}),ue())},i(s){i||(M(l),i=!0)},o(s){D(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function k_(n){let e,t,i=de(n[10]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;obe(e,"record",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&5&&(t=!0,a.record=n[0].expand[n[7].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function y_(n){let e,t,i,l,s,o=n[9]>0&&$I();const r=[OI,CI],a=[];function u(f,c){var d;return f[7].type=="relation"&&((d=f[0].expand)!=null&&d[f[7].name])?0:1}return t=u(n),i=a[t]=r[t](n),{c(){o&&o.c(),e=C(),i.c(),l=ke()},m(f,c){o&&o.m(f,c),y(f,e,c),a[t].m(f,c),y(f,l,c),s=!0},p(f,c){let d=t;t=u(f),t===d?a[t].p(f,c):(ae(),D(a[d],1,1,()=>{a[d]=null}),ue(),i=a[t],i?i.p(f,c):(i=a[t]=r[t](f),i.c()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&(v(e),v(l)),o&&o.d(f),a[t].d(f)}}}function EI(n){let e,t,i,l=de(n[1]),s=[];for(let c=0;cD(s[c],1,1,()=>{s[c]=null});let r=de(n[2]),a=[];for(let c=0;cD(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=v_(n)),{c(){for(let c=0;ct(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.fields)||[];if(t(1,o=f.filter(c=>!c.hidden&&c.presentable&&c.type=="file")),t(2,r=f.filter(c=>!c.hidden&&c.presentable&&c.type!="file")),!o.length&&!r.length){const c=f.find(d=>{var m;return!d.hidden&&d.type=="file"&&d.maxSelect==1&&((m=d.mimeTypes)==null?void 0:m.find(h=>h.startsWith("image/")))});c&&o.push(c)}}function u(f,c){n.$$.not_equal(s.expand[c.name],f)&&(s.expand[c.name]=f,t(0,s))}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l,u]}class dv extends we{constructor(e){super(),ye(this,e,MI,EI,_e,{record:0})}}function DI(n){let e,t,i,l,s,o,r,a,u,f;return t=new dv({props:{record:n[0]}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(l,"target","_blank"),p(l,"class","inline-flex link-hint"),p(l,"rel","noopener noreferrer"),p(e,"class","record-info svelte-69icne")},m(c,d){y(c,e,d),q(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Ee(r=He.call(null,l,{text:`Open relation record in new tab: +`+V.truncate(JSON.stringify(V.truncateObject(w_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),W(l,"click",On(n[1])),W(l,"keydown",On(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&Nt(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab: +`+V.truncate(JSON.stringify(V.truncateObject(w_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(M(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&v(e),H(t),u=!1,Ie(f)}}}function w_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function II(n,e,t){let{record:i}=e;function l(o){Ne.call(this,n,o)}function s(o){Ne.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Ur extends we{constructor(e){super(),ye(this,e,II,DI,_e,{record:0})}}function S_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function T_(n,e,t){const i=n.slice();return i[14]=e[t],i}function $_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function C_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function LI(n){const e=n.slice(),t=V.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function AI(n){var s,o;const e=n.slice(),t=V.toArray(e[3]);e[10]=t;const i=V.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[11]=i;const l=e[2]?20:500;return e[12]=l,e}function PI(n){const e=n.slice(),t=V.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function NI(n){let e,t;return{c(){e=b("div"),t=B(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l&8&&re(t,i[3])},i:te,o:te,d(i){i&&v(e)}}}function RI(n){let e,t=V.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=V.truncate(n[3]))},m(s,o){y(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=V.truncate(s[3])+"")&&re(i,t),o&8&&l!==(l=V.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&v(e)}}}function FI(n){let e,t=[],i=new Map,l,s,o=de(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;un[18]&&E_();return{c(){e=b("div");for(let u=0;uu[18]?a||(a=E_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&Q(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;fn[12]&&I_();return{c(){e=b("div"),i.c(),l=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){y(f,e,c),r[t].m(e,null),w(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ae(),D(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),M(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=I_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function HI(n){let e,t=[],i=new Map,l=de(V.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function UI(n){let e,t=V.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){y(o,e,r),w(e,i),l||(s=[Ee(He.call(null,e,"Open in new tab")),W(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=V.truncate(o[3])+"")&&re(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&v(e),l=!1,Ie(s)}}}function VI(n){let e,t;return{c(){e=b("span"),t=B(n[3]),p(e,"class","txt")},m(i,l){y(i,e,l),w(e,t)},p(i,l){l&8&&re(t,i[3])},i:te,o:te,d(i){i&&v(e)}}}function BI(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=B(t),p(e,"class","label"),Q(e,"label-success",!!n[3])},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&re(i,t),s&8&&Q(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&v(e)}}}function WI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function YI(n){let e,t,i,l;const s=[xI,QI],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function KI(n){let e,t,i,l,s,o,r,a;t=new fi({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&P_();return{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),s=B(n[3]),o=C(),u&&u.c(),r=ke(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){y(f,e,c),q(t,e,null),w(e,i),w(e,l),w(l,s),y(f,o,c),u&&u.m(f,c),y(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&re(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=P_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(M(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(v(e),v(o),v(r)),H(t),u&&u.d(f)}}}function O_(n,e){let t,i,l;return i=new of({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(s,o){y(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(i,s)}}}function E_(n){let e;return{c(){e=B("...")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function JI(n){let e,t=de(n[10].slice(0,n[12])),i=[];for(let l=0;lr[9]+r[7];for(let r=0;r500&&A_(n);return{c(){e=b("span"),i=B(t),l=C(),r&&r.c(),s=ke(),p(e,"class","txt")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),r&&r.m(a,u),y(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=V.truncate(a[6],500,!0)+"")&&re(i,t),a[6].length>500?r?(r.p(a,u),u&8&&M(r,1)):(r=A_(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(ae(),D(r,1,1,()=>{r=null}),ue())},i(a){o||(M(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function xI(n){let e,t=V.truncate(n[6])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(l,s){y(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=V.truncate(l[6])+"")&&re(i,t)},i:te,o:te,d(l){l&&v(e)}}}function A_(n){let e,t;return e=new fi({props:{value:JSON.stringify(n[3],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function P_(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function eL(n){let e,t,i,l,s;const o=[KI,YI,WI,BI,VI,UI,zI,jI,HI,qI,FI,RI,NI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!V.isEmpty(f[3])),e?2:f[1].type==="bool"?3:f[1].type==="number"?4:f[1].type==="url"?5:f[1].type==="editor"?6:f[1].type==="date"||f[1].type==="autodate"?7:f[1].type==="select"?8:f[1].type==="relation"?9:f[1].type==="file"?10:f[2]?11:12)}function u(f,c){return c===1?PI(f):c===9?AI(f):c===10?LI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ke()},m(f,c){r[t].m(f,c),y(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ae(),D(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()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&v(l),r[t].d(f)}}}function tL(n,e,t){let i,l;Qe(n,Fr,u=>t(4,l=u));let{record:s}=e,{field:o}=e,{short:r=!1}=e;function a(u){Ne.call(this,n,u)}return n.$$set=u=>{"record"in u&&t(0,s=u.record),"field"in u&&t(1,o=u.field),"short"in u&&t(2,r=u.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[o.name])},[s,o,r,i,l,a]}class pv extends we{constructor(e){super(),ye(this,e,tL,eL,_e,{record:0,field:1,short:2})}}function N_(n,e,t){const i=n.slice();return i[13]=e[t],i}function R_(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new pv({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=B(i),s=C(),o=b("td"),j(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){y(u,e,f),w(e,t),w(t,l),w(e,s),w(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&re(l,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(M(r.$$.fragment,u),a=!0)},o(u){D(r.$$.fragment,u),a=!1},d(u){u&&v(e),H(r)}}}function F_(n){let e,t,i,l,s,o;return s=new sf({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=C(),l=b("td"),j(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),q(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(M(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&v(e),H(s)}}}function q_(n){let e,t,i,l,s,o;return s=new sf({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=C(),l=b("td"),j(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),q(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(M(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&v(e),H(s)}}}function nL(n){var E;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,h,_,g;a=new fi({props:{value:n[3].id}});let k=de((E=n[0])==null?void 0:E.fields),S=[];for(let I=0;ID(S[I],1,1,()=>{S[I]=null});let T=n[3].created&&F_(n),O=n[3].updated&&q_(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("div"),j(a.$$.fragment),u=C(),f=b("span"),d=B(c),m=C();for(let I=0;I{T=null}),ue()),I[3].updated?O?(O.p(I,L),L&8&&M(O,1)):(O=q_(I),O.c(),M(O,1),O.m(t,null)):O&&(ae(),D(O,1,1,()=>{O=null}),ue()),(!g||L&16)&&Q(e,"table-loading",I[4])},i(I){if(!g){M(a.$$.fragment,I);for(let L=0;LClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[7]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function sL(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[lL],header:[iL],default:[nL]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function oL(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return f(g),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await me.collection(l.id).getOne(g)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),Ci(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>u();function m(g){ie[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ne.call(this,n,g)}function _(g){Ne.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.fields)!=null&&g.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,h,_]}class rL extends we{constructor(e){super(),ye(this,e,oL,sL,_e,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function aL(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){y(s,e,o),i||(l=Ee(t=He.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&Nt(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:te,o:te,d(s){s&&v(e),i=!1,l()}}}const rL="yyyy-MM-dd HH:mm:ss.SSS";function aL(n,e,t){let i,l;Qe(n,En,a=>t(2,l=a));let{record:s}=e,o=[];function r(){t(0,o=[]);const a=i.fields||[];for(let u of a)u.type=="autodate"&&o.push(u.name+": "+V.formatToLocalDate(s[u.name],rL)+" Local")}return n.$$set=a=>{"record"in a&&t(1,s=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=s&&l.find(a=>a.id==s.collectionId)),n.$$.dirty&2&&s&&r()},[o,s,l]}class uL extends we{constructor(e){super(),ye(this,e,aL,oL,_e,{record:1})}}function H_(n,e,t){const i=n.slice();return i[9]=e[t],i}function fL(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function cL(n){let e,t=pe(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function j_(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,_,g,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=W(r),u=C(),f=b("div"),c=W("ID: "),m=W(d),h=C(),_=b("button"),_.innerHTML='',g=C(),kn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){y(T,e,O),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,_),w(e,g),k||(S=B(_,"click",$),k=!0)},p(T,O){var M;n=T,O&2&&!kn(i.src,l="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&re(a,r),O&2&&d!==(d=n[9].providerId+"")&&re(m,d)},d(T){T&&v(e),k=!1,S()}}}function pL(n){let e;function t(s,o){var r;return s[2]?dL:(r=s[0])!=null&&r.id&&s[1].length?cL:fL}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function mL(n,e,t){const i=bt();let{record:l}=e,s=[],o=!1;function r(d){return ef.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||V.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await me.collection("_externalAuths").getFullList({filter:me.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){me.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||pn(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>me.collection("_externalAuths").delete(d.id).then(()=>{en(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{me.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class hL extends we{constructor(e){super(),ye(this,e,mL,pL,_e,{record:0})}}function _L(n){let e,t,i,l,s,o,r,a,u,f;return s=new fi({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=C(),j(s.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){y(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),q(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Ee(He.call(null,r,"Refresh")),B(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&re(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),H(s),u=!1,Ie(f)}}}function gL(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[_L]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new jn({props:d}),ie.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){y(m,e,h),w(e,t),w(e,i),q(l,e,null),a=!0,u||(f=Ee(r=He.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],Te(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Nt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&v(e),H(l),u=!1,f()}}}function bL(n,e,t){const i=bt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=V.randomSecret(s)),i("generate",o),await un(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){ie[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class kL extends we{constructor(e){super(),ye(this,e,bL,gL,_e,{class:0,length:5})}}function z_(n){let e,t,i,l,s=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),l=W("Public: "),o=W(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class",r="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(e,"class","form-field-addon email-visibility-addon svelte-1751a4d")},m(f,c){y(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Ee(He.call(null,t,{text:"Make email public or private",position:"top-right"})),B(t,"click",et(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&re(o,s),c&1&&r!==(r="btn btn-sm btn-transparent "+(f[0].emailVisibility?"btn-success":"btn-hint"))&&p(t,"class",r)},d(f){f&&v(e),a=!1,Ie(u)}}}function vL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&z_(n);return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="email",o=C(),m&&m.c(),r=C(),a=b("input"),p(t,"class",V.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[14]),p(a,"type","email"),a.autofocus=n[1],p(a,"autocomplete","off"),p(a,"id",u=n[14]),a.required=f=n[4].required,p(a,"class","svelte-1751a4d")},m(h,_){y(h,e,_),w(e,t),w(e,i),w(e,l),y(h,o,_),m&&m.m(h,_),y(h,r,_),y(h,a,_),ce(a,n[0].email),n[1]&&a.focus(),c||(d=B(a,"input",n[8]),c=!0)},p(h,_){_&16384&&s!==(s=h[14])&&p(e,"for",s),h[5]?m&&(m.d(1),m=null):m?m.p(h,_):(m=z_(h),m.c(),m.m(r.parentNode,r)),_&2&&(a.autofocus=h[1]),_&16384&&u!==(u=h[14])&&p(a,"id",u),_&16&&f!==(f=h[4].required)&&(a.required=f),_&1&&a.value!==h[0].email&&ce(a,h[0].email)},d(h){h&&(v(e),v(o),v(r),v(a)),m&&m.d(h),c=!1,d()}}}function U_(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[yL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){y(u,e,f),e.checked=n[2],y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[9]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function V_(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[wL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[SL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){y(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&Q(t,"p-t-xs",f[2])},i(f){u||(E(l.$$.fragment,f),E(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=je(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=je(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),H(l),H(r),f&&a&&a.end()}}}function wL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new kL({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password",o=C(),r=b("input"),u=C(),f=b("div"),j(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0,p(f,"class","form-field-addon")},m(_,g){y(_,e,g),w(e,t),w(e,i),w(e,l),y(_,o,g),y(_,r,g),ce(r,n[0].password),y(_,u,g),y(_,f,g),q(c,f,null),d=!0,m||(h=B(r,"input",n[10]),m=!0)},p(_,g){(!d||g&16384&&s!==(s=_[14]))&&p(e,"for",s),(!d||g&16384&&a!==(a=_[14]))&&p(r,"id",a),g&1&&r.value!==_[0].password&&ce(r,_[0].password);const k={};g&8&&(k.length=Math.max(15,_[3].min||0)),c.$set(k)},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){D(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(u),v(f)),H(c),m=!1,h()}}}function SL(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password confirm",o=C(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[0].passwordConfirm),u||(f=B(r,"input",n[11]),u=!0)},p(c,d){d&16384&&s!==(s=c[14])&&p(e,"for",s),d&16384&&a!==(a=c[14])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ce(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function B_(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[TL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function TL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){y(u,e,f),e.checked=n[0].verified,y(u,i,f),y(u,l,f),w(l,s),r||(a=[B(e,"change",n[12]),B(e,"change",et(n[13]))],r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,Ie(a)}}}function $L(n){var d;let e,t,i,l,s,o,r,a;i=new fe({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[vL,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&U_(n),f=(n[1]||n[2])&&V_(n),c=!n[5]&&B_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),u&&u.c(),o=C(),f&&f.c(),r=C(),c&&c.c(),p(t,"class","col-lg-12"),p(s,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(m,h){y(m,e,h),w(e,t),q(i,t,null),w(e,l),w(e,s),u&&u.m(s,null),w(s,o),f&&f.m(s,null),w(e,r),c&&c.m(e,null),a=!0},p(m,[h]){var g;const _={};h&16&&(_.class="form-field "+((g=m[4])!=null&&g.required?"required":"")),h&49203&&(_.$$scope={dirty:h,ctx:m}),i.$set(_),m[1]?u&&(ae(),D(u,1,1,()=>{u=null}),ue()):u?(u.p(m,h),h&2&&E(u,1)):(u=U_(m),u.c(),E(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&E(f,1)):(f=V_(m),f.c(),E(f,1),f.m(s,null)):f&&(ae(),D(f,1,1,()=>{f=null}),ue()),m[5]?c&&(ae(),D(c,1,1,()=>{c=null}),ue()):c?(c.p(m,h),h&32&&E(c,1)):(c=B_(m),c.c(),E(c,1),c.m(e,null))},i(m){a||(E(i.$$.fragment,m),E(u),E(f),E(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&v(e),H(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function CL(n,e,t){let i,l,s,{record:o}=e,{collection:r}=e,{isNew:a=!(o!=null&&o.id)}=e,u=!1;const f=()=>t(0,o.emailVisibility=!o.emailVisibility,o);function c(){o.email=this.value,t(0,o),t(2,u)}function d(){u=this.checked,t(2,u)}function m(){o.password=this.value,t(0,o),t(2,u)}function h(){o.passwordConfirm=this.value,t(0,o),t(2,u)}function _(){o.verified=this.checked,t(0,o),t(2,u)}const g=k=>{a||pn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!k.target.checked,o)})};return n.$$set=k=>{"record"in k&&t(0,o=k.record),"collection"in k&&t(6,r=k.collection),"isNew"in k&&t(1,a=k.isNew)},n.$$.update=()=>{var k,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,l=((k=r==null?void 0:r.fields)==null?void 0:k.find($=>$.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find($=>$.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),di("password"),di("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,_,g]}class OL extends we{constructor(e){super(),ye(this,e,CL,$L,_e,{record:0,collection:6,isNew:1})}}function W_(n){let e;function t(s,o){return s[1].primaryKey?ML:EL}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function EL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[1].type))},m(i,l){y(i,e,l)},p(i,l){l&2&&t!==(t=V.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&v(e)}}}function ML(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Y_(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function DL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&W_(n),f=n[1].hidden&&Y_();const c=n[4].default,d=It(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),s=W(l),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){y(m,e,h),u&&u.m(e,null),w(e,t),w(e,i),w(i,s),w(e,o),f&&f.m(e,null),w(e,r),d&&d.m(e,null),a=!0},p(m,[h]){m[2]?u?u.p(m,h):(u=W_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&re(s,l),m[1].hidden?f||(f=Y_(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&At(d,c,m,m[3],a?Lt(c,m[3],h,null):Pt(m[3]),null),(!a||h&1)&&p(e,"for",m[0])},i(m){a||(E(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&v(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function IL(n,e,t){let{$$slots:i={},$$scope:l}=e,{uniqueId:s}=e,{field:o}=e,{icon:r=!0}=e;return n.$$set=a=>{"uniqueId"in a&&t(0,s=a.uniqueId),"field"in a&&t(1,o=a.field),"icon"in a&&t(2,r=a.icon),"$$scope"in a&&t(3,l=a.$$scope)},[s,o,r,l,i]}class ni extends we{constructor(e){super(),ye(this,e,IL,DL,_e,{uniqueId:0,field:1,icon:2})}}function LL(n){let e,t,i,l,s,o,r;return l=new ni({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),j(l.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){y(a,e,u),e.checked=n[0],y(a,i,u),q(l,a,u),s=!0,o||(r=B(e,"change",n[2]),o=!0)},p(a,u){(!s||u&8&&t!==(t=a[3]))&&p(e,"id",t),u&1&&(e.checked=a[0]);const f={};u&8&&(f.uniqueId=a[3]),u&2&&(f.field=a[1]),l.$set(f)},i(a){s||(E(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),H(l,a),o=!1,r()}}}function AL(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[LL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function PL(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class NL extends we{constructor(e){super(),ye(this,e,PL,AL,_e,{field:1,value:0})}}function K_(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){y(s,e,o),w(e,t),i||(l=[Ee(He.call(null,t,"Clear")),B(t,"click",n[5])],i=!0)},p:te,d(s){s&&v(e),i=!1,Ie(l)}}}function RL(n){let e,t,i,l,s,o,r;e=new ni({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&K_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0]!==void 0&&(c.formattedValue=n[0]),l=new tf({props:c}),ie.push(()=>be(l,"value",u)),ie.push(()=>be(l,"formattedValue",f)),l.$on("close",n[3]),{c(){j(e.$$.fragment),t=C(),a&&a.c(),i=C(),j(l.$$.fragment)},m(d,m){q(e,d,m),y(d,t,m),a&&a.m(d,m),y(d,i,m),q(l,d,m),r=!0},p(d,m){const h={};m&256&&(h.uniqueId=d[8]),m&2&&(h.field=d[1]),e.$set(h),d[0]&&!d[1].required?a?a.p(d,m):(a=K_(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const _={};m&256&&(_.id=d[8]),!s&&m&4&&(s=!0,_.value=d[2],Te(()=>s=!1)),!o&&m&1&&(o=!0,_.formattedValue=d[0],Te(()=>o=!1)),l.$set(_)},i(d){r||(E(e.$$.fragment,d),E(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(v(t),v(i)),H(e,d),a&&a.d(d),H(l,d)}}}function FL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RL,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function qL(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class HL extends we{constructor(e){super(),ye(this,e,qL,FL,_e,{field:1,value:0})}}function J_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Z_(n,e,t){const i=n.slice();return i[48]=e[t],i}function G_(n,e,t){const i=n.slice();return i[51]=e[t],i}function jL(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,_,g=pe(n[7]);const k=S=>S[51].id;for(let S=0;SNew record',c=C(),j(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){y(S,e,$),w(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function X_(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=W(i),s=C(),p(t,"type","button"),p(t,"class","sidebar-item"),Q(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){y(u,t,f),w(t,l),w(t,s),o||(r=B(t,"click",et(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&re(l,i),f[0]&384&&Q(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&v(t),o=!1,r()}}}function UL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Q_(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){y(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Q_(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function VL(n){let e=[],t=new Map,i,l=pe(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){y(l,e,s),t||(i=B(e,"click",et(n[17])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function BL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function WL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),kn(e.src,t=me.files.getURL(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){y(l,e,s)},p(l,s){s[0]&32&&!kn(e.src,t=me.files.getURL(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function x_(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!V.hasImageExtension(f[48])),t?WL:BL}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=C(),p(e,"type","button"),p(e,"class","thumb handle"),Q(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){y(f,e,c),u.m(e,null),w(e,i),s||(o=[Ee(l=He.call(null,e,n[48]+` -(record: `+n[44].id+")")),B(e,"click",et(function(){Nt(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&Nt(l.update)&&c[0]&32&&l.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&Q(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,Ie(o)}}}function eg(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function YL(n){let e,t;function i(r,a){if(r[15])return VL;if(!r[6])return UL}let l=i(n),s=l&&l(n),o=n[6]&&tg();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ke()},m(r,a){s&&s.m(r,a),y(r,e,a),o&&o.m(r,a),y(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=tg(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function KL(n){let e,t,i,l;const s=[zL,jL],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function JL(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){y(i,e,l),w(e,t)},p(i,l){l[0]&1&&re(t,i[0])},d(i){i&&v(e)}}}function ng(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[ZL,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZL(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GL(n){var h;let e,t,i,l=V.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&ng(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),s=C(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(_,g){y(_,e,g),w(e,t),y(_,i,g),m&&m.m(_,g),y(_,s,g),y(_,o,g),w(o,r),w(r,a),f=!0,c||(d=[B(e,"click",n[2]),B(o,"click",n[21])],c=!0)},p(_,g){var k;(!f||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=V.hasImageExtension((k=_[9])==null?void 0:k.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=ng(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(ae(),D(m,1,1,()=>{m=null}),ue()),(!f||g[0]&2)&&re(a,_[1]),(!f||g[0]&8192&&u!==(u=!_[13]))&&(o.disabled=u)},i(_){f||(E(m),f=!0)},o(_){D(m),f=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,Ie(d)}}}function XL(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[GL],header:[JL],default:[KL]},$$scope:{ctx:n}};for(let a=0;at(27,u=Ve));const f=bt(),c="file_picker_"+V.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,k="",S=[],$=1,T=0,O=!1,M=[],L=[],I=[],A={},P={},N="";function R(){return J(!0),_==null?void 0:_.show()}function z(){return _==null?void 0:_.hide()}function F(){t(5,S=[]),t(9,P={}),t(12,N="")}function U(){t(4,k="")}async function J(Ve=!1){if(A!=null&&A.id){t(6,O=!0),Ve&&F();try{const Me=Ve?1:$+1,st=V.getAllCollectionIdentifiers(A);let De=V.normalizeSearchFilter(k,st)||"";De&&(De+=" && "),De+="("+L.map(Ce=>`${Ce.name}:length>0`).join("||")+")";let Be="";A.type!="view"&&(Be="-@rowid");const ve=await me.collection(A.id).getList(Me,ig,{filter:De,sort:Be,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=V.filterDuplicatesByKey(S.concat(ve.items))),$=ve.page,t(26,T=ve.items.length),t(6,O=!1)}catch(Me){Me.isAbort||(me.error(Me),t(6,O=!1))}}}function K(){var Me;let Ve=["100x100"];if((Me=P==null?void 0:P.record)!=null&&Me.id){for(const st of L)if(V.toArray(P.record[st.name]).includes(P.name)){Ve=Ve.concat(V.toArray(st.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const st of Ve)I.push({label:`${st} thumb`,value:st});N&&!Ve.includes(N)&&t(12,N="")}function x(Ve){let Me=[];for(const st of L){const De=V.toArray(Ve[st.name]);for(const Be of De)h.includes(V.getFileType(Be))&&Me.push(Be)}return Me}function X(Ve,Me){t(9,P={record:Ve,name:Me})}function oe(){o&&(f("submit",Object.assign({size:N},P)),z())}function Se(Ve){N=Ve,t(12,N)}const ge=Ve=>{t(8,A=Ve)},$e=Ve=>t(4,k=Ve.detail),Ye=()=>g==null?void 0:g.show(),nt=()=>{s&&J()};function xe(Ve){ie[Ve?"unshift":"push"](()=>{_=Ve,t(3,_)})}function We(Ve){Ne.call(this,n,Ve)}function rt(Ve){Ne.call(this,n,Ve)}function Ze(Ve){ie[Ve?"unshift":"push"](()=>{g=Ve,t(10,g)})}const at=Ve=>{V.removeByKey(S,"id",Ve.detail.record.id),S.unshift(Ve.detail.record),t(5,S);const Me=x(Ve.detail.record);Me.length>0&&X(Ve.detail.record,Me[0])},Ht=Ve=>{var Me;((Me=P==null?void 0:P.record)==null?void 0:Me.id)==Ve.detail.id&&t(9,P={}),V.removeByKey(S,"id",Ve.detail.id),t(5,S)};return n.$$set=Ve=>{e=ze(ze({},e),Ut(Ve)),t(22,a=lt(e,r)),"title"in Ve&&t(0,d=Ve.title),"submitText"in Ve&&t(1,m=Ve.submitText),"fileTypes"in Ve&&t(24,h=Ve.fileTypes)},n.$$.update=()=>{var Ve;n.$$.dirty[0]&134217728&&t(7,M=u.filter(Me=>Me.type!=="view"&&!!V.toArray(Me.fields).find(st=>{var De,Be;return st.type==="file"&&!st.protected&&(!((De=st.mimeTypes)!=null&&De.length)||!!((Be=st.mimeTypes)!=null&&Be.find(ve=>ve.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&M.length>0&&t(8,A=M[0]),n.$$.dirty[0]&256&&(L=(Ve=A==null?void 0:A.fields)==null?void 0:Ve.filter(Me=>Me.type==="file"&&!Me.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(U(),K()),n.$$.dirty[0]&512&&P!=null&&P.name&&K(),n.$$.dirty[0]&280&&typeof k<"u"&&A!=null&&A.id&&_!=null&&_.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(Me,st)=>{var De;return(P==null?void 0:P.name)==st&&((De=P==null?void 0:P.record)==null?void 0:De.id)==Me.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Me=>x(Me).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!O&&T==ig),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,_,k,S,O,M,A,P,g,I,N,o,s,l,i,U,J,x,X,oe,a,c,h,R,T,u,Se,ge,$e,Ye,nt,xe,We,rt,Ze,at,Ht]}class xL extends we{constructor(e){super(),ye(this,e,QL,XL,_e,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function eA(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function tA(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Tu({props:s}),ie.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function nA(n){let e,t,i,l,s,o;e=new ni({props:{uniqueId:n[11],field:n[1]}});const r=[tA,eA],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ke()},m(f,c){q(e,f,c),y(f,t,c),a[i].m(f,c),y(f,s,c),o=!0},p(f,c){const d={};c&2048&&(d.uniqueId=f[11]),c&2&&(d.field=f[1]),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(ae(),D(a[m],1,1,()=>{a[m]=null}),ue(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),E(l,1),l.m(s.parentNode,s))},i(f){o||(E(e.$$.fragment,f),E(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(v(t),v(s)),H(e,f),a[i].d(f)}}}function iA(n){let e,t,i,l;e=new fe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[nA,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new xL({props:s}),n[8](i),i.$on("submit",n[9]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),y(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&v(t),H(e,o),n[8](null),H(i,o)}}}function lA(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Zt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ie[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,me.files.getURL(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=Object.assign(V.defaultEditorOptions(),{convert_urls:l.convertURLs,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class sA extends we{constructor(e){super(),ye(this,e,lA,iA,_e,{field:1,value:0})}}function oA(n){let e,t,i,l,s,o,r,a;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","email"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),y(u,t,f),y(u,i,f),ce(i,n[0]),o=!0,r||(a=B(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&ce(i,u[0])},i(u){o||(E(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(v(t),v(i)),H(e,u),r=!1,a()}}}function rA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[oA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function aA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class uA extends we{constructor(e){super(),ye(this,e,aA,rA,_e,{field:1,value:0})}}function fA(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){y(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function cA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),kn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){y(l,e,s)},p(l,s){s&4&&!kn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function dA(n){let e;function t(s,o){return s[2]?cA:fA}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function pA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){V.hasImageExtension(l==null?void 0:l.name)?V.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class mA extends we{constructor(e){super(),ye(this,e,pA,dA,_e,{file:0,size:1})}}function lg(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function sg(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function hA(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){y(s,e,o),t||(i=[Ee(He.call(null,e,"Remove file")),B(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,Ie(i)}}}function _A(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){y(s,e,o),t||(i=B(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function gA(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new of({props:{record:n[3],filename:n[34]}});function h(k,S){return k[35]?_A:hA}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("a"),a=W(r),c=C(),d=b("div"),g.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=me.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(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(k,S){y(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,c),w(e,d),g.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&Q(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&re(a,r),(!m||S[0]&1064&&u!==(u=me.files.getURL(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),_===(_=h(k))&&g?g.p(k,S):(g.d(1),g=_(k),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&Q(e,"dragging",k[32]),(!m||S[1]&4)&&Q(e,"dragover",k[33])},i(k){m||(E(i.$$.fragment,k),m=!0)},o(k){D(i.$$.fragment,k),m=!1},d(k){k&&v(e),H(i),g.d()}}}function og(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[gA,({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 go({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!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}),!l&&u[0]&1&&(l=!0,f.list=e[0],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function bA(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,h,_,g;i=new mA({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),j(i.$$.fragment),l=C(),s=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=W(u),d=C(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,$){y(S,e,$),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(s,r),w(s,a),w(a,f),w(e,d),w(e,m),h=!0,_||(g=[Ee(He.call(null,m,"Remove file")),B(m,"click",k)],_=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!h||$[0]&2)&&u!==(u=n[29].name+"")&&re(f,u),(!h||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||$[1]&2)&&Q(e,"dragging",n[32]),(!h||$[1]&4)&&Q(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&v(e),H(i),_=!1,Ie(g)}}}function rg(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[bA,({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 go({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!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}),!l&&u[0]&2&&(l=!0,f.list=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function kA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,_,g,k,S,$,T;e=new ni({props:{uniqueId:n[28],field:n[4]}});let O=pe(n[5]);const M=A=>A[34]+A[3].id;for(let A=0;AA[29].name+A[31];for(let A=0;At(2,l=a));let{record:s}=e,o=[];function r(){t(0,o=[]);const a=i.fields||[];for(let u of a)u.type=="autodate"&&o.push(u.name+": "+V.formatToLocalDate(s[u.name],uL)+" Local")}return n.$$set=a=>{"record"in a&&t(1,s=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=s&&l.find(a=>a.id==s.collectionId)),n.$$.dirty&2&&s&&r()},[o,s,l]}class cL extends we{constructor(e){super(),ye(this,e,fL,aL,_e,{record:1})}}function H_(n,e,t){const i=n.slice();return i[9]=e[t],i}function dL(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function pL(n){let e,t=de(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function j_(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,_,g,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=B(r),u=C(),f=b("div"),c=B("ID: "),m=B(d),h=C(),_=b("button"),_.innerHTML='',g=C(),kn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){y(T,e,O),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,_),w(e,g),k||(S=W(_,"click",$),k=!0)},p(T,O){var E;n=T,O&2&&!kn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&re(a,r),O&2&&d!==(d=n[9].providerId+"")&&re(m,d)},d(T){T&&v(e),k=!1,S()}}}function hL(n){let e;function t(s,o){var r;return s[2]?mL:(r=s[0])!=null&&r.id&&s[1].length?pL:dL}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function _L(n,e,t){const i=bt();let{record:l}=e,s=[],o=!1;function r(d){return ef.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||V.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await me.collection("_externalAuths").getFullList({filter:me.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){me.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||pn(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>me.collection("_externalAuths").delete(d.id).then(()=>{tn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{me.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class gL extends we{constructor(e){super(),ye(this,e,_L,hL,_e,{record:0})}}function bL(n){let e,t,i,l,s,o,r,a,u,f;return s=new fi({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=B(n[1]),l=C(),j(s.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){y(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),q(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Ee(He.call(null,r,"Refresh")),W(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&re(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(M(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),H(s),u=!1,Ie(f)}}}function kL(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[bL]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new jn({props:d}),ie.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){y(m,e,h),w(e,t),w(e,i),q(l,e,null),a=!0,u||(f=Ee(r=He.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],Te(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Nt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(M(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&v(e),H(l),u=!1,f()}}}function vL(n,e,t){const i=bt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=V.randomSecret(s)),i("generate",o),await un(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){ie[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class yL extends we{constructor(e){super(),ye(this,e,vL,kL,_e,{class:0,length:5})}}function z_(n){let e,t,i,l,s=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),l=B("Public: "),o=B(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class",r="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(e,"class","form-field-addon email-visibility-addon svelte-1751a4d")},m(f,c){y(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Ee(He.call(null,t,{text:"Make email public or private",position:"top-right"})),W(t,"click",et(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&re(o,s),c&1&&r!==(r="btn btn-sm btn-transparent "+(f[0].emailVisibility?"btn-success":"btn-hint"))&&p(t,"class",r)},d(f){f&&v(e),a=!1,Ie(u)}}}function wL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&z_(n);return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="email",o=C(),m&&m.c(),r=C(),a=b("input"),p(t,"class",V.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[14]),p(a,"type","email"),a.autofocus=n[1],p(a,"autocomplete","off"),p(a,"id",u=n[14]),a.required=f=n[4].required,p(a,"class","svelte-1751a4d")},m(h,_){y(h,e,_),w(e,t),w(e,i),w(e,l),y(h,o,_),m&&m.m(h,_),y(h,r,_),y(h,a,_),ce(a,n[0].email),n[1]&&a.focus(),c||(d=W(a,"input",n[8]),c=!0)},p(h,_){_&16384&&s!==(s=h[14])&&p(e,"for",s),h[5]?m&&(m.d(1),m=null):m?m.p(h,_):(m=z_(h),m.c(),m.m(r.parentNode,r)),_&2&&(a.autofocus=h[1]),_&16384&&u!==(u=h[14])&&p(a,"id",u),_&16&&f!==(f=h[4].required)&&(a.required=f),_&1&&a.value!==h[0].email&&ce(a,h[0].email)},d(h){h&&(v(e),v(o),v(r),v(a)),m&&m.d(h),c=!1,d()}}}function U_(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[SL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){y(u,e,f),e.checked=n[2],y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function V_(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[TL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[$L,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){y(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&Q(t,"p-t-xs",f[2])},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=je(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=je(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),H(l),H(r),f&&a&&a.end()}}}function TL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new yL({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password",o=C(),r=b("input"),u=C(),f=b("div"),j(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0,p(f,"class","form-field-addon")},m(_,g){y(_,e,g),w(e,t),w(e,i),w(e,l),y(_,o,g),y(_,r,g),ce(r,n[0].password),y(_,u,g),y(_,f,g),q(c,f,null),d=!0,m||(h=W(r,"input",n[10]),m=!0)},p(_,g){(!d||g&16384&&s!==(s=_[14]))&&p(e,"for",s),(!d||g&16384&&a!==(a=_[14]))&&p(r,"id",a),g&1&&r.value!==_[0].password&&ce(r,_[0].password);const k={};g&8&&(k.length=Math.max(15,_[3].min||0)),c.$set(k)},i(_){d||(M(c.$$.fragment,_),d=!0)},o(_){D(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(u),v(f)),H(c),m=!1,h()}}}function $L(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password confirm",o=C(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[0].passwordConfirm),u||(f=W(r,"input",n[11]),u=!0)},p(c,d){d&16384&&s!==(s=c[14])&&p(e,"for",s),d&16384&&a!==(a=c[14])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ce(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function B_(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[CL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function CL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){y(u,e,f),e.checked=n[0].verified,y(u,i,f),y(u,l,f),w(l,s),r||(a=[W(e,"change",n[12]),W(e,"change",et(n[13]))],r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,Ie(a)}}}function OL(n){var d;let e,t,i,l,s,o,r,a;i=new fe({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[wL,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&U_(n),f=(n[1]||n[2])&&V_(n),c=!n[5]&&B_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),u&&u.c(),o=C(),f&&f.c(),r=C(),c&&c.c(),p(t,"class","col-lg-12"),p(s,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(m,h){y(m,e,h),w(e,t),q(i,t,null),w(e,l),w(e,s),u&&u.m(s,null),w(s,o),f&&f.m(s,null),w(e,r),c&&c.m(e,null),a=!0},p(m,[h]){var g;const _={};h&16&&(_.class="form-field "+((g=m[4])!=null&&g.required?"required":"")),h&49203&&(_.$$scope={dirty:h,ctx:m}),i.$set(_),m[1]?u&&(ae(),D(u,1,1,()=>{u=null}),ue()):u?(u.p(m,h),h&2&&M(u,1)):(u=U_(m),u.c(),M(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&M(f,1)):(f=V_(m),f.c(),M(f,1),f.m(s,null)):f&&(ae(),D(f,1,1,()=>{f=null}),ue()),m[5]?c&&(ae(),D(c,1,1,()=>{c=null}),ue()):c?(c.p(m,h),h&32&&M(c,1)):(c=B_(m),c.c(),M(c,1),c.m(e,null))},i(m){a||(M(i.$$.fragment,m),M(u),M(f),M(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&v(e),H(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function EL(n,e,t){let i,l,s,{record:o}=e,{collection:r}=e,{isNew:a=!(o!=null&&o.id)}=e,u=!1;const f=()=>t(0,o.emailVisibility=!o.emailVisibility,o);function c(){o.email=this.value,t(0,o),t(2,u)}function d(){u=this.checked,t(2,u)}function m(){o.password=this.value,t(0,o),t(2,u)}function h(){o.passwordConfirm=this.value,t(0,o),t(2,u)}function _(){o.verified=this.checked,t(0,o),t(2,u)}const g=k=>{a||pn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!k.target.checked,o)})};return n.$$set=k=>{"record"in k&&t(0,o=k.record),"collection"in k&&t(6,r=k.collection),"isNew"in k&&t(1,a=k.isNew)},n.$$.update=()=>{var k,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,l=((k=r==null?void 0:r.fields)==null?void 0:k.find($=>$.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find($=>$.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),di("password"),di("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,_,g]}class ML extends we{constructor(e){super(),ye(this,e,EL,OL,_e,{record:0,collection:6,isNew:1})}}function W_(n){let e;function t(s,o){return s[1].primaryKey?IL:DL}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function DL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[1].type))},m(i,l){y(i,e,l)},p(i,l){l&2&&t!==(t=V.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&v(e)}}}function IL(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Y_(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function LL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&W_(n),f=n[1].hidden&&Y_();const c=n[4].default,d=It(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),s=B(l),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){y(m,e,h),u&&u.m(e,null),w(e,t),w(e,i),w(i,s),w(e,o),f&&f.m(e,null),w(e,r),d&&d.m(e,null),a=!0},p(m,[h]){m[2]?u?u.p(m,h):(u=W_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&re(s,l),m[1].hidden?f||(f=Y_(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&At(d,c,m,m[3],a?Lt(c,m[3],h,null):Pt(m[3]),null),(!a||h&1)&&p(e,"for",m[0])},i(m){a||(M(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&v(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function AL(n,e,t){let{$$slots:i={},$$scope:l}=e,{uniqueId:s}=e,{field:o}=e,{icon:r=!0}=e;return n.$$set=a=>{"uniqueId"in a&&t(0,s=a.uniqueId),"field"in a&&t(1,o=a.field),"icon"in a&&t(2,r=a.icon),"$$scope"in a&&t(3,l=a.$$scope)},[s,o,r,l,i]}class ni extends we{constructor(e){super(),ye(this,e,AL,LL,_e,{uniqueId:0,field:1,icon:2})}}function PL(n){let e,t,i,l,s,o,r;return l=new ni({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),j(l.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){y(a,e,u),e.checked=n[0],y(a,i,u),q(l,a,u),s=!0,o||(r=W(e,"change",n[2]),o=!0)},p(a,u){(!s||u&8&&t!==(t=a[3]))&&p(e,"id",t),u&1&&(e.checked=a[0]);const f={};u&8&&(f.uniqueId=a[3]),u&2&&(f.field=a[1]),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),H(l,a),o=!1,r()}}}function NL(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[PL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function RL(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class FL extends we{constructor(e){super(),ye(this,e,RL,NL,_e,{field:1,value:0})}}function K_(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){y(s,e,o),w(e,t),i||(l=[Ee(He.call(null,t,"Clear")),W(t,"click",n[5])],i=!0)},p:te,d(s){s&&v(e),i=!1,Ie(l)}}}function qL(n){let e,t,i,l,s,o,r;e=new ni({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&K_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0]!==void 0&&(c.formattedValue=n[0]),l=new tf({props:c}),ie.push(()=>be(l,"value",u)),ie.push(()=>be(l,"formattedValue",f)),l.$on("close",n[3]),{c(){j(e.$$.fragment),t=C(),a&&a.c(),i=C(),j(l.$$.fragment)},m(d,m){q(e,d,m),y(d,t,m),a&&a.m(d,m),y(d,i,m),q(l,d,m),r=!0},p(d,m){const h={};m&256&&(h.uniqueId=d[8]),m&2&&(h.field=d[1]),e.$set(h),d[0]&&!d[1].required?a?a.p(d,m):(a=K_(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const _={};m&256&&(_.id=d[8]),!s&&m&4&&(s=!0,_.value=d[2],Te(()=>s=!1)),!o&&m&1&&(o=!0,_.formattedValue=d[0],Te(()=>o=!1)),l.$set(_)},i(d){r||(M(e.$$.fragment,d),M(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(v(t),v(i)),H(e,d),a&&a.d(d),H(l,d)}}}function HL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qL,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jL(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class zL extends we{constructor(e){super(),ye(this,e,jL,HL,_e,{field:1,value:0})}}function J_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Z_(n,e,t){const i=n.slice();return i[48]=e[t],i}function G_(n,e,t){const i=n.slice();return i[51]=e[t],i}function UL(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,_,g=de(n[7]);const k=S=>S[51].id;for(let S=0;SNew record',c=C(),j(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){y(S,e,$),w(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function X_(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=B(i),s=C(),p(t,"type","button"),p(t,"class","sidebar-item"),Q(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){y(u,t,f),w(t,l),w(t,s),o||(r=W(t,"click",et(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&re(l,i),f[0]&384&&Q(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&v(t),o=!1,r()}}}function BL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Q_(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){y(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Q_(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function WL(n){let e=[],t=new Map,i,l=de(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){y(l,e,s),t||(i=W(e,"click",et(n[17])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function YL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function KL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),kn(e.src,t=me.files.getURL(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){y(l,e,s)},p(l,s){s[0]&32&&!kn(e.src,t=me.files.getURL(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function x_(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!V.hasImageExtension(f[48])),t?KL:YL}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=C(),p(e,"type","button"),p(e,"class","thumb handle"),Q(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){y(f,e,c),u.m(e,null),w(e,i),s||(o=[Ee(l=He.call(null,e,n[48]+` +(record: `+n[44].id+")")),W(e,"click",et(function(){Nt(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&Nt(l.update)&&c[0]&32&&l.update.call(null,n[48]+` +(record: `+n[44].id+")"),c[0]&589856&&Q(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,Ie(o)}}}function eg(n,e){let t,i,l=de(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function JL(n){let e,t;function i(r,a){if(r[15])return WL;if(!r[6])return BL}let l=i(n),s=l&&l(n),o=n[6]&&tg();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ke()},m(r,a){s&&s.m(r,a),y(r,e,a),o&&o.m(r,a),y(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=tg(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function ZL(n){let e,t,i,l;const s=[VL,UL],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function GL(n){let e,t;return{c(){e=b("h4"),t=B(n[0])},m(i,l){y(i,e,l),w(e,t)},p(i,l){l[0]&1&&re(t,i[0])},d(i){i&&v(e)}}}function ng(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[XL,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function XL(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new Wn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QL(n){var h;let e,t,i,l=V.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&ng(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),s=C(),o=b("button"),r=b("span"),a=B(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(_,g){y(_,e,g),w(e,t),y(_,i,g),m&&m.m(_,g),y(_,s,g),y(_,o,g),w(o,r),w(r,a),f=!0,c||(d=[W(e,"click",n[2]),W(o,"click",n[21])],c=!0)},p(_,g){var k;(!f||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=V.hasImageExtension((k=_[9])==null?void 0:k.name)),l?m?(m.p(_,g),g[0]&512&&M(m,1)):(m=ng(_),m.c(),M(m,1),m.m(s.parentNode,s)):m&&(ae(),D(m,1,1,()=>{m=null}),ue()),(!f||g[0]&2)&&re(a,_[1]),(!f||g[0]&8192&&u!==(u=!_[13]))&&(o.disabled=u)},i(_){f||(M(m),f=!0)},o(_){D(m),f=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,Ie(d)}}}function xL(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[QL],header:[GL],default:[ZL]},$$scope:{ctx:n}};for(let a=0;at(27,u=Ve));const f=bt(),c="file_picker_"+V.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,k="",S=[],$=1,T=0,O=!1,E=[],I=[],L=[],A={},P={},N="";function R(){return J(!0),_==null?void 0:_.show()}function z(){return _==null?void 0:_.hide()}function F(){t(5,S=[]),t(9,P={}),t(12,N="")}function U(){t(4,k="")}async function J(Ve=!1){if(A!=null&&A.id){t(6,O=!0),Ve&&F();try{const Me=Ve?1:$+1,st=V.getAllCollectionIdentifiers(A);let De=V.normalizeSearchFilter(k,st)||"";De&&(De+=" && "),De+="("+I.map(Ce=>`${Ce.name}:length>0`).join("||")+")";let Be="";A.type!="view"&&(Be="-@rowid");const ve=await me.collection(A.id).getList(Me,ig,{filter:De,sort:Be,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=V.filterDuplicatesByKey(S.concat(ve.items))),$=ve.page,t(26,T=ve.items.length),t(6,O=!1)}catch(Me){Me.isAbort||(me.error(Me),t(6,O=!1))}}}function K(){var Me;let Ve=["100x100"];if((Me=P==null?void 0:P.record)!=null&&Me.id){for(const st of I)if(V.toArray(P.record[st.name]).includes(P.name)){Ve=Ve.concat(V.toArray(st.thumbs));break}}t(11,L=[{label:"Original size",value:""}]);for(const st of Ve)L.push({label:`${st} thumb`,value:st});N&&!Ve.includes(N)&&t(12,N="")}function x(Ve){let Me=[];for(const st of I){const De=V.toArray(Ve[st.name]);for(const Be of De)h.includes(V.getFileType(Be))&&Me.push(Be)}return Me}function X(Ve,Me){t(9,P={record:Ve,name:Me})}function oe(){o&&(f("submit",Object.assign({size:N},P)),z())}function Se(Ve){N=Ve,t(12,N)}const ge=Ve=>{t(8,A=Ve)},$e=Ve=>t(4,k=Ve.detail),Ye=()=>g==null?void 0:g.show(),nt=()=>{s&&J()};function xe(Ve){ie[Ve?"unshift":"push"](()=>{_=Ve,t(3,_)})}function We(Ve){Ne.call(this,n,Ve)}function rt(Ve){Ne.call(this,n,Ve)}function Ze(Ve){ie[Ve?"unshift":"push"](()=>{g=Ve,t(10,g)})}const at=Ve=>{V.removeByKey(S,"id",Ve.detail.record.id),S.unshift(Ve.detail.record),t(5,S);const Me=x(Ve.detail.record);Me.length>0&&X(Ve.detail.record,Me[0])},Ht=Ve=>{var Me;((Me=P==null?void 0:P.record)==null?void 0:Me.id)==Ve.detail.id&&t(9,P={}),V.removeByKey(S,"id",Ve.detail.id),t(5,S)};return n.$$set=Ve=>{e=ze(ze({},e),Ut(Ve)),t(22,a=lt(e,r)),"title"in Ve&&t(0,d=Ve.title),"submitText"in Ve&&t(1,m=Ve.submitText),"fileTypes"in Ve&&t(24,h=Ve.fileTypes)},n.$$.update=()=>{var Ve;n.$$.dirty[0]&134217728&&t(7,E=u.filter(Me=>Me.type!=="view"&&!!V.toArray(Me.fields).find(st=>{var De,Be;return st.type==="file"&&!st.protected&&(!((De=st.mimeTypes)!=null&&De.length)||!!((Be=st.mimeTypes)!=null&&Be.find(ve=>ve.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(I=(Ve=A==null?void 0:A.fields)==null?void 0:Ve.filter(Me=>Me.type==="file"&&!Me.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(U(),K()),n.$$.dirty[0]&512&&P!=null&&P.name&&K(),n.$$.dirty[0]&280&&typeof k<"u"&&A!=null&&A.id&&_!=null&&_.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(Me,st)=>{var De;return(P==null?void 0:P.name)==st&&((De=P==null?void 0:P.record)==null?void 0:De.id)==Me.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Me=>x(Me).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!O&&T==ig),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,_,k,S,O,E,A,P,g,L,N,o,s,l,i,U,J,x,X,oe,a,c,h,R,T,u,Se,ge,$e,Ye,nt,xe,We,rt,Ze,at,Ht]}class tA extends we{constructor(e){super(),ye(this,e,eA,xL,_e,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function nA(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function iA(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Tu({props:s}),ie.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function lA(n){let e,t,i,l,s,o;e=new ni({props:{uniqueId:n[11],field:n[1]}});const r=[iA,nA],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ke()},m(f,c){q(e,f,c),y(f,t,c),a[i].m(f,c),y(f,s,c),o=!0},p(f,c){const d={};c&2048&&(d.uniqueId=f[11]),c&2&&(d.field=f[1]),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(ae(),D(a[m],1,1,()=>{a[m]=null}),ue(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(v(t),v(s)),H(e,f),a[i].d(f)}}}function sA(n){let e,t,i,l;e=new fe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[lA,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new tA({props:s}),n[8](i),i.$on("submit",n[9]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),y(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&v(t),H(e,o),n[8](null),H(i,o)}}}function oA(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Zt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ie[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,me.files.getURL(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=Object.assign(V.defaultEditorOptions(),{convert_urls:l.convertURLs,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class rA extends we{constructor(e){super(),ye(this,e,oA,sA,_e,{field:1,value:0})}}function aA(n){let e,t,i,l,s,o,r,a;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","email"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),y(u,t,f),y(u,i,f),ce(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&ce(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(v(t),v(i)),H(e,u),r=!1,a()}}}function uA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[aA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function fA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class cA extends we{constructor(e){super(),ye(this,e,fA,uA,_e,{field:1,value:0})}}function dA(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){y(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function pA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),kn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){y(l,e,s)},p(l,s){s&4&&!kn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function mA(n){let e;function t(s,o){return s[2]?pA:dA}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function hA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){V.hasImageExtension(l==null?void 0:l.name)?V.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class _A extends we{constructor(e){super(),ye(this,e,hA,mA,_e,{file:0,size:1})}}function lg(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function sg(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function gA(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){y(s,e,o),t||(i=[Ee(He.call(null,e,"Remove file")),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,Ie(i)}}}function bA(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){y(s,e,o),t||(i=W(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function kA(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new of({props:{record:n[3],filename:n[34]}});function h(k,S){return k[35]?bA:gA}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("a"),a=B(r),c=C(),d=b("div"),g.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=me.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(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(k,S){y(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,c),w(e,d),g.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&Q(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&re(a,r),(!m||S[0]&1064&&u!==(u=me.files.getURL(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),_===(_=h(k))&&g?g.p(k,S):(g.d(1),g=_(k),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&Q(e,"dragging",k[32]),(!m||S[1]&4)&&Q(e,"dragover",k[33])},i(k){m||(M(i.$$.fragment,k),m=!0)},o(k){D(i.$$.fragment,k),m=!1},d(k){k&&v(e),H(i),g.d()}}}function og(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[kA,({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 go({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!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}),!l&&u[0]&1&&(l=!0,f.list=e[0],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function vA(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,h,_,g;i=new _A({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),j(i.$$.fragment),l=C(),s=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=B(u),d=C(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,$){y(S,e,$),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(s,r),w(s,a),w(a,f),w(e,d),w(e,m),h=!0,_||(g=[Ee(He.call(null,m,"Remove file")),W(m,"click",k)],_=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!h||$[0]&2)&&u!==(u=n[29].name+"")&&re(f,u),(!h||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||$[1]&2)&&Q(e,"dragging",n[32]),(!h||$[1]&4)&&Q(e,"dragover",n[33])},i(S){h||(M(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&v(e),H(i),_=!1,Ie(g)}}}function rg(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[vA,({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 go({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!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}),!l&&u[0]&2&&(l=!0,f.list=e[1],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function yA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,_,g,k,S,$,T;e=new ni({props:{uniqueId:n[28],field:n[4]}});let O=de(n[5]);const E=A=>A[34]+A[3].id;for(let A=0;AA[29].name+A[31];for(let A=0;A({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","block")},m(o,r){y(o,e,r),q(t,e,null),i=!0,l||(s=[B(e,"dragover",et(n[25])),B(e,"dragleave",n[26]),B(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[yA,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","block")},m(o,r){y(o,e,r),q(t,e,null),i=!0,l||(s=[W(e,"dragover",et(n[25])),W(e,"dragleave",n[26]),W(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&v(e),H(t),l=!1,Ie(s)}}}function yA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,h="";function _(U){V.removeByValue(f,U),t(2,f)}function g(U){V.pushUnique(f,U),t(2,f)}function k(U){V.isEmpty(u[U])||u.splice(U,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(U){var K;U.preventDefault(),t(9,m=!1);const J=((K=U.dataTransfer)==null?void 0:K.files)||[];if(!(s||!J.length)){for(const x of J){const X=l.length+u.length-f.length;if(r.maxSelect<=X)break;u.push(x)}t(1,u)}}Zt(async()=>{t(10,h=await me.getSuperuserFileToken(o.collectionId))});const T=U=>_(U),O=U=>g(U);function M(U){a=U,t(0,a),t(6,i),t(4,r)}const L=U=>k(U);function I(U){u=U,t(1,u)}function A(U){ie[U?"unshift":"push"](()=>{c=U,t(7,c)})}const P=()=>{for(let U of c.files)u.push(U);t(1,u),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function R(U){ie[U?"unshift":"push"](()=>{d=U,t(8,d)})}const z=()=>{t(9,m=!0)},F=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,u=U.uploadedFiles),"deletedFileNames"in U&&t(2,f=U.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=V.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,h,s,_,g,k,$,T,O,M,L,I,A,P,N,R,z,F]}class wA extends we{constructor(e){super(),ye(this,e,yA,vA,_e,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function SA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function TA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function $A(n){let e,t,i,l;function s(a,u){return a[4]?TA:SA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){y(a,e,u),r.m(e,null),i||(l=Ee(t=He.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&Nt(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&v(e),r.d(),i=!1,l()}}}function CA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function OA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=jt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ke()},m(o,r){e&&q(e,o,r),y(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){ae();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ue()}l?(e=jt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&H(e,o)}}}function EA(n){let e,t,i,l,s,o;e=new ni({props:{uniqueId:n[6],field:n[1],$$slots:{default:[$A]},$$scope:{ctx:n}}});const r=[OA,CA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ke()},m(f,c){q(e,f,c),y(f,t,c),a[i].m(f,c),y(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(ae(),D(a[m],1,1,()=>{a[m]=null}),ue(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),E(l,1),l.m(s.parentNode,s))},i(f){o||(E(e.$$.fragment,f),E(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(v(t),v(s)),H(e,f),a[i].d(f)}}}function MA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[EA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ag(n){return typeof n=="string"&&dv(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function dv(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function DA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=ag(s);Zt(async()=>{try{t(3,o=(await Ct(async()=>{const{default:u}=await import("./CodeEditor-DKQxSBo9.js");return{default:u}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=ag(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=dv(r))},[s,l,r,o,i,a]}class IA extends we{constructor(e){super(),ye(this,e,DA,MA,_e,{field:1,value:0})}}function LA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),y(c,t,d),y(c,i,d),ce(i,n[0]),a=!0,u||(f=B(i,"input",n[2]),u=!0)},p(c,d){const m={};d&8&&(m.uniqueId=c[3]),d&2&&(m.field=c[1]),e.$set(m),(!a||d&8&&l!==(l=c[3]))&&p(i,"id",l),(!a||d&2&&s!==(s=c[1].required))&&(i.required=s),(!a||d&2&&o!==(o=c[1].min))&&p(i,"min",o),(!a||d&2&&r!==(r=c[1].max))&&p(i,"max",r),d&1&>(i.value)!==c[0]&&ce(i,c[0])},i(c){a||(E(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(v(t),v(i)),H(e,c),u=!1,f()}}}function AA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[LA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function PA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class NA extends we{constructor(e){super(),ye(this,e,PA,AA,_e,{field:1,value:0})}}function RA(n){let e,t,i,l,s,o,r,a;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),y(u,t,f),y(u,i,f),ce(i,n[0]),o=!0,r||(a=B(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&ce(i,u[0])},i(u){o||(E(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(v(t),v(i)),H(e,u),r=!1,a()}}}function FA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function qA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class HA extends we{constructor(e){super(),ye(this,e,qA,FA,_e,{field:1,value:0})}}function ug(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function jA(n,e){e=ug(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=ug(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function fg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function cg(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function dg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[31]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function pg(n){let e,t=!n[13]&&mg(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=mg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function mg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&hg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){y(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=hg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function hg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[35]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function zA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function UA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function _g(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){y(o,e,r),w(e,t),i||(l=[Ee(He.call(null,t,"Edit")),B(t,"keydown",On(n[27])),B(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,Ie(l)}}}function gg(n,e){let t,i,l,s,o,r,a,u;function f(g,k){return g[6]?UA:zA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&_g(e);function h(){return e[33](e[50])}function _(...g){return e[34](e[50],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),j(s.$$.fragment),o=C(),m&&m.c(),p(l,"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,k){y(g,t,k),d.m(t,null),w(t,i),w(t,l),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[B(t,"click",h),B(t,"keydown",_)],a=!0)},p(g,k){e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=_g(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&Q(t,"selected",e[6]),(!r||k[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){D(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function bg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function kg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=W("("),i=W(t),l=W(" of MAX "),s=W(n[4]),o=W(")")},m(r,a){y(r,e,a),y(r,i,a),y(r,l,a),y(r,s,a),y(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&re(i,t),a[0]&16&&re(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function VA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function BA(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"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){y(f,e,c),q(t,e,null),w(e,i),w(e,l),y(f,s,c),o=!0,r||(a=B(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),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||(E(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(v(e),v(s)),H(t),r=!1,a()}}}function vg(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[WA,({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&&(s.list=n[6]),e=new go({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YA(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,_,g,k,S,$;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&dg(n),O=pe(n[8]);const M=z=>z[50].id;for(let z=0;z1&&kg(n);const P=[BA,VA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),_=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=C(),T&&T.c(),l=C(),s=b("div");for(let z=0;z1?A?A.p(z,F):(A=kg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(ae(),D(N[J],1,1,()=>{N[J]=null}),ue(),_=N[h],_?_.p(z,F):(_=N[h]=P[h](z),_.c()),E(_,1),_.m(g.parentNode,g))},i(z){if(!k){E(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=[B(e,"click",n[28]),B(i,"click",n[29])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,Ie(s)}}}function ZA(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[JA],header:[KA],default:[YA]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ce));const h=bt(),_="picker_"+V.randomString(5);let{value:g}=e,{field:k}=e,S,$,T="",O=[],M=[],L=1,I=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,O=[]),t(6,M=[]),F(),U(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var qt;let Ce="";const ut=(qt=s==null?void 0:s.fields)==null?void 0:qt.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ut){const ot=V.getExpandPresentableRelField(Le,m,2);ot&&(Ce!=""&&(Ce+=","),Ce+=ot)}return Ce}async function F(){const Ce=V.toArray(g);if(!l||!Ce.length)return;t(24,P=!0);let ut=[];const qt=Ce.slice(),Le=[];for(;qt.length>0;){const ot=[];for(const on of qt.splice(0,Xo))ot.push(`id="${on}"`);Le.push(me.collection(l).getFullList({batch:Xo,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ut=ut.concat(...ot)}),t(6,M=[]);for(const ot of Ce){const on=V.findByKey(ut,"id",ot);on&&M.push(on)}T.trim()||t(8,O=V.filterDuplicatesByKey(M.concat(O))),t(24,P=!1)}catch(ot){ot.isAbort||(me.error(ot),t(24,P=!1))}}async function U(Ce=!1){if(l){t(3,A=!0),Ce&&(T.trim()?t(8,O=[]):t(8,O=V.toArray(M).slice()));try{const ut=Ce?1:L+1,qt=V.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await me.collection(l).getList(ut,Xo,{filter:V.normalizeSearchFilter(T,qt),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:_+"loadList"});t(8,O=V.filterDuplicatesByKey(O.concat(ot.items))),L=ot.page,t(23,I=ot.items.length),t(3,A=!1)}catch(ut){ut.isAbort||(me.error(ut),t(3,A=!1))}}}function J(Ce){i==1?t(6,M=[Ce]):u&&(V.pushOrReplaceByKey(M,Ce),t(6,M))}function K(Ce){V.removeByKey(M,"id",Ce.id),t(6,M)}function x(Ce){f(Ce)?K(Ce):J(Ce)}function X(){var Ce;i!=1?t(20,g=M.map(ut=>ut.id)):t(20,g=((Ce=M==null?void 0:M[0])==null?void 0:Ce.id)||""),h("save",M),R()}function oe(Ce){Ne.call(this,n,Ce)}const Se=()=>R(),ge=()=>X(),$e=Ce=>t(2,T=Ce.detail),Ye=()=>$==null?void 0:$.show(),nt=Ce=>$==null?void 0:$.show(Ce.id),xe=Ce=>x(Ce),We=(Ce,ut)=>{(ut.code==="Enter"||ut.code==="Space")&&(ut.preventDefault(),ut.stopPropagation(),x(Ce))},rt=()=>t(2,T=""),Ze=()=>{a&&!A&&U()},at=Ce=>K(Ce);function Ht(Ce){M=Ce,t(6,M)}function Ve(Ce){ie[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function Me(Ce){Ne.call(this,n,Ce)}function st(Ce){Ne.call(this,n,Ce)}function De(Ce){ie[Ce?"unshift":"push"](()=>{$=Ce,t(7,$)})}const Be=Ce=>{V.removeByKey(O,"id",Ce.detail.record.id),O.unshift(Ce.detail.record),t(8,O),J(Ce.detail.record)},ve=Ce=>{V.removeByKey(O,"id",Ce.detail.id),t(8,O),K(Ce.detail)};return n.$$set=Ce=>{e=ze(ze({},e),Ut(Ce)),t(19,d=lt(e,c)),"value"in Ce&&t(20,g=Ce.value),"field"in Ce&&t(21,k=Ce.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=k==null?void 0:k.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ce=>Ce.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&U(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=A||P),n.$$.dirty[0]&8388608&&t(12,a=I==Xo),n.$$.dirty[0]&80&&t(10,u=i<=0||i>M.length),n.$$.dirty[0]&64&&t(9,f=function(Ce){return V.findByKey(M,"id",Ce.id)})},[R,S,T,A,i,s,M,$,O,f,u,o,a,r,U,J,K,x,X,d,g,k,N,I,P,l,m,oe,Se,ge,$e,Ye,nt,xe,We,rt,Ze,at,Ht,Ve,Me,st,De,Be,ve]}class XA extends we{constructor(e){super(),ye(this,e,GA,ZA,_e,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function yg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function wg(n,e,t){const i=n.slice();return i[27]=e[t],i}function Sg(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){y(s,e,o),i||(l=Ee(t=He.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Nt(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function QA(n){let e,t=n[6].length&&Sg(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Sg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Tg(n){let e,t=n[5]&&$g(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=$g(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function $g(n){let e,t=pe(V.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function xA(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[25]),Q(e,"dragover",n[26])},m(d,m){y(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),y(d,r,m),a=!0,u||(f=[Ee(He.call(null,o,"Remove")),B(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&Q(e,"dragging",n[25]),(!a||m&67108864)&&Q(e,"dragover",n[26])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),H(i),u=!1,Ie(f)}}}function Og(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[xA,({dragging:a,dragover:u})=>({25:a,26:u}),({dragging:a,dragover:u})=>(a?33554432:0)|(u?67108864:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new go({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function eP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ni({props:{uniqueId:n[21],field:n[2],$$slots:{default:[QA]},$$scope:{ctx:n}}});let m=pe(n[4]);const h=g=>g[22].id;for(let g=0;g Open picker',p(l,"class","relations-list svelte-1ynw0pc"),p(u,"type","button"),p(u,"class","btn btn-transparent btn-sm btn-block"),p(a,"class","list-item list-item-btn"),p(i,"class","list")},m(g,k){q(e,g,k),y(g,t,k),y(g,i,k),w(i,l);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new XA({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),y(r,t,a),q(i,r,a),l=!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&1075839223&&(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){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Eg=100;function nP(n,e,t){let i,l;Qe(n,En,I=>t(18,l=I));let{field:s}=e,{value:o}=e,{picker:r}=e,a,u=[],f=!1,c,d=[];function m(){if(f)return!1;const I=V.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=V.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(U=>U.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(U=>!U.hidden&&U.presentable&&U.type=="relation");for(const U of P){const J=V.getExpandPresentableRelField(U,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const U=[];for(const J of N.splice(0,Eg))U.push(`id="${J}"`);R.push(me.collection(s.collectionId).getFullList(Eg,{filter:U.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let U=[];await Promise.all(R).then(J=>{U=U.concat(...J)});for(const J of I){const K=V.findByKey(U,"id",J);K?u.push(K):d.push(J)}t(4,u),g()}catch(U){me.error(U)}t(5,f=!1)}function _(I){V.removeByKey(u,"id",I.id),t(4,u),g()}function g(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}ro(()=>{clearTimeout(c)});const k=I=>_(I);function S(I){u=I,t(4,u)}const $=()=>{g()},T=()=>r==null?void 0:r.show();function O(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function M(I){ie[I?"unshift":"push"](()=>{r=I,t(1,r)})}const L=I=>{var A;t(4,u=I.detail||[]),t(0,o=i?u.map(P=>P.id):((A=u[0])==null?void 0:A.id)||"")};return n.$$set=I=>{"field"in I&&t(2,s=I.field),"value"in I&&t(0,o=I.value),"picker"in I&&t(1,r=I.picker)},n.$$.update=()=>{n.$$.dirty&4&&t(7,i=s.maxSelect>1),n.$$.dirty&9&&typeof o<"u"&&(a==null||a.changed()),n.$$.dirty&1041&&m()&&(t(5,f=!0),clearTimeout(c),t(10,c=setTimeout(h,0)))},[o,r,s,a,u,f,d,i,_,g,c,k,S,$,T,O,M,L]}class iP extends we{constructor(e){super(),ye(this,e,nP,tP,_e,{field:2,value:0,picker:1})}}function Mg(n){let e,t,i,l;return{c(){e=b("div"),t=W("Select up to "),i=W(n[2]),l=W(" items."),p(e,"class","help-block")},m(s,o){y(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&re(i,s[2])},d(s){s&&v(e)}}}function lP(n){var c,d;let e,t,i,l,s,o,r;e=new ni({props:{uniqueId:n[5],field:n[1]}});function a(m){n[4](m)}let u={id:n[5],toggle:!n[1].required||n[3],multiple:n[3],closable:!n[3]||((c=n[0])==null?void 0:c.length)>=n[1].maxSelect,items:n[1].values,searchable:((d=n[1].values)==null?void 0:d.length)>5};n[0]!==void 0&&(u.selected=n[0]),i=new ds({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Mg(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),s=C(),f&&f.c(),o=ke()},m(m,h){q(e,m,h),y(m,t,h),q(i,m,h),y(m,s,h),f&&f.m(m,h),y(m,o,h),r=!0},p(m,h){var k,S;const _={};h&32&&(_.uniqueId=m[5]),h&2&&(_.field=m[1]),e.$set(_);const g={};h&32&&(g.id=m[5]),h&10&&(g.toggle=!m[1].required||m[3]),h&8&&(g.multiple=m[3]),h&11&&(g.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(g.items=m[1].values),h&2&&(g.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,g.selected=m[0],Te(()=>l=!1)),i.$set(g),m[3]?f?f.p(m,h):(f=Mg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(E(e.$$.fragment,m),E(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(v(t),v(s),v(o)),H(e,m),H(i,m),f&&f.d(m)}}}function sP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[lP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function oP(n,e,t){let i,l,{field:s}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,s),t(2,l)}return n.$$set=a=>{"field"in a&&t(1,s=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=s.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,l=s.maxSelect||s.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>s.values.includes(a))),o.length>l&&t(0,o=o.slice(o.length-l)))},[o,s,l,i,r]}class rP extends we{constructor(e){super(),ye(this,e,oP,sP,_e,{field:1,value:0})}}function aP(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Zt(()=>(u(),()=>clearTimeout(a)));function c(m){ie[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=ze(ze({},e),Ut(m)),t(3,l=lt(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class fP extends we{constructor(e){super(),ye(this,e,uP,aP,_e,{value:0,maxHeight:4})}}function cP(n){let e,t,i,l,s;e=new ni({props:{uniqueId:n[6],field:n[1]}});function o(a){n[5](a)}let r={id:n[6],required:n[3],placeholder:n[2]?"Leave empty to autogenerate...":""};return n[0]!==void 0&&(r.value=n[0]),i=new fP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],Te(()=>l=!1)),i.$set(c)},i(a){s||(E(e.$$.fragment,a),E(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(e,a),H(i,a)}}}function dP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[cP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pP(n,e,t){let i,l,{original:s}=e,{field:o}=e,{value:r=void 0}=e;function a(u){r=u,t(0,r)}return n.$$set=u=>{"original"in u&&t(4,s=u.original),"field"in u&&t(1,o=u.field),"value"in u&&t(0,r=u.value)},n.$$.update=()=>{n.$$.dirty&18&&t(2,i=!V.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class mP extends we{constructor(e){super(),ye(this,e,pP,dP,_e,{original:4,field:1,value:0})}}function hP(n){let e,t,i,l,s,o,r,a;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),y(u,t,f),y(u,i,f),ce(i,n[0]),o=!0,r||(a=B(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&ce(i,u[0])},i(u){o||(E(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(v(t),v(i)),H(e,u),r=!1,a()}}}function _P(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gP(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class bP extends we{constructor(e){super(),ye(this,e,gP,_P,_e,{field:1,value:0})}}function Dg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ig(n,e,t){const i=n.slice();return i[6]=e[t],i}function Lg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=W(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),Q(t,"active",e[1]===e[6].language),this.first=t},m(f,c){y(f,t,c),w(t,i),w(i,s),w(t,o),r||(a=B(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&re(s,l),c&6&&Q(t,"active",e[1]===e[6].language)},d(f){f&&v(t),r=!1,a()}}}function Ag(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new Qu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=W(a),f=W(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(s,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),Q(t,"active",e[1]===e[6].language),this.first=t},m(h,_){y(h,t,_),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,_){e=h;const g={};_&4&&(g.language=e[6].language),_&4&&(g.content=e[6].content),i.$set(g),(!m||_&4)&&a!==(a=e[6].title+"")&&re(u,a),(!m||_&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||_&6)&&Q(t,"active",e[1]===e[6].language)},i(h){m||(E(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&v(t),H(i)}}}function kP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=pe(n[2]);const d=_=>_[6].language;for(let _=0;__[6].language;for(let _=0;_t(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,l=u.class),"js"in u&&t(3,s=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(Pg,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:s,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[l,r,i,s,o,a]}class yP extends we{constructor(e){super(),ye(this,e,vP,kP,_e,{class:0,js:3,dart:4})}}function wP(n){let e,t,i,l,s,o=V.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[TP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=W(`Generate a non-refreshable auth token for - `),s=b("strong"),r=W(o),a=W(":"),u=C(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,_){y(h,e,_),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=B(e,"submit",et(n[9])),d=!0)},p(h,_){(!c||_&2)&&o!==(o=V.displayValue(h[1])+"")&&re(r,o);const g={};_&3145761&&(g.$$scope={dirty:_,ctx:h}),f.$set(g)},i(h){c||(E(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&v(e),H(f),d=!1,m()}}}function SP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new fi({props:{value:n[3].authStore.token}}),u=new yP({props:{class:"m-b-0",js:` + `),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||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&v(e),H(t),l=!1,Ie(s)}}}function SA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,h="";function _(U){V.removeByValue(f,U),t(2,f)}function g(U){V.pushUnique(f,U),t(2,f)}function k(U){V.isEmpty(u[U])||u.splice(U,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(U){var K;U.preventDefault(),t(9,m=!1);const J=((K=U.dataTransfer)==null?void 0:K.files)||[];if(!(s||!J.length)){for(const x of J){const X=l.length+u.length-f.length;if(r.maxSelect<=X)break;u.push(x)}t(1,u)}}Zt(async()=>{t(10,h=await me.getSuperuserFileToken(o.collectionId))});const T=U=>_(U),O=U=>g(U);function E(U){a=U,t(0,a),t(6,i),t(4,r)}const I=U=>k(U);function L(U){u=U,t(1,u)}function A(U){ie[U?"unshift":"push"](()=>{c=U,t(7,c)})}const P=()=>{for(let U of c.files)u.push(U);t(1,u),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function R(U){ie[U?"unshift":"push"](()=>{d=U,t(8,d)})}const z=()=>{t(9,m=!0)},F=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,u=U.uploadedFiles),"deletedFileNames"in U&&t(2,f=U.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=V.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,h,s,_,g,k,$,T,O,E,I,L,A,P,N,R,z,F]}class TA extends we{constructor(e){super(),ye(this,e,SA,wA,_e,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function $A(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function CA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function OA(n){let e,t,i,l;function s(a,u){return a[4]?CA:$A}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){y(a,e,u),r.m(e,null),i||(l=Ee(t=He.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&Nt(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&v(e),r.d(),i=!1,l()}}}function EA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function MA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=jt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ke()},m(o,r){e&&q(e,o,r),y(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){ae();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ue()}l?(e=jt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&H(e,o)}}}function DA(n){let e,t,i,l,s,o;e=new ni({props:{uniqueId:n[6],field:n[1],$$slots:{default:[OA]},$$scope:{ctx:n}}});const r=[MA,EA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ke()},m(f,c){q(e,f,c),y(f,t,c),a[i].m(f,c),y(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(ae(),D(a[m],1,1,()=>{a[m]=null}),ue(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(v(t),v(s)),H(e,f),a[i].d(f)}}}function IA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[DA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ag(n){return typeof n=="string"&&mv(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function mv(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function LA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=ag(s);Zt(async()=>{try{t(3,o=(await Ct(async()=>{const{default:u}=await import("./CodeEditor-pEpUQJ5v.js");return{default:u}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=ag(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=mv(r))},[s,l,r,o,i,a]}class AA extends we{constructor(e){super(),ye(this,e,LA,IA,_e,{field:1,value:0})}}function PA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),y(c,t,d),y(c,i,d),ce(i,n[0]),a=!0,u||(f=W(i,"input",n[2]),u=!0)},p(c,d){const m={};d&8&&(m.uniqueId=c[3]),d&2&&(m.field=c[1]),e.$set(m),(!a||d&8&&l!==(l=c[3]))&&p(i,"id",l),(!a||d&2&&s!==(s=c[1].required))&&(i.required=s),(!a||d&2&&o!==(o=c[1].min))&&p(i,"min",o),(!a||d&2&&r!==(r=c[1].max))&&p(i,"max",r),d&1&>(i.value)!==c[0]&&ce(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(v(t),v(i)),H(e,c),u=!1,f()}}}function NA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[PA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function RA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class FA extends we{constructor(e){super(),ye(this,e,RA,NA,_e,{field:1,value:0})}}function qA(n){let e,t,i,l,s,o,r,a;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),y(u,t,f),y(u,i,f),ce(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&ce(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(v(t),v(i)),H(e,u),r=!1,a()}}}function HA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class zA extends we{constructor(e){super(),ye(this,e,jA,HA,_e,{field:1,value:0})}}function ug(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function UA(n,e){e=ug(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=ug(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function fg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function cg(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function dg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[31]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function pg(n){let e,t=!n[13]&&mg(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=mg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function mg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&hg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){y(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=hg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function hg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function VA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function BA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function _g(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){y(o,e,r),w(e,t),i||(l=[Ee(He.call(null,t,"Edit")),W(t,"keydown",On(n[27])),W(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,Ie(l)}}}function gg(n,e){let t,i,l,s,o,r,a,u;function f(g,k){return g[6]?BA:VA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&_g(e);function h(){return e[33](e[50])}function _(...g){return e[34](e[50],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),j(s.$$.fragment),o=C(),m&&m.c(),p(l,"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,k){y(g,t,k),d.m(t,null),w(t,i),w(t,l),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[W(t,"click",h),W(t,"keydown",_)],a=!0)},p(g,k){e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=_g(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&Q(t,"selected",e[6]),(!r||k[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(M(s.$$.fragment,g),r=!0)},o(g){D(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function bg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function kg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=B("("),i=B(t),l=B(" of MAX "),s=B(n[4]),o=B(")")},m(r,a){y(r,e,a),y(r,i,a),y(r,l,a),y(r,s,a),y(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&re(i,t),a[0]&16&&re(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function WA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function YA(n){let e,t,i=de(n[6]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"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){y(f,e,c),q(t,e,null),w(e,i),w(e,l),y(f,s,c),o=!0,r||(a=W(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),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||(M(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(v(e),v(s)),H(t),r=!1,a()}}}function vg(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[KA,({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&&(s.list=n[6]),e=new go({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JA(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,_,g,k,S,$;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&dg(n),O=de(n[8]);const E=z=>z[50].id;for(let z=0;z1&&kg(n);const P=[YA,WA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),_=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=C(),T&&T.c(),l=C(),s=b("div");for(let z=0;z1?A?A.p(z,F):(A=kg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(ae(),D(N[J],1,1,()=>{N[J]=null}),ue(),_=N[h],_?_.p(z,F):(_=N[h]=P[h](z),_.c()),M(_,1),_.m(g.parentNode,g))},i(z){if(!k){M(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=[W(e,"click",n[28]),W(i,"click",n[29])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,Ie(s)}}}function XA(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[GA],header:[ZA],default:[JA]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ce));const h=bt(),_="picker_"+V.randomString(5);let{value:g}=e,{field:k}=e,S,$,T="",O=[],E=[],I=1,L=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,O=[]),t(6,E=[]),F(),U(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var qt;let Ce="";const ut=(qt=s==null?void 0:s.fields)==null?void 0:qt.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ut){const ot=V.getExpandPresentableRelField(Le,m,2);ot&&(Ce!=""&&(Ce+=","),Ce+=ot)}return Ce}async function F(){const Ce=V.toArray(g);if(!l||!Ce.length)return;t(24,P=!0);let ut=[];const qt=Ce.slice(),Le=[];for(;qt.length>0;){const ot=[];for(const on of qt.splice(0,Xo))ot.push(`id="${on}"`);Le.push(me.collection(l).getFullList({batch:Xo,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ut=ut.concat(...ot)}),t(6,E=[]);for(const ot of Ce){const on=V.findByKey(ut,"id",ot);on&&E.push(on)}T.trim()||t(8,O=V.filterDuplicatesByKey(E.concat(O))),t(24,P=!1)}catch(ot){ot.isAbort||(me.error(ot),t(24,P=!1))}}async function U(Ce=!1){if(l){t(3,A=!0),Ce&&(T.trim()?t(8,O=[]):t(8,O=V.toArray(E).slice()));try{const ut=Ce?1:I+1,qt=V.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await me.collection(l).getList(ut,Xo,{filter:V.normalizeSearchFilter(T,qt),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:_+"loadList"});t(8,O=V.filterDuplicatesByKey(O.concat(ot.items))),I=ot.page,t(23,L=ot.items.length),t(3,A=!1)}catch(ut){ut.isAbort||(me.error(ut),t(3,A=!1))}}}function J(Ce){i==1?t(6,E=[Ce]):u&&(V.pushOrReplaceByKey(E,Ce),t(6,E))}function K(Ce){V.removeByKey(E,"id",Ce.id),t(6,E)}function x(Ce){f(Ce)?K(Ce):J(Ce)}function X(){var Ce;i!=1?t(20,g=E.map(ut=>ut.id)):t(20,g=((Ce=E==null?void 0:E[0])==null?void 0:Ce.id)||""),h("save",E),R()}function oe(Ce){Ne.call(this,n,Ce)}const Se=()=>R(),ge=()=>X(),$e=Ce=>t(2,T=Ce.detail),Ye=()=>$==null?void 0:$.show(),nt=Ce=>$==null?void 0:$.show(Ce.id),xe=Ce=>x(Ce),We=(Ce,ut)=>{(ut.code==="Enter"||ut.code==="Space")&&(ut.preventDefault(),ut.stopPropagation(),x(Ce))},rt=()=>t(2,T=""),Ze=()=>{a&&!A&&U()},at=Ce=>K(Ce);function Ht(Ce){E=Ce,t(6,E)}function Ve(Ce){ie[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function Me(Ce){Ne.call(this,n,Ce)}function st(Ce){Ne.call(this,n,Ce)}function De(Ce){ie[Ce?"unshift":"push"](()=>{$=Ce,t(7,$)})}const Be=Ce=>{V.removeByKey(O,"id",Ce.detail.record.id),O.unshift(Ce.detail.record),t(8,O),J(Ce.detail.record)},ve=Ce=>{V.removeByKey(O,"id",Ce.detail.id),t(8,O),K(Ce.detail)};return n.$$set=Ce=>{e=ze(ze({},e),Ut(Ce)),t(19,d=lt(e,c)),"value"in Ce&&t(20,g=Ce.value),"field"in Ce&&t(21,k=Ce.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=k==null?void 0:k.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ce=>Ce.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&U(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=A||P),n.$$.dirty[0]&8388608&&t(12,a=L==Xo),n.$$.dirty[0]&80&&t(10,u=i<=0||i>E.length),n.$$.dirty[0]&64&&t(9,f=function(Ce){return V.findByKey(E,"id",Ce.id)})},[R,S,T,A,i,s,E,$,O,f,u,o,a,r,U,J,K,x,X,d,g,k,N,L,P,l,m,oe,Se,ge,$e,Ye,nt,xe,We,rt,Ze,at,Ht,Ve,Me,st,De,Be,ve]}class xA extends we{constructor(e){super(),ye(this,e,QA,XA,_e,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function yg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function wg(n,e,t){const i=n.slice();return i[27]=e[t],i}function Sg(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){y(s,e,o),i||(l=Ee(t=He.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Nt(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function eP(n){let e,t=n[6].length&&Sg(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Sg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Tg(n){let e,t=n[5]&&$g(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),y(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=$g(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function $g(n){let e,t=de(V.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function tP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[25]),Q(e,"dragover",n[26])},m(d,m){y(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),y(d,r,m),a=!0,u||(f=[Ee(He.call(null,o,"Remove")),W(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&Q(e,"dragging",n[25]),(!a||m&67108864)&&Q(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),H(i),u=!1,Ie(f)}}}function Og(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[tP,({dragging:a,dragover:u})=>({25:a,26:u}),({dragging:a,dragover:u})=>(a?33554432:0)|(u?67108864:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new go({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function nP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ni({props:{uniqueId:n[21],field:n[2],$$slots:{default:[eP]},$$scope:{ctx:n}}});let m=de(n[4]);const h=g=>g[22].id;for(let g=0;g Open picker',p(l,"class","relations-list svelte-1ynw0pc"),p(u,"type","button"),p(u,"class","btn btn-transparent btn-sm btn-block"),p(a,"class","list-item list-item-btn"),p(i,"class","list")},m(g,k){q(e,g,k),y(g,t,k),y(g,i,k),w(i,l);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new xA({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),y(r,t,a),q(i,r,a),l=!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&1075839223&&(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){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Eg=100;function lP(n,e,t){let i,l;Qe(n,En,L=>t(18,l=L));let{field:s}=e,{value:o}=e,{picker:r}=e,a,u=[],f=!1,c,d=[];function m(){if(f)return!1;const L=V.toArray(o);return t(4,u=u.filter(A=>L.includes(A.id))),L.length!=u.length}async function h(){var z,F;const L=V.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!L.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(U=>U.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(U=>!U.hidden&&U.presentable&&U.type=="relation");for(const U of P){const J=V.getExpandPresentableRelField(U,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=L.slice(),R=[];for(;N.length>0;){const U=[];for(const J of N.splice(0,Eg))U.push(`id="${J}"`);R.push(me.collection(s.collectionId).getFullList(Eg,{filter:U.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let U=[];await Promise.all(R).then(J=>{U=U.concat(...J)});for(const J of L){const K=V.findByKey(U,"id",J);K?u.push(K):d.push(J)}t(4,u),g()}catch(U){me.error(U)}t(5,f=!1)}function _(L){V.removeByKey(u,"id",L.id),t(4,u),g()}function g(){var L;i?t(0,o=u.map(A=>A.id)):t(0,o=((L=u[0])==null?void 0:L.id)||"")}ro(()=>{clearTimeout(c)});const k=L=>_(L);function S(L){u=L,t(4,u)}const $=()=>{g()},T=()=>r==null?void 0:r.show();function O(L){ie[L?"unshift":"push"](()=>{a=L,t(3,a)})}function E(L){ie[L?"unshift":"push"](()=>{r=L,t(1,r)})}const I=L=>{var A;t(4,u=L.detail||[]),t(0,o=i?u.map(P=>P.id):((A=u[0])==null?void 0:A.id)||"")};return n.$$set=L=>{"field"in L&&t(2,s=L.field),"value"in L&&t(0,o=L.value),"picker"in L&&t(1,r=L.picker)},n.$$.update=()=>{n.$$.dirty&4&&t(7,i=s.maxSelect>1),n.$$.dirty&9&&typeof o<"u"&&(a==null||a.changed()),n.$$.dirty&1041&&m()&&(t(5,f=!0),clearTimeout(c),t(10,c=setTimeout(h,0)))},[o,r,s,a,u,f,d,i,_,g,c,k,S,$,T,O,E,I]}class sP extends we{constructor(e){super(),ye(this,e,lP,iP,_e,{field:2,value:0,picker:1})}}function Mg(n){let e,t,i,l;return{c(){e=b("div"),t=B("Select up to "),i=B(n[2]),l=B(" items."),p(e,"class","help-block")},m(s,o){y(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&re(i,s[2])},d(s){s&&v(e)}}}function oP(n){var c,d;let e,t,i,l,s,o,r;e=new ni({props:{uniqueId:n[5],field:n[1]}});function a(m){n[4](m)}let u={id:n[5],toggle:!n[1].required||n[3],multiple:n[3],closable:!n[3]||((c=n[0])==null?void 0:c.length)>=n[1].maxSelect,items:n[1].values,searchable:((d=n[1].values)==null?void 0:d.length)>5};n[0]!==void 0&&(u.selected=n[0]),i=new ds({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Mg(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),s=C(),f&&f.c(),o=ke()},m(m,h){q(e,m,h),y(m,t,h),q(i,m,h),y(m,s,h),f&&f.m(m,h),y(m,o,h),r=!0},p(m,h){var k,S;const _={};h&32&&(_.uniqueId=m[5]),h&2&&(_.field=m[1]),e.$set(_);const g={};h&32&&(g.id=m[5]),h&10&&(g.toggle=!m[1].required||m[3]),h&8&&(g.multiple=m[3]),h&11&&(g.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(g.items=m[1].values),h&2&&(g.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,g.selected=m[0],Te(()=>l=!1)),i.$set(g),m[3]?f?f.p(m,h):(f=Mg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(M(e.$$.fragment,m),M(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(v(t),v(s),v(o)),H(e,m),H(i,m),f&&f.d(m)}}}function rP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[oP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function aP(n,e,t){let i,l,{field:s}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,s),t(2,l)}return n.$$set=a=>{"field"in a&&t(1,s=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=s.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,l=s.maxSelect||s.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>s.values.includes(a))),o.length>l&&t(0,o=o.slice(o.length-l)))},[o,s,l,i,r]}class uP extends we{constructor(e){super(),ye(this,e,aP,rP,_e,{field:1,value:0})}}function fP(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Zt(()=>(u(),()=>clearTimeout(a)));function c(m){ie[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=ze(ze({},e),Ut(m)),t(3,l=lt(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class dP extends we{constructor(e){super(),ye(this,e,cP,fP,_e,{value:0,maxHeight:4})}}function pP(n){let e,t,i,l,s;e=new ni({props:{uniqueId:n[6],field:n[1]}});function o(a){n[5](a)}let r={id:n[6],required:n[3],placeholder:n[2]?"Leave empty to autogenerate...":""};return n[0]!==void 0&&(r.value=n[0]),i=new dP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],Te(()=>l=!1)),i.$set(c)},i(a){s||(M(e.$$.fragment,a),M(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(e,a),H(i,a)}}}function mP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[pP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hP(n,e,t){let i,l,{original:s}=e,{field:o}=e,{value:r=void 0}=e;function a(u){r=u,t(0,r)}return n.$$set=u=>{"original"in u&&t(4,s=u.original),"field"in u&&t(1,o=u.field),"value"in u&&t(0,r=u.value)},n.$$.update=()=>{n.$$.dirty&18&&t(2,i=!V.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class _P extends we{constructor(e){super(),ye(this,e,hP,mP,_e,{original:4,field:1,value:0})}}function gP(n){let e,t,i,l,s,o,r,a;return e=new ni({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),y(u,t,f),y(u,i,f),ce(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&ce(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(v(t),v(i)),H(e,u),r=!1,a()}}}function bP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function kP(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class vP extends we{constructor(e){super(),ye(this,e,kP,bP,_e,{field:1,value:0})}}function Dg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ig(n,e,t){const i=n.slice();return i[6]=e[t],i}function Lg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=B(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),Q(t,"active",e[1]===e[6].language),this.first=t},m(f,c){y(f,t,c),w(t,i),w(i,s),w(t,o),r||(a=W(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&re(s,l),c&6&&Q(t,"active",e[1]===e[6].language)},d(f){f&&v(t),r=!1,a()}}}function Ag(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new Qu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=B(a),f=B(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(s,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),Q(t,"active",e[1]===e[6].language),this.first=t},m(h,_){y(h,t,_),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,_){e=h;const g={};_&4&&(g.language=e[6].language),_&4&&(g.content=e[6].content),i.$set(g),(!m||_&4)&&a!==(a=e[6].title+"")&&re(u,a),(!m||_&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||_&6)&&Q(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&v(t),H(i)}}}function yP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=de(n[2]);const d=_=>_[6].language;for(let _=0;__[6].language;for(let _=0;_t(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,l=u.class),"js"in u&&t(3,s=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(Pg,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:s,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[l,r,i,s,o,a]}class SP extends we{constructor(e){super(),ye(this,e,wP,yP,_e,{class:0,js:3,dart:4})}}function TP(n){let e,t,i,l,s,o=V.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[CP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=B(`Generate a non-refreshable auth token for + `),s=b("strong"),r=B(o),a=B(":"),u=C(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,_){y(h,e,_),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=W(e,"submit",et(n[9])),d=!0)},p(h,_){(!c||_&2)&&o!==(o=V.displayValue(h[1])+"")&&re(r,o);const g={};_&3145761&&(g.$$scope={dirty:_,ctx:h}),f.$set(g)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&v(e),H(f),d=!1,m()}}}function $P(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new fi({props:{value:n[3].authStore.token}}),u=new SP({props:{class:"m-b-0",js:` import PocketBase from 'pocketbase'; const token = "..."; @@ -136,7 +136,7 @@ Do you really want to upload and initialize "${T.name}"?`,()=>{h(T)},()=>{d()})} final pb = PocketBase('${n[7]}'); pb.authStore.save(token, null); - `}}),{c(){e=b("div"),t=b("div"),i=b("span"),s=W(l),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),p(i,"class","txt token-holder svelte-1i56uix"),p(t,"class","content txt-bold"),p(e,"class","alert alert-success")},m(c,d){y(c,e,d),w(e,t),w(t,i),w(i,s),w(t,o),q(r,t,null),y(c,a,d),q(u,c,d),f=!0},p(c,d){(!f||d&8)&&l!==(l=c[3].authStore.token+"")&&re(s,l);const m={};d&8&&(m.value=c[3].authStore.token),r.$set(m);const h={};d&128&&(h.js=` + `}}),{c(){e=b("div"),t=b("div"),i=b("span"),s=B(l),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),p(i,"class","txt token-holder svelte-1i56uix"),p(t,"class","content txt-bold"),p(e,"class","alert alert-success")},m(c,d){y(c,e,d),w(e,t),w(t,i),w(i,s),w(t,o),q(r,t,null),y(c,a,d),q(u,c,d),f=!0},p(c,d){(!f||d&8)&&l!==(l=c[3].authStore.token+"")&&re(s,l);const m={};d&8&&(m.value=c[3].authStore.token),r.$set(m);const h={};d&128&&(h.js=` import PocketBase from 'pocketbase'; const token = "..."; @@ -152,56 +152,69 @@ Do you really want to upload and initialize "${T.name}"?`,()=>{h(T)},()=>{d()})} final pb = PocketBase('${c[7]}'); pb.authStore.save(token, null); - `),u.$set(h)},i(c){f||(E(r.$$.fragment,c),E(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(v(e),v(a)),H(r),H(u,c)}}}function TP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=W("Token duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","number"),p(s,"id",o=n[20]),p(s,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(s,"min","0"),p(s,"step","1"),s.value=a=n[5]||""},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),u||(f=B(s,"input",n[14]),u=!0)},p(c,d){var m,h;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(s,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((h=(m=c[0])==null?void 0:m.authToken)==null?void 0:h.duration)||0)+"s)")&&p(s,"placeholder",r),d&32&&a!==(a=c[5]||"")&&s.value!==a&&(s.value=a)},d(c){c&&(v(e),v(l),v(s)),u=!1,f()}}}function $P(n){let e,t,i,l,s,o;const r=[SP,wP],a=[];function u(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?0:1}return i=u(n),l=a[i]=r[i](n),{c(){e=b("div"),t=C(),l.c(),s=ke(),p(e,"class","clearfix")},m(f,c){y(f,e,c),y(f,t,c),a[i].m(f,c),y(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(ae(),D(a[d],1,1,()=>{a[d]=null}),ue(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),E(l,1),l.m(s.parentNode,s))},i(f){o||(E(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(v(e),v(t),v(s)),a[i].d(f)}}}function CP(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function OP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],Q(e,"btn-loading",n[6])},m(s,o){y(s,e,o),w(e,t),i||(l=B(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&Q(e,"btn-loading",s[6])},d(s){s&&v(e),i=!1,l()}}}function EP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate a new one",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded"),e.disabled=n[6]},m(s,o){y(s,e,o),w(e,t),i||(l=B(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&v(e),i=!1,l()}}}function MP(n){let e,t,i,l,s,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?EP:OP}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){y(f,e,c),w(e,t),y(f,i,c),u.m(f,c),y(f,l,c),s||(o=B(e,"click",n[2]),s=!0)},p(f,c){c&64&&(e.disabled=f[6]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(v(e),v(i),v(l)),u.d(f),s=!1,o()}}}function DP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[MP],header:[CP],default:[$P]},$$scope:{ctx:n}};return e=new nn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function IP(n,e,t){let i;const l=bt(),s="impersonate_"+V.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(_(),a==null||a.show())}function m(){a==null||a.hide(),_()}async function h(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await me.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){me.error(L)}t(6,f=!1)}}function _(){t(5,u=0),t(3,c=void 0)}const g=()=>_(),k=()=>h(),S=L=>t(5,u=L.target.value<<0),$=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Ne.call(this,n,L)}function M(L){Ne.call(this,n,L)}return n.$$set=L=>{"collection"in L&&t(0,o=L.collection),"record"in L&&t(1,r=L.record)},n.$$.update=()=>{n.$$.dirty&8&&t(7,i=V.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,_,d,g,k,S,$,T,O,M]}class LP extends we{constructor(e){super(),ye(this,e,IP,DP,_e,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function Ng(n,e,t){const i=n.slice();return i[82]=e[t],i[83]=e,i[84]=t,i}function Rg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=W(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(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,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(t,a),w(t,u),w(e,f),w(e,c),m=!0,h||(_=[B(r,"click",n[46]),Ee(He.call(null,u,"Discard draft")),B(u,"click",et(n[47]))],h=!0)},p:te,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=mu(e,mt,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,Ie(_)}}}function Fg(n){let e,t,i;return t=new uL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function AP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S=!n[6]&&Fg(n);return{c(){var $,T;e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="id",s=C(),o=b("span"),a=C(),S&&S.c(),u=C(),f=b("input"),p(t,"class",zs(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[85]),p(f,"type","text"),p(f,"id",c=n[85]),p(f,"placeholder",d=!n[7]&&!V.isEmpty(($=n[19])==null?void 0:$.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=(T=n[19])==null?void 0:T.min),f.readOnly=h=!n[6]},m($,T){y($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),y($,a,T),S&&S.m($,T),y($,u,T),y($,f,T),ce(f,n[3].id),_=!0,g||(k=B(f,"input",n[48]),g=!0)},p($,T){var O,M;(!_||T[2]&8388608&&r!==(r=$[85]))&&p(e,"for",r),$[6]?S&&(ae(),D(S,1,1,()=>{S=null}),ue()):S?(S.p($,T),T[0]&64&&E(S,1)):(S=Fg($),S.c(),E(S,1),S.m(u.parentNode,u)),(!_||T[2]&8388608&&c!==(c=$[85]))&&p(f,"id",c),(!_||T[0]&524416&&d!==(d=!$[7]&&!V.isEmpty((O=$[19])==null?void 0:O.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||T[0]&524288&&m!==(m=(M=$[19])==null?void 0:M.min))&&p(f,"minlength",m),(!_||T[0]&64&&h!==(h=!$[6]))&&(f.readOnly=h),T[0]&8&&f.value!==$[3].id&&ce(f,$[3].id)},i($){_||(E(S),_=!0)},o($){D(S),_=!1},d($){$&&(v(e),v(a),v(u),v(f)),S&&S.d($),g=!1,k()}}}function qg(n){let e,t,i,l,s;function o(u){n[49](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new OL({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Hg();return{c(){j(e.$$.fragment),i=C(),a&&a.c(),l=ke()},m(u,f){q(e,u,f),y(u,i,f),a&&a.m(u,f),y(u,l,f),s=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],Te(()=>t=!1)),e.$set(c),u[16].length?a||(a=Hg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(v(i),v(l)),H(e,u),a&&a.d(u)}}}function Hg(n){let e;return{c(){e=b("hr")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function PP(n){let e,t,i;function l(o){n[63](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new HA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function NP(n){let e,t,i;function l(o){n[62](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new iP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function RP(n){let e,t,i,l,s;function o(f){n[59](f,n[82])}function r(f){n[60](f,n[82])}function a(f){n[61](f,n[82])}let u={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(u.value=n[3][n[82].name]),n[4][n[82].name]!==void 0&&(u.uploadedFiles=n[4][n[82].name]),n[5][n[82].name]!==void 0&&(u.deletedFileNames=n[5][n[82].name]),e=new wA({props:u}),ie.push(()=>be(e,"value",o)),ie.push(()=>be(e,"uploadedFiles",r)),ie.push(()=>be(e,"deletedFileNames",a)),{c(){j(e.$$.fragment)},m(f,c){q(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[82]),c[0]&4&&(d.original=n[2]),c[0]&8&&(d.record=n[3]),!t&&c[0]&65544&&(t=!0,d.value=n[3][n[82].name],Te(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[82].name],Te(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[82].name],Te(()=>l=!1)),e.$set(d)},i(f){s||(E(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){H(e,f)}}}function FP(n){let e,t,i;function l(o){n[58](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new IA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qP(n){let e,t,i;function l(o){n[57](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new rP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function HP(n){let e,t,i;function l(o){n[56](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new HL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jP(n){let e,t,i;function l(o){n[55](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new sA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zP(n){let e,t,i;function l(o){n[54](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new bP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UP(n){let e,t,i;function l(o){n[53](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new uA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VP(n){let e,t,i;function l(o){n[52](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new NL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BP(n){let e,t,i;function l(o){n[51](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new NA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WP(n){let e,t,i;function l(o){n[50](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new mP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jg(n,e){let t,i,l,s,o;const r=[WP,BP,VP,UP,zP,jP,HP,qP,FP,RP,NP,PP],a=[];function u(f,c){return f[82].type==="text"?0:f[82].type==="number"?1:f[82].type==="bool"?2:f[82].type==="email"?3:f[82].type==="url"?4:f[82].type==="editor"?5:f[82].type==="date"?6:f[82].type==="select"?7:f[82].type==="json"?8:f[82].type==="file"?9:f[82].type==="relation"?10:f[82].type==="password"?11:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),l&&l.c(),s=ke(),this.first=t},m(f,c){y(f,t,c),~i&&a[i].m(f,c),y(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(ae(),D(a[d],1,1,()=>{a[d]=null}),ue()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(E(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(v(t),v(s)),~i&&a[i].d(f)}}}function zg(n){let e,t,i;return t=new hL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[15]===lo)},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&Q(e,"active",l[15]===lo)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function YP(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&Rg(n);l=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[AP,({uniqueId:S})=>({85:S}),({uniqueId:S})=>[0,0,S?8388608:0]]},$$scope:{ctx:n}}});let h=n[9]&&qg(n),_=pe(n[16]);const g=S=>S[82].name;for(let S=0;S<_.length;S+=1){let $=Ng(n,_,S),T=g($);a.set(T,r[S]=jg(T,$))}let k=n[9]&&!n[17]&&!n[6]&&zg(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=C(),j(l.$$.fragment),s=C(),h&&h.c(),o=C();for(let S=0;S{m=null}),ue());const T={};$[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),$[0]&524488|$[2]&25165824&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),S[9]?h?(h.p(S,$),$[0]&512&&E(h,1)):(h=qg(S),h.c(),E(h,1),h.m(t,o)):h&&(ae(),D(h,1,1,()=>{h=null}),ue()),$[0]&65596&&(_=pe(S[16]),ae(),r=yt(r,$,g,1,S,_,a,t,zt,jg,null,Ng),ue()),(!f||$[0]&128)&&Q(t,"no-pointer-events",S[7]),(!f||$[0]&32768)&&Q(t,"active",S[15]===Ml),S[9]&&!S[17]&&!S[6]?k?(k.p(S,$),$[0]&131648&&E(k,1)):(k=zg(S),k.c(),E(k,1),k.m(e,null)):k&&(ae(),D(k,1,1,()=>{k=null}),ue())},i(S){if(!f){E(m),E(l.$$.fragment,S),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(k),f=!0}},o(S){D(m),D(l.$$.fragment,S),D(h);for(let $=0;${d=null}),ue()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Ug(h),d.c(),E(d,1),d.m(f.parentNode,f))},i(h){c||(E(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(v(e),v(u),v(f)),d&&d.d(h)}}}function JP(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},p:te,i:te,o:te,d(l){l&&(v(e),v(t),v(i))}}}function Ug(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[ZP]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&16777216&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),H(o)}}}function Vg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[39]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function Bg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[40]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function ZP(n){let e,t,i,l,s,o,r,a,u,f=n[9]&&!n[2].verified&&n[2].email&&Vg(n),c=n[9]&&n[2].email&&Bg(n);return{c(){f&&f.c(),e=C(),c&&c.c(),t=C(),i=b("button"),i.innerHTML=' Impersonate',l=C(),s=b("button"),s.innerHTML=' Duplicate',o=C(),r=b("button"),r.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item txt-danger closable"),p(r,"role","menuitem")},m(d,m){f&&f.m(d,m),y(d,e,m),c&&c.m(d,m),y(d,t,m),y(d,i,m),y(d,l,m),y(d,s,m),y(d,o,m),y(d,r,m),a||(u=[B(i,"click",n[41]),B(s,"click",n[42]),B(r,"click",On(et(n[43])))],a=!0)},p(d,m){d[9]&&!d[2].verified&&d[2].email?f?f.p(d,m):(f=Vg(d),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null),d[9]&&d[2].email?c?c.p(d,m):(c=Bg(d),c.c(),c.m(t.parentNode,t)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),f&&f.d(d),c&&c.d(d),a=!1,Ie(u)}}}function Wg(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=C(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[15]===Ml),p(l,"type","button"),p(l,"class","tab-item"),Q(l,"active",n[15]===lo),p(e,"class","tabs-header stretched")},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=[B(t,"click",n[44]),B(l,"click",n[45])],s=!0)},p(r,a){a[0]&32768&&Q(t,"active",r[15]===Ml),a[0]&32768&&Q(l,"active",r[15]===lo)},d(r){r&&v(e),s=!1,Ie(o)}}}function GP(n){let e,t,i,l,s;const o=[JP,KP],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[9]&&!n[17]&&!n[6]&&Wg(n);return{c(){t.c(),i=C(),u&&u.c(),l=ke()},m(f,c){r[e].m(f,c),y(f,i,c),u&&u.m(f,c),y(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(ae(),D(r[d],1,1,()=>{r[d]=null}),ue(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),E(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=Wg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(E(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(v(i),v(l)),r[e].d(f),u&&u.d(f)}}}function Yg(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[XP]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[18]||n[13]},m(r,a){y(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&16777216&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&270336&&s!==(s=!r[18]||r[13]))&&(e.disabled=s)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&v(e),H(l)}}}function XP(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[38]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function QP(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,_=!n[6]&&Yg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=C(),s=b("div"),o=b("button"),r=b("span"),u=W(a),c=C(),_&&_.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[13]||n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[21]),p(o,"title","Save and close"),p(o,"class","btn"),o.disabled=f=!n[18]||n[13],Q(o,"btn-expanded",n[6]),Q(o,"btn-expanded-sm",!n[6]),Q(o,"btn-loading",n[13]||n[7]),p(s,"class","btns-group no-gap")},m(g,k){y(g,e,k),w(e,t),y(g,l,k),y(g,s,k),w(s,o),w(o,r),w(r,u),w(s,c),_&&_.m(s,null),d=!0,m||(h=B(e,"click",n[37]),m=!0)},p(g,k){(!d||k[0]&8320&&i!==(i=g[13]||g[7]))&&(e.disabled=i),(!d||k[0]&64)&&a!==(a=g[6]?"Create":"Save changes")&&re(u,a),(!d||k[0]&270336&&f!==(f=!g[18]||g[13]))&&(o.disabled=f),(!d||k[0]&64)&&Q(o,"btn-expanded",g[6]),(!d||k[0]&64)&&Q(o,"btn-expanded-sm",!g[6]),(!d||k[0]&8320)&&Q(o,"btn-loading",g[13]||g[7]),g[6]?_&&(ae(),D(_,1,1,()=>{_=null}),ue()):_?(_.p(g,k),k[0]&64&&E(_,1)):(_=Yg(g),_.c(),E(_,1),_.m(s,null))},i(g){d||(E(_),d=!0)},o(g){D(_),d=!1},d(g){g&&(v(e),v(l),v(s)),_&&_.d(),m=!1,h()}}}function xP(n){let e,t,i,l,s={class:` + `),u.$set(h)},i(c){f||(M(r.$$.fragment,c),M(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(v(e),v(a)),H(r),H(u,c)}}}function CP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=B("Token duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","number"),p(s,"id",o=n[20]),p(s,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(s,"min","0"),p(s,"step","1"),s.value=a=n[5]||""},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),u||(f=W(s,"input",n[14]),u=!0)},p(c,d){var m,h;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(s,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((h=(m=c[0])==null?void 0:m.authToken)==null?void 0:h.duration)||0)+"s)")&&p(s,"placeholder",r),d&32&&a!==(a=c[5]||"")&&s.value!==a&&(s.value=a)},d(c){c&&(v(e),v(l),v(s)),u=!1,f()}}}function OP(n){let e,t,i,l,s,o;const r=[$P,TP],a=[];function u(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?0:1}return i=u(n),l=a[i]=r[i](n),{c(){e=b("div"),t=C(),l.c(),s=ke(),p(e,"class","clearfix")},m(f,c){y(f,e,c),y(f,t,c),a[i].m(f,c),y(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(ae(),D(a[d],1,1,()=>{a[d]=null}),ue(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(v(e),v(t),v(s)),a[i].d(f)}}}function EP(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function MP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],Q(e,"btn-loading",n[6])},m(s,o){y(s,e,o),w(e,t),i||(l=W(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&Q(e,"btn-loading",s[6])},d(s){s&&v(e),i=!1,l()}}}function DP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate a new one",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded"),e.disabled=n[6]},m(s,o){y(s,e,o),w(e,t),i||(l=W(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&v(e),i=!1,l()}}}function IP(n){let e,t,i,l,s,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?DP:MP}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){y(f,e,c),w(e,t),y(f,i,c),u.m(f,c),y(f,l,c),s||(o=W(e,"click",n[2]),s=!0)},p(f,c){c&64&&(e.disabled=f[6]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(v(e),v(i),v(l)),u.d(f),s=!1,o()}}}function LP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[IP],header:[EP],default:[OP]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function AP(n,e,t){let i;const l=bt(),s="impersonate_"+V.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(_(),a==null||a.show())}function m(){a==null||a.hide(),_()}async function h(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await me.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(I){me.error(I)}t(6,f=!1)}}function _(){t(5,u=0),t(3,c=void 0)}const g=()=>_(),k=()=>h(),S=I=>t(5,u=I.target.value<<0),$=()=>!f;function T(I){ie[I?"unshift":"push"](()=>{a=I,t(4,a)})}function O(I){Ne.call(this,n,I)}function E(I){Ne.call(this,n,I)}return n.$$set=I=>{"collection"in I&&t(0,o=I.collection),"record"in I&&t(1,r=I.record)},n.$$.update=()=>{n.$$.dirty&8&&t(7,i=V.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,_,d,g,k,S,$,T,O,E]}class PP extends we{constructor(e){super(),ye(this,e,AP,LP,_e,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function Ng(n,e,t){const i=n.slice();return i[82]=e[t],i[83]=e,i[84]=t,i}function Rg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=B(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(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,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(t,a),w(t,u),w(e,f),w(e,c),m=!0,h||(_=[W(r,"click",n[46]),Ee(He.call(null,u,"Discard draft")),W(u,"click",et(n[47]))],h=!0)},p:te,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=mu(e,mt,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,Ie(_)}}}function Fg(n){let e,t,i;return t=new cL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function NP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S=!n[6]&&Fg(n);return{c(){var $,T;e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="id",s=C(),o=b("span"),a=C(),S&&S.c(),u=C(),f=b("input"),p(t,"class",zs(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[85]),p(f,"type","text"),p(f,"id",c=n[85]),p(f,"placeholder",d=!n[7]&&!V.isEmpty(($=n[19])==null?void 0:$.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=(T=n[19])==null?void 0:T.min),f.readOnly=h=!n[6]},m($,T){y($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),y($,a,T),S&&S.m($,T),y($,u,T),y($,f,T),ce(f,n[3].id),_=!0,g||(k=W(f,"input",n[48]),g=!0)},p($,T){var O,E;(!_||T[2]&8388608&&r!==(r=$[85]))&&p(e,"for",r),$[6]?S&&(ae(),D(S,1,1,()=>{S=null}),ue()):S?(S.p($,T),T[0]&64&&M(S,1)):(S=Fg($),S.c(),M(S,1),S.m(u.parentNode,u)),(!_||T[2]&8388608&&c!==(c=$[85]))&&p(f,"id",c),(!_||T[0]&524416&&d!==(d=!$[7]&&!V.isEmpty((O=$[19])==null?void 0:O.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||T[0]&524288&&m!==(m=(E=$[19])==null?void 0:E.min))&&p(f,"minlength",m),(!_||T[0]&64&&h!==(h=!$[6]))&&(f.readOnly=h),T[0]&8&&f.value!==$[3].id&&ce(f,$[3].id)},i($){_||(M(S),_=!0)},o($){D(S),_=!1},d($){$&&(v(e),v(a),v(u),v(f)),S&&S.d($),g=!1,k()}}}function qg(n){let e,t,i,l,s;function o(u){n[49](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new ML({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Hg();return{c(){j(e.$$.fragment),i=C(),a&&a.c(),l=ke()},m(u,f){q(e,u,f),y(u,i,f),a&&a.m(u,f),y(u,l,f),s=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],Te(()=>t=!1)),e.$set(c),u[16].length?a||(a=Hg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(M(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(v(i),v(l)),H(e,u),a&&a.d(u)}}}function Hg(n){let e;return{c(){e=b("hr")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function RP(n){let e,t,i;function l(o){n[63](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new zA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function FP(n){let e,t,i;function l(o){n[62](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new sP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qP(n){let e,t,i,l,s;function o(f){n[59](f,n[82])}function r(f){n[60](f,n[82])}function a(f){n[61](f,n[82])}let u={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(u.value=n[3][n[82].name]),n[4][n[82].name]!==void 0&&(u.uploadedFiles=n[4][n[82].name]),n[5][n[82].name]!==void 0&&(u.deletedFileNames=n[5][n[82].name]),e=new TA({props:u}),ie.push(()=>be(e,"value",o)),ie.push(()=>be(e,"uploadedFiles",r)),ie.push(()=>be(e,"deletedFileNames",a)),{c(){j(e.$$.fragment)},m(f,c){q(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[82]),c[0]&4&&(d.original=n[2]),c[0]&8&&(d.record=n[3]),!t&&c[0]&65544&&(t=!0,d.value=n[3][n[82].name],Te(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[82].name],Te(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[82].name],Te(()=>l=!1)),e.$set(d)},i(f){s||(M(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){H(e,f)}}}function HP(n){let e,t,i;function l(o){n[58](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new AA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jP(n){let e,t,i;function l(o){n[57](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new uP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zP(n){let e,t,i;function l(o){n[56](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new zL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UP(n){let e,t,i;function l(o){n[55](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new rA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VP(n){let e,t,i;function l(o){n[54](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new vP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BP(n){let e,t,i;function l(o){n[53](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new cA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WP(n){let e,t,i;function l(o){n[52](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new FL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YP(n){let e,t,i;function l(o){n[51](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new FA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KP(n){let e,t,i;function l(o){n[50](o,n[82])}let s={field:n[82],original:n[2],record:n[3]};return n[3][n[82].name]!==void 0&&(s.value=n[3][n[82].name]),e=new _P({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[82]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[82].name],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jg(n,e){let t,i,l,s,o;const r=[KP,YP,WP,BP,VP,UP,zP,jP,HP,qP,FP,RP],a=[];function u(f,c){return f[82].type==="text"?0:f[82].type==="number"?1:f[82].type==="bool"?2:f[82].type==="email"?3:f[82].type==="url"?4:f[82].type==="editor"?5:f[82].type==="date"?6:f[82].type==="select"?7:f[82].type==="json"?8:f[82].type==="file"?9:f[82].type==="relation"?10:f[82].type==="password"?11:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),l&&l.c(),s=ke(),this.first=t},m(f,c){y(f,t,c),~i&&a[i].m(f,c),y(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(ae(),D(a[d],1,1,()=>{a[d]=null}),ue()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),M(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(v(t),v(s)),~i&&a[i].d(f)}}}function zg(n){let e,t,i;return t=new gL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[15]===lo)},m(l,s){y(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&Q(e,"active",l[15]===lo)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function JP(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&Rg(n);l=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[NP,({uniqueId:S})=>({85:S}),({uniqueId:S})=>[0,0,S?8388608:0]]},$$scope:{ctx:n}}});let h=n[9]&&qg(n),_=de(n[16]);const g=S=>S[82].name;for(let S=0;S<_.length;S+=1){let $=Ng(n,_,S),T=g($);a.set(T,r[S]=jg(T,$))}let k=n[9]&&!n[17]&&!n[6]&&zg(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=C(),j(l.$$.fragment),s=C(),h&&h.c(),o=C();for(let S=0;S{m=null}),ue());const T={};$[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),$[0]&524488|$[2]&25165824&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),S[9]?h?(h.p(S,$),$[0]&512&&M(h,1)):(h=qg(S),h.c(),M(h,1),h.m(t,o)):h&&(ae(),D(h,1,1,()=>{h=null}),ue()),$[0]&65596&&(_=de(S[16]),ae(),r=yt(r,$,g,1,S,_,a,t,zt,jg,null,Ng),ue()),(!f||$[0]&128)&&Q(t,"no-pointer-events",S[7]),(!f||$[0]&32768)&&Q(t,"active",S[15]===Ml),S[9]&&!S[17]&&!S[6]?k?(k.p(S,$),$[0]&131648&&M(k,1)):(k=zg(S),k.c(),M(k,1),k.m(e,null)):k&&(ae(),D(k,1,1,()=>{k=null}),ue())},i(S){if(!f){M(m),M(l.$$.fragment,S),M(h);for(let $=0;$<_.length;$+=1)M(r[$]);M(k),f=!0}},o(S){D(m),D(l.$$.fragment,S),D(h);for(let $=0;${d=null}),ue()):d?(d.p(h,_),_[0]&64&&M(d,1)):(d=Ug(h),d.c(),M(d,1),d.m(f.parentNode,f))},i(h){c||(M(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(v(e),v(u),v(f)),d&&d.d(h)}}}function GP(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},p:te,i:te,o:te,d(l){l&&(v(e),v(t),v(i))}}}function Ug(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[XP]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&16777216&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),H(o)}}}function Vg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[39]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function Bg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[40]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function XP(n){let e,t,i,l,s,o,r,a,u,f=n[9]&&!n[2].verified&&n[2].email&&Vg(n),c=n[9]&&n[2].email&&Bg(n);return{c(){f&&f.c(),e=C(),c&&c.c(),t=C(),i=b("button"),i.innerHTML=' Impersonate',l=C(),s=b("button"),s.innerHTML=' Duplicate',o=C(),r=b("button"),r.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item txt-danger closable"),p(r,"role","menuitem")},m(d,m){f&&f.m(d,m),y(d,e,m),c&&c.m(d,m),y(d,t,m),y(d,i,m),y(d,l,m),y(d,s,m),y(d,o,m),y(d,r,m),a||(u=[W(i,"click",n[41]),W(s,"click",n[42]),W(r,"click",On(et(n[43])))],a=!0)},p(d,m){d[9]&&!d[2].verified&&d[2].email?f?f.p(d,m):(f=Vg(d),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null),d[9]&&d[2].email?c?c.p(d,m):(c=Bg(d),c.c(),c.m(t.parentNode,t)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),f&&f.d(d),c&&c.d(d),a=!1,Ie(u)}}}function Wg(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=C(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[15]===Ml),p(l,"type","button"),p(l,"class","tab-item"),Q(l,"active",n[15]===lo),p(e,"class","tabs-header stretched")},m(r,a){y(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=[W(t,"click",n[44]),W(l,"click",n[45])],s=!0)},p(r,a){a[0]&32768&&Q(t,"active",r[15]===Ml),a[0]&32768&&Q(l,"active",r[15]===lo)},d(r){r&&v(e),s=!1,Ie(o)}}}function QP(n){let e,t,i,l,s;const o=[GP,ZP],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[9]&&!n[17]&&!n[6]&&Wg(n);return{c(){t.c(),i=C(),u&&u.c(),l=ke()},m(f,c){r[e].m(f,c),y(f,i,c),u&&u.m(f,c),y(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(ae(),D(r[d],1,1,()=>{r[d]=null}),ue(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),M(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=Wg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(M(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(v(i),v(l)),r[e].d(f),u&&u.d(f)}}}function Yg(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[xP]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[18]||n[13]},m(r,a){y(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&16777216&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&270336&&s!==(s=!r[18]||r[13]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&v(e),H(l)}}}function xP(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[38]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function eN(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,_=!n[6]&&Yg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=C(),s=b("div"),o=b("button"),r=b("span"),u=B(a),c=C(),_&&_.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[13]||n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[21]),p(o,"title","Save and close"),p(o,"class","btn"),o.disabled=f=!n[18]||n[13],Q(o,"btn-expanded",n[6]),Q(o,"btn-expanded-sm",!n[6]),Q(o,"btn-loading",n[13]||n[7]),p(s,"class","btns-group no-gap")},m(g,k){y(g,e,k),w(e,t),y(g,l,k),y(g,s,k),w(s,o),w(o,r),w(r,u),w(s,c),_&&_.m(s,null),d=!0,m||(h=W(e,"click",n[37]),m=!0)},p(g,k){(!d||k[0]&8320&&i!==(i=g[13]||g[7]))&&(e.disabled=i),(!d||k[0]&64)&&a!==(a=g[6]?"Create":"Save changes")&&re(u,a),(!d||k[0]&270336&&f!==(f=!g[18]||g[13]))&&(o.disabled=f),(!d||k[0]&64)&&Q(o,"btn-expanded",g[6]),(!d||k[0]&64)&&Q(o,"btn-expanded-sm",!g[6]),(!d||k[0]&8320)&&Q(o,"btn-loading",g[13]||g[7]),g[6]?_&&(ae(),D(_,1,1,()=>{_=null}),ue()):_?(_.p(g,k),k[0]&64&&M(_,1)):(_=Yg(g),_.c(),M(_,1),_.m(s,null))},i(g){d||(M(_),d=!0)},o(g){D(_),d=!1},d(g){g&&(v(e),v(l),v(s)),_&&_.d(),m=!1,h()}}}function tN(n){let e,t,i,l,s={class:` record-panel `+(n[20]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[9]&&!n[17]&&!n[6]?"colored-header":"")+` - `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[64],$$slots:{footer:[QP],header:[GP],default:[YP]},$$scope:{ctx:n}};e=new nn({props:s}),n[65](e),e.$on("hide",n[66]),e.$on("show",n[67]);let o={record:n[3],collection:n[0]};return i=new LP({props:o}),n[68](i),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),y(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&1180224&&(u.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[64],$$slots:{footer:[eN],header:[QP],default:[JP]},$$scope:{ctx:n}};e=new Gt({props:s}),n[65](e),e.$on("hide",n[66]),e.$on("show",n[67]);let o={record:n[3],collection:n[0]};return i=new PP({props:o}),n[68](i),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),y(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&1180224&&(u.class=` record-panel `+(r[20]?"overlay-panel-xl":"overlay-panel-lg")+` `+(r[9]&&!r[17]&&!r[6]?"colored-header":"")+` - `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[64]),a[0]&1031165|a[2]&16777216&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&8&&(f.record=r[3]),a[0]&1&&(f.collection=r[0]),i.$set(f)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[65](null),H(e,r),n[68](null),H(i,r)}}}const Ml="form",lo="providers";function eN(n,e,t){let i,l,s,o,r,a,u,f;const c=bt(),d="record_"+V.randomString(5);let{collection:m}=e,h,_,g={},k={},S=null,$=!1,T=!1,O={},M={},L=JSON.stringify(g),I=L,A=Ml,P=!0,N=!0,R=m,z=[];const F=["id"],U=F.concat("email","emailVisibility","verified","tokenKey","password");function J(le){return Se(le),t(14,T=!0),t(15,A=Ml),h==null?void 0:h.show()}function K(){return h==null?void 0:h.hide()}function x(){t(14,T=!1),K()}function X(){t(34,R=m),h!=null&&h.isActive()&&(nt(JSON.stringify(k)),x())}async function oe(le){if(le&&typeof le=="string"){try{return await me.collection(m.id).getOne(le)}catch(Oe){Oe.isAbort||(x(),console.warn("resolveModel:",Oe),Ci(`Unable to load record with id "${le}"`))}return null}return le}async function Se(le){t(7,N=!0),Yt({}),t(4,O={}),t(5,M={}),t(2,g=typeof le=="string"?{id:le,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:le||{}),t(3,k=structuredClone(g)),t(2,g=await oe(le)||{}),t(3,k=structuredClone(g)),await un(),t(12,S=Ye()),!S||We(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(32,L=JSON.stringify(k)),t(7,N=!1)}async function ge(le){var Fe,Je;Yt({}),t(2,g=le||{}),t(4,O={}),t(5,M={});const Oe=((Je=(Fe=m==null?void 0:m.fields)==null?void 0:Fe.filter(Pe=>Pe.type!="file"))==null?void 0:Je.map(Pe=>Pe.name))||[];for(let Pe in le)Oe.includes(Pe)||t(3,k[Pe]=le[Pe],k);await un(),t(32,L=JSON.stringify(k)),rt()}function $e(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((g==null?void 0:g.id)||"")}function Ye(le){try{const Oe=window.localStorage.getItem($e());if(Oe)return JSON.parse(Oe)}catch{}return le}function nt(le){try{window.localStorage.setItem($e(),le)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem($e())}}function xe(){S&&(t(3,k=S),t(12,S=null))}function We(le,Oe){var ft;const Fe=structuredClone(le||{}),Je=structuredClone(Oe||{}),Pe=(ft=m==null?void 0:m.fields)==null?void 0:ft.filter(Gt=>Gt.type==="file");for(let Gt of Pe)delete Fe[Gt.name],delete Je[Gt.name];const Ge=["expand","password","passwordConfirm"];for(let Gt of Ge)delete Fe[Gt],delete Je[Gt];return JSON.stringify(Fe)==JSON.stringify(Je)}function rt(){t(12,S=null),window.localStorage.removeItem($e())}async function Ze(le=!0){var Oe;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const Fe=Ht();let Je;if(P?Je=await me.collection(m.id).create(Fe):Je=await me.collection(m.id).update(k.id,Fe),en(P?"Successfully created record.":"Successfully updated record."),rt(),l&&(k==null?void 0:k.id)==((Oe=me.authStore.record)==null?void 0:Oe.id)&&Fe.get("password"))return me.logout();le?x():ge(Je),c("save",{isNew:P,record:Je})}catch(Fe){me.error(Fe)}t(13,$=!1)}}function at(){g!=null&&g.id&&pn("Do you really want to delete the selected record?",()=>me.collection(g.collectionId).delete(g.id).then(()=>{x(),en("Successfully deleted record."),c("delete",g)}).catch(le=>{me.error(le)}))}function Ht(){const le=structuredClone(k||{}),Oe=new FormData,Fe={},Je={};for(const Pe of(m==null?void 0:m.fields)||[])Pe.type=="autodate"||i&&Pe.type=="password"||(Fe[Pe.name]=!0,Pe.type=="json"&&(Je[Pe.name]=!0));i&&le.password&&(Fe.password=!0),i&&le.passwordConfirm&&(Fe.passwordConfirm=!0);for(const Pe in le)if(Fe[Pe]){if(typeof le[Pe]>"u"&&(le[Pe]=null),Je[Pe]&&le[Pe]!=="")try{JSON.parse(le[Pe])}catch(Ge){const ft={};throw ft[Pe]={code:"invalid_json",message:Ge.toString()},new Fn({status:400,response:{data:ft}})}V.addValueToFormData(Oe,Pe,le[Pe])}for(const Pe in O){const Ge=V.toArray(O[Pe]);for(const ft of Ge)Oe.append(Pe+"+",ft)}for(const Pe in M){const Ge=V.toArray(M[Pe]);for(const ft of Ge)Oe.append(Pe+"-",ft)}return Oe}function Ve(){!(m!=null&&m.id)||!(g!=null&&g.email)||pn(`Do you really want to sent verification email to ${g.email}?`,()=>me.collection(m.id).requestVerification(g.email).then(()=>{en(`Successfully sent verification email to ${g.email}.`)}).catch(le=>{me.error(le)}))}function Me(){!(m!=null&&m.id)||!(g!=null&&g.email)||pn(`Do you really want to sent password reset email to ${g.email}?`,()=>me.collection(m.id).requestPasswordReset(g.email).then(()=>{en(`Successfully sent password reset email to ${g.email}.`)}).catch(le=>{me.error(le)}))}function st(){a?pn("You have unsaved changes. Do you really want to discard them?",()=>{De()}):De()}async function De(){let le=g?structuredClone(g):null;if(le){const Oe=["file","autodate"],Fe=(m==null?void 0:m.fields)||[];for(const Je of Fe)Oe.includes(Je.type)&&delete le[Je.name];le.id=""}rt(),J(le),await un(),t(32,L="")}function Be(le){(le.ctrlKey||le.metaKey)&&le.code=="KeyS"&&(le.preventDefault(),le.stopPropagation(),Ze(!1))}const ve=()=>K(),Ce=()=>Ze(!1),ut=()=>Ve(),qt=()=>Me(),Le=()=>_==null?void 0:_.show(),ot=()=>st(),on=()=>at(),Mn=()=>t(15,A=Ml),Re=()=>t(15,A=lo),Ft=()=>xe(),Vt=()=>rt();function wn(){k.id=this.value,t(3,k)}function cn(le){k=le,t(3,k)}function Oi(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function ii(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function kt(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Sn(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function ln(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Dt(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Ei(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function ul(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function zi(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Ui(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function fl(le,Oe){n.$$.not_equal(O[Oe.name],le)&&(O[Oe.name]=le,t(4,O))}function Dn(le,Oe){n.$$.not_equal(M[Oe.name],le)&&(M[Oe.name]=le,t(5,M))}function Rl(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function cl(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}const Z=()=>a&&T?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{x()}),!1):(Yt({}),rt(),!0);function ee(le){ie[le?"unshift":"push"](()=>{h=le,t(10,h)})}function se(le){Ne.call(this,n,le)}function he(le){Ne.call(this,n,le)}function qe(le){ie[le?"unshift":"push"](()=>{_=le,t(11,_)})}return n.$$set=le=>{"collection"in le&&t(0,m=le.collection)},n.$$.update=()=>{var le,Oe,Fe;n.$$.dirty[0]&1&&t(9,i=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&1&&t(17,l=(m==null?void 0:m.name)==="_superusers"),n.$$.dirty[0]&1&&t(20,s=!!((le=m==null?void 0:m.fields)!=null&&le.find(Je=>Je.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Oe=m==null?void 0:m.fields)==null?void 0:Oe.find(Je=>Je.name==="id")),n.$$.dirty[0]&48&&t(36,r=V.hasNonEmptyProps(O)||V.hasNonEmptyProps(M)),n.$$.dirty[0]&8&&t(33,I=JSON.stringify(k)),n.$$.dirty[1]&38&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!g||!g.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&4&&(N||nt(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&m&&(R==null?void 0:R.id)!=(m==null?void 0:m.id)&&X(),n.$$.dirty[0]&512&&t(35,f=i?U:F),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&t(16,z=((Fe=m==null?void 0:m.fields)==null?void 0:Fe.filter(Je=>!f.includes(Je.name)&&Je.type!="autodate"))||[])},[m,K,g,k,O,M,P,N,a,i,h,_,S,$,T,A,z,l,u,o,s,d,x,xe,rt,Ze,at,Ve,Me,st,Be,J,L,I,R,f,r,ve,Ce,ut,qt,Le,ot,on,Mn,Re,Ft,Vt,wn,cn,Oi,ii,kt,Sn,ln,Dt,Ei,ul,zi,Ui,fl,Dn,Rl,cl,Z,ee,se,he,qe]}class rf extends we{constructor(e){super(),ye(this,e,eN,xP,_e,{collection:0,show:31,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[31]}get hide(){return this.$$.ctx[1]}}function tN(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=C(),l=b("span"),o=W(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){y(a,e,u),w(e,t),w(e,i),w(e,l),w(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&re(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:te,o:te,d(a){a&&v(e)}}}function nN(n,e,t){const i=bt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=V.getAllCollectionIdentifiers(l),c=await me.collection(l.id).getList(1,1,{filter:V.normalizeSearchFilter(s,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class iN extends we{constructor(e){super(),ye(this,e,nN,tN,_e,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function Kg(n,e,t){const i=n.slice();return i[58]=e[t],i}function Jg(n,e,t){const i=n.slice();return i[61]=e[t],i}function Zg(n,e,t){const i=n.slice();return i[61]=e[t],i}function Gg(n,e,t){const i=n.slice();return i[54]=e[t],i}function Xg(n){let e;function t(s,o){return s[9]?sN:lN}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){y(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function lN(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[13],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){y(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=B(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&8192&&(t.checked=a[13])},d(a){a&&v(e),o=!1,r()}}}function sN(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function oN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[61].type))},m(i,l){y(i,e,l)},p(i,l){l[0]&32768&&t!==(t=V.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&v(e)}}}function rN(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function aN(n){let e,t,i,l=n[61].name+"",s;function o(u,f){return u[61].primaryKey?rN:oN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),s=W(l),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){y(u,e,f),a.m(e,null),w(e,t),w(e,i),w(i,s)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,t))),f[0]&32768&&l!==(l=u[61].name+"")&&re(s,l)},d(u){u&&v(e),a.d()}}}function Qg(n,e){let t,i,l,s;function o(a){e[32](a)}let r={class:"col-type-"+e[61].type+" col-field-"+e[61].name,name:e[61].name,$$slots:{default:[aN]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new lr({props:r}),ie.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[61].type+" col-field-"+e[61].name),u[0]&32768&&(f.name=e[61].name),u[0]&32768|u[2]&16&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],Te(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function xg(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){y(t,e,i),n[33](e)},p:te,d(t){t&&v(e),n[33](null)}}}function e1(n){let e;function t(s,o){return s[9]?fN:uN}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function uN(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return dN;if(!a[16])return cN}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=C(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){y(a,e,u),w(e,t),w(t,i),w(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function fN(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function cN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[38]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function dN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[37]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function t1(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[58].id),i.checked=s=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){y(d,e,m),w(e,t),w(t,i),w(t,o),w(t,r),u||(f=[B(i,"change",c),B(t,"click",On(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[58].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[58].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&v(e),u=!1,Ie(f)}}}function n1(n,e){let t,i,l,s;return i=new cv({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),j(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){y(o,t,r),q(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&v(t),H(i)}}}function i1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&t1(e),d=pe(e[15]);const m=g=>g[61].id;for(let g=0;g',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(g,k){y(g,t,k),c&&c.m(t,null),w(t,i);for(let S=0;SL[61].id;for(let L=0;LL[16]?L[58]:L[58].id;for(let L=0;L<$.length;L+=1){let I=Kg(n,$,L),A=T(I);d.set(A,c[L]=i1(A,I))}let O=null;$.length||(O=e1(n));let M=n[3].length&&n[14]&&l1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),_&&_.c(),l=C();for(let L=0;L({57:s}),({uniqueId:s})=>[0,s?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(s,o){y(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(i,s)}}}function hN(n){let e,t,i=[],l=new Map,s,o,r=pe(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u{i=null}),ue())},i(l){t||(E(i),t=!0)},o(l){D(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function r1(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,_,g,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),l=b("strong"),s=W(n[6]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.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[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),Q(h,"btn-loading",n[10]),Q(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m($,T){y($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),g=!0,k||(S=[B(f,"click",n[41]),B(h,"click",n[42])],k=!0)},p($,T){(!g||T[0]&64)&&re(s,$[6]),(!g||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&re(a,r),(!g||T[0]&1024)&&Q(f,"btn-disabled",$[10]),(!g||T[0]&1024)&&Q(h,"btn-loading",$[10]),(!g||T[0]&1024)&&Q(h,"btn-disabled",$[10])},i($){g||($&&tt(()=>{g&&(_||(_=je(e,qn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o($){$&&(_||(_=je(e,qn,{duration:150,y:5},!1)),_.run(0)),g=!1},d($){$&&v(e),$&&_&&_.end(),k=!1,Ie(S)}}}function gN(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[_N],default:[pN]},$$scope:{ctx:n}};e=new Pu({props:s}),n[40](e);let o=n[6]&&r1(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=ke()},m(r,a){q(e,r,a),y(r,t,a),o&&o.m(r,a),y(r,i,a),l=!0},p(r,a){const u={};a[0]&129851|a[2]&16&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=r1(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(ae(),D(o,1,1,()=>{o=null}),ue())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(v(t),v(i)),n[40](null),H(e,r),o&&o.d(r)}}}const bN=/^([\+\-])?(\w+)$/,a1=40;function kN(n,e,t){let i,l,s,o,r,a,u,f,c,d,m;Qe(n,En,Le=>t(47,d=Le)),Qe(n,Js,Le=>t(28,m=Le));const h=bt();let{collection:_}=e,{sort:g=""}=e,{filter:k=""}=e,S,$=[],T=1,O=0,M={},L=!0,I=!1,A=0,P,N=[],R=[],z="";const F=["verified","emailVisibility"];function U(){_!=null&&_.id&&(N.length?localStorage.setItem(z,JSON.stringify(N)):localStorage.removeItem(z))}function J(){if(t(5,N=[]),!!(_!=null&&_.id))try{const Le=localStorage.getItem(z);Le&&t(5,N=JSON.parse(Le)||[])}catch{}}function K(Le){return!!$.find(ot=>ot.id==Le)}async function x(){const Le=T;for(let ot=1;ot<=Le;ot++)(ot===1||u)&&await X(ot,!1)}async function X(Le=1,ot=!0){var cn,Oi,ii;if(!(_!=null&&_.id))return;t(9,L=!0);let on=g;const Mn=on.match(bN),Re=Mn?r.find(kt=>kt.name===Mn[2]):null;if(Mn&&Re){const kt=((ii=(Oi=(cn=d==null?void 0:d.find(ln=>ln.id==Re.collectionId))==null?void 0:cn.fields)==null?void 0:Oi.filter(ln=>ln.presentable))==null?void 0:ii.map(ln=>ln.name))||[],Sn=[];for(const ln of kt)Sn.push((Mn[1]||"")+Mn[2]+"."+ln);Sn.length>0&&(on=Sn.join(","))}const Ft=V.getAllCollectionIdentifiers(_),Vt=o.map(kt=>kt.name+":excerpt(200)").concat(r.map(kt=>"expand."+kt.name+".*:excerpt(200)"));Vt.length&&Vt.unshift("*");const wn=[];for(const kt of r){const Sn=V.getExpandPresentableRelField(kt,d,2);Sn&&wn.push(Sn)}return me.collection(_.id).getList(Le,a1,{sort:on,skipTotal:1,filter:V.normalizeSearchFilter(k,Ft),expand:wn.join(","),fields:Vt.join(","),requestKey:"records_list"}).then(async kt=>{var Sn;if(Le<=1&&oe(),t(9,L=!1),t(8,T=kt.page),t(25,O=kt.items.length),h("load",$.concat(kt.items)),o.length)for(let ln of kt.items)ln._partial=!0;if(ot){const ln=++A;for(;(Sn=kt.items)!=null&&Sn.length&&A==ln;){const Dt=kt.items.splice(0,20);for(let Ei of Dt)V.pushOrReplaceByKey($,Ei);t(3,$),await V.yieldToMain()}}else{for(let ln of kt.items)V.pushOrReplaceByKey($,ln);t(3,$)}}).catch(kt=>{kt!=null&&kt.isAbort||(t(9,L=!1),console.warn(kt),oe(),me.error(kt,!k||(kt==null?void 0:kt.status)!=400))})}function oe(){S==null||S.resetVerticalScroll(),t(3,$=[]),t(8,T=1),t(25,O=0),t(4,M={})}function Se(){c?ge():$e()}function ge(){t(4,M={})}function $e(){for(const Le of $)t(4,M[Le.id]=Le,M);t(4,M)}function Ye(Le){M[Le.id]?delete M[Le.id]:t(4,M[Le.id]=Le,M),t(4,M)}function nt(){pn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,xe)}async function xe(){if(I||!f||!(_!=null&&_.id))return;let Le=[];for(const ot of Object.keys(M))Le.push(me.collection(_.id).delete(ot));return t(10,I=!0),Promise.all(Le).then(()=>{en(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",M),ge()}).catch(ot=>{me.error(ot)}).finally(()=>(t(10,I=!1),x()))}function We(Le){Ne.call(this,n,Le)}const rt=(Le,ot)=>{ot.target.checked?V.removeByValue(N,Le.id):V.pushUnique(N,Le.id),t(5,N)},Ze=()=>Se();function at(Le){g=Le,t(0,g)}function Ht(Le){ie[Le?"unshift":"push"](()=>{P=Le,t(11,P)})}const Ve=Le=>Ye(Le),Me=Le=>h("select",Le),st=(Le,ot)=>{ot.code==="Enter"&&(ot.preventDefault(),h("select",Le))},De=()=>t(1,k=""),Be=()=>h("new"),ve=()=>X(T+1);function Ce(Le){ie[Le?"unshift":"push"](()=>{S=Le,t(7,S)})}const ut=()=>ge(),qt=()=>nt();return n.$$set=Le=>{"collection"in Le&&t(22,_=Le.collection),"sort"in Le&&t(0,g=Le.sort),"filter"in Le&&t(1,k=Le.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&_!=null&&_.id&&(z=_.id+"@hiddenColumns",J(),oe()),n.$$.dirty[0]&4194304&&t(16,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(_==null?void 0:_.type)==="auth"&&_.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((_==null?void 0:_.fields)||[]).filter(Le=>!Le.hidden&&(!l||!F.includes(Le.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Le=>Le.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Le=>Le.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Le=>!N.includes(Le.id))),n.$$.dirty[0]&272629763&&!m&&_!=null&&_.id&&g!==-1&&k!==-1&&X(1),n.$$.dirty[0]&33554432&&t(14,u=O>=a1),n.$$.dirty[0]&16&&t(6,f=Object.keys(M).length),n.$$.dirty[0]&72&&t(13,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Le=>!Le.primaryKey).map(Le=>({id:Le.id,name:Le.name})))},[g,k,X,$,M,N,f,S,T,L,I,P,R,c,u,a,i,h,Se,ge,Ye,nt,_,K,x,O,s,l,m,We,rt,Ze,at,Ht,Ve,Me,st,De,Be,ve,Ce,ut,qt]}class vN extends we{constructor(e){super(),ye(this,e,kN,gN,_e,{collection:22,sort:0,filter:1,hasRecord:23,reloadLoadedPages:24,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[23]}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[2]}}function yN(n){let e,t,i,l;return e=new iI({}),i=new mi({props:{class:"flex-content",$$slots:{footer:[$N],default:[TN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function wN(n){let e,t;return e=new mi({props:{center:!0,$$slots:{default:[EN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SN(n){let e,t;return e=new mi({props:{center:!0,$$slots:{default:[MN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function u1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){y(l,e,s),t||(i=[Ee(He.call(null,e,{text:"Edit collection",position:"right"})),B(e,"click",n[21])],t=!0)},p:te,d(l){l&&v(e),t=!1,Ie(i)}}}function f1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[24]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function TN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P,N=!n[12]&&u1(n);c=new Au({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&f1(n);k=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),O=new vN({props:U}),n[26](O),ie.push(()=>be(O,"filter",z)),ie.push(()=>be(O,"sort",F)),O.$on("select",n[29]),O.$on("delete",n[30]),O.$on("new",n[31]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=C(),s=b("div"),r=W(o),a=C(),u=b("div"),N&&N.c(),f=C(),j(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=C(),R&&R.c(),g=C(),j(k.$$.fragment),S=C(),$=b("div"),T=C(),j(O.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(J,K){y(J,e,K),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),N&&N.m(u,null),w(u,f),q(c,u,null),w(e,d),w(e,m),w(m,h),w(m,_),R&&R.m(m,null),y(J,g,K),q(k,J,K),y(J,S,K),y(J,$,K),y(J,T,K),q(O,J,K),I=!0,A||(P=B(h,"click",n[23]),A=!0)},p(J,K){(!I||K[0]&4)&&o!==(o=J[2].name+"")&&re(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,K):(N=u1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,K):(R=f1(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const x={};K[0]&1&&(x.value=J[0]),K[0]&4&&(x.autocompleteCollection=J[2]),k.$set(x);const X={};K[0]&4&&(X.collection=J[2]),!M&&K[0]&1&&(M=!0,X.filter=J[0],Te(()=>M=!1)),!L&&K[0]&2&&(L=!0,X.sort=J[1],Te(()=>L=!1)),O.$set(X)},i(J){I||(E(c.$$.fragment,J),E(k.$$.fragment,J),E(O.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(k.$$.fragment,J),D(O.$$.fragment,J),I=!1},d(J){J&&(v(e),v(g),v(S),v($),v(T)),N&&N.d(),H(c),R&&R.d(),H(k,J),n[26](null),H(O,J),A=!1,P()}}}function $N(n){let e,t,i;function l(o){n[20](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new iN({props:s}),n[19](e),ie.push(()=>be(e,"totalCount",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[19](null),H(e,o)}}}function CN(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=C(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=B(i,"click",n[18]),l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function ON(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function EN(n){let e,t,i;function l(r,a){return r[12]?ON:CN}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){y(r,e,a),w(e,t),w(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function MN(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function DN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[SN,wN,yN],m=[];function h($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new nf({props:_}),n[32](l),l.$on("truncate",n[33]);let g={};o=new I5({props:g}),n[34](o);let k={collection:n[2]};a=new rf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new sL({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),j(f.$$.fragment)},m($,T){m[e].m($,T),y($,i,T),q(l,$,T),y($,s,T),q(o,$,T),y($,r,T),q(a,$,T),y($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=h($),e===O?m[e].p($,T):(ae(),D(m[O],1,1,()=>{m[O]=null}),ue(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),E(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=$[2]),a.$set(I);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(E(t),E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(f.$$.fragment,$),c=!0)},o($){D(t),D(l.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(v(i),v(s),v(r),v(u)),m[e].d($),n[32](null),H(l,$),n[34](null),H(o,$),n[35](null),H(a,$),n[39](null),H(f,$)}}}function IN(n,e,t){let i,l,s,o,r,a,u,f;Qe(n,ei,Me=>t(2,s=Me)),Qe(n,fn,Me=>t(41,o=Me)),Qe(n,Js,Me=>t(3,r=Me)),Qe(n,Lu,Me=>t(17,a=Me)),Qe(n,En,Me=>t(11,u=Me)),Qe(n,Dl,Me=>t(12,f=Me));const c=new URLSearchParams(a);let d,m,h,_,g,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(s==null?void 0:s.id),O=0;Du(T);async function M(Me){await un(),(s==null?void 0:s.type)==="view"?_.show(Me):h==null||h.show(Me)}function L(){t(14,T=s==null?void 0:s.id),t(0,S=""),t(1,$="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!$)return;const Me=V.getAllCollectionIdentifiers(s),st=$.split(",").map(De=>De.startsWith("+")||De.startsWith("-")?De.substring(1):De);st.filter(De=>Me.includes(De)).length!=st.length&&((s==null?void 0:s.type)!="view"?t(1,$="-@rowid"):Me.includes("created")?t(1,$="-created"):t(1,$=""))}function A(Me={}){const st=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:$},Me);V.replaceHashQueryParams(st)}const P=()=>d==null?void 0:d.show();function N(Me){ie[Me?"unshift":"push"](()=>{k=Me,t(9,k)})}function R(Me){O=Me,t(10,O)}const z=()=>d==null?void 0:d.show(s),F=()=>{g==null||g.load(),k==null||k.reload()},U=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),K=Me=>t(0,S=Me.detail);function x(Me){ie[Me?"unshift":"push"](()=>{g=Me,t(8,g)})}function X(Me){S=Me,t(0,S)}function oe(Me){$=Me,t(1,$)}const Se=Me=>{A({recordId:Me.detail.id});let st=Me.detail._partial?Me.detail.id:Me.detail;s.type==="view"?_==null||_.show(st):h==null||h.show(st)},ge=()=>{k==null||k.reload()},$e=()=>h==null?void 0:h.show();function Ye(Me){ie[Me?"unshift":"push"](()=>{d=Me,t(4,d)})}const nt=()=>{g==null||g.load(),k==null||k.reload()};function xe(Me){ie[Me?"unshift":"push"](()=>{m=Me,t(5,m)})}function We(Me){ie[Me?"unshift":"push"](()=>{h=Me,t(6,h)})}const rt=()=>{A({recordId:null})},Ze=Me=>{S?k==null||k.reload():Me.detail.isNew&&t(10,O++,O),g==null||g.reloadLoadedPages()},at=Me=>{(!S||g!=null&&g.hasRecord(Me.detail.id))&&t(10,O--,O),g==null||g.reloadLoadedPages()};function Ht(Me){ie[Me?"unshift":"push"](()=>{_=Me,t(7,_)})}const Ve=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,l=i.get("collection")),n.$$.dirty[0]&49164&&!r&&l&&l!=T&&l!=(s==null?void 0:s.id)&&l!=(s==null?void 0:s.name)&&Lw(l),n.$$.dirty[0]&16388&&s!=null&&s.id&&T!=s.id&&T!=s.name&&L(),n.$$.dirty[0]&4&&s!=null&&s.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&M(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||s!=null&&s.id)&&A(),n.$$.dirty[0]&4&&Rn(fn,o=(s==null?void 0:s.name)||"Collections",o)},[S,$,s,r,d,m,h,_,g,k,O,u,f,A,T,l,i,a,P,N,R,z,F,U,J,K,x,X,oe,Se,ge,$e,Ye,nt,xe,We,rt,Ze,at,Ht,Ve]}class LN extends we{constructor(e){super(),ye(this,e,IN,DN,_e,{},null,[-1,-1])}}function c1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',l=C(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),y(a,l,u),y(a,s,u),o||(r=[Ee(qi.call(null,i,{path:"/settings/export-collections/?.*"})),Ee(Vn.call(null,i)),Ee(qi.call(null,s,{path:"/settings/import-collections/?.*"})),Ee(Vn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,Ie(r)}}}function AN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&c1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),l=b("a"),l.innerHTML=' Application',s=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),h&&h.c(),p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(_,g){y(_,e,g),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),w(e,r),w(e,a),w(e,u),w(e,f),w(e,c),h&&h.m(e,null),d||(m=[Ee(qi.call(null,l,{path:"/settings"})),Ee(Vn.call(null,l)),Ee(qi.call(null,o,{path:"/settings/mail/?.*"})),Ee(Vn.call(null,o)),Ee(qi.call(null,a,{path:"/settings/storage/?.*"})),Ee(Vn.call(null,a)),Ee(qi.call(null,f,{path:"/settings/backups/?.*"})),Ee(Vn.call(null,f))],d=!0)},p(_,g){_[0]?h&&(h.d(1),h=null):h||(h=c1(),h.c(),h.m(e,null))},d(_){_&&v(e),h&&h.d(),d=!1,Ie(m)}}}function PN(n){let e,t;return e=new uv({props:{class:"settings-sidebar",$$slots:{default:[AN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function NN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class ms extends we{constructor(e){super(),ye(this,e,NN,PN,_e,{})}}function RN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(u,f){y(u,e,f),e.checked=n[0].batch.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[4]),r=!0)},p(u,f){f&256&&t!==(t=u[8])&&p(e,"id",t),f&1&&(e.checked=u[0].batch.enabled),f&256&&o!==(o=u[8])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function FN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max allowed batch requests"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].batch.maxRequests),r||(a=B(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.maxRequests&&ce(s,u[0].batch.maxRequests)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function qN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",l=C(),s=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].batch.timeout),r||(a=B(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.timeout&&ce(s,u[0].batch.timeout)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function HN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max body size (in bytes)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),p(s,"placeholder","Default to 128MB"),s.value=r=n[0].batch.maxBodySize||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=B(s,"input",n[7]),a=!0)},p(f,c){c&256&&i!==(i=f[8])&&p(e,"for",i),c&256&&o!==(o=f[8])&&p(s,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function jN(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[RN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[FN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[qN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[HN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),u=C(),f=b("div"),j(c.$$.fragment),p(l,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),y(m,t,h),y(m,i,h),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),w(i,u),w(i,f),q(c,f,null),d=!0},p(m,h){const _={};h&769&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&2&&(g.class="form-field "+(m[1]?"required":"")),h&771&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const k={};h&2&&(k.class="form-field "+(m[1]?"required":"")),h&771&&(k.$$scope={dirty:h,ctx:m}),a.$set(k);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i)),H(e,m),H(s),H(a),H(c)}}}function zN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function UN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function d1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function VN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?UN:zN}let a=r(n),u=a(n),f=n[2]&&d1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&E(f,1):(f=d1(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function BN(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[VN],default:[jN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function WN(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=gt(this.value),t(0,o)}function u(){o.batch.timeout=gt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!V.isEmpty(s==null?void 0:s.batch)),n.$$.dirty&1&&t(1,l=!!((c=o.batch)!=null&&c.enabled))},[o,l,i,s,r,a,u,f]}class YN extends we{constructor(e){super(),ye(this,e,WN,BN,_e,{formSettings:0})}}function p1(n,e,t){const i=n.slice();return i[17]=e[t],i}function m1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&re(i,t)},d(a){a&&(v(e),v(l)),s=!1,o()}}}function KN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;function k(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new ps({props:S}),ie.push(()=>be(s,"value",k));let $=pe(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=m1(p1(n,$,O));return{c(){e=b("label"),t=W("Trusted proxy headers"),l=C(),j(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as: - `);for(let O=0;Oo=!1)),s.$set(L),(!h||M&1)&&Q(u,"hidden",V.isEmpty(O[0].trustedProxy.headers)),M&68){$=pe(O[2]);let I;for(I=0;I<$.length;I+=1){const A=p1(O,$,I);T[I]?T[I].p(A,M):(T[I]=m1(A),T[I].c(),T[I].m(d,null))}for(;Ibe(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,_){y(h,e,_),w(e,t),w(e,i),w(e,l),y(h,o,_),q(r,h,_),u=!0,f||(c=Ee(He.call(null,l,{text:"This is in case the proxy returns more than 1 IP as header value. The rightmost IP is usually considered to be the more trustworthy but this could vary depending on the proxy.",position:"right"})),f=!0)},p(h,_){(!u||_&65536&&s!==(s=h[16]))&&p(e,"for",s);const g={};!a&&_&1&&(a=!0,g.keyOfSelected=h[0].trustedProxy.useLeftmostIP,Te(()=>a=!1)),r.$set(g)},i(h){u||(E(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),H(r,h),f=!1,c()}}}function ZN(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,_,g,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,O,M,L,I,A,P,N,R,z,F,U;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[KN,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[JN,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=C(),o=b("strong"),a=W(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),_=b("span"),_.textContent="Detected proxy header:",g=C(),k=b("strong"),$=W(S),T=C(),O=b("div"),O.innerHTML=`

    When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as + `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[64]),a[0]&1031165|a[2]&16777216&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&8&&(f.record=r[3]),a[0]&1&&(f.collection=r[0]),i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[65](null),H(e,r),n[68](null),H(i,r)}}}const Ml="form",lo="providers";function nN(n,e,t){let i,l,s,o,r,a,u,f;const c=bt(),d="record_"+V.randomString(5);let{collection:m}=e,h,_,g={},k={},S=null,$=!1,T=!1,O={},E={},I=JSON.stringify(g),L=I,A=Ml,P=!0,N=!0,R=m,z=[];const F=["id"],U=F.concat("email","emailVisibility","verified","tokenKey","password");function J(le){return Se(le),t(14,T=!0),t(15,A=Ml),h==null?void 0:h.show()}function K(){return h==null?void 0:h.hide()}function x(){t(14,T=!1),K()}function X(){t(34,R=m),h!=null&&h.isActive()&&(nt(JSON.stringify(k)),x())}async function oe(le){if(le&&typeof le=="string"){try{return await me.collection(m.id).getOne(le)}catch(Oe){Oe.isAbort||(x(),console.warn("resolveModel:",Oe),Ci(`Unable to load record with id "${le}"`))}return null}return le}async function Se(le){t(7,N=!0),Yt({}),t(4,O={}),t(5,E={}),t(2,g=typeof le=="string"?{id:le,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:le||{}),t(3,k=structuredClone(g)),t(2,g=await oe(le)||{}),t(3,k=structuredClone(g)),await un(),t(12,S=Ye()),!S||We(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(32,I=JSON.stringify(k)),t(7,N=!1)}async function ge(le){var Fe,Je;Yt({}),t(2,g=le||{}),t(4,O={}),t(5,E={});const Oe=((Je=(Fe=m==null?void 0:m.fields)==null?void 0:Fe.filter(Pe=>Pe.type!="file"))==null?void 0:Je.map(Pe=>Pe.name))||[];for(let Pe in le)Oe.includes(Pe)||t(3,k[Pe]=le[Pe],k);await un(),t(32,I=JSON.stringify(k)),rt()}function $e(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((g==null?void 0:g.id)||"")}function Ye(le){try{const Oe=window.localStorage.getItem($e());if(Oe)return JSON.parse(Oe)}catch{}return le}function nt(le){try{window.localStorage.setItem($e(),le)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem($e())}}function xe(){S&&(t(3,k=S),t(12,S=null))}function We(le,Oe){var ft;const Fe=structuredClone(le||{}),Je=structuredClone(Oe||{}),Pe=(ft=m==null?void 0:m.fields)==null?void 0:ft.filter(Xt=>Xt.type==="file");for(let Xt of Pe)delete Fe[Xt.name],delete Je[Xt.name];const Ge=["expand","password","passwordConfirm"];for(let Xt of Ge)delete Fe[Xt],delete Je[Xt];return JSON.stringify(Fe)==JSON.stringify(Je)}function rt(){t(12,S=null),window.localStorage.removeItem($e())}async function Ze(le=!0){var Oe;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const Fe=Ht();let Je;if(P?Je=await me.collection(m.id).create(Fe):Je=await me.collection(m.id).update(k.id,Fe),tn(P?"Successfully created record.":"Successfully updated record."),rt(),l&&(k==null?void 0:k.id)==((Oe=me.authStore.record)==null?void 0:Oe.id)&&Fe.get("password"))return me.logout();le?x():ge(Je),c("save",{isNew:P,record:Je})}catch(Fe){me.error(Fe)}t(13,$=!1)}}function at(){g!=null&&g.id&&pn("Do you really want to delete the selected record?",()=>me.collection(g.collectionId).delete(g.id).then(()=>{x(),tn("Successfully deleted record."),c("delete",g)}).catch(le=>{me.error(le)}))}function Ht(){const le=structuredClone(k||{}),Oe=new FormData,Fe={},Je={};for(const Pe of(m==null?void 0:m.fields)||[])Pe.type=="autodate"||i&&Pe.type=="password"||(Fe[Pe.name]=!0,Pe.type=="json"&&(Je[Pe.name]=!0));i&&le.password&&(Fe.password=!0),i&&le.passwordConfirm&&(Fe.passwordConfirm=!0);for(const Pe in le)if(Fe[Pe]){if(typeof le[Pe]>"u"&&(le[Pe]=null),Je[Pe]&&le[Pe]!=="")try{JSON.parse(le[Pe])}catch(Ge){const ft={};throw ft[Pe]={code:"invalid_json",message:Ge.toString()},new Fn({status:400,response:{data:ft}})}V.addValueToFormData(Oe,Pe,le[Pe])}for(const Pe in O){const Ge=V.toArray(O[Pe]);for(const ft of Ge)Oe.append(Pe+"+",ft)}for(const Pe in E){const Ge=V.toArray(E[Pe]);for(const ft of Ge)Oe.append(Pe+"-",ft)}return Oe}function Ve(){!(m!=null&&m.id)||!(g!=null&&g.email)||pn(`Do you really want to sent verification email to ${g.email}?`,()=>me.collection(m.id).requestVerification(g.email).then(()=>{tn(`Successfully sent verification email to ${g.email}.`)}).catch(le=>{me.error(le)}))}function Me(){!(m!=null&&m.id)||!(g!=null&&g.email)||pn(`Do you really want to sent password reset email to ${g.email}?`,()=>me.collection(m.id).requestPasswordReset(g.email).then(()=>{tn(`Successfully sent password reset email to ${g.email}.`)}).catch(le=>{me.error(le)}))}function st(){a?pn("You have unsaved changes. Do you really want to discard them?",()=>{De()}):De()}async function De(){let le=g?structuredClone(g):null;if(le){const Oe=["file","autodate"],Fe=(m==null?void 0:m.fields)||[];for(const Je of Fe)Oe.includes(Je.type)&&delete le[Je.name];le.id=""}rt(),J(le),await un(),t(32,I="")}function Be(le){(le.ctrlKey||le.metaKey)&&le.code=="KeyS"&&(le.preventDefault(),le.stopPropagation(),Ze(!1))}const ve=()=>K(),Ce=()=>Ze(!1),ut=()=>Ve(),qt=()=>Me(),Le=()=>_==null?void 0:_.show(),ot=()=>st(),on=()=>at(),Mn=()=>t(15,A=Ml),Re=()=>t(15,A=lo),Ft=()=>xe(),Vt=()=>rt();function wn(){k.id=this.value,t(3,k)}function cn(le){k=le,t(3,k)}function Oi(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function ii(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function kt(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Sn(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function ln(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Dt(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Ei(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function ul(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function zi(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function Ui(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function fl(le,Oe){n.$$.not_equal(O[Oe.name],le)&&(O[Oe.name]=le,t(4,O))}function Dn(le,Oe){n.$$.not_equal(E[Oe.name],le)&&(E[Oe.name]=le,t(5,E))}function Rl(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}function cl(le,Oe){n.$$.not_equal(k[Oe.name],le)&&(k[Oe.name]=le,t(3,k))}const Z=()=>a&&T?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{x()}),!1):(Yt({}),rt(),!0);function ee(le){ie[le?"unshift":"push"](()=>{h=le,t(10,h)})}function se(le){Ne.call(this,n,le)}function he(le){Ne.call(this,n,le)}function qe(le){ie[le?"unshift":"push"](()=>{_=le,t(11,_)})}return n.$$set=le=>{"collection"in le&&t(0,m=le.collection)},n.$$.update=()=>{var le,Oe,Fe;n.$$.dirty[0]&1&&t(9,i=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&1&&t(17,l=(m==null?void 0:m.name)==="_superusers"),n.$$.dirty[0]&1&&t(20,s=!!((le=m==null?void 0:m.fields)!=null&&le.find(Je=>Je.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Oe=m==null?void 0:m.fields)==null?void 0:Oe.find(Je=>Je.name==="id")),n.$$.dirty[0]&48&&t(36,r=V.hasNonEmptyProps(O)||V.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(33,L=JSON.stringify(k)),n.$$.dirty[1]&38&&t(8,a=r||I!=L),n.$$.dirty[0]&4&&t(6,P=!g||!g.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&4&&(N||nt(L)),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&m&&(R==null?void 0:R.id)!=(m==null?void 0:m.id)&&X(),n.$$.dirty[0]&512&&t(35,f=i?U:F),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&t(16,z=((Fe=m==null?void 0:m.fields)==null?void 0:Fe.filter(Je=>!f.includes(Je.name)&&Je.type!="autodate"))||[])},[m,K,g,k,O,E,P,N,a,i,h,_,S,$,T,A,z,l,u,o,s,d,x,xe,rt,Ze,at,Ve,Me,st,Be,J,I,L,R,f,r,ve,Ce,ut,qt,Le,ot,on,Mn,Re,Ft,Vt,wn,cn,Oi,ii,kt,Sn,ln,Dt,Ei,ul,zi,Ui,fl,Dn,Rl,cl,Z,ee,se,he,qe]}class rf extends we{constructor(e){super(),ye(this,e,nN,tN,_e,{collection:0,show:31,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[31]}get hide(){return this.$$.ctx[1]}}function iN(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=C(),l=b("span"),o=B(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){y(a,e,u),w(e,t),w(e,i),w(e,l),w(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&re(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:te,o:te,d(a){a&&v(e)}}}function lN(n,e,t){const i=bt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=V.getAllCollectionIdentifiers(l),c=await me.collection(l.id).getList(1,1,{filter:V.normalizeSearchFilter(s,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class sN extends we{constructor(e){super(),ye(this,e,lN,iN,_e,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function Kg(n,e,t){const i=n.slice();return i[58]=e[t],i}function Jg(n,e,t){const i=n.slice();return i[61]=e[t],i}function Zg(n,e,t){const i=n.slice();return i[61]=e[t],i}function Gg(n,e,t){const i=n.slice();return i[54]=e[t],i}function Xg(n){let e;function t(s,o){return s[9]?rN:oN}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){y(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function oN(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[13],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){y(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&8192&&(t.checked=a[13])},d(a){a&&v(e),o=!1,r()}}}function rN(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function aN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[61].type))},m(i,l){y(i,e,l)},p(i,l){l[0]&32768&&t!==(t=V.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&v(e)}}}function uN(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function fN(n){let e,t,i,l=n[61].name+"",s;function o(u,f){return u[61].primaryKey?uN:aN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){y(u,e,f),a.m(e,null),w(e,t),w(e,i),w(i,s)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,t))),f[0]&32768&&l!==(l=u[61].name+"")&&re(s,l)},d(u){u&&v(e),a.d()}}}function Qg(n,e){let t,i,l,s;function o(a){e[32](a)}let r={class:"col-type-"+e[61].type+" col-field-"+e[61].name,name:e[61].name,$$slots:{default:[fN]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new lr({props:r}),ie.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(a,u){y(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[61].type+" col-field-"+e[61].name),u[0]&32768&&(f.name=e[61].name),u[0]&32768|u[2]&16&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],Te(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&v(t),H(i,a)}}}function xg(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){y(t,e,i),n[33](e)},p:te,d(t){t&&v(e),n[33](null)}}}function e1(n){let e;function t(s,o){return s[9]?dN:cN}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function cN(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return mN;if(!a[16])return pN}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=C(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){y(a,e,u),w(e,t),w(t,i),w(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function dN(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function pN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[38]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function mN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[37]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function t1(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[58].id),i.checked=s=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){y(d,e,m),w(e,t),w(t,i),w(t,o),w(t,r),u||(f=[W(i,"change",c),W(t,"click",On(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[58].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[58].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&v(e),u=!1,Ie(f)}}}function n1(n,e){let t,i,l,s;return i=new pv({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),j(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){y(o,t,r),q(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",l)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&v(t),H(i)}}}function i1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&t1(e),d=de(e[15]);const m=g=>g[61].id;for(let g=0;g',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(g,k){y(g,t,k),c&&c.m(t,null),w(t,i);for(let S=0;SI[61].id;for(let I=0;II[16]?I[58]:I[58].id;for(let I=0;I<$.length;I+=1){let L=Kg(n,$,I),A=T(L);d.set(A,c[I]=i1(A,L))}let O=null;$.length||(O=e1(n));let E=n[3].length&&n[14]&&l1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),_&&_.c(),l=C();for(let I=0;I({57:s}),({uniqueId:s})=>[0,s?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),j(i.$$.fragment),this.first=t},m(s,o){y(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(i,s)}}}function gN(n){let e,t,i=[],l=new Map,s,o,r=de(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u{i=null}),ue())},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function r1(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,_,g,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[6]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.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[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),Q(h,"btn-loading",n[10]),Q(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m($,T){y($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),g=!0,k||(S=[W(f,"click",n[41]),W(h,"click",n[42])],k=!0)},p($,T){(!g||T[0]&64)&&re(s,$[6]),(!g||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&re(a,r),(!g||T[0]&1024)&&Q(f,"btn-disabled",$[10]),(!g||T[0]&1024)&&Q(h,"btn-loading",$[10]),(!g||T[0]&1024)&&Q(h,"btn-disabled",$[10])},i($){g||($&&tt(()=>{g&&(_||(_=je(e,qn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o($){$&&(_||(_=je(e,qn,{duration:150,y:5},!1)),_.run(0)),g=!1},d($){$&&v(e),$&&_&&_.end(),k=!1,Ie(S)}}}function kN(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[bN],default:[hN]},$$scope:{ctx:n}};e=new Pu({props:s}),n[40](e);let o=n[6]&&r1(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=ke()},m(r,a){q(e,r,a),y(r,t,a),o&&o.m(r,a),y(r,i,a),l=!0},p(r,a){const u={};a[0]&129851|a[2]&16&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&M(o,1)):(o=r1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(ae(),D(o,1,1,()=>{o=null}),ue())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(v(t),v(i)),n[40](null),H(e,r),o&&o.d(r)}}}const vN=/^([\+\-])?(\w+)$/,a1=40;function yN(n,e,t){let i,l,s,o,r,a,u,f,c,d,m;Qe(n,En,Le=>t(47,d=Le)),Qe(n,Js,Le=>t(28,m=Le));const h=bt();let{collection:_}=e,{sort:g=""}=e,{filter:k=""}=e,S,$=[],T=1,O=0,E={},I=!0,L=!1,A=0,P,N=[],R=[],z="";const F=["verified","emailVisibility"];function U(){_!=null&&_.id&&(N.length?localStorage.setItem(z,JSON.stringify(N)):localStorage.removeItem(z))}function J(){if(t(5,N=[]),!!(_!=null&&_.id))try{const Le=localStorage.getItem(z);Le&&t(5,N=JSON.parse(Le)||[])}catch{}}function K(Le){return!!$.find(ot=>ot.id==Le)}async function x(){const Le=T;for(let ot=1;ot<=Le;ot++)(ot===1||u)&&await X(ot,!1)}async function X(Le=1,ot=!0){var cn,Oi,ii;if(!(_!=null&&_.id))return;t(9,I=!0);let on=g;const Mn=on.match(vN),Re=Mn?r.find(kt=>kt.name===Mn[2]):null;if(Mn&&Re){const kt=((ii=(Oi=(cn=d==null?void 0:d.find(ln=>ln.id==Re.collectionId))==null?void 0:cn.fields)==null?void 0:Oi.filter(ln=>ln.presentable))==null?void 0:ii.map(ln=>ln.name))||[],Sn=[];for(const ln of kt)Sn.push((Mn[1]||"")+Mn[2]+"."+ln);Sn.length>0&&(on=Sn.join(","))}const Ft=V.getAllCollectionIdentifiers(_),Vt=o.map(kt=>kt.name+":excerpt(200)").concat(r.map(kt=>"expand."+kt.name+".*:excerpt(200)"));Vt.length&&Vt.unshift("*");const wn=[];for(const kt of r){const Sn=V.getExpandPresentableRelField(kt,d,2);Sn&&wn.push(Sn)}return me.collection(_.id).getList(Le,a1,{sort:on,skipTotal:1,filter:V.normalizeSearchFilter(k,Ft),expand:wn.join(","),fields:Vt.join(","),requestKey:"records_list"}).then(async kt=>{var Sn;if(Le<=1&&oe(),t(9,I=!1),t(8,T=kt.page),t(25,O=kt.items.length),h("load",$.concat(kt.items)),o.length)for(let ln of kt.items)ln._partial=!0;if(ot){const ln=++A;for(;(Sn=kt.items)!=null&&Sn.length&&A==ln;){const Dt=kt.items.splice(0,20);for(let Ei of Dt)V.pushOrReplaceByKey($,Ei);t(3,$),await V.yieldToMain()}}else{for(let ln of kt.items)V.pushOrReplaceByKey($,ln);t(3,$)}}).catch(kt=>{kt!=null&&kt.isAbort||(t(9,I=!1),console.warn(kt),oe(),me.error(kt,!k||(kt==null?void 0:kt.status)!=400))})}function oe(){S==null||S.resetVerticalScroll(),t(3,$=[]),t(8,T=1),t(25,O=0),t(4,E={})}function Se(){c?ge():$e()}function ge(){t(4,E={})}function $e(){for(const Le of $)t(4,E[Le.id]=Le,E);t(4,E)}function Ye(Le){E[Le.id]?delete E[Le.id]:t(4,E[Le.id]=Le,E),t(4,E)}function nt(){pn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,xe)}async function xe(){if(L||!f||!(_!=null&&_.id))return;let Le=[];for(const ot of Object.keys(E))Le.push(me.collection(_.id).delete(ot));return t(10,L=!0),Promise.all(Le).then(()=>{tn(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",E),ge()}).catch(ot=>{me.error(ot)}).finally(()=>(t(10,L=!1),x()))}function We(Le){Ne.call(this,n,Le)}const rt=(Le,ot)=>{ot.target.checked?V.removeByValue(N,Le.id):V.pushUnique(N,Le.id),t(5,N)},Ze=()=>Se();function at(Le){g=Le,t(0,g)}function Ht(Le){ie[Le?"unshift":"push"](()=>{P=Le,t(11,P)})}const Ve=Le=>Ye(Le),Me=Le=>h("select",Le),st=(Le,ot)=>{ot.code==="Enter"&&(ot.preventDefault(),h("select",Le))},De=()=>t(1,k=""),Be=()=>h("new"),ve=()=>X(T+1);function Ce(Le){ie[Le?"unshift":"push"](()=>{S=Le,t(7,S)})}const ut=()=>ge(),qt=()=>nt();return n.$$set=Le=>{"collection"in Le&&t(22,_=Le.collection),"sort"in Le&&t(0,g=Le.sort),"filter"in Le&&t(1,k=Le.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&_!=null&&_.id&&(z=_.id+"@hiddenColumns",J(),oe()),n.$$.dirty[0]&4194304&&t(16,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(_==null?void 0:_.type)==="auth"&&_.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((_==null?void 0:_.fields)||[]).filter(Le=>!Le.hidden&&(!l||!F.includes(Le.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Le=>Le.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Le=>Le.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Le=>!N.includes(Le.id))),n.$$.dirty[0]&272629763&&!m&&_!=null&&_.id&&g!==-1&&k!==-1&&X(1),n.$$.dirty[0]&33554432&&t(14,u=O>=a1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Le=>!Le.primaryKey).map(Le=>({id:Le.id,name:Le.name})))},[g,k,X,$,E,N,f,S,T,I,L,P,R,c,u,a,i,h,Se,ge,Ye,nt,_,K,x,O,s,l,m,We,rt,Ze,at,Ht,Ve,Me,st,De,Be,ve,Ce,ut,qt]}class wN extends we{constructor(e){super(),ye(this,e,yN,kN,_e,{collection:22,sort:0,filter:1,hasRecord:23,reloadLoadedPages:24,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[23]}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[2]}}function SN(n){let e,t,i,l;return e=new sI({}),i=new mi({props:{class:"flex-content",$$slots:{footer:[ON],default:[CN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function TN(n){let e,t;return e=new mi({props:{center:!0,$$slots:{default:[DN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $N(n){let e,t;return e=new mi({props:{center:!0,$$slots:{default:[IN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function u1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){y(l,e,s),t||(i=[Ee(He.call(null,e,{text:"Edit collection",position:"right"})),W(e,"click",n[21])],t=!0)},p:te,d(l){l&&v(e),t=!1,Ie(i)}}}function f1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[24]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function CN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P,N=!n[12]&&u1(n);c=new Au({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&f1(n);k=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),O=new wN({props:U}),n[26](O),ie.push(()=>be(O,"filter",z)),ie.push(()=>be(O,"sort",F)),O.$on("select",n[29]),O.$on("delete",n[30]),O.$on("new",n[31]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=C(),s=b("div"),r=B(o),a=C(),u=b("div"),N&&N.c(),f=C(),j(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=C(),R&&R.c(),g=C(),j(k.$$.fragment),S=C(),$=b("div"),T=C(),j(O.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(J,K){y(J,e,K),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),N&&N.m(u,null),w(u,f),q(c,u,null),w(e,d),w(e,m),w(m,h),w(m,_),R&&R.m(m,null),y(J,g,K),q(k,J,K),y(J,S,K),y(J,$,K),y(J,T,K),q(O,J,K),L=!0,A||(P=W(h,"click",n[23]),A=!0)},p(J,K){(!L||K[0]&4)&&o!==(o=J[2].name+"")&&re(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,K):(N=u1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,K):(R=f1(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const x={};K[0]&1&&(x.value=J[0]),K[0]&4&&(x.autocompleteCollection=J[2]),k.$set(x);const X={};K[0]&4&&(X.collection=J[2]),!E&&K[0]&1&&(E=!0,X.filter=J[0],Te(()=>E=!1)),!I&&K[0]&2&&(I=!0,X.sort=J[1],Te(()=>I=!1)),O.$set(X)},i(J){L||(M(c.$$.fragment,J),M(k.$$.fragment,J),M(O.$$.fragment,J),L=!0)},o(J){D(c.$$.fragment,J),D(k.$$.fragment,J),D(O.$$.fragment,J),L=!1},d(J){J&&(v(e),v(g),v(S),v($),v(T)),N&&N.d(),H(c),R&&R.d(),H(k,J),n[26](null),H(O,J),A=!1,P()}}}function ON(n){let e,t,i;function l(o){n[20](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new sN({props:s}),n[19](e),ie.push(()=>be(e,"totalCount",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[19](null),H(e,o)}}}function EN(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=C(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),l||(s=W(i,"click",n[18]),l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function MN(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function DN(n){let e,t,i;function l(r,a){return r[12]?MN:EN}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){y(r,e,a),w(e,t),w(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function IN(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function LN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[$N,TN,SN],m=[];function h($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new nf({props:_}),n[32](l),l.$on("truncate",n[33]);let g={};o=new A5({props:g}),n[34](o);let k={collection:n[2]};a=new rf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new rL({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),j(f.$$.fragment)},m($,T){m[e].m($,T),y($,i,T),q(l,$,T),y($,s,T),q(o,$,T),y($,r,T),q(a,$,T),y($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=h($),e===O?m[e].p($,T):(ae(),D(m[O],1,1,()=>{m[O]=null}),ue(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),M(t,1),t.m(i.parentNode,i));const E={};l.$set(E);const I={};o.$set(I);const L={};T[0]&4&&(L.collection=$[2]),a.$set(L);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(M(t),M(l.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(f.$$.fragment,$),c=!0)},o($){D(t),D(l.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(v(i),v(s),v(r),v(u)),m[e].d($),n[32](null),H(l,$),n[34](null),H(o,$),n[35](null),H(a,$),n[39](null),H(f,$)}}}function AN(n,e,t){let i,l,s,o,r,a,u,f;Qe(n,ei,Me=>t(2,s=Me)),Qe(n,fn,Me=>t(41,o=Me)),Qe(n,Js,Me=>t(3,r=Me)),Qe(n,Lu,Me=>t(17,a=Me)),Qe(n,En,Me=>t(11,u=Me)),Qe(n,Dl,Me=>t(12,f=Me));const c=new URLSearchParams(a);let d,m,h,_,g,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(s==null?void 0:s.id),O=0;Du(T);async function E(Me){await un(),(s==null?void 0:s.type)==="view"?_.show(Me):h==null||h.show(Me)}function I(){t(14,T=s==null?void 0:s.id),t(0,S=""),t(1,$="-@rowid"),L(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function L(){if(!$)return;const Me=V.getAllCollectionIdentifiers(s),st=$.split(",").map(De=>De.startsWith("+")||De.startsWith("-")?De.substring(1):De);st.filter(De=>Me.includes(De)).length!=st.length&&((s==null?void 0:s.type)!="view"?t(1,$="-@rowid"):Me.includes("created")?t(1,$="-created"):t(1,$=""))}function A(Me={}){const st=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:$},Me);V.replaceHashQueryParams(st)}const P=()=>d==null?void 0:d.show();function N(Me){ie[Me?"unshift":"push"](()=>{k=Me,t(9,k)})}function R(Me){O=Me,t(10,O)}const z=()=>d==null?void 0:d.show(s),F=()=>{g==null||g.load(),k==null||k.reload()},U=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),K=Me=>t(0,S=Me.detail);function x(Me){ie[Me?"unshift":"push"](()=>{g=Me,t(8,g)})}function X(Me){S=Me,t(0,S)}function oe(Me){$=Me,t(1,$)}const Se=Me=>{A({recordId:Me.detail.id});let st=Me.detail._partial?Me.detail.id:Me.detail;s.type==="view"?_==null||_.show(st):h==null||h.show(st)},ge=()=>{k==null||k.reload()},$e=()=>h==null?void 0:h.show();function Ye(Me){ie[Me?"unshift":"push"](()=>{d=Me,t(4,d)})}const nt=()=>{g==null||g.load(),k==null||k.reload()};function xe(Me){ie[Me?"unshift":"push"](()=>{m=Me,t(5,m)})}function We(Me){ie[Me?"unshift":"push"](()=>{h=Me,t(6,h)})}const rt=()=>{A({recordId:null})},Ze=Me=>{S?k==null||k.reload():Me.detail.isNew&&t(10,O++,O),g==null||g.reloadLoadedPages()},at=Me=>{(!S||g!=null&&g.hasRecord(Me.detail.id))&&t(10,O--,O),g==null||g.reloadLoadedPages()};function Ht(Me){ie[Me?"unshift":"push"](()=>{_=Me,t(7,_)})}const Ve=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,l=i.get("collection")),n.$$.dirty[0]&49164&&!r&&l&&l!=T&&l!=(s==null?void 0:s.id)&&l!=(s==null?void 0:s.name)&&Pw(l),n.$$.dirty[0]&16388&&s!=null&&s.id&&T!=s.id&&T!=s.name&&I(),n.$$.dirty[0]&4&&s!=null&&s.id&&L(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||s!=null&&s.id)&&A(),n.$$.dirty[0]&4&&Rn(fn,o=(s==null?void 0:s.name)||"Collections",o)},[S,$,s,r,d,m,h,_,g,k,O,u,f,A,T,l,i,a,P,N,R,z,F,U,J,K,x,X,oe,Se,ge,$e,Ye,nt,xe,We,rt,Ze,at,Ht,Ve]}class PN extends we{constructor(e){super(),ye(this,e,AN,LN,_e,{},null,[-1,-1])}}function c1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',l=C(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),y(a,l,u),y(a,s,u),o||(r=[Ee(qi.call(null,i,{path:"/settings/export-collections/?.*"})),Ee(Vn.call(null,i)),Ee(qi.call(null,s,{path:"/settings/import-collections/?.*"})),Ee(Vn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,Ie(r)}}}function NN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&c1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),l=b("a"),l.innerHTML=' Application',s=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),h&&h.c(),p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(_,g){y(_,e,g),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),w(e,r),w(e,a),w(e,u),w(e,f),w(e,c),h&&h.m(e,null),d||(m=[Ee(qi.call(null,l,{path:"/settings"})),Ee(Vn.call(null,l)),Ee(qi.call(null,o,{path:"/settings/mail/?.*"})),Ee(Vn.call(null,o)),Ee(qi.call(null,a,{path:"/settings/storage/?.*"})),Ee(Vn.call(null,a)),Ee(qi.call(null,f,{path:"/settings/backups/?.*"})),Ee(Vn.call(null,f))],d=!0)},p(_,g){_[0]?h&&(h.d(1),h=null):h||(h=c1(),h.c(),h.m(e,null))},d(_){_&&v(e),h&&h.d(),d=!1,Ie(m)}}}function RN(n){let e,t;return e=new cv({props:{class:"settings-sidebar",$$slots:{default:[NN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function FN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class ms extends we{constructor(e){super(),ye(this,e,FN,RN,_e,{})}}function qN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(u,f){y(u,e,f),e.checked=n[0].batch.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[4]),r=!0)},p(u,f){f&256&&t!==(t=u[8])&&p(e,"id",t),f&1&&(e.checked=u[0].batch.enabled),f&256&&o!==(o=u[8])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function HN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max allowed batch requests"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].batch.maxRequests),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.maxRequests&&ce(s,u[0].batch.maxRequests)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function jN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",l=C(),s=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].batch.timeout),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.timeout&&ce(s,u[0].batch.timeout)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function zN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max body size (in bytes)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),p(s,"placeholder","Default to 128MB"),s.value=r=n[0].batch.maxBodySize||""},m(f,c){y(f,e,c),w(e,t),y(f,l,c),y(f,s,c),a||(u=W(s,"input",n[7]),a=!0)},p(f,c){c&256&&i!==(i=f[8])&&p(e,"for",i),c&256&&o!==(o=f[8])&&p(s,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&s.value!==r&&(s.value=r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function UN(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[qN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[HN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[jN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[zN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),u=C(),f=b("div"),j(c.$$.fragment),p(l,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),y(m,t,h),y(m,i,h),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),w(i,u),w(i,f),q(c,f,null),d=!0},p(m,h){const _={};h&769&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&2&&(g.class="form-field "+(m[1]?"required":"")),h&771&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const k={};h&2&&(k.class="form-field "+(m[1]?"required":"")),h&771&&(k.$$scope={dirty:h,ctx:m}),a.$set(k);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(M(e.$$.fragment,m),M(s.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i)),H(e,m),H(s),H(a),H(c)}}}function VN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function BN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function d1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function WN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?BN:VN}let a=r(n),u=a(n),f=n[2]&&d1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),u.m(c,d),y(c,s,d),f&&f.m(c,d),y(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&M(f,1):(f=d1(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(ae(),D(f,1,1,()=>{f=null}),ue())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function YN(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[WN],default:[UN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KN(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=gt(this.value),t(0,o)}function u(){o.batch.timeout=gt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!V.isEmpty(s==null?void 0:s.batch)),n.$$.dirty&1&&t(1,l=!!((c=o.batch)!=null&&c.enabled))},[o,l,i,s,r,a,u,f]}class JN extends we{constructor(e){super(),ye(this,e,KN,YN,_e,{formSettings:0})}}function p1(n,e,t){const i=n.slice();return i[17]=e[t],i}function m1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=B(t),l=B(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){y(a,e,u),w(e,i),y(a,l,u),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&re(i,t)},d(a){a&&(v(e),v(l)),s=!1,o()}}}function ZN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;function k(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new ps({props:S}),ie.push(()=>be(s,"value",k));let $=de(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=m1(p1(n,$,O));return{c(){e=b("label"),t=B("Trusted proxy headers"),l=C(),j(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=B(`Comma separated list of headers such as: + `);for(let O=0;Oo=!1)),s.$set(I),(!h||E&1)&&Q(u,"hidden",V.isEmpty(O[0].trustedProxy.headers)),E&68){$=de(O[2]);let L;for(L=0;L<$.length;L+=1){const A=p1(O,$,L);T[L]?T[L].p(A,E):(T[L]=m1(A),T[L].c(),T[L].m(d,null))}for(;Lbe(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,_){y(h,e,_),w(e,t),w(e,i),w(e,l),y(h,o,_),q(r,h,_),u=!0,f||(c=Ee(He.call(null,l,{text:"This is in case the proxy returns more than 1 IP as header value. The rightmost IP is usually considered to be the more trustworthy but this could vary depending on the proxy.",position:"right"})),f=!0)},p(h,_){(!u||_&65536&&s!==(s=h[16]))&&p(e,"for",s);const g={};!a&&_&1&&(a=!0,g.keyOfSelected=h[0].trustedProxy.useLeftmostIP,Te(()=>a=!1)),r.$set(g)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),H(r,h),f=!1,c()}}}function XN(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,_,g,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,O,E,I,L,A,P,N,R,z,F,U;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[ZN,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[GN,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=C(),o=b("strong"),a=B(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),_=b("span"),_.textContent="Detected proxy header:",g=C(),k=b("strong"),$=B(S),T=C(),O=b("div"),O.innerHTML=`

    When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as NGINX, requests from different users will originate from the same IP address (the IP of the proxy connecting to your PocketBase app).

    In this case to retrieve the actual user IP (used for rate limiting, logging, etc.) you need to properly configure your proxy and list below the trusted headers that PocketBase could use to - extract the user IP.

    When using such proxy, to avoid spoofing it is recommended to:

    • use headers that are controlled only by the proxy and cannot be manually set by the users
    • make sure that the PocketBase server can be accessed only through the proxy

    You can clear the headers field if PocketBase is not deployed behind a proxy.

    `,M=C(),L=b("div"),I=b("div"),j(A.$$.fragment),P=C(),N=b("div"),j(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(O,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(N,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(J,K){y(J,e,K),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,a),w(i,u),w(i,f),w(t,c),w(t,d),w(t,m),w(t,h),w(h,_),w(h,g),w(h,k),w(k,$),y(J,T,K),y(J,O,K),y(J,M,K),y(J,L,K),w(L,I),q(A,I,null),w(L,P),w(L,N),q(R,N,null),z=!0,F||(U=Ee(He.call(null,f,`Must show your actual IP. -If not, set the correct proxy header.`)),F=!0)},p(J,K){(!z||K&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&re(a,r),(!z||K&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&re($,S);const x={};K&1114117&&(x.$$scope={dirty:K,ctx:J}),A.$set(x);const X={};K&1114113&&(X.$$scope={dirty:K,ctx:J}),R.$set(X)},i(J){z||(E(A.$$.fragment,J),E(R.$$.fragment,J),z=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),z=!1},d(J){J&&(v(e),v(T),v(O),v(M),v(L)),H(A),H(R),F=!1,U()}}}function GN(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function XN(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,`Detected proxy header. -It is recommend to list it as trusted.`)),t=!0)},d(l){l&&v(e),t=!1,i()}}}function QN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function xN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function h1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e7(n){let e,t,i,l,s,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return XN;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return GN}let m=d(n,-1),h=m&&m(n);function _($,T){return $[3]?xN:QN}let g=_(n),k=g(n),S=n[4]&&h1();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),l.textContent="User IP proxy headers",s=C(),h&&h.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ke(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){y($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),y($,r,T),y($,a,T),y($,u,T),k.m($,T),y($,f,T),S&&S.m($,T),y($,c,T)},p($,T){m!==(m=d($,T))&&(h&&h.d(1),h=m&&m($),h&&(h.c(),h.m(e,null))),g!==(g=_($))&&(k.d(1),k=g($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&E(S,1):(S=h1(),S.c(),E(S,1),S.m(c.parentNode,c)):S&&(ae(),D(S,1,1,()=>{S=null}),ue())},d($){$&&(v(e),v(r),v(a),v(u),v(f),v(c)),h&&h.d(),k.d($),S&&S.d($)}}}function t7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[e7],default:[ZN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function n7(n,e,t){let i,l,s,o,r,a;Qe(n,yn,$=>t(10,a=$));const u=["X-Forward-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function _($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const g=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!V.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!V.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter($=>$!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,_,g,k,S]}class i7 extends we{constructor(e){super(),ye(this,e,n7,t7,_e,{formSettings:0,healthData:1})}}function _1(n,e,t){const i=n.slice();return i[5]=e[t],i}function g1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=W(t),e.__value=l=n[5].value,ce(e,e.__value)},m(s,o){y(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&re(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,ce(e,e.__value))},d(s){s&&v(e)}}}function l7(n){let e,t,i,l,s,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c{t(0,s=u.target.value)};return n.$$set=u=>{e=ze(ze({},e),Ut(u)),t(3,l=lt(e,i)),"value"in u&&t(0,s=u.value),"options"in u&&t(1,o=u.options)},[s,o,r,l,a]}class o7 extends we{constructor(e){super(),ye(this,e,s7,l7,_e,{value:0,options:1})}}function b1(n,e,t){const i=n.slice();return i[15]=e[t],i[16]=e,i[17]=t,i}function r7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(l,"for",o=n[18])},m(u,f){y(u,e,f),e.checked=n[0].rateLimits.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[6]),r=!0)},p(u,f){f&262144&&t!==(t=u[18])&&p(e,"id",t),f&1&&(e.checked=u[0].rateLimits.enabled),f&262144&&o!==(o=u[18])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function k1(n){let e,t,i,l,s,o=pe(n[0].rateLimits.rules||[]),r=[];for(let u=0;uD(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML="Rate limit label Max requests (per IP) Interval (in seconds) ",i=C(),l=b("tbody");for(let u=0;ube(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r&4&&(a.options=n[2]),!t&&r&1&&(t=!0,a.value=n[15].label,Te(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function u7(n){let e,t,i;function l(){n[8].call(e,n[16],n[17])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Max requests*"),p(e,"min","1"),p(e,"step","1")},m(s,o){y(s,e,o),ce(e,n[15].maxRequests),t||(i=B(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[15].maxRequests&&ce(e,n[15].maxRequests)},d(s){s&&v(e),t=!1,i()}}}function f7(n){let e,t,i;function l(){n[9].call(e,n[16],n[17])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Interval*"),p(e,"min","1"),p(e,"step","1")},m(s,o){y(s,e,o),ce(e,n[15].duration),t||(i=B(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[15].duration&&ce(e,n[15].duration)},d(s){s&&v(e),t=!1,i()}}}function v1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;i=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".label",inlineError:!0,$$slots:{default:[a7]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".maxRequests",inlineError:!0,$$slots:{default:[u7]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".duration",inlineError:!0,$$slots:{default:[f7]},$$scope:{ctx:n}}});function k(){return n[10](n[17])}return{c(){e=b("tr"),t=b("td"),j(i.$$.fragment),l=C(),s=b("td"),j(o.$$.fragment),r=C(),a=b("td"),j(u.$$.fragment),f=C(),c=b("td"),d=b("button"),d.innerHTML='',m=C(),p(t,"class","col-tag"),p(s,"class","col-requests"),p(a,"class","col-burst"),p(d,"type","button"),p(d,"title","Remove rule"),p(d,"aria-label","Remove rule"),p(d,"class","btn btn-xs btn-circle btn-hint btn-transparent"),p(c,"class","col-action"),p(e,"class","rate-limit-row")},m(S,$){y(S,e,$),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),w(c,d),w(e,m),h=!0,_||(g=B(d,"click",k),_=!0)},p(S,$){n=S;const T={};$&524293&&(T.$$scope={dirty:$,ctx:n}),i.$set(T);const O={};$&524289&&(O.$$scope={dirty:$,ctx:n}),o.$set(O);const M={};$&524289&&(M.$$scope={dirty:$,ctx:n}),u.$set(M)},i(S){h||(E(i.$$.fragment,S),E(o.$$.fragment,S),E(u.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),D(o.$$.fragment,S),D(u.$$.fragment,S),h=!1},d(S){S&&v(e),H(i),H(o),H(u),_=!1,g()}}}function c7(n){let e,t,i=!V.isEmpty(n[0].rateLimits.rules),l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[r7,({uniqueId:m})=>({18:m}),({uniqueId:m})=>m?262144:0]},$$scope:{ctx:n}}});let d=i&&k1(n);return{c(){var m,h,_;j(e.$$.fragment),t=C(),d&&d.c(),l=C(),s=b("div"),o=b("button"),o.innerHTML=' Add rate limit rule',r=C(),a=b("a"),a.innerHTML="Learn more about the rate limit rules",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),Q(o,"btn-danger",(_=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:_.message),p(a,"href","https://pocketbase.io/docs/@todo"),p(a,"class","txt-nowrap txt-sm link-hint"),p(a,"target","_blank"),p(a,"rel","noopener noreferrer"),p(s,"class","flex m-t-sm")},m(m,h){q(e,m,h),y(m,t,h),d&&d.m(m,h),y(m,l,h),y(m,s,h),w(s,o),w(s,r),w(s,a),u=!0,f||(c=B(o,"click",n[11]),f=!0)},p(m,h){var g,k,S;const _={};h&786433&&(_.$$scope={dirty:h,ctx:m}),e.$set(_),h&1&&(i=!V.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&E(d,1)):(d=k1(m),d.c(),E(d,1),d.m(l.parentNode,l)):d&&(ae(),D(d,1,1,()=>{d=null}),ue()),(!u||h&2)&&Q(o,"btn-danger",(S=(k=(g=m[1])==null?void 0:g.rateLimits)==null?void 0:k.rules)==null?void 0:S.message)},i(m){u||(E(e.$$.fragment,m),E(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(v(t),v(l),v(s)),H(e,m),d&&d.d(m),f=!1,c()}}}function y1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function d7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function p7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function m7(n){let e,t,i,l,s,o,r=n[3]&&y1();function a(c,d){return c[0].rateLimits.enabled?p7:d7}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML=' Rate limiting',t=C(),i=b("div"),l=C(),r&&r.c(),s=C(),f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),r&&r.m(c,d),y(c,s,d),f.m(c,d),y(c,o,d)},p(c,d){c[3]?r?d&8&&E(r,1):(r=y1(),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(ae(),D(r,1,1,()=>{r=null}),ue()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),r&&r.d(c),f.d(c)}}}function h7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[m7],default:[c7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&524303&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _7(n,e,t){let i,l,s;Qe(n,En,S=>t(12,l=S)),Qe(n,yn,S=>t(1,s=S));let{formSettings:o}=e;const r=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let a=r;u();async function u(){await Du(),t(2,a=[]);for(let S of l)S.system||(a.push({value:S.name+":list"}),a.push({value:S.name+":view"}),S.type!="view"&&(a.push({value:S.name+":create"}),a.push({value:S.name+":update"}),a.push({value:S.name+":delete"})),S.type=="auth"&&(a.push({value:S.name+":listAuthMethods"}),a.push({value:S.name+":authRefresh"}),a.push({value:S.name+":auth"}),a.push({value:S.name+":authWithPassword"}),a.push({value:S.name+":authWithOAuth2"}),a.push({value:S.name+":authWithOTP"}),a.push({value:S.name+":requestOTP"}),a.push({value:S.name+":requestPasswordReset"}),a.push({value:S.name+":confirmPasswordReset"}),a.push({value:S.name+":requestVerification"}),a.push({value:S.name+":confirmVerification"}),a.push({value:S.name+":requestEmailChange"}),a.push({value:S.name+":confirmEmailChange"})),S.fields.find($=>$.type=="file")&&a.push({value:S.name+":file"}));t(2,a=a.concat(r))}function f(){Yt({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function c(S){Yt({}),o.rateLimits.rules.splice(S,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function d(){o.rateLimits.enabled=this.checked,t(0,o)}function m(S,$){n.$$.not_equal($.label,S)&&($.label=S,t(0,o))}function h(S,$){S[$].maxRequests=gt(this.value),t(0,o)}function _(S,$){S[$].duration=gt(this.value),t(0,o)}const g=S=>c(S),k=()=>f();return n.$$set=S=>{"formSettings"in S&&t(0,o=S.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=!V.isEmpty(s==null?void 0:s.rateLimits))},[o,s,a,i,f,c,d,m,h,_,g,k]}class g7 extends we{constructor(e){super(),ye(this,e,_7,h7,_e,{formSettings:0})}}function b7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P,N,R,z,F,U;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[v7,({uniqueId:$e})=>({23:$e}),({uniqueId:$e})=>$e?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[y7,({uniqueId:$e})=>({23:$e}),({uniqueId:$e})=>$e?8388608:0]},$$scope:{ctx:n}}});function J($e){n[11]($e)}let K={healthData:n[3]};n[0]!==void 0&&(K.formSettings=n[0]),f=new i7({props:K}),ie.push(()=>be(f,"formSettings",J));function x($e){n[12]($e)}let X={};n[0]!==void 0&&(X.formSettings=n[0]),m=new g7({props:X}),ie.push(()=>be(m,"formSettings",x));function oe($e){n[13]($e)}let Se={};n[0]!==void 0&&(Se.formSettings=n[0]),g=new YN({props:Se}),ie.push(()=>be(g,"formSettings",oe)),T=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[w7,({uniqueId:$e})=>({23:$e}),({uniqueId:$e})=>$e?8388608:0]},$$scope:{ctx:n}}});let ge=n[4]&&w1(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),u=b("div"),j(f.$$.fragment),d=C(),j(m.$$.fragment),_=C(),j(g.$$.fragment),S=C(),$=b("div"),j(T.$$.fragment),O=C(),M=b("div"),L=b("div"),I=C(),ge&&ge.c(),A=C(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],Q(P,"btn-loading",n[2]),p(M,"class","flex m-t-base")},m($e,Ye){y($e,e,Ye),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),w(a,u),q(f,u,null),w(u,d),q(m,u,null),w(u,_),q(g,u,null),w(e,S),w(e,$),q(T,$,null),y($e,O,Ye),y($e,M,Ye),w(M,L),w(M,I),ge&&ge.m(M,null),w(M,A),w(M,P),w(P,N),z=!0,F||(U=B(P,"click",n[16]),F=!0)},p($e,Ye){const nt={};Ye&25165825&&(nt.$$scope={dirty:Ye,ctx:$e}),i.$set(nt);const xe={};Ye&25165825&&(xe.$$scope={dirty:Ye,ctx:$e}),o.$set(xe);const We={};Ye&8&&(We.healthData=$e[3]),!c&&Ye&1&&(c=!0,We.formSettings=$e[0],Te(()=>c=!1)),f.$set(We);const rt={};!h&&Ye&1&&(h=!0,rt.formSettings=$e[0],Te(()=>h=!1)),m.$set(rt);const Ze={};!k&&Ye&1&&(k=!0,Ze.formSettings=$e[0],Te(()=>k=!1)),g.$set(Ze);const at={};Ye&25165825&&(at.$$scope={dirty:Ye,ctx:$e}),T.$set(at),$e[4]?ge?ge.p($e,Ye):(ge=w1($e),ge.c(),ge.m(M,A)):ge&&(ge.d(1),ge=null),(!z||Ye&20&&R!==(R=!$e[4]||$e[2]))&&(P.disabled=R),(!z||Ye&4)&&Q(P,"btn-loading",$e[2])},i($e){z||(E(i.$$.fragment,$e),E(o.$$.fragment,$e),E(f.$$.fragment,$e),E(m.$$.fragment,$e),E(g.$$.fragment,$e),E(T.$$.fragment,$e),z=!0)},o($e){D(i.$$.fragment,$e),D(o.$$.fragment,$e),D(f.$$.fragment,$e),D(m.$$.fragment,$e),D(g.$$.fragment,$e),D(T.$$.fragment,$e),z=!1},d($e){$e&&(v(e),v(O),v(M)),H(i),H(o),H(f),H(m),H(g),H(T),ge&&ge.d(),F=!1,U()}}}function k7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function v7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application name"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.appName),r||(a=B(s,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&ce(s,u[0].meta.appName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function y7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application URL"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.appURL),r||(a=B(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appURL&&ce(s,u[0].meta.appURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function w7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){y(c,e,d),e.checked=n[0].meta.hideControls,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[14]),Ee(He.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function w1(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){y(s,e,o),w(e,t),i||(l=B(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function S7(n){let e,t,i,l,s,o,r,a,u;const f=[k7,b7],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='',t=C(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){y(m,e,h),y(m,t,h),y(m,i,h),w(i,l),c[s].m(l,null),r=!0,a||(u=B(l,"submit",et(n[5])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(ae(),D(c[_],1,1,()=>{c[_]=null}),ue(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,u()}}}function T7(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[S7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function $7(n,e,t){let i,l,s,o;Qe(n,Dl,P=>t(17,l=P)),Qe(n,gr,P=>t(18,s=P)),Qe(n,fn,P=>t(19,o=P)),Rn(fn,o="Application settings",o);let r={},a={},u=!1,f=!1,c="",d={};h();async function m(){var P;try{t(3,d=((P=await me.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function h(){t(1,u=!0);try{const P=await me.settings.getAll()||{};g(P),await m()}catch(P){me.error(P)}t(1,u=!1)}async function _(){if(!(f||!i)){t(2,f=!0);try{const P=await me.settings.update(V.filterRedactedProps(a));g(P),await m(),en("Successfully saved application settings.")}catch(P){me.error(P)}t(2,f=!1)}}function g(P={}){var N,R;Rn(gr,s=(N=P==null?void 0:P.meta)==null?void 0:N.appName,s),Rn(Dl,l=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),l),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{tags:[]}}),t(7,r=JSON.parse(JSON.stringify(a)))}function k(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function $(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function M(P){a=P,t(0,a)}function L(){a.meta.hideControls=this.checked,t(0,a)}const I=()=>k(),A=()=>_();return n.$$.update=()=>{n.$$.dirty&128&&t(8,c=JSON.stringify(r)),n.$$.dirty&257&&t(4,i=c!=JSON.stringify(a))},[a,u,f,d,i,_,k,r,c,S,$,T,O,M,L,I,A]}class C7 extends we{constructor(e){super(),ye(this,e,$7,T7,_e,{})}}function O7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Backup name"),l=C(),s=b("input"),r=C(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[2]),y(c,r,d),y(c,a,d),u||(f=B(s,"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(s,"id",o),d&4&&s.value!==c[2]&&ce(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function E7(n){let e,t,i,l,s,o,r;return l=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[O7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + extract the user IP.

    When using such proxy, to avoid spoofing it is recommended to:

    • use headers that are controlled only by the proxy and cannot be manually set by the users
    • make sure that the PocketBase server can be accessed only through the proxy

    You can clear the headers field if PocketBase is not deployed behind a proxy.

    `,E=C(),I=b("div"),L=b("div"),j(A.$$.fragment),P=C(),N=b("div"),j(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(O,"class","content m-b-sm"),p(L,"class","col-lg-9"),p(N,"class","col-lg-3"),p(I,"class","grid grid-sm")},m(J,K){y(J,e,K),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,a),w(i,u),w(i,f),w(t,c),w(t,d),w(t,m),w(t,h),w(h,_),w(h,g),w(h,k),w(k,$),y(J,T,K),y(J,O,K),y(J,E,K),y(J,I,K),w(I,L),q(A,L,null),w(I,P),w(I,N),q(R,N,null),z=!0,F||(U=Ee(He.call(null,f,`Must show your actual IP. +If not, set the correct proxy header.`)),F=!0)},p(J,K){(!z||K&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&re(a,r),(!z||K&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&re($,S);const x={};K&1114117&&(x.$$scope={dirty:K,ctx:J}),A.$set(x);const X={};K&1114113&&(X.$$scope={dirty:K,ctx:J}),R.$set(X)},i(J){z||(M(A.$$.fragment,J),M(R.$$.fragment,J),z=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),z=!1},d(J){J&&(v(e),v(T),v(O),v(E),v(I)),H(A),H(R),F=!1,U()}}}function QN(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function xN(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){y(l,e,s),t||(i=Ee(He.call(null,e,`Detected proxy header. +It is recommend to list it as trusted.`)),t=!0)},d(l){l&&v(e),t=!1,i()}}}function e7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function t7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function h1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function n7(n){let e,t,i,l,s,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return xN;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return QN}let m=d(n,-1),h=m&&m(n);function _($,T){return $[3]?t7:e7}let g=_(n),k=g(n),S=n[4]&&h1();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),l.textContent="User IP proxy headers",s=C(),h&&h.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ke(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){y($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),y($,r,T),y($,a,T),y($,u,T),k.m($,T),y($,f,T),S&&S.m($,T),y($,c,T)},p($,T){m!==(m=d($,T))&&(h&&h.d(1),h=m&&m($),h&&(h.c(),h.m(e,null))),g!==(g=_($))&&(k.d(1),k=g($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&M(S,1):(S=h1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(ae(),D(S,1,1,()=>{S=null}),ue())},d($){$&&(v(e),v(r),v(a),v(u),v(f),v(c)),h&&h.d(),k.d($),S&&S.d($)}}}function i7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[n7],default:[XN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l7(n,e,t){let i,l,s,o,r,a;Qe(n,yn,$=>t(10,a=$));const u=["X-Forward-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function _($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const g=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!V.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!V.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter($=>$!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,_,g,k,S]}class s7 extends we{constructor(e){super(),ye(this,e,l7,i7,_e,{formSettings:0,healthData:1})}}function _1(n,e,t){const i=n.slice();return i[5]=e[t],i}function g1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=B(t),e.__value=l=n[5].value,ce(e,e.__value)},m(s,o){y(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&re(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,ce(e,e.__value))},d(s){s&&v(e)}}}function o7(n){let e,t,i,l,s,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c{t(0,s=u.target.value)};return n.$$set=u=>{e=ze(ze({},e),Ut(u)),t(3,l=lt(e,i)),"value"in u&&t(0,s=u.value),"options"in u&&t(1,o=u.options)},[s,o,r,l,a]}class a7 extends we{constructor(e){super(),ye(this,e,r7,o7,_e,{value:0,options:1})}}function b1(n,e,t){const i=n.slice();return i[19]=e[t],i}function k1(n,e,t){const i=n.slice();return i[22]=e[t],i[23]=e,i[24]=t,i}function u7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){y(u,e,f),e.checked=n[0].rateLimits.enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[8]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&1&&(e.checked=u[0].rateLimits.enabled),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function v1(n){let e,t,i,l,s,o=de(n[0].rateLimits.rules||[]),r=[];for(let u=0;uD(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML="Rate limit label Max requests (per IP) Interval (in seconds) ",i=C(),l=b("tbody");for(let u=0;ube(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r&4&&(a.options=n[2]),!t&&r&1&&(t=!0,a.value=n[22].label,Te(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function c7(n){let e,t,i;function l(){n[10].call(e,n[23],n[24])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Max requests*"),p(e,"min","1"),p(e,"step","1")},m(s,o){y(s,e,o),ce(e,n[22].maxRequests),t||(i=W(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[22].maxRequests&&ce(e,n[22].maxRequests)},d(s){s&&v(e),t=!1,i()}}}function d7(n){let e,t,i;function l(){n[11].call(e,n[23],n[24])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Interval*"),p(e,"min","1"),p(e,"step","1")},m(s,o){y(s,e,o),ce(e,n[22].duration),t||(i=W(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[22].duration&&ce(e,n[22].duration)},d(s){s&&v(e),t=!1,i()}}}function y1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;i=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[24]+".label",inlineError:!0,$$slots:{default:[f7]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[24]+".maxRequests",inlineError:!0,$$slots:{default:[c7]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[24]+".duration",inlineError:!0,$$slots:{default:[d7]},$$scope:{ctx:n}}});function k(){return n[12](n[24])}return{c(){e=b("tr"),t=b("td"),j(i.$$.fragment),l=C(),s=b("td"),j(o.$$.fragment),r=C(),a=b("td"),j(u.$$.fragment),f=C(),c=b("td"),d=b("button"),d.innerHTML='',m=C(),p(t,"class","col-tag"),p(s,"class","col-requests"),p(a,"class","col-burst"),p(d,"type","button"),p(d,"title","Remove rule"),p(d,"aria-label","Remove rule"),p(d,"class","btn btn-xs btn-circle btn-hint btn-transparent"),p(c,"class","col-action"),p(e,"class","rate-limit-row")},m(S,$){y(S,e,$),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),w(c,d),w(e,m),h=!0,_||(g=W(d,"click",k),_=!0)},p(S,$){n=S;const T={};$&67108869&&(T.$$scope={dirty:$,ctx:n}),i.$set(T);const O={};$&67108865&&(O.$$scope={dirty:$,ctx:n}),o.$set(O);const E={};$&67108865&&(E.$$scope={dirty:$,ctx:n}),u.$set(E)},i(S){h||(M(i.$$.fragment,S),M(o.$$.fragment,S),M(u.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),D(o.$$.fragment,S),D(u.$$.fragment,S),h=!1},d(S){S&&v(e),H(i),H(o),H(u),_=!1,g()}}}function p7(n){let e,t,i=!V.isEmpty(n[0].rateLimits.rules),l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[u7,({uniqueId:m})=>({25:m}),({uniqueId:m})=>m?33554432:0]},$$scope:{ctx:n}}});let d=i&&v1(n);return{c(){var m,h,_;j(e.$$.fragment),t=C(),d&&d.c(),l=C(),s=b("div"),o=b("button"),o.innerHTML=' Add rate limit rule',r=C(),a=b("button"),a.innerHTML="Learn more about the rate limit rules",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),Q(o,"btn-danger",(_=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:_.message),p(a,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(s,"class","flex m-t-sm")},m(m,h){q(e,m,h),y(m,t,h),d&&d.m(m,h),y(m,l,h),y(m,s,h),w(s,o),w(s,r),w(s,a),u=!0,f||(c=[W(o,"click",n[13]),W(a,"click",n[14])],f=!0)},p(m,h){var g,k,S;const _={};h&100663297&&(_.$$scope={dirty:h,ctx:m}),e.$set(_),h&1&&(i=!V.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&M(d,1)):(d=v1(m),d.c(),M(d,1),d.m(l.parentNode,l)):d&&(ae(),D(d,1,1,()=>{d=null}),ue()),(!u||h&2)&&Q(o,"btn-danger",(S=(k=(g=m[1])==null?void 0:g.rateLimits)==null?void 0:k.rules)==null?void 0:S.message)},i(m){u||(M(e.$$.fragment,m),M(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(v(t),v(l),v(s)),H(e,m),d&&d.d(m),f=!1,Ie(c)}}}function w1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){y(o,e,r),i=!0,l||(s=Ee(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function m7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function h7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function _7(n){let e,t,i,l,s,o,r=n[4]&&w1();function a(c,d){return c[0].rateLimits.enabled?h7:m7}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML=' Rate limiting',t=C(),i=b("div"),l=C(),r&&r.c(),s=C(),f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){y(c,e,d),y(c,t,d),y(c,i,d),y(c,l,d),r&&r.m(c,d),y(c,s,d),f.m(c,d),y(c,o,d)},p(c,d){c[4]?r?d&16&&M(r,1):(r=w1(),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(ae(),D(r,1,1,()=>{r=null}),ue()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),r&&r.d(c),f.d(c)}}}function g7(n){let e;return{c(){e=b("em"),e.textContent=`(${n[19].description})`,p(e,"class","txt-hint")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function S1(n){let e,t=n[19].value.replace("*:",":")+"",i,l,s,o=n[19].description&&g7(n);return{c(){e=b("li"),i=B(t),l=C(),o&&o.c(),s=C(),p(e,"class","m-0")},m(r,a){y(r,e,a),w(e,i),w(e,l),o&&o.m(e,null),w(e,s)},p(r,a){r[19].description&&o.p(r,a)},d(r){r&&v(e),o&&o.d()}}}function b7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L=de(n[5]),A=[];for(let P=0;P[METHOD ]/my/path - full exact route match ( + must be without trailing slash ; "METHOD" is optional). +
    For example: +
    • /hello - matches GET /hello, POST /hello, etc.
    • POST /hello - matches only POST /hello
    `,s=C(),o=b("li"),o.innerHTML=`[METHOD ]/my/prefix/ - path prefix ( + must end with trailing slash; + "METHOD" is optional). For example: +
    • /hello/ - matches GET /hello, + POST /hello/a/b/c, etc.
    • POST /hello/ - matches POST /hello, + POST /hello/a/b/c, etc.
    `,r=C(),a=b("li"),u=b("code"),u.textContent="collectionName:predefinedTag",f=B(` - targets a specific action of a single collection. To + apply the rule for all collections you can use the `),c=b("code"),c.textContent="*",d=B(` wildcard. For example: + `),m=b("code"),m.textContent="posts:create",h=B(", "),_=b("code"),_.textContent="users:listAuthMethods",g=B(", "),k=b("code"),k.textContent="*:auth",S=B(`. + `),$=b("br"),T=B(` + The predifined collection tags are (`),O=b("em"),O.textContent="there should be autocomplete once you start typing",E=B(`): + `),I=b("ul");for(let P=0;Pt(17,l=E)),Qe(n,yn,E=>t(1,s=E));let{formSettings:o}=e;const r=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let a=r,u;f();async function f(){await Du(),t(2,a=[]);for(let E of l)E.system||(a.push({value:E.name+":list"}),a.push({value:E.name+":view"}),E.type!="view"&&(a.push({value:E.name+":create"}),a.push({value:E.name+":update"}),a.push({value:E.name+":delete"})),E.type=="auth"&&(a.push({value:E.name+":listAuthMethods"}),a.push({value:E.name+":authRefresh"}),a.push({value:E.name+":auth"}),a.push({value:E.name+":authWithPassword"}),a.push({value:E.name+":authWithOAuth2"}),a.push({value:E.name+":authWithOTP"}),a.push({value:E.name+":requestOTP"}),a.push({value:E.name+":requestPasswordReset"}),a.push({value:E.name+":confirmPasswordReset"}),a.push({value:E.name+":requestVerification"}),a.push({value:E.name+":confirmVerification"}),a.push({value:E.name+":requestEmailChange"}),a.push({value:E.name+":confirmEmailChange"})),E.fields.find(I=>I.type=="file")&&a.push({value:E.name+":file"}));t(2,a=a.concat(r))}function c(){Yt({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function d(E){Yt({}),o.rateLimits.rules.splice(E,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function m(){o.rateLimits.enabled=this.checked,t(0,o)}function h(E,I){n.$$.not_equal(I.label,E)&&(I.label=E,t(0,o))}function _(E,I){E[I].maxRequests=gt(this.value),t(0,o)}function g(E,I){E[I].duration=gt(this.value),t(0,o)}const k=E=>d(E),S=()=>c(),$=()=>u==null?void 0:u.show(),T=()=>u==null?void 0:u.hide();function O(E){ie[E?"unshift":"push"](()=>{u=E,t(3,u)})}return n.$$set=E=>{"formSettings"in E&&t(0,o=E.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(4,i=!V.isEmpty(s==null?void 0:s.rateLimits))},[o,s,a,u,i,r,c,d,m,h,_,g,k,S,$,T,O]}class S7 extends we{constructor(e){super(),ye(this,e,w7,y7,_e,{formSettings:0})}}function T7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P,N,R,z,F,U;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[C7,({uniqueId:$e})=>({23:$e}),({uniqueId:$e})=>$e?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[O7,({uniqueId:$e})=>({23:$e}),({uniqueId:$e})=>$e?8388608:0]},$$scope:{ctx:n}}});function J($e){n[11]($e)}let K={healthData:n[3]};n[0]!==void 0&&(K.formSettings=n[0]),f=new s7({props:K}),ie.push(()=>be(f,"formSettings",J));function x($e){n[12]($e)}let X={};n[0]!==void 0&&(X.formSettings=n[0]),m=new S7({props:X}),ie.push(()=>be(m,"formSettings",x));function oe($e){n[13]($e)}let Se={};n[0]!==void 0&&(Se.formSettings=n[0]),g=new JN({props:Se}),ie.push(()=>be(g,"formSettings",oe)),T=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[E7,({uniqueId:$e})=>({23:$e}),({uniqueId:$e})=>$e?8388608:0]},$$scope:{ctx:n}}});let ge=n[4]&&T1(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),u=b("div"),j(f.$$.fragment),d=C(),j(m.$$.fragment),_=C(),j(g.$$.fragment),S=C(),$=b("div"),j(T.$$.fragment),O=C(),E=b("div"),I=b("div"),L=C(),ge&&ge.c(),A=C(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid"),p(I,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],Q(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m($e,Ye){y($e,e,Ye),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),w(a,u),q(f,u,null),w(u,d),q(m,u,null),w(u,_),q(g,u,null),w(e,S),w(e,$),q(T,$,null),y($e,O,Ye),y($e,E,Ye),w(E,I),w(E,L),ge&&ge.m(E,null),w(E,A),w(E,P),w(P,N),z=!0,F||(U=W(P,"click",n[16]),F=!0)},p($e,Ye){const nt={};Ye&25165825&&(nt.$$scope={dirty:Ye,ctx:$e}),i.$set(nt);const xe={};Ye&25165825&&(xe.$$scope={dirty:Ye,ctx:$e}),o.$set(xe);const We={};Ye&8&&(We.healthData=$e[3]),!c&&Ye&1&&(c=!0,We.formSettings=$e[0],Te(()=>c=!1)),f.$set(We);const rt={};!h&&Ye&1&&(h=!0,rt.formSettings=$e[0],Te(()=>h=!1)),m.$set(rt);const Ze={};!k&&Ye&1&&(k=!0,Ze.formSettings=$e[0],Te(()=>k=!1)),g.$set(Ze);const at={};Ye&25165825&&(at.$$scope={dirty:Ye,ctx:$e}),T.$set(at),$e[4]?ge?ge.p($e,Ye):(ge=T1($e),ge.c(),ge.m(E,A)):ge&&(ge.d(1),ge=null),(!z||Ye&20&&R!==(R=!$e[4]||$e[2]))&&(P.disabled=R),(!z||Ye&4)&&Q(P,"btn-loading",$e[2])},i($e){z||(M(i.$$.fragment,$e),M(o.$$.fragment,$e),M(f.$$.fragment,$e),M(m.$$.fragment,$e),M(g.$$.fragment,$e),M(T.$$.fragment,$e),z=!0)},o($e){D(i.$$.fragment,$e),D(o.$$.fragment,$e),D(f.$$.fragment,$e),D(m.$$.fragment,$e),D(g.$$.fragment,$e),D(T.$$.fragment,$e),z=!1},d($e){$e&&(v(e),v(O),v(E)),H(i),H(o),H(f),H(m),H(g),H(T),ge&&ge.d(),F=!1,U()}}}function $7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function C7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Application name"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.appName),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&ce(s,u[0].meta.appName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function O7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Application URL"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.appURL),r||(a=W(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appURL&&ce(s,u[0].meta.appURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function E7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){y(c,e,d),e.checked=n[0].meta.hideControls,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[14]),Ee(He.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function T1(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){y(s,e,o),w(e,t),i||(l=W(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function M7(n){let e,t,i,l,s,o,r,a,u;const f=[$7,T7],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='',t=C(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){y(m,e,h),y(m,t,h),y(m,i,h),w(i,l),c[s].m(l,null),r=!0,a||(u=W(l,"submit",et(n[5])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(ae(),D(c[_],1,1,()=>{c[_]=null}),ue(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(l,null))},i(m){r||(M(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,u()}}}function D7(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[M7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function I7(n,e,t){let i,l,s,o;Qe(n,Dl,P=>t(17,l=P)),Qe(n,gr,P=>t(18,s=P)),Qe(n,fn,P=>t(19,o=P)),Rn(fn,o="Application settings",o);let r={},a={},u=!1,f=!1,c="",d={};h();async function m(){var P;try{t(3,d=((P=await me.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function h(){t(1,u=!0);try{const P=await me.settings.getAll()||{};g(P),await m()}catch(P){me.error(P)}t(1,u=!1)}async function _(){if(!(f||!i)){t(2,f=!0);try{const P=await me.settings.update(V.filterRedactedProps(a));g(P),await m(),tn("Successfully saved application settings.")}catch(P){me.error(P)}t(2,f=!1)}}function g(P={}){var N,R;Rn(gr,s=(N=P==null?void 0:P.meta)==null?void 0:N.appName,s),Rn(Dl,l=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),l),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{tags:[]}}),t(7,r=JSON.parse(JSON.stringify(a)))}function k(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function $(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function I(){a.meta.hideControls=this.checked,t(0,a)}const L=()=>k(),A=()=>_();return n.$$.update=()=>{n.$$.dirty&128&&t(8,c=JSON.stringify(r)),n.$$.dirty&257&&t(4,i=c!=JSON.stringify(a))},[a,u,f,d,i,_,k,r,c,S,$,T,O,E,I,L,A]}class L7 extends we{constructor(e){super(),ye(this,e,I7,D7,_e,{})}}function A7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Backup name"),l=C(),s=b("input"),r=C(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){y(c,e,d),w(e,t),y(c,l,d),y(c,s,d),ce(s,n[2]),y(c,r,d),y(c,a,d),u||(f=W(s,"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(s,"id",o),d&4&&s.value!==c[2]&&ce(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function P7(n){let e,t,i,l,s,o,r;return l=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[A7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

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

    `,t=C(),i=b("form"),j(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),q(l,i,null),s=!0,o||(r=B(i,"submit",et(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(E(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),H(l),o=!1,r()}}}function M7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function D7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],Q(l,"btn-loading",n[3])},m(a,u){y(a,e,u),w(e,t),y(a,i,u),y(a,l,u),w(l,s),o||(r=B(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&Q(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function I7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[D7],header:[M7],default:[E7]},$$scope:{ctx:n}};return e=new nn({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function L7(n,e,t){const i=bt(),l="backup_create_"+V.randomString(5);let s,o="",r=!1,a;function u(S){Yt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await me.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),en("Successfully generated new backup.")}catch(S){S.isAbort||me.error(S)}clearTimeout(a),t(3,r=!1)}}ro(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function g(S){Ne.call(this,n,S)}function k(S){Ne.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,_,g,k]}class A7 extends we{constructor(e){super(),ye(this,e,L7,I7,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function P7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=C(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[2]),r||(a=B(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function N7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;return u=new fi({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[P7,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please proceed with caution and use it only with trusted backups!

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

    The restore operation will attempt to replace your existing pb_data with the one from + separately since they are not locally stored and will not be included in the final backup!

    `,t=C(),i=b("form"),j(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){y(a,e,u),y(a,t,u),y(a,i,u),q(l,i,null),s=!0,o||(r=W(i,"submit",et(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),H(l),o=!1,r()}}}function N7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function R7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],Q(l,"btn-loading",n[3])},m(a,u){y(a,e,u),w(e,t),y(a,i,u),y(a,l,u),w(l,s),o||(r=W(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&Q(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function F7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[R7],header:[N7],default:[P7]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function q7(n,e,t){const i=bt(),l="backup_create_"+V.randomString(5);let s,o="",r=!1,a;function u(S){Yt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await me.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),tn("Successfully generated new backup.")}catch(S){S.isAbort||me.error(S)}clearTimeout(a),t(3,r=!1)}}ro(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function g(S){Ne.call(this,n,S)}function k(S){Ne.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,_,g,k]}class H7 extends we{constructor(e){super(),ye(this,e,q7,F7,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function j7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Backup name"),l=C(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[2]),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function z7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;return u=new fi({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[j7,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please proceed with caution and use it only with trusted backups!

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

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

    This means that on success all of your data (including app settings, users, superusers, etc.) will be replaced with the ones from the backup.

    Nothing will happen if the backup is invalid or incompatible (ex. missing - data.db file).

    `,t=C(),i=b("div"),l=W(`Type the backup name - `),s=b("div"),o=b("span"),r=W(n[1]),a=C(),j(u.$$.fragment),f=W(` - to confirm:`),c=C(),d=b("form"),j(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){y(k,e,S),y(k,t,S),y(k,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),q(u,s,null),w(i,f),y(k,c,S),y(k,d,S),q(m,d,null),h=!0,_||(g=B(d,"submit",et(n[7])),_=!0)},p(k,S){(!h||S&2)&&re(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(E(u.$$.fragment,k),E(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),H(u),H(m),_=!1,g()}}}function R7(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){y(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&re(l,s[1])},d(s){s&&v(e)}}}function F7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=C(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],Q(l,"btn-loading",n[4])},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&Q(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function q7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[F7],header:[R7],default:[N7]},$$scope:{ctx:n}};return e=new nn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function H7(n,e,t){let i;const l="backup_restore_"+V.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Yt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await me.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Ci(((S=$.response)==null?void 0:S.message)||$.message))}}}ro(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ne.call(this,n,S)}function k(S){Ne.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,_,g,k]}class j7 extends we{constructor(e){super(),ye(this,e,H7,q7,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function S1(n,e,t){const i=n.slice();return i[22]=e[t],i}function T1(n,e,t){const i=n.slice();return i[19]=e[t],i}function z7(n){let e=[],t=new Map,i,l,s=pe(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){y(t,e,i)},p:te,d(t){t&&v(e)}}}function C1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=V.formattedFileSize(e[22].size)+"",h,_,g,k,S,$,T,O,M,L,I,A,P,N,R,z,F,U,J,K;function x(){return e[10](e[22])}function X(){return e[11](e[22])}function oe(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=C(),s=b("div"),o=b("span"),a=W(r),f=C(),c=b("span"),d=W("("),h=W(m),_=W(")"),g=C(),k=b("div"),S=b("button"),$=b("i"),O=C(),M=b("button"),L=b("i"),A=C(),P=b("button"),N=b("i"),z=C(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(L,"class","ri-restart-line"),p(M,"type","button"),p(M,"class","btn btn-sm btn-circle btn-hint btn-transparent"),M.disabled=I=e[6][e[22].key],p(M,"aria-label","Restore"),p(N,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=R=e[6][e[22].key],p(P,"aria-label","Delete"),Q(P,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(Se,ge){y(Se,t,ge),w(t,i),w(t,l),w(t,s),w(s,o),w(o,a),w(s,f),w(s,c),w(c,d),w(c,h),w(c,_),w(t,g),w(t,k),w(k,S),w(S,$),w(k,O),w(k,M),w(M,L),w(k,A),w(k,P),w(P,N),w(t,z),U=!0,J||(K=[Ee(He.call(null,S,"Download")),B(S,"click",et(x)),Ee(He.call(null,M,"Restore")),B(M,"click",et(X)),Ee(He.call(null,P,"Delete")),B(P,"click",et(oe))],J=!0)},p(Se,ge){e=Se,(!U||ge&8)&&r!==(r=e[22].key+"")&&re(a,r),(!U||ge&8&&u!==(u=e[22].key))&&p(o,"title",u),(!U||ge&8)&&m!==(m=V.formattedFileSize(e[22].size)+"")&&re(h,m),(!U||ge&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!U||ge&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!U||ge&72&&I!==(I=e[6][e[22].key]))&&(M.disabled=I),(!U||ge&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!U||ge&72)&&Q(P,"btn-loading",e[6][e[22].key])},i(Se){U||(Se&&tt(()=>{U&&(F||(F=je(t,mt,{duration:150},!0)),F.run(1))}),U=!0)},o(Se){Se&&(F||(F=je(t,mt,{duration:150},!1)),F.run(0)),U=!1},d(Se){Se&&v(t),Se&&F&&F.end(),J=!1,Ie(K)}}}function O1(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function V7(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function B7(n){let e,t,i;return{c(){e=b("i"),t=C(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function W7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;const g=[U7,z7],k=[];function S(I,A){return I[4]?0:1}i=S(n),l=k[i]=g[i](n);function $(I,A){return I[7]?B7:V7}let T=$(n),O=T(n),M={};f=new A7({props:M}),n[14](f),f.$on("submit",n[15]);let L={};return d=new j7({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=C(),o=b("div"),r=b("button"),O.c(),u=C(),j(f.$$.fragment),c=C(),j(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){y(I,e,A),w(e,t),k[i].m(t,null),w(e,s),w(e,o),w(o,r),O.m(r,null),y(I,u,A),q(f,I,A),y(I,c,A),q(d,I,A),m=!0,h||(_=B(r,"click",n[13]),h=!0)},p(I,[A]){let P=i;i=S(I),i===P?k[i].p(I,A):(ae(),D(k[P],1,1,()=>{k[P]=null}),ue(),l=k[i],l?l.p(I,A):(l=k[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),T!==(T=$(I))&&(O.d(1),O=T(I),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(E(l),E(f.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){D(l),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(u),v(c)),k[i].d(),O.d(),n[14](null),H(f,I),n[16](null),H(d,I),h=!1,_()}}}function Y7(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),h();async function f(){t(4,o=!0);try{t(3,s=await me.backups.getFullList()),s.sort((M,L)=>M.modifiedL.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(me.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const L=await me.getSuperuserFileToken(),I=me.backups.getDownloadURL(L,M);V.download(I)}catch(L){L.isAbort||me.error(L)}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 me.backups.delete(M),V.removeByKey(s,"name",M),f(),en(`Successfully deleted ${M}.`)}catch(L){L.isAbort||me.error(L)}delete a[M],t(6,a)}}async function h(){var M;try{const L=await me.health.check({$autoCancel:!1}),I=u;t(7,u=((M=L==null?void 0:L.data)==null?void 0:M.canBackup)||!1),I!=u&&u&&f()}catch{}}Zt(()=>{let M=setInterval(()=>{h()},3e3);return()=>{clearInterval(M)}});const _=M=>c(M.key),g=M=>l.show(M.key),k=M=>d(M.key),S=()=>i==null?void 0:i.show();function $(M){ie[M?"unshift":"push"](()=>{i=M,t(1,i)})}const T=()=>{f()};function O(M){ie[M?"unshift":"push"](()=>{l=M,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,_,g,k,S,$,T,O]}class K7 extends we{constructor(e){super(),ye(this,e,Y7,W7,_e,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const J7=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),E1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function Z7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){y(u,e,f),e.checked=n[0].enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[9]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&re(s,u[4]),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function M1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[G7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[X7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[Q7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[x7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),_=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[eR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new fe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[tR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("div"),j(_.$$.fragment),g=C(),k=b("div"),j(S.$$.fragment),$=C(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){y(L,e,I),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),q(_,h,null),w(e,g),w(e,k),q(S,k,null),w(e,$),w(e,T),M=!0},p(L,I){const A={};I&8&&(A.name=L[3]+".endpoint"),I&8519681&&(A.$$scope={dirty:I,ctx:L}),i.$set(A);const P={};I&8&&(P.name=L[3]+".bucket"),I&8519681&&(P.$$scope={dirty:I,ctx:L}),o.$set(P);const N={};I&8&&(N.name=L[3]+".region"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),u.$set(N);const R={};I&8&&(R.name=L[3]+".accessKey"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),d.$set(R);const z={};I&8&&(z.name=L[3]+".secret"),I&8519713&&(z.$$scope={dirty:I,ctx:L}),_.$set(z);const F={};I&8&&(F.name=L[3]+".forcePathStyle"),I&8519681&&(F.$$scope={dirty:I,ctx:L}),S.$set(F)},i(L){M||(E(i.$$.fragment,L),E(o.$$.fragment,L),E(u.$$.fragment,L),E(d.$$.fragment,L),E(_.$$.fragment,L),E(S.$$.fragment,L),L&&tt(()=>{M&&(O||(O=je(e,mt,{duration:150},!0)),O.run(1))}),M=!0)},o(L){D(i.$$.fragment,L),D(o.$$.fragment,L),D(u.$$.fragment,L),D(d.$$.fragment,L),D(_.$$.fragment,L),D(S.$$.fragment,L),L&&(O||(O=je(e,mt,{duration:150},!1)),O.run(0)),M=!1},d(L){L&&v(e),H(i),H(o),H(u),H(d),H(_),H(S),L&&O&&O.end()}}}function G7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].endpoint),r||(a=B(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].endpoint&&ce(s,u[0].endpoint)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function X7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Bucket"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].bucket),r||(a=B(s,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].bucket&&ce(s,u[0].bucket)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Q7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Region"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].region),r||(a=B(s,"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(s,"id",o),f&1&&s.value!==u[0].region&&ce(s,u[0].region)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function x7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Access key"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].accessKey),r||(a=B(s,"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(s,"id",o),f&1&&s.value!==u[0].accessKey&&ce(s,u[0].accessKey)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function eR(n){let e,t,i,l,s,o,r,a;function u(d){n[14](d)}function f(d){n[15](d)}let c={required:!0,id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[0].secret!==void 0&&(c.value=n[0].secret),s=new xu({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Te(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,Te(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function tR(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){y(c,e,d),e.checked=n[0].forcePathStyle,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[16]),Ee(He.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&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function nR(n){let e,t,i,l,s;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[Z7,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=It(o,n,n[17],E1);let a=n[0].enabled&&M1(n);return{c(){j(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),l=ke()},m(u,f){q(e,u,f),y(u,t,f),r&&r.m(u,f),y(u,i,f),a&&a.m(u,f),y(u,l,f),s=!0},p(u,[f]){const c={};f&8519697&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&131079)&&At(r,o,u,u[17],s?Lt(o,u[17],f,J7):Pt(u[17]),E1),u[0].enabled?a?(a.p(u,f),f&1&&E(a,1)):(a=M1(u),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(ae(),D(a,1,1,()=>{a=null}),ue())},i(u){s||(E(e.$$.fragment,u),E(r,u),E(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(v(t),v(i),v(l)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const Aa="s3_test_request";function iR(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null,h=!1;function _(){t(5,h=!!(s!=null&&s.accessKey))}function g(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{k()},P)}async function k(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;me.cancelRequest(Aa),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(Aa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await me.settings.testS3(u,{$cancelKey:Aa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}Zt(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function $(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function M(){o.accessKey=this.value,t(0,o)}function L(P){h=P,t(5,h)}function I(P){n.$$.not_equal(o.secret,P)&&(o.secret=P,t(0,o))}function A(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=P=>{"originalConfig"in P&&t(6,s=P.originalConfig),"config"in P&&t(0,o=P.config),"configKey"in P&&t(3,r=P.configKey),"toggleLabel"in P&&t(4,a=P.toggleLabel),"testFilesystem"in P&&t(7,u=P.testFilesystem),"testError"in P&&t(1,f=P.testError),"isTesting"in P&&t(2,c=P.isTesting),"$$scope"in P&&t(17,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&s!=null&&s.enabled&&(_(),g(100)),n.$$.dirty&9&&(o.enabled||di(r))},[o,f,c,r,a,h,s,u,i,S,$,T,O,M,L,I,A,l]}class pv extends we{constructor(e){super(),ye(this,e,iR,nR,_e,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function lR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=C(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){y(a,e,u),w(e,t),y(a,l,u),y(a,s,u),n[5](s),o||(r=[Ee(He.call(null,e,"Upload backup")),B(e,"click",n[4]),B(s,"change",n[6])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,Ie(r)}}}const D1="upload_backup";function sR(n,e,t){const i=bt();let{class:l=""}=e,s,o=!1;function r(){s&&t(1,s.value="",s)}function a(m){m&&pn(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the source. + data.db file).

    `,t=C(),i=b("div"),l=B(`Type the backup name + `),s=b("div"),o=b("span"),r=B(n[1]),a=C(),j(u.$$.fragment),f=B(` + to confirm:`),c=C(),d=b("form"),j(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){y(k,e,S),y(k,t,S),y(k,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),q(u,s,null),w(i,f),y(k,c,S),y(k,d,S),q(m,d,null),h=!0,_||(g=W(d,"submit",et(n[7])),_=!0)},p(k,S){(!h||S&2)&&re(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(M(u.$$.fragment,k),M(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),H(u),H(m),_=!1,g()}}}function U7(n){let e,t,i,l;return{c(){e=b("h4"),t=B("Restore "),i=b("strong"),l=B(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){y(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&re(l,s[1])},d(s){s&&v(e)}}}function V7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=B("Cancel"),i=C(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],Q(l,"btn-loading",n[4])},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&Q(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function B7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[V7],header:[U7],default:[z7]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function W7(n,e,t){let i;const l="backup_restore_"+V.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Yt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await me.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Ci(((S=$.response)==null?void 0:S.message)||$.message))}}}ro(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ne.call(this,n,S)}function k(S){Ne.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,_,g,k]}class Y7 extends we{constructor(e){super(),ye(this,e,W7,B7,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function $1(n,e,t){const i=n.slice();return i[22]=e[t],i}function C1(n,e,t){const i=n.slice();return i[19]=e[t],i}function K7(n){let e=[],t=new Map,i,l,s=de(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function E1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=V.formattedFileSize(e[22].size)+"",h,_,g,k,S,$,T,O,E,I,L,A,P,N,R,z,F,U,J,K;function x(){return e[10](e[22])}function X(){return e[11](e[22])}function oe(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=C(),s=b("div"),o=b("span"),a=B(r),f=C(),c=b("span"),d=B("("),h=B(m),_=B(")"),g=C(),k=b("div"),S=b("button"),$=b("i"),O=C(),E=b("button"),I=b("i"),A=C(),P=b("button"),N=b("i"),z=C(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(I,"class","ri-restart-line"),p(E,"type","button"),p(E,"class","btn btn-sm btn-circle btn-hint btn-transparent"),E.disabled=L=e[6][e[22].key],p(E,"aria-label","Restore"),p(N,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=R=e[6][e[22].key],p(P,"aria-label","Delete"),Q(P,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(Se,ge){y(Se,t,ge),w(t,i),w(t,l),w(t,s),w(s,o),w(o,a),w(s,f),w(s,c),w(c,d),w(c,h),w(c,_),w(t,g),w(t,k),w(k,S),w(S,$),w(k,O),w(k,E),w(E,I),w(k,A),w(k,P),w(P,N),w(t,z),U=!0,J||(K=[Ee(He.call(null,S,"Download")),W(S,"click",et(x)),Ee(He.call(null,E,"Restore")),W(E,"click",et(X)),Ee(He.call(null,P,"Delete")),W(P,"click",et(oe))],J=!0)},p(Se,ge){e=Se,(!U||ge&8)&&r!==(r=e[22].key+"")&&re(a,r),(!U||ge&8&&u!==(u=e[22].key))&&p(o,"title",u),(!U||ge&8)&&m!==(m=V.formattedFileSize(e[22].size)+"")&&re(h,m),(!U||ge&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!U||ge&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!U||ge&72&&L!==(L=e[6][e[22].key]))&&(E.disabled=L),(!U||ge&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!U||ge&72)&&Q(P,"btn-loading",e[6][e[22].key])},i(Se){U||(Se&&tt(()=>{U&&(F||(F=je(t,mt,{duration:150},!0)),F.run(1))}),U=!0)},o(Se){Se&&(F||(F=je(t,mt,{duration:150},!1)),F.run(0)),U=!1},d(Se){Se&&v(t),Se&&F&&F.end(),J=!1,Ie(K)}}}function M1(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Z7(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function G7(n){let e,t,i;return{c(){e=b("i"),t=C(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function X7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;const g=[J7,K7],k=[];function S(L,A){return L[4]?0:1}i=S(n),l=k[i]=g[i](n);function $(L,A){return L[7]?G7:Z7}let T=$(n),O=T(n),E={};f=new H7({props:E}),n[14](f),f.$on("submit",n[15]);let I={};return d=new Y7({props:I}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=C(),o=b("div"),r=b("button"),O.c(),u=C(),j(f.$$.fragment),c=C(),j(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(L,A){y(L,e,A),w(e,t),k[i].m(t,null),w(e,s),w(e,o),w(o,r),O.m(r,null),y(L,u,A),q(f,L,A),y(L,c,A),q(d,L,A),m=!0,h||(_=W(r,"click",n[13]),h=!0)},p(L,[A]){let P=i;i=S(L),i===P?k[i].p(L,A):(ae(),D(k[P],1,1,()=>{k[P]=null}),ue(),l=k[i],l?l.p(L,A):(l=k[i]=g[i](L),l.c()),M(l,1),l.m(t,null)),T!==(T=$(L))&&(O.d(1),O=T(L),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=L[4]||!L[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(L){m||(M(l),M(f.$$.fragment,L),M(d.$$.fragment,L),m=!0)},o(L){D(l),D(f.$$.fragment,L),D(d.$$.fragment,L),m=!1},d(L){L&&(v(e),v(u),v(c)),k[i].d(),O.d(),n[14](null),H(f,L),n[16](null),H(d,L),h=!1,_()}}}function Q7(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),h();async function f(){t(4,o=!0);try{t(3,s=await me.backups.getFullList()),s.sort((E,I)=>E.modifiedI.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(me.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const I=await me.getSuperuserFileToken(),L=me.backups.getDownloadURL(I,E);V.download(L)}catch(I){I.isAbort||me.error(I)}delete r[E],t(5,r)}}function d(E){pn(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await me.backups.delete(E),V.removeByKey(s,"name",E),f(),tn(`Successfully deleted ${E}.`)}catch(I){I.isAbort||me.error(I)}delete a[E],t(6,a)}}async function h(){var E;try{const I=await me.health.check({$autoCancel:!1}),L=u;t(7,u=((E=I==null?void 0:I.data)==null?void 0:E.canBackup)||!1),L!=u&&u&&f()}catch{}}Zt(()=>{let E=setInterval(()=>{h()},3e3);return()=>{clearInterval(E)}});const _=E=>c(E.key),g=E=>l.show(E.key),k=E=>d(E.key),S=()=>i==null?void 0:i.show();function $(E){ie[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function O(E){ie[E?"unshift":"push"](()=>{l=E,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,_,g,k,S,$,T,O]}class x7 extends we{constructor(e){super(),ye(this,e,Q7,X7,_e,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const eR=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),D1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function tR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){y(u,e,f),e.checked=n[0].enabled,y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&re(s,u[4]),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function I1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[nR,({uniqueId:I})=>({23:I}),({uniqueId:I})=>I?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[iR,({uniqueId:I})=>({23:I}),({uniqueId:I})=>I?8388608:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[lR,({uniqueId:I})=>({23:I}),({uniqueId:I})=>I?8388608:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[sR,({uniqueId:I})=>({23:I}),({uniqueId:I})=>I?8388608:0]},$$scope:{ctx:n}}}),_=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[oR,({uniqueId:I})=>({23:I}),({uniqueId:I})=>I?8388608:0]},$$scope:{ctx:n}}}),S=new fe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[rR,({uniqueId:I})=>({23:I}),({uniqueId:I})=>I?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("div"),j(_.$$.fragment),g=C(),k=b("div"),j(S.$$.fragment),$=C(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(I,L){y(I,e,L),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),q(_,h,null),w(e,g),w(e,k),q(S,k,null),w(e,$),w(e,T),E=!0},p(I,L){const A={};L&8&&(A.name=I[3]+".endpoint"),L&8519681&&(A.$$scope={dirty:L,ctx:I}),i.$set(A);const P={};L&8&&(P.name=I[3]+".bucket"),L&8519681&&(P.$$scope={dirty:L,ctx:I}),o.$set(P);const N={};L&8&&(N.name=I[3]+".region"),L&8519681&&(N.$$scope={dirty:L,ctx:I}),u.$set(N);const R={};L&8&&(R.name=I[3]+".accessKey"),L&8519681&&(R.$$scope={dirty:L,ctx:I}),d.$set(R);const z={};L&8&&(z.name=I[3]+".secret"),L&8519713&&(z.$$scope={dirty:L,ctx:I}),_.$set(z);const F={};L&8&&(F.name=I[3]+".forcePathStyle"),L&8519681&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){E||(M(i.$$.fragment,I),M(o.$$.fragment,I),M(u.$$.fragment,I),M(d.$$.fragment,I),M(_.$$.fragment,I),M(S.$$.fragment,I),I&&tt(()=>{E&&(O||(O=je(e,mt,{duration:150},!0)),O.run(1))}),E=!0)},o(I){D(i.$$.fragment,I),D(o.$$.fragment,I),D(u.$$.fragment,I),D(d.$$.fragment,I),D(_.$$.fragment,I),D(S.$$.fragment,I),I&&(O||(O=je(e,mt,{duration:150},!1)),O.run(0)),E=!1},d(I){I&&v(e),H(i),H(o),H(u),H(d),H(_),H(S),I&&O&&O.end()}}}function nR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Endpoint"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].endpoint),r||(a=W(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].endpoint&&ce(s,u[0].endpoint)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function iR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Bucket"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].bucket),r||(a=W(s,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].bucket&&ce(s,u[0].bucket)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function lR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Region"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].region),r||(a=W(s,"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(s,"id",o),f&1&&s.value!==u[0].region&&ce(s,u[0].region)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function sR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Access key"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].accessKey),r||(a=W(s,"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(s,"id",o),f&1&&s.value!==u[0].accessKey&&ce(s,u[0].accessKey)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oR(n){let e,t,i,l,s,o,r,a;function u(d){n[14](d)}function f(d){n[15](d)}let c={required:!0,id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[0].secret!==void 0&&(c.value=n[0].secret),s=new xu({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Te(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,Te(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function rR(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){y(c,e,d),e.checked=n[0].forcePathStyle,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[16]),Ee(He.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&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function aR(n){let e,t,i,l,s;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[tR,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=It(o,n,n[17],D1);let a=n[0].enabled&&I1(n);return{c(){j(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),l=ke()},m(u,f){q(e,u,f),y(u,t,f),r&&r.m(u,f),y(u,i,f),a&&a.m(u,f),y(u,l,f),s=!0},p(u,[f]){const c={};f&8519697&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&131079)&&At(r,o,u,u[17],s?Lt(o,u[17],f,eR):Pt(u[17]),D1),u[0].enabled?a?(a.p(u,f),f&1&&M(a,1)):(a=I1(u),a.c(),M(a,1),a.m(l.parentNode,l)):a&&(ae(),D(a,1,1,()=>{a=null}),ue())},i(u){s||(M(e.$$.fragment,u),M(r,u),M(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(v(t),v(i),v(l)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const Aa="s3_test_request";function uR(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null,h=!1;function _(){t(5,h=!!(s!=null&&s.accessKey))}function g(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{k()},P)}async function k(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;me.cancelRequest(Aa),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(Aa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await me.settings.testS3(u,{$cancelKey:Aa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}Zt(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function $(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function I(P){h=P,t(5,h)}function L(P){n.$$.not_equal(o.secret,P)&&(o.secret=P,t(0,o))}function A(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=P=>{"originalConfig"in P&&t(6,s=P.originalConfig),"config"in P&&t(0,o=P.config),"configKey"in P&&t(3,r=P.configKey),"toggleLabel"in P&&t(4,a=P.toggleLabel),"testFilesystem"in P&&t(7,u=P.testFilesystem),"testError"in P&&t(1,f=P.testError),"isTesting"in P&&t(2,c=P.isTesting),"$$scope"in P&&t(17,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&s!=null&&s.enabled&&(_(),g(100)),n.$$.dirty&9&&(o.enabled||di(r))},[o,f,c,r,a,h,s,u,i,S,$,T,O,E,I,L,A,l]}class hv extends we{constructor(e){super(),ye(this,e,uR,aR,_e,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function fR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=C(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){y(a,e,u),w(e,t),y(a,l,u),y(a,s,u),n[5](s),o||(r=[Ee(He.call(null,e,"Upload backup")),W(e,"click",n[4]),W(s,"change",n[6])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,Ie(r)}}}const L1="upload_backup";function cR(n,e,t){const i=bt();let{class:l=""}=e,s,o=!1;function r(){s&&t(1,s.value="",s)}function a(m){m&&pn(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the source. -Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var _,g,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await me.backups.upload(h,{requestKey:D1}),t(2,o=!1),i("success"),en("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(g=(_=S.response)==null?void 0:_.data)==null?void 0:g.file)!=null&&k.message?Ci(S.response.data.file.message):me.error(S))}r()}ro(()=>{me.cancelRequest(D1)});const f=()=>s==null?void 0:s.click();function c(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}const d=m=>{var h,_;a((_=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:_[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class oR extends we{constructor(e){super(),ye(this,e,sR,lR,_e,{class:0})}}function rR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function aR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function I1(n){var U,J,K;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[uR,({uniqueId:x})=>({31:x}),({uniqueId:x})=>[0,x?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&L1(n);function A(x){n[24](x)}function P(x){n[25](x)}function N(x){n[26](x)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new pv({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",P)),ie.push(()=>be(r,"testError",N));let z=((K=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:K.enabled)&&!n[9]&&!n[5]&&A1(n),F=n[9]&&P1(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),I&&I.c(),l=C(),s=b("div"),o=C(),j(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),z&&z.c(),_=C(),F&&F.c(),g=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],Q(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(x,X){y(x,e,X),q(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),q(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),z&&z.m(d,null),w(d,_),F&&F.m(d,null),w(d,g),w(d,k),w(k,S),O=!0,M||(L=[B(k,"click",n[28]),B(e,"submit",et(n[11]))],M=!0)},p(x,X){var ge,$e,Ye;const oe={};X[0]&4|X[1]&3&&(oe.$$scope={dirty:X,ctx:x}),t.$set(oe),x[2]?I?(I.p(x,X),X[0]&4&&E(I,1)):(I=L1(x),I.c(),E(I,1),I.m(e,l)):I&&(ae(),D(I,1,1,()=>{I=null}),ue());const Se={};X[0]&1&&(Se.originalConfig=(ge=x[0].backups)==null?void 0:ge.s3),!a&&X[0]&2&&(a=!0,Se.config=x[1].backups.s3,Te(()=>a=!1)),!u&&X[0]&128&&(u=!0,Se.isTesting=x[7],Te(()=>u=!1)),!f&&X[0]&256&&(f=!0,Se.testError=x[8],Te(()=>f=!1)),r.$set(Se),(Ye=($e=x[1].backups)==null?void 0:$e.s3)!=null&&Ye.enabled&&!x[9]&&!x[5]?z?z.p(x,X):(z=A1(x),z.c(),z.m(d,_)):z&&(z.d(1),z=null),x[9]?F?F.p(x,X):(F=P1(x),F.c(),F.m(d,g)):F&&(F.d(1),F=null),(!O||X[0]&544&&$!==($=!x[9]||x[5]))&&(k.disabled=$),(!O||X[0]&32)&&Q(k,"btn-loading",x[5])},i(x){O||(E(t.$$.fragment,x),E(I),E(r.$$.fragment,x),x&&tt(()=>{O&&(T||(T=je(e,mt,{duration:150},!0)),T.run(1))}),O=!0)},o(x){D(t.$$.fragment,x),D(I),D(r.$$.fragment,x),x&&(T||(T=je(e,mt,{duration:150},!1)),T.run(0)),O=!1},d(x){x&&v(e),H(t),I&&I.d(),H(r),z&&z.d(),F&&F.d(),x&&T&&T.end(),M=!1,Ie(L)}}}function uR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){y(u,e,f),e.checked=n[2],y(u,i,f),y(u,l,f),w(l,s),r||(a=B(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function L1(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[cR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[dR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(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){y(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(E(l.$$.fragment,f),E(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=je(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=je(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),H(l),H(r),f&&a&&a.end()}}}function fR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=C(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=C(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=C(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),y(f,s,c),y(f,o,c),y(f,r,c),a||(u=[B(e,"click",n[19]),B(i,"click",n[20]),B(s,"click",n[21]),B(r,"click",n[22])],a=!0)},p:te,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,Ie(u)}}}function cR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[fR]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=W("Cron expression"),l=C(),s=b("input"),a=C(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=C(),m=b("i"),h=C(),j(_.$$.fragment),g=C(),k=b("div"),S=b("p"),$=W(`Supports numeric list, steps, ranges or - `),T=b("span"),T.textContent="macros",O=W(`. - `),M=b("br"),L=W(` - The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.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(T,"class","link-primary"),p(k,"class","help-block")},m(N,R){var z,F;y(N,e,R),w(e,t),y(N,l,R),y(N,s,R),ce(s,n[1].backups.cron),y(N,a,R),y(N,u,R),w(u,f),w(f,c),w(f,d),w(f,m),w(f,h),q(_,f,null),y(N,g,R),y(N,k,R),w(k,S),w(S,$),w(S,T),w(S,O),w(S,M),w(S,L),I=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||s.focus(),A||(P=[B(s,"input",n[18]),Ee(He.call(null,T,`@yearly +Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var _,g,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await me.backups.upload(h,{requestKey:L1}),t(2,o=!1),i("success"),tn("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(g=(_=S.response)==null?void 0:_.data)==null?void 0:g.file)!=null&&k.message?Ci(S.response.data.file.message):me.error(S))}r()}ro(()=>{me.cancelRequest(L1)});const f=()=>s==null?void 0:s.click();function c(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}const d=m=>{var h,_;a((_=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:_[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class dR extends we{constructor(e){super(),ye(this,e,cR,fR,_e,{class:0})}}function pR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function mR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function A1(n){var U,J,K;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[hR,({uniqueId:x})=>({31:x}),({uniqueId:x})=>[0,x?1:0]]},$$scope:{ctx:n}}});let L=n[2]&&P1(n);function A(x){n[24](x)}function P(x){n[25](x)}function N(x){n[26](x)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new hv({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",P)),ie.push(()=>be(r,"testError",N));let z=((K=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:K.enabled)&&!n[9]&&!n[5]&&N1(n),F=n[9]&&R1(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),L&&L.c(),l=C(),s=b("div"),o=C(),j(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),z&&z.c(),_=C(),F&&F.c(),g=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],Q(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(x,X){y(x,e,X),q(t,e,null),w(e,i),L&&L.m(e,null),w(e,l),w(e,s),w(e,o),q(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),z&&z.m(d,null),w(d,_),F&&F.m(d,null),w(d,g),w(d,k),w(k,S),O=!0,E||(I=[W(k,"click",n[28]),W(e,"submit",et(n[11]))],E=!0)},p(x,X){var ge,$e,Ye;const oe={};X[0]&4|X[1]&3&&(oe.$$scope={dirty:X,ctx:x}),t.$set(oe),x[2]?L?(L.p(x,X),X[0]&4&&M(L,1)):(L=P1(x),L.c(),M(L,1),L.m(e,l)):L&&(ae(),D(L,1,1,()=>{L=null}),ue());const Se={};X[0]&1&&(Se.originalConfig=(ge=x[0].backups)==null?void 0:ge.s3),!a&&X[0]&2&&(a=!0,Se.config=x[1].backups.s3,Te(()=>a=!1)),!u&&X[0]&128&&(u=!0,Se.isTesting=x[7],Te(()=>u=!1)),!f&&X[0]&256&&(f=!0,Se.testError=x[8],Te(()=>f=!1)),r.$set(Se),(Ye=($e=x[1].backups)==null?void 0:$e.s3)!=null&&Ye.enabled&&!x[9]&&!x[5]?z?z.p(x,X):(z=N1(x),z.c(),z.m(d,_)):z&&(z.d(1),z=null),x[9]?F?F.p(x,X):(F=R1(x),F.c(),F.m(d,g)):F&&(F.d(1),F=null),(!O||X[0]&544&&$!==($=!x[9]||x[5]))&&(k.disabled=$),(!O||X[0]&32)&&Q(k,"btn-loading",x[5])},i(x){O||(M(t.$$.fragment,x),M(L),M(r.$$.fragment,x),x&&tt(()=>{O&&(T||(T=je(e,mt,{duration:150},!0)),T.run(1))}),O=!0)},o(x){D(t.$$.fragment,x),D(L),D(r.$$.fragment,x),x&&(T||(T=je(e,mt,{duration:150},!1)),T.run(0)),O=!1},d(x){x&&v(e),H(t),L&&L.d(),H(r),z&&z.d(),F&&F.d(),x&&T&&T.end(),E=!1,Ie(I)}}}function hR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){y(u,e,f),e.checked=n[2],y(u,i,f),y(u,l,f),w(l,s),r||(a=W(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function P1(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[gR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[bR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(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){y(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=je(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=je(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),H(l),H(r),f&&a&&a.end()}}}function _R(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=C(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=C(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=C(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){y(f,e,c),y(f,t,c),y(f,i,c),y(f,l,c),y(f,s,c),y(f,o,c),y(f,r,c),a||(u=[W(e,"click",n[19]),W(i,"click",n[20]),W(s,"click",n[21]),W(r,"click",n[22])],a=!0)},p:te,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,Ie(u)}}}function gR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[_R]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=B("Cron expression"),l=C(),s=b("input"),a=C(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=C(),m=b("i"),h=C(),j(_.$$.fragment),g=C(),k=b("div"),S=b("p"),$=B(`Supports numeric list, steps, ranges or + `),T=b("span"),T.textContent="macros",O=B(`. + `),E=b("br"),I=B(` + The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.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(T,"class","link-primary"),p(k,"class","help-block")},m(N,R){var z,F;y(N,e,R),w(e,t),y(N,l,R),y(N,s,R),ce(s,n[1].backups.cron),y(N,a,R),y(N,u,R),w(u,f),w(f,c),w(f,d),w(f,m),w(f,h),q(_,f,null),y(N,g,R),y(N,k,R),w(k,S),w(S,$),w(S,T),w(S,O),w(S,E),w(S,I),L=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||s.focus(),A||(P=[W(s,"input",n[18]),Ee(He.call(null,T,`@yearly @annually @monthly @weekly @daily @midnight -@hourly`))],A=!0)},p(N,R){var F,U;(!I||R[1]&1&&i!==(i=N[31]))&&p(e,"for",i),(!I||R[1]&1&&o!==(o=N[31]))&&p(s,"id",o),(!I||R[0]&1&&r!==(r=!((U=(F=N[0])==null?void 0:F.backups)!=null&&U.cron)))&&(s.autofocus=r),R[0]&2&&s.value!==N[1].backups.cron&&ce(s,N[1].backups.cron);const z={};R[0]&2|R[1]&2&&(z.$$scope={dirty:R,ctx:N}),_.$set(z)},i(N){I||(E(_.$$.fragment,N),I=!0)},o(N){D(_.$$.fragment,N),I=!1},d(N){N&&(v(e),v(l),v(s),v(a),v(u),v(g),v(k)),H(_),A=!1,Ie(P)}}}function dR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=C(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[1].backups.cronMaxKeep),r||(a=B(s,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(s,"id",o),f[0]&2&>(s.value)!==u[1].backups.cronMaxKeep&&ce(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function A1(n){let e;function t(s,o){return s[7]?hR:s[8]?mR:pR}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function pR(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function mR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;y(s,e,o),i||(l=Ee(t=He.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Nt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function hR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function P1(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){y(o,e,r),w(e,t),l||(s=B(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function _R(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P,N;m=new Au({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new oR({props:{class:"btn-sm"}}),_.$on("success",n[13]);let R={};k=new K7({props:R}),n[15](k);function z(K,x){return K[6]?aR:rR}let F=z(n),U=F(n),J=n[6]&&!n[4]&&I1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),j(m.$$.fragment),h=C(),j(_.$$.fragment),g=C(),j(k.$$.fragment),S=C(),$=b("hr"),T=C(),O=b("button"),M=b("span"),M.textContent="Backups options",L=C(),U.c(),I=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(M,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],Q(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(K,x){y(K,e,x),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(K,r,x),y(K,a,x),w(a,u),w(u,f),w(f,c),w(f,d),q(m,f,null),w(f,h),q(_,f,null),w(u,g),q(k,u,null),w(u,S),w(u,$),w(u,T),w(u,O),w(O,M),w(O,L),U.m(O,null),w(u,I),J&&J.m(u,null),A=!0,P||(N=[B(O,"click",n[16]),B(u,"submit",et(n[11]))],P=!0)},p(K,x){(!A||x[0]&1024)&&re(o,K[10]);const X={};k.$set(X),F!==(F=z(K))&&(U.d(1),U=F(K),U&&(U.c(),U.m(O,null))),(!A||x[0]&16)&&(O.disabled=K[4]),(!A||x[0]&16)&&Q(O,"btn-loading",K[4]),K[6]&&!K[4]?J?(J.p(K,x),x[0]&80&&E(J,1)):(J=I1(K),J.c(),E(J,1),J.m(u,null)):J&&(ae(),D(J,1,1,()=>{J=null}),ue())},i(K){A||(E(m.$$.fragment,K),E(_.$$.fragment,K),E(k.$$.fragment,K),E(J),A=!0)},o(K){D(m.$$.fragment,K),D(_.$$.fragment,K),D(k.$$.fragment,K),D(J),A=!1},d(K){K&&(v(e),v(r),v(a)),H(m),H(_),n[15](null),H(k),U.d(),J&&J.d(),P=!1,Ie(N)}}}function gR(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[_R]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function bR(n,e,t){let i,l;Qe(n,fn,x=>t(10,l=x)),Rn(fn,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const x=await me.settings.getAll()||{};k(x)}catch(x){me.error(x)}t(4,a=!1)}async function g(){if(!(u||!i)){t(5,u=!0);try{const x=await me.settings.update(V.filterRedactedProps(r));Yt({}),await $(),k(x),en("Successfully saved application settings.")}catch(x){me.error(x)}t(5,u=!1)}}function k(x={}){t(1,r={backups:(x==null?void 0:x.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 $(){return s==null?void 0:s.loadBackups()}function T(x){ie[x?"unshift":"push"](()=>{s=x,t(3,s)})}const O=()=>t(6,d=!d);function M(){c=this.checked,t(2,c)}function L(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},A=()=>{t(1,r.backups.cron="0 0 * * 0",r)},P=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},N=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=gt(this.value),t(1,r),t(2,c)}function z(x){n.$$.not_equal(r.backups.s3,x)&&(r.backups.s3=x,t(1,r),t(2,c))}function F(x){m=x,t(7,m)}function U(x){h=x,t(8,h)}const J=()=>S(),K=()=>g();return n.$$.update=()=>{var x;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(x=r==null?void 0:r.backups)!=null&&x.cron&&(di("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,h,i,l,g,S,$,f,T,O,M,L,I,A,P,N,R,z,F,U,J,K]}class kR extends we{constructor(e){super(),ye(this,e,bR,gR,_e,{},null,[-1,-1])}}function N1(n,e,t){const i=n.slice();return i[22]=e[t],i}function vR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I,A,P,N,R,z;o=new fe({props:{class:"form-field",$$slots:{default:[wR,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=pe(n[0]);const U=J=>J[22].id;for(let J=0;JBelow you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=C(),i=b("div"),l=b("div"),s=b("div"),j(o.$$.fragment),r=C();for(let J=0;J({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){y(o,t,r),q(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&v(t),H(i)}}}function TR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[yR,vR],h=[];function _(g,k){return g[4]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(g,r,k),y(g,a,k),w(a,u),h[f].m(u,null),d=!0},p(g,k){(!d||k&128)&&re(o,g[7]);let S=f;f=_(g),f===S?h[f].p(g,k):(ae(),D(h[S],1,1,()=>{h[S]=null}),ue(),c=h[f],c?c.p(g,k):(c=h[f]=m[f](g),c.c()),E(c,1),c.m(u,null))},i(g){d||(E(c),d=!0)},o(g){D(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function $R(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[TR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function CR(n,e,t){let i,l,s,o;Qe(n,fn,A=>t(7,o=A)),Rn(fn,o="Export collections",o);const r="export_"+V.randomString(5);let a,u=[],f={},c=!1;d();async function d(){var A;t(4,c=!0);try{t(0,u=await me.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=V.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;k()}catch(P){me.error(P)}t(4,c=!1)}function m(){V.downloadJson(Object.values(f),"pb_schema")}function h(){V.copyToClipboard(i),Ks("The configuration was copied to your clipboard!",3e3)}function _(){s?g():k()}function g(){t(1,f={})}function k(){t(1,f={});for(const A of u)t(1,f[A.id]=A,f)}function S(A){f[A.id]?delete f[A.id]:t(1,f[A.id]=A,f),t(1,f)}const $=()=>_(),T=A=>S(A),O=()=>h();function M(A){ie[A?"unshift":"push"](()=>{a=A,t(3,a)})}const L=A=>{if(A.ctrlKey&&A.code==="KeyA"){A.preventDefault();const P=window.getSelection(),N=document.createRange();N.selectNodeContents(a),P.removeAllRanges(),P.addRange(N)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,_,S,r,$,T,O,M,L,I]}class OR extends we{constructor(e){super(),ye(this,e,CR,$R,_e,{})}}function F1(n,e,t){const i=n.slice();return i[14]=e[t],i}function q1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function H1(n,e,t){const i=n.slice();return i[14]=e[t],i}function j1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function z1(n,e,t){const i=n.slice();return i[14]=e[t],i}function U1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function V1(n,e,t){const i=n.slice();return i[30]=e[t],i}function ER(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&B1(),a=n[0].name!==n[1].name&&W1(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),l=b("strong"),o=W(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){y(u,e,f),r&&r.m(e,null),w(e,t),a&&a.m(e,null),w(e,i),w(e,l),w(l,o)},p(u,f){u[10]?r||(r=B1(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=W1(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&re(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function MR(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=C(),i=b("strong"),s=W(l),p(e,"class","label label-danger")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),w(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&re(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function DR(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=C(),i=b("strong"),s=W(l),p(e,"class","label label-success")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),w(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&re(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function B1(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function W1(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=C(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){y(o,e,r),w(e,i),y(o,l,r),y(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&re(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function Y1(n){var g,k;let e,t,i,l=n[30]+"",s,o,r,a,u=n[12]((g=n[0])==null?void 0:g[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",_;return{c(){var S,$,T,O,M,L;e=b("tr"),t=b("td"),i=b("span"),s=W(l),o=C(),r=b("td"),a=b("pre"),f=W(u),c=C(),d=b("td"),m=b("pre"),_=W(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),Q(r,"changed-old-col",!n[11]&&Pn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),Q(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),Q(d,"changed-new-col",!n[5]&&Pn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),Q(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),Q(e,"txt-primary",Pn((M=n[0])==null?void 0:M[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,$){y(S,e,$),w(e,t),w(t,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(e,c),w(e,d),w(d,m),w(m,_)},p(S,$){var T,O,M,L,I,A,P,N;$[0]&512&&l!==(l=S[30]+"")&&re(s,l),$[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&re(f,u),$[0]&2563&&Q(r,"changed-old-col",!S[11]&&Pn((O=S[0])==null?void 0:O[S[30]],(M=S[1])==null?void 0:M[S[30]])),$[0]&2048&&Q(r,"changed-none-col",S[11]),$[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&re(_,h),$[0]&547&&Q(d,"changed-new-col",!S[5]&&Pn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),$[0]&32&&Q(d,"changed-none-col",S[5]),$[0]&515&&Q(e,"txt-primary",Pn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&v(e)}}}function K1(n){let e,t=pe(n[6]),i=[];for(let l=0;lProps Old New',s=C(),o=b("tbody");for(let T=0;T!c.find(S=>k.id==S.id))))}function g(k){return typeof k>"u"?"":V.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,r=k.collectionA),"collectionB"in k&&t(1,a=k.collectionB),"deleteMissing"in k&&t(2,u=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)&&!(a!=null&&a.name)),n.$$.dirty[0]&33&&t(11,l=!i&&!(r!=null&&r.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(r==null?void 0:r.fields)?r==null?void 0:r.fields.concat():[]),n.$$.dirty[0]&7&&(typeof(r==null?void 0:r.fields)<"u"||typeof(a==null?void 0:a.fields)<"u"||typeof u<"u")&&_(),n.$$.dirty[0]&24&&t(6,d=f.filter(k=>!c.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(k=>f.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(k=>!f.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(10,s=V.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=V.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(k=>!["fields","created","updated"].includes(k)))},[r,a,u,f,c,i,d,m,h,o,s,l,g]}class AR extends we{constructor(e){super(),ye(this,e,LR,IR,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function tb(n,e,t){const i=n.slice();return i[17]=e[t],i}function nb(n){let e,t;return e=new AR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function PR(n){let e,t,i=pe(n[2]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function vR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;y(s,e,o),i||(l=Ee(t=He.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Nt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function yR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function R1(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){y(o,e,r),w(e,t),l||(s=W(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function wR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P,N;m=new Au({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new dR({props:{class:"btn-sm"}}),_.$on("success",n[13]);let R={};k=new x7({props:R}),n[15](k);function z(K,x){return K[6]?mR:pR}let F=z(n),U=F(n),J=n[6]&&!n[4]&&A1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),j(m.$$.fragment),h=C(),j(_.$$.fragment),g=C(),j(k.$$.fragment),S=C(),$=b("hr"),T=C(),O=b("button"),E=b("span"),E.textContent="Backups options",I=C(),U.c(),L=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],Q(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(K,x){y(K,e,x),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(K,r,x),y(K,a,x),w(a,u),w(u,f),w(f,c),w(f,d),q(m,f,null),w(f,h),q(_,f,null),w(u,g),q(k,u,null),w(u,S),w(u,$),w(u,T),w(u,O),w(O,E),w(O,I),U.m(O,null),w(u,L),J&&J.m(u,null),A=!0,P||(N=[W(O,"click",n[16]),W(u,"submit",et(n[11]))],P=!0)},p(K,x){(!A||x[0]&1024)&&re(o,K[10]);const X={};k.$set(X),F!==(F=z(K))&&(U.d(1),U=F(K),U&&(U.c(),U.m(O,null))),(!A||x[0]&16)&&(O.disabled=K[4]),(!A||x[0]&16)&&Q(O,"btn-loading",K[4]),K[6]&&!K[4]?J?(J.p(K,x),x[0]&80&&M(J,1)):(J=A1(K),J.c(),M(J,1),J.m(u,null)):J&&(ae(),D(J,1,1,()=>{J=null}),ue())},i(K){A||(M(m.$$.fragment,K),M(_.$$.fragment,K),M(k.$$.fragment,K),M(J),A=!0)},o(K){D(m.$$.fragment,K),D(_.$$.fragment,K),D(k.$$.fragment,K),D(J),A=!1},d(K){K&&(v(e),v(r),v(a)),H(m),H(_),n[15](null),H(k),U.d(),J&&J.d(),P=!1,Ie(N)}}}function SR(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[wR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function TR(n,e,t){let i,l;Qe(n,fn,x=>t(10,l=x)),Rn(fn,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const x=await me.settings.getAll()||{};k(x)}catch(x){me.error(x)}t(4,a=!1)}async function g(){if(!(u||!i)){t(5,u=!0);try{const x=await me.settings.update(V.filterRedactedProps(r));Yt({}),await $(),k(x),tn("Successfully saved application settings.")}catch(x){me.error(x)}t(5,u=!1)}}function k(x={}){t(1,r={backups:(x==null?void 0:x.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 $(){return s==null?void 0:s.loadBackups()}function T(x){ie[x?"unshift":"push"](()=>{s=x,t(3,s)})}const O=()=>t(6,d=!d);function E(){c=this.checked,t(2,c)}function I(){r.backups.cron=this.value,t(1,r),t(2,c)}const L=()=>{t(1,r.backups.cron="0 0 * * *",r)},A=()=>{t(1,r.backups.cron="0 0 * * 0",r)},P=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},N=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=gt(this.value),t(1,r),t(2,c)}function z(x){n.$$.not_equal(r.backups.s3,x)&&(r.backups.s3=x,t(1,r),t(2,c))}function F(x){m=x,t(7,m)}function U(x){h=x,t(8,h)}const J=()=>S(),K=()=>g();return n.$$.update=()=>{var x;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(x=r==null?void 0:r.backups)!=null&&x.cron&&(di("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,h,i,l,g,S,$,f,T,O,E,I,L,A,P,N,R,z,F,U,J,K]}class $R extends we{constructor(e){super(),ye(this,e,TR,SR,_e,{},null,[-1,-1])}}function F1(n,e,t){const i=n.slice();return i[22]=e[t],i}function CR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L,A,P,N,R,z;o=new fe({props:{class:"form-field",$$slots:{default:[ER,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=de(n[0]);const U=J=>J[22].id;for(let J=0;JBelow you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=C(),i=b("div"),l=b("div"),s=b("div"),j(o.$$.fragment),r=C();for(let J=0;J({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){y(o,t,r),q(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&v(t),H(i)}}}function DR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[OR,CR],h=[];function _(g,k){return g[4]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(g,r,k),y(g,a,k),w(a,u),h[f].m(u,null),d=!0},p(g,k){(!d||k&128)&&re(o,g[7]);let S=f;f=_(g),f===S?h[f].p(g,k):(ae(),D(h[S],1,1,()=>{h[S]=null}),ue(),c=h[f],c?c.p(g,k):(c=h[f]=m[f](g),c.c()),M(c,1),c.m(u,null))},i(g){d||(M(c),d=!0)},o(g){D(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function IR(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[DR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function LR(n,e,t){let i,l,s,o;Qe(n,fn,A=>t(7,o=A)),Rn(fn,o="Export collections",o);const r="export_"+V.randomString(5);let a,u=[],f={},c=!1;d();async function d(){var A;t(4,c=!0);try{t(0,u=await me.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=V.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;k()}catch(P){me.error(P)}t(4,c=!1)}function m(){V.downloadJson(Object.values(f),"pb_schema")}function h(){V.copyToClipboard(i),Ks("The configuration was copied to your clipboard!",3e3)}function _(){s?g():k()}function g(){t(1,f={})}function k(){t(1,f={});for(const A of u)t(1,f[A.id]=A,f)}function S(A){f[A.id]?delete f[A.id]:t(1,f[A.id]=A,f),t(1,f)}const $=()=>_(),T=A=>S(A),O=()=>h();function E(A){ie[A?"unshift":"push"](()=>{a=A,t(3,a)})}const I=A=>{if(A.ctrlKey&&A.code==="KeyA"){A.preventDefault();const P=window.getSelection(),N=document.createRange();N.selectNodeContents(a),P.removeAllRanges(),P.addRange(N)}},L=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,_,S,r,$,T,O,E,I,L]}class AR extends we{constructor(e){super(),ye(this,e,LR,IR,_e,{})}}function H1(n,e,t){const i=n.slice();return i[14]=e[t],i}function j1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function z1(n,e,t){const i=n.slice();return i[14]=e[t],i}function U1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function V1(n,e,t){const i=n.slice();return i[14]=e[t],i}function B1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function W1(n,e,t){const i=n.slice();return i[30]=e[t],i}function PR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&Y1(),a=n[0].name!==n[1].name&&K1(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),l=b("strong"),o=B(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){y(u,e,f),r&&r.m(e,null),w(e,t),a&&a.m(e,null),w(e,i),w(e,l),w(l,o)},p(u,f){u[10]?r||(r=Y1(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=K1(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&re(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function NR(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=C(),i=b("strong"),s=B(l),p(e,"class","label label-danger")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),w(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&re(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function RR(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=C(),i=b("strong"),s=B(l),p(e,"class","label label-success")},m(r,a){y(r,e,a),y(r,t,a),y(r,i,a),w(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&re(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function Y1(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function K1(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=B(t),l=C(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){y(o,e,r),w(e,i),y(o,l,r),y(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&re(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function J1(n){var g,k;let e,t,i,l=n[30]+"",s,o,r,a,u=n[12]((g=n[0])==null?void 0:g[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",_;return{c(){var S,$,T,O,E,I;e=b("tr"),t=b("td"),i=b("span"),s=B(l),o=C(),r=b("td"),a=b("pre"),f=B(u),c=C(),d=b("td"),m=b("pre"),_=B(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),Q(r,"changed-old-col",!n[11]&&Pn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),Q(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),Q(d,"changed-new-col",!n[5]&&Pn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),Q(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),Q(e,"txt-primary",Pn((E=n[0])==null?void 0:E[n[30]],(I=n[1])==null?void 0:I[n[30]]))},m(S,$){y(S,e,$),w(e,t),w(t,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(e,c),w(e,d),w(d,m),w(m,_)},p(S,$){var T,O,E,I,L,A,P,N;$[0]&512&&l!==(l=S[30]+"")&&re(s,l),$[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&re(f,u),$[0]&2563&&Q(r,"changed-old-col",!S[11]&&Pn((O=S[0])==null?void 0:O[S[30]],(E=S[1])==null?void 0:E[S[30]])),$[0]&2048&&Q(r,"changed-none-col",S[11]),$[0]&514&&h!==(h=S[12]((I=S[1])==null?void 0:I[S[30]])+"")&&re(_,h),$[0]&547&&Q(d,"changed-new-col",!S[5]&&Pn((L=S[0])==null?void 0:L[S[30]],(A=S[1])==null?void 0:A[S[30]])),$[0]&32&&Q(d,"changed-none-col",S[5]),$[0]&515&&Q(e,"txt-primary",Pn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&v(e)}}}function Z1(n){let e,t=de(n[6]),i=[];for(let l=0;lProps Old New',s=C(),o=b("tbody");for(let T=0;T!c.find(S=>k.id==S.id))))}function g(k){return typeof k>"u"?"":V.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,r=k.collectionA),"collectionB"in k&&t(1,a=k.collectionB),"deleteMissing"in k&&t(2,u=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)&&!(a!=null&&a.name)),n.$$.dirty[0]&33&&t(11,l=!i&&!(r!=null&&r.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(r==null?void 0:r.fields)?r==null?void 0:r.fields.concat():[]),n.$$.dirty[0]&7&&(typeof(r==null?void 0:r.fields)<"u"||typeof(a==null?void 0:a.fields)<"u"||typeof u<"u")&&_(),n.$$.dirty[0]&24&&t(6,d=f.filter(k=>!c.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(k=>f.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(k=>!f.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(10,s=V.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=V.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(k=>!["fields","created","updated"].includes(k)))},[r,a,u,f,c,i,d,m,h,o,s,l,g]}class HR extends we{constructor(e){super(),ye(this,e,qR,FR,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function ib(n,e,t){const i=n.slice();return i[17]=e[t],i}function lb(n){let e,t;return e=new HR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jR(n){let e,t,i=de(n[2]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),en("Successfully imported collections configuration."),i("submit")}catch(T){me.error(T)}t(4,u=!1),c()}}const _=()=>m(),g=()=>!u;function k(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ne.call(this,n,T)}function $(T){Ne.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,_,g,k,S,$]}class HR extends we{constructor(e){super(),ye(this,e,qR,FR,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function ib(n,e,t){const i=n.slice();return i[33]=e[t],i}function lb(n,e,t){const i=n.slice();return i[36]=e[t],i}function sb(n,e,t){const i=n.slice();return i[33]=e[t],i}function jR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,M,L,I;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[UR,({uniqueId:U})=>({41:U}),({uniqueId:U})=>[0,U?1024:0]]},$$scope:{ctx:n}}});let A=n[1].length&&rb(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&ab(),R=n[6]&&n[1].length&&n[7]&&ub(n),z=n[13].length&&vb(n),F=!!n[0]&&yb(n);return{c(){e=b("input"),t=C(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=C(),j(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),N&&N.c(),d=C(),R&&R.c(),m=C(),z&&z.c(),h=C(),_=b("div"),F&&F.c(),g=C(),k=b("div"),S=C(),$=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=O=!n[14],p(_,"class","flex m-t-base")},m(U,J){y(U,e,J),n[21](e),y(U,t,J),y(U,i,J),w(i,l),w(l,s),w(l,o),y(U,r,J),q(a,U,J),y(U,u,J),A&&A.m(U,J),y(U,f,J),y(U,c,J),N&&N.m(U,J),y(U,d,J),R&&R.m(U,J),y(U,m,J),z&&z.m(U,J),y(U,h,J),y(U,_,J),F&&F.m(_,null),w(_,g),w(_,k),w(_,S),w(_,$),w($,T),M=!0,L||(I=[B(e,"change",n[22]),B(o,"click",n[23]),B($,"click",n[19])],L=!0)},p(U,J){(!M||J[0]&4096)&&Q(o,"btn-loading",U[12]);const K={};J[0]&64&&(K.class="form-field "+(U[6]?"":"field-error")),J[0]&65|J[1]&3072&&(K.$$scope={dirty:J,ctx:U}),a.$set(K),U[1].length?A?(A.p(U,J),J[0]&2&&E(A,1)):(A=rb(U),A.c(),E(A,1),A.m(f.parentNode,f)):A&&(ae(),D(A,1,1,()=>{A=null}),ue()),U[6]&&U[1].length&&!U[7]?N||(N=ab(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),U[6]&&U[1].length&&U[7]?R?R.p(U,J):(R=ub(U),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),U[13].length?z?z.p(U,J):(z=vb(U),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),U[0]?F?F.p(U,J):(F=yb(U),F.c(),F.m(_,g)):F&&(F.d(1),F=null),(!M||J[0]&16384&&O!==(O=!U[14]))&&($.disabled=O)},i(U){M||(E(a.$$.fragment,U),E(A),E(P),M=!0)},o(U){D(a.$$.fragment,U),D(A),D(P),M=!1},d(U){U&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(h),v(_)),n[21](null),H(a,U),A&&A.d(U),N&&N.d(U),R&&R.d(U),z&&z.d(U),F&&F.d(),L=!1,Ie(I)}}}function zR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function ob(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function UR(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&ob();return{c(){e=b("label"),t=W("Collections"),l=C(),s=b("textarea"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[41]),p(e,"class","p-b-10"),p(s,"id",o=n[41]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),ce(s,n[0]),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=B(s,"input",n[24]),u=!0)},p(d,m){m[1]&1024&&i!==(i=d[41])&&p(e,"for",i),m[1]&1024&&o!==(o=d[41])&&p(s,"id",o),m[0]&1&&ce(s,d[0]),d[0]&&!d[6]?c||(c=ob(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function rb(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[VR,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&3072&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=W("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[41]),e.disabled=i=!n[6],p(s,"for",r=n[41])},m(f,c){y(f,e,c),e.checked=n[5],y(f,l,c),y(f,s,c),w(s,o),a||(u=B(e,"change",n[25]),a=!0)},p(f,c){c[1]&1024&&t!==(t=f[41])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&1024&&r!==(r=f[41])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function ab(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function ub(n){let e,t,i,l,s,o=n[9].length&&fb(n),r=n[3].length&&pb(n),a=n[8].length&&gb(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),l=C(),r&&r.c(),s=C(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){y(u,e,f),y(u,t,f),y(u,i,f),o&&o.m(i,null),w(i,l),r&&r.m(i,null),w(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=fb(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=pb(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=gb(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function fb(n){let e=[],t=new Map,i,l=pe(n[9]);const s=o=>o[33].id;for(let o=0;oo[36].old.id+o[36].new.id;for(let o=0;oo[33].id;for(let o=0;o',i=C(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),tn("Successfully imported collections configuration."),i("submit")}catch(T){me.error(T)}t(4,u=!1),c()}}const _=()=>m(),g=()=>!u;function k(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ne.call(this,n,T)}function $(T){Ne.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,_,g,k,S,$]}class WR extends we{constructor(e){super(),ye(this,e,BR,VR,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function sb(n,e,t){const i=n.slice();return i[33]=e[t],i}function ob(n,e,t){const i=n.slice();return i[36]=e[t],i}function rb(n,e,t){const i=n.slice();return i[33]=e[t],i}function YR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T,O,E,I,L;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[JR,({uniqueId:U})=>({41:U}),({uniqueId:U})=>[0,U?1024:0]]},$$scope:{ctx:n}}});let A=n[1].length&&ub(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&fb(),R=n[6]&&n[1].length&&n[7]&&cb(n),z=n[13].length&&wb(n),F=!!n[0]&&Sb(n);return{c(){e=b("input"),t=C(),i=b("div"),l=b("p"),s=B(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=C(),j(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),N&&N.c(),d=C(),R&&R.c(),m=C(),z&&z.c(),h=C(),_=b("div"),F&&F.c(),g=C(),k=b("div"),S=C(),$=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=O=!n[14],p(_,"class","flex m-t-base")},m(U,J){y(U,e,J),n[21](e),y(U,t,J),y(U,i,J),w(i,l),w(l,s),w(l,o),y(U,r,J),q(a,U,J),y(U,u,J),A&&A.m(U,J),y(U,f,J),y(U,c,J),N&&N.m(U,J),y(U,d,J),R&&R.m(U,J),y(U,m,J),z&&z.m(U,J),y(U,h,J),y(U,_,J),F&&F.m(_,null),w(_,g),w(_,k),w(_,S),w(_,$),w($,T),E=!0,I||(L=[W(e,"change",n[22]),W(o,"click",n[23]),W($,"click",n[19])],I=!0)},p(U,J){(!E||J[0]&4096)&&Q(o,"btn-loading",U[12]);const K={};J[0]&64&&(K.class="form-field "+(U[6]?"":"field-error")),J[0]&65|J[1]&3072&&(K.$$scope={dirty:J,ctx:U}),a.$set(K),U[1].length?A?(A.p(U,J),J[0]&2&&M(A,1)):(A=ub(U),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(ae(),D(A,1,1,()=>{A=null}),ue()),U[6]&&U[1].length&&!U[7]?N||(N=fb(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),U[6]&&U[1].length&&U[7]?R?R.p(U,J):(R=cb(U),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),U[13].length?z?z.p(U,J):(z=wb(U),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),U[0]?F?F.p(U,J):(F=Sb(U),F.c(),F.m(_,g)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!U[14]))&&($.disabled=O)},i(U){E||(M(a.$$.fragment,U),M(A),M(P),E=!0)},o(U){D(a.$$.fragment,U),D(A),D(P),E=!1},d(U){U&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(h),v(_)),n[21](null),H(a,U),A&&A.d(U),N&&N.d(U),R&&R.d(U),z&&z.d(U),F&&F.d(),I=!1,Ie(L)}}}function KR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function ab(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function JR(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&ab();return{c(){e=b("label"),t=B("Collections"),l=C(),s=b("textarea"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[41]),p(e,"class","p-b-10"),p(s,"id",o=n[41]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),ce(s,n[0]),y(d,r,m),c&&c.m(d,m),y(d,a,m),u||(f=W(s,"input",n[24]),u=!0)},p(d,m){m[1]&1024&&i!==(i=d[41])&&p(e,"for",i),m[1]&1024&&o!==(o=d[41])&&p(s,"id",o),m[0]&1&&ce(s,d[0]),d[0]&&!d[6]?c||(c=ab(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function ub(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[ZR,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&3072&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[41]),e.disabled=i=!n[6],p(s,"for",r=n[41])},m(f,c){y(f,e,c),e.checked=n[5],y(f,l,c),y(f,s,c),w(s,o),a||(u=W(e,"change",n[25]),a=!0)},p(f,c){c[1]&1024&&t!==(t=f[41])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&1024&&r!==(r=f[41])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function fb(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function cb(n){let e,t,i,l,s,o=n[9].length&&db(n),r=n[3].length&&hb(n),a=n[8].length&&kb(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),l=C(),r&&r.c(),s=C(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){y(u,e,f),y(u,t,f),y(u,i,f),o&&o.m(i,null),w(i,l),r&&r.m(i,null),w(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=db(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=hb(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=kb(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function db(n){let e=[],t=new Map,i,l=de(n[9]);const s=o=>o[33].id;for(let o=0;oo[36].old.id+o[36].new.id;for(let o=0;oo[33].id;for(let o=0;o',i=C(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,s=C(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){y(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),r||(a=B(o,"click",n[27]),r=!0)},p:te,d(u){u&&v(e),r=!1,a()}}}function yb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[28]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function BR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[zR,jR],h=[];function _(g,k){return g[4]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(g,r,k),y(g,a,k),w(a,u),h[f].m(u,null),d=!0},p(g,k){(!d||k[0]&32768)&&re(o,g[15]);let S=f;f=_(g),f===S?h[f].p(g,k):(ae(),D(h[S],1,1,()=>{h[S]=null}),ue(),c=h[f],c?c.p(g,k):(c=h[f]=m[f](g),c.c()),E(c,1),c.m(u,null))},i(g){d||(E(c),d=!0)},o(g){D(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function WR(n){let e,t,i,l,s,o;e=new ms({}),i=new mi({props:{$$slots:{default:[BR]},$$scope:{ctx:n}}});let r={};return s=new HR({props:r}),n[29](s),s.$on("submit",n[18]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),y(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&2048&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),H(e,a),H(i,a),n[29](null),H(s,a)}}}function YR(n,e,t){let i,l,s,o,r,a,u;Qe(n,fn,oe=>t(15,u=oe)),Rn(fn,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],g=!0,k=[],S=!1,$=!1;T();async function T(){var oe;t(4,S=!0);try{t(20,_=await me.collections.getFullList(200));for(let Se of _)delete Se.created,delete Se.updated,(oe=Se.oauth2)==null||delete oe.providers}catch(Se){me.error(Se)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let oe of h){const Se=V.findByKey(_,"id",oe.id);!(Se!=null&&Se.id)||!V.hasCollectionChanges(Se,oe,g)||k.push({new:oe,old:Se})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let oe of h)delete oe.created,delete oe.updated,oe.fields=V.filterDuplicatesByKey(oe.fields)}function L(){for(let oe of h){const Se=V.findByKey(_,"name",oe.name)||V.findByKey(_,"id",oe.id);if(!Se)continue;const ge=oe.id,$e=Se.id;oe.id=$e;const Ye=Array.isArray(Se.fields)?Se.fields:[],nt=Array.isArray(oe.fields)?oe.fields:[];for(const xe of nt){const We=V.findByKey(Ye,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===ge&&(We.collectionId=$e)}t(0,d=JSON.stringify(h,null,4))}function I(oe){t(12,m=!0);const Se=new FileReader;Se.onload=async ge=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ge.target.result),await un(),h.length||(Ci("Invalid collections configuration."),A())},Se.onerror=ge=>{console.warn(ge),Ci("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},Se.readAsText(oe)}function A(){t(0,d=""),t(10,f.value="",f),Yt({})}function P(){const oe=$?V.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,oe,g)}function N(oe){ie[oe?"unshift":"push"](()=>{f=oe,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},z=()=>{f.click()};function F(){d=this.value,t(0,d)}function U(){$=this.checked,t(5,$)}function J(){g=this.checked,t(2,g)}const K=()=>L(),x=()=>A();function X(oe){ie[oe?"unshift":"push"](()=>{c=oe,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&$!==null&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(oe=>!!oe.id&&!!oe.name).length),n.$$.dirty[0]&1048678&&t(9,l=_.filter(oe=>i&&!$&&g&&!V.findByKey(h,"id",oe.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(oe=>i&&!V.findByKey(_,"id",oe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&O(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(oe=>{let Se=V.findByKey(_,"name",oe.name)||V.findByKey(_,"id",oe.id);if(!Se)return!1;if(Se.id!=oe.id)return!0;const ge=Array.isArray(Se.fields)?Se.fields:[],$e=Array.isArray(oe.fields)?oe.fields:[];for(const Ye of $e){if(V.findByKey(ge,"id",Ye.id))continue;const xe=V.findByKey(ge,"name",Ye.name);if(xe&&Ye.id!=xe.id)return!0}return!1}))},[d,h,g,k,S,$,i,o,s,l,f,c,m,a,r,u,L,I,A,P,_,N,R,z,F,U,J,K,x,X]}class KR extends we{constructor(e){super(),ye(this,e,YR,WR,_e,{},null,[-1,-1])}}function JR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;i=new fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[GR,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[XR,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[QR,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}});let _=n[0].smtp.enabled&&wb(n);function g($,T){return $[6]?uF:aF}let k=g(n),S=k(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),_&&_.c(),f=C(),c=b("div"),d=b("div"),m=C(),S.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(d,"class","flex-fill"),p(c,"class","flex")},m($,T){y($,e,T),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),y($,r,T),q(a,$,T),y($,u,T),_&&_.m($,T),y($,f,T),y($,c,T),w(c,d),w(c,m),S.m(c,null),h=!0},p($,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:$}),i.$set(O);const M={};T[0]&1|T[1]&12&&(M.$$scope={dirty:T,ctx:$}),o.$set(M);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:$}),a.$set(L),$[0].smtp.enabled?_?(_.p($,T),T[0]&1&&E(_,1)):(_=wb($),_.c(),E(_,1),_.m(f.parentNode,f)):_&&(ae(),D(_,1,1,()=>{_=null}),ue()),k===(k=g($))&&S?S.p($,T):(S.d(1),S=k($),S&&(S.c(),S.m(c,null)))},i($){h||(E(i.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(_),h=!0)},o($){D(i.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(_),h=!1},d($){$&&(v(e),v(r),v(u),v(f),v(c)),H(i),H(o),H(a,$),_&&_.d($),S.d()}}}function ZR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function GR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender name"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.senderName),r||(a=B(s,"input",n[14]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&ce(s,u[0].meta.senderName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function XR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender address"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","email"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.senderAddress),r||(a=B(s,"input",n[15]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&ce(s,u[0].meta.senderAddress)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function QR(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[33]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[33])},m(c,d){y(c,e,d),e.checked=n[0].smtp.enabled,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[16]),Ee(He.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]&4&&t!==(t=c[33])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&4&&a!==(a=c[33])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function wb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T;l=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[xR,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[eF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[tF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[nF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?lF:iF}let M=O(n),L=M(n),I=n[5]&&Sb(n);return{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),_=b("button"),L.c(),g=C(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){y(A,e,P),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(e,h),w(e,_),L.m(_,null),w(e,g),I&&I.m(e,null),S=!0,$||(T=B(_,"click",et(n[22])),$=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),l.$set(N);const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),r.$set(R);const z={};P[0]&1|P[1]&12&&(z.$$scope={dirty:P,ctx:A}),f.$set(z);const F={};P[0]&17|P[1]&12&&(F.$$scope={dirty:P,ctx:A}),m.$set(F),M!==(M=O(A))&&(L.d(1),L=M(A),L&&(L.c(),L.m(_,null))),A[5]?I?(I.p(A,P),P[0]&32&&E(I,1)):(I=Sb(A),I.c(),E(I,1),I.m(e,null)):I&&(ae(),D(I,1,1,()=>{I=null}),ue())},i(A){S||(E(l.$$.fragment,A),E(r.$$.fragment,A),E(f.$$.fragment,A),E(m.$$.fragment,A),E(I),A&&tt(()=>{S&&(k||(k=je(e,mt,{duration:150},!0)),k.run(1))}),S=!0)},o(A){D(l.$$.fragment,A),D(r.$$.fragment,A),D(f.$$.fragment,A),D(m.$$.fragment,A),D(I),A&&(k||(k=je(e,mt,{duration:150},!1)),k.run(0)),S=!1},d(A){A&&v(e),H(l),H(r),H(f),H(m),L.d(),I&&I.d(),A&&k&&k.end(),$=!1,T()}}}function xR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].smtp.host),r||(a=B(s,"input",n[17]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&ce(s,u[0].smtp.host)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function eF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Port"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","number"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].smtp.port),r||(a=B(s,"input",n[18]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&>(s.value)!==u[0].smtp.port&&ce(s,u[0].smtp.port)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function tF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Username"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33])},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].smtp.username),r||(a=B(s,"input",n[19]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&ce(s,u[0].smtp.username)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function nF(n){let e,t,i,l,s,o,r,a;function u(d){n[20](d)}function f(d){n[21](d)}let c={id:n[33]};return n[4]!==void 0&&(c.mask=n[4]),n[0].smtp.password!==void 0&&(c.value=n[0].smtp.password),s=new xu({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Password"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],Te(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,Te(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function iF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function lF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function Sb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[sF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[oF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[rF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){y(h,e,_),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&12&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const k={};_[0]&1|_[1]&12&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const S={};_[0]&1|_[1]&12&&(S.$$scope={dirty:_,ctx:h}),u.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),h&&tt(()=>{m&&(d||(d=je(e,mt,{duration:150},!0)),d.run(1))}),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),h&&(d||(d=je(e,mt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),H(i),H(o),H(u),h&&d&&d.end()}}}function sF(n){let e,t,i,l,s,o,r;function a(f){n[23](f)}let u={id:n[33],items:n[8]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function oF(n){let e,t,i,l,s,o,r;function a(f){n[24](f)}let u={id:n[33],items:n[9]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,Te(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function rF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[33]),p(r,"type","text"),p(r,"id",a=n[33]),p(r,"placeholder","Default to localhost")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[0].smtp.localName),u||(f=[Ee(He.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),B(r,"input",n[25])],u=!0)},p(c,d){d[1]&4&&s!==(s=c[33])&&p(e,"for",s),d[1]&4&&a!==(a=c[33])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ce(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ie(f)}}}function aF(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){y(l,e,s),t||(i=B(e,"click",n[28]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function uF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[6]||n[3],Q(l,"btn-loading",n[3])},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),w(l,s),r||(a=[B(e,"click",n[26]),B(l,"click",n[27])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&72&&o!==(o=!u[6]||u[3])&&(l.disabled=o),f[0]&8&&Q(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,Ie(a)}}}function fF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const k=[ZR,JR],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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(T,O){y(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(T,r,O),y(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,_||(g=B(u,"submit",et(n[29])),_=!0)},p(T,O){(!h||O[0]&128)&&re(o,T[7]);let M=d;d=$(T),d===M?S[d].p(T,O):(ae(),D(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),E(m,1),m.m(u,null))},i(T){h||(E(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function cF(n){let e,t,i,l,s,o;e=new ms({}),i=new mi({props:{$$slots:{default:[fF]},$$scope:{ctx:n}}});let r={};return s=new sv({props:r}),n[30](s),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),y(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function dF(n,e,t){let i,l,s;Qe(n,fn,oe=>t(7,s=oe));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Rn(fn,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;_();async function _(){t(2,c=!0);try{const oe=await me.settings.getAll()||{};k(oe)}catch(oe){me.error(oe)}t(2,c=!1)}async function g(){if(!(d||!l)){t(3,d=!0);try{const oe=await me.settings.update(V.filterRedactedProps(f));k(oe),Yt({}),en("Successfully saved mail settings.")}catch(oe){me.error(oe)}t(3,d=!1)}}function k(oe={}){t(0,f={meta:(oe==null?void 0:oe.meta)||{},smtp:(oe==null?void 0:oe.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(12,u=JSON.parse(JSON.stringify(f))),t(4,m=!!f.smtp.username)}function S(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function $(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function O(){f.smtp.enabled=this.checked,t(0,f)}function M(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=gt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(oe){m=oe,t(4,m)}function P(oe){n.$$.not_equal(f.smtp.password,oe)&&(f.smtp.password=oe,t(0,f))}const N=()=>{t(5,h=!h)};function R(oe){n.$$.not_equal(f.smtp.tls,oe)&&(f.smtp.tls=oe,t(0,f))}function z(oe){n.$$.not_equal(f.smtp.authMethod,oe)&&(f.smtp.authMethod=oe,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const U=()=>S(),J=()=>g(),K=()=>a==null?void 0:a.show(),x=()=>g();function X(oe){ie[oe?"unshift":"push"](()=>{a=oe,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&4096&&t(13,i=JSON.stringify(u)),n.$$.dirty[0]&8193&&t(6,l=i!=JSON.stringify(f))},[f,a,c,d,m,h,l,s,o,r,g,S,u,i,$,T,O,M,L,I,A,P,N,R,z,F,U,J,K,x,X]}class pF extends we{constructor(e){super(),ye(this,e,dF,cF,_e,{},null,[-1,-1])}}function mF(n){var L;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;function k(I){n[11](I)}function S(I){n[12](I)}function $(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[_F]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new pv({props:T}),ie.push(()=>be(e,"config",k)),ie.push(()=>be(e,"isTesting",S)),ie.push(()=>be(e,"testError",$));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&$b(n),M=n[6]&&Cb(n);return{c(){j(e.$$.fragment),s=C(),o=b("div"),r=b("div"),a=C(),O&&O.c(),u=C(),M&&M.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),y(I,s,A),y(I,o,A),w(o,r),w(o,a),O&&O.m(o,null),w(o,u),M&&M.m(o,null),w(o,f),w(o,c),w(c,d),h=!0,_||(g=B(c,"click",n[15]),_=!0)},p(I,A){var N;const P={};A&1&&(P.originalConfig=I[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:I}),!t&&A&2&&(t=!0,P.config=I[1].s3,Te(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],Te(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],Te(()=>l=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=$b(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?M?M.p(I,A):(M=Cb(I),M.c(),M.m(o,f)):M&&(M.d(1),M=null),(!h||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||A&8)&&Q(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),H(e,I),O&&O.d(),M&&M.d(),_=!1,g()}}}function hF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function Tb(n){var A;let e,t,i,l,s,o,r,a=(A=n[0].s3)!=null&&A.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,k,S,$,T,O,M,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually + to.
    `,s=C(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){y(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),r||(a=W(o,"click",n[27]),r=!0)},p:te,d(u){u&&v(e),r=!1,a()}}}function Sb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[28]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function GR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[KR,YR],h=[];function _(g,k){return g[4]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,k){y(g,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(g,r,k),y(g,a,k),w(a,u),h[f].m(u,null),d=!0},p(g,k){(!d||k[0]&32768)&&re(o,g[15]);let S=f;f=_(g),f===S?h[f].p(g,k):(ae(),D(h[S],1,1,()=>{h[S]=null}),ue(),c=h[f],c?c.p(g,k):(c=h[f]=m[f](g),c.c()),M(c,1),c.m(u,null))},i(g){d||(M(c),d=!0)},o(g){D(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function XR(n){let e,t,i,l,s,o;e=new ms({}),i=new mi({props:{$$slots:{default:[GR]},$$scope:{ctx:n}}});let r={};return s=new WR({props:r}),n[29](s),s.$on("submit",n[18]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),y(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&2048&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),H(e,a),H(i,a),n[29](null),H(s,a)}}}function QR(n,e,t){let i,l,s,o,r,a,u;Qe(n,fn,oe=>t(15,u=oe)),Rn(fn,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],g=!0,k=[],S=!1,$=!1;T();async function T(){var oe;t(4,S=!0);try{t(20,_=await me.collections.getFullList(200));for(let Se of _)delete Se.created,delete Se.updated,(oe=Se.oauth2)==null||delete oe.providers}catch(Se){me.error(Se)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let oe of h){const Se=V.findByKey(_,"id",oe.id);!(Se!=null&&Se.id)||!V.hasCollectionChanges(Se,oe,g)||k.push({new:oe,old:Se})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let oe of h)delete oe.created,delete oe.updated,oe.fields=V.filterDuplicatesByKey(oe.fields)}function I(){for(let oe of h){const Se=V.findByKey(_,"name",oe.name)||V.findByKey(_,"id",oe.id);if(!Se)continue;const ge=oe.id,$e=Se.id;oe.id=$e;const Ye=Array.isArray(Se.fields)?Se.fields:[],nt=Array.isArray(oe.fields)?oe.fields:[];for(const xe of nt){const We=V.findByKey(Ye,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===ge&&(We.collectionId=$e)}t(0,d=JSON.stringify(h,null,4))}function L(oe){t(12,m=!0);const Se=new FileReader;Se.onload=async ge=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ge.target.result),await un(),h.length||(Ci("Invalid collections configuration."),A())},Se.onerror=ge=>{console.warn(ge),Ci("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},Se.readAsText(oe)}function A(){t(0,d=""),t(10,f.value="",f),Yt({})}function P(){const oe=$?V.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,oe,g)}function N(oe){ie[oe?"unshift":"push"](()=>{f=oe,t(10,f)})}const R=()=>{f.files.length&&L(f.files[0])},z=()=>{f.click()};function F(){d=this.value,t(0,d)}function U(){$=this.checked,t(5,$)}function J(){g=this.checked,t(2,g)}const K=()=>I(),x=()=>A();function X(oe){ie[oe?"unshift":"push"](()=>{c=oe,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&$!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(oe=>!!oe.id&&!!oe.name).length),n.$$.dirty[0]&1048678&&t(9,l=_.filter(oe=>i&&!$&&g&&!V.findByKey(h,"id",oe.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(oe=>i&&!V.findByKey(_,"id",oe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&O(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(oe=>{let Se=V.findByKey(_,"name",oe.name)||V.findByKey(_,"id",oe.id);if(!Se)return!1;if(Se.id!=oe.id)return!0;const ge=Array.isArray(Se.fields)?Se.fields:[],$e=Array.isArray(oe.fields)?oe.fields:[];for(const Ye of $e){if(V.findByKey(ge,"id",Ye.id))continue;const xe=V.findByKey(ge,"name",Ye.name);if(xe&&Ye.id!=xe.id)return!0}return!1}))},[d,h,g,k,S,$,i,o,s,l,f,c,m,a,r,u,I,L,A,P,_,N,R,z,F,U,J,K,x,X]}class xR extends we{constructor(e){super(),ye(this,e,QR,XR,_e,{},null,[-1,-1])}}function eF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;i=new fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[nF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[iF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[lF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}});let _=n[0].smtp.enabled&&Tb(n);function g($,T){return $[6]?hF:mF}let k=g(n),S=k(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),_&&_.c(),f=C(),c=b("div"),d=b("div"),m=C(),S.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(d,"class","flex-fill"),p(c,"class","flex")},m($,T){y($,e,T),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),y($,r,T),q(a,$,T),y($,u,T),_&&_.m($,T),y($,f,T),y($,c,T),w(c,d),w(c,m),S.m(c,null),h=!0},p($,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:$}),i.$set(O);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:$}),o.$set(E);const I={};T[0]&1|T[1]&12&&(I.$$scope={dirty:T,ctx:$}),a.$set(I),$[0].smtp.enabled?_?(_.p($,T),T[0]&1&&M(_,1)):(_=Tb($),_.c(),M(_,1),_.m(f.parentNode,f)):_&&(ae(),D(_,1,1,()=>{_=null}),ue()),k===(k=g($))&&S?S.p($,T):(S.d(1),S=k($),S&&(S.c(),S.m(c,null)))},i($){h||(M(i.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(_),h=!0)},o($){D(i.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(_),h=!1},d($){$&&(v(e),v(r),v(u),v(f),v(c)),H(i),H(o),H(a,$),_&&_.d($),S.d()}}}function tF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function nF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Sender name"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.senderName),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&ce(s,u[0].meta.senderName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function iF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Sender address"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","email"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].meta.senderAddress),r||(a=W(s,"input",n[15]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&ce(s,u[0].meta.senderAddress)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function lF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[33]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[33])},m(c,d){y(c,e,d),e.checked=n[0].smtp.enabled,y(c,i,d),y(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[16]),Ee(He.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]&4&&t!==(t=c[33])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&4&&a!==(a=c[33])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,Ie(f)}}}function Tb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,$,T;l=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[sF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[oF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[rF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[aF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?fF:uF}let E=O(n),I=E(n),L=n[5]&&$b(n);return{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),_=b("button"),I.c(),g=C(),L&&L.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){y(A,e,P),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(e,h),w(e,_),I.m(_,null),w(e,g),L&&L.m(e,null),S=!0,$||(T=W(_,"click",et(n[22])),$=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),l.$set(N);const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),r.$set(R);const z={};P[0]&1|P[1]&12&&(z.$$scope={dirty:P,ctx:A}),f.$set(z);const F={};P[0]&17|P[1]&12&&(F.$$scope={dirty:P,ctx:A}),m.$set(F),E!==(E=O(A))&&(I.d(1),I=E(A),I&&(I.c(),I.m(_,null))),A[5]?L?(L.p(A,P),P[0]&32&&M(L,1)):(L=$b(A),L.c(),M(L,1),L.m(e,null)):L&&(ae(),D(L,1,1,()=>{L=null}),ue())},i(A){S||(M(l.$$.fragment,A),M(r.$$.fragment,A),M(f.$$.fragment,A),M(m.$$.fragment,A),M(L),A&&tt(()=>{S&&(k||(k=je(e,mt,{duration:150},!0)),k.run(1))}),S=!0)},o(A){D(l.$$.fragment,A),D(r.$$.fragment,A),D(f.$$.fragment,A),D(m.$$.fragment,A),D(L),A&&(k||(k=je(e,mt,{duration:150},!1)),k.run(0)),S=!1},d(A){A&&v(e),H(l),H(r),H(f),H(m),I.d(),L&&L.d(),A&&k&&k.end(),$=!1,T()}}}function sF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("SMTP server host"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].smtp.host),r||(a=W(s,"input",n[17]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&ce(s,u[0].smtp.host)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Port"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","number"),p(s,"id",o=n[33]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].smtp.port),r||(a=W(s,"input",n[18]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&>(s.value)!==u[0].smtp.port&&ce(s,u[0].smtp.port)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function rF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Username"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33])},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[0].smtp.username),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&ce(s,u[0].smtp.username)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function aF(n){let e,t,i,l,s,o,r,a;function u(d){n[20](d)}function f(d){n[21](d)}let c={id:n[33]};return n[4]!==void 0&&(c.mask=n[4]),n[0].smtp.password!==void 0&&(c.value=n[0].smtp.password),s=new xu({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Password"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){y(d,e,m),w(e,t),y(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],Te(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,Te(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),H(s,d)}}}function uF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function fF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){y(l,e,s),y(l,t,s),y(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function $b(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[cF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[dF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[pF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){y(h,e,_),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&12&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const k={};_[0]&1|_[1]&12&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const S={};_[0]&1|_[1]&12&&(S.$$scope={dirty:_,ctx:h}),u.$set(S)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),h&&tt(()=>{m&&(d||(d=je(e,mt,{duration:150},!0)),d.run(1))}),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),h&&(d||(d=je(e,mt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),H(i),H(o),H(u),h&&d&&d.end()}}}function cF(n){let e,t,i,l,s,o,r;function a(f){n[23](f)}let u={id:n[33],items:n[8]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("TLS encryption"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function dF(n){let e,t,i,l,s,o,r;function a(f){n[24](f)}let u={id:n[33],items:n[9]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),s=new Wn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("AUTH method"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){y(f,e,c),w(e,t),y(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,Te(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),H(s,f)}}}function pF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[33]),p(r,"type","text"),p(r,"id",a=n[33]),p(r,"placeholder","Default to localhost")},m(c,d){y(c,e,d),w(e,t),w(e,i),w(e,l),y(c,o,d),y(c,r,d),ce(r,n[0].smtp.localName),u||(f=[Ee(He.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),W(r,"input",n[25])],u=!0)},p(c,d){d[1]&4&&s!==(s=c[33])&&p(e,"for",s),d[1]&4&&a!==(a=c[33])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ce(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ie(f)}}}function mF(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){y(l,e,s),t||(i=W(e,"click",n[28]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function hF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[6]||n[3],Q(l,"btn-loading",n[3])},m(u,f){y(u,e,f),w(e,t),y(u,i,f),y(u,l,f),w(l,s),r||(a=[W(e,"click",n[26]),W(l,"click",n[27])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&72&&o!==(o=!u[6]||u[3])&&(l.disabled=o),f[0]&8&&Q(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,Ie(a)}}}function _F(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const k=[tF,eF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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(T,O){y(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(T,r,O),y(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,_||(g=W(u,"submit",et(n[29])),_=!0)},p(T,O){(!h||O[0]&128)&&re(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(ae(),D(S[E],1,1,()=>{S[E]=null}),ue(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function gF(n){let e,t,i,l,s,o;e=new ms({}),i=new mi({props:{$$slots:{default:[_F]},$$scope:{ctx:n}}});let r={};return s=new rv({props:r}),n[30](s),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),y(a,t,u),q(i,a,u),y(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function bF(n,e,t){let i,l,s;Qe(n,fn,oe=>t(7,s=oe));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Rn(fn,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;_();async function _(){t(2,c=!0);try{const oe=await me.settings.getAll()||{};k(oe)}catch(oe){me.error(oe)}t(2,c=!1)}async function g(){if(!(d||!l)){t(3,d=!0);try{const oe=await me.settings.update(V.filterRedactedProps(f));k(oe),Yt({}),tn("Successfully saved mail settings.")}catch(oe){me.error(oe)}t(3,d=!1)}}function k(oe={}){t(0,f={meta:(oe==null?void 0:oe.meta)||{},smtp:(oe==null?void 0:oe.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(12,u=JSON.parse(JSON.stringify(f))),t(4,m=!!f.smtp.username)}function S(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function $(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=gt(this.value),t(0,f)}function L(){f.smtp.username=this.value,t(0,f)}function A(oe){m=oe,t(4,m)}function P(oe){n.$$.not_equal(f.smtp.password,oe)&&(f.smtp.password=oe,t(0,f))}const N=()=>{t(5,h=!h)};function R(oe){n.$$.not_equal(f.smtp.tls,oe)&&(f.smtp.tls=oe,t(0,f))}function z(oe){n.$$.not_equal(f.smtp.authMethod,oe)&&(f.smtp.authMethod=oe,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const U=()=>S(),J=()=>g(),K=()=>a==null?void 0:a.show(),x=()=>g();function X(oe){ie[oe?"unshift":"push"](()=>{a=oe,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&4096&&t(13,i=JSON.stringify(u)),n.$$.dirty[0]&8193&&t(6,l=i!=JSON.stringify(f))},[f,a,c,d,m,h,l,s,o,r,g,S,u,i,$,T,O,E,I,L,A,P,N,R,z,F,U,J,K,x,X]}class kF extends we{constructor(e){super(),ye(this,e,bF,gF,_e,{},null,[-1,-1])}}function vF(n){var I;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;function k(L){n[11](L)}function S(L){n[12](L)}function $(L){n[13](L)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[wF]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new hv({props:T}),ie.push(()=>be(e,"config",k)),ie.push(()=>be(e,"isTesting",S)),ie.push(()=>be(e,"testError",$));let O=((I=n[1].s3)==null?void 0:I.enabled)&&!n[6]&&!n[3]&&Ob(n),E=n[6]&&Eb(n);return{c(){j(e.$$.fragment),s=C(),o=b("div"),r=b("div"),a=C(),O&&O.c(),u=C(),E&&E.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(L,A){q(e,L,A),y(L,s,A),y(L,o,A),w(o,r),w(o,a),O&&O.m(o,null),w(o,u),E&&E.m(o,null),w(o,f),w(o,c),w(c,d),h=!0,_||(g=W(c,"click",n[15]),_=!0)},p(L,A){var N;const P={};A&1&&(P.originalConfig=L[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:L}),!t&&A&2&&(t=!0,P.config=L[1].s3,Te(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=L[4],Te(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=L[5],Te(()=>l=!1)),e.$set(P),(N=L[1].s3)!=null&&N.enabled&&!L[6]&&!L[3]?O?O.p(L,A):(O=Ob(L),O.c(),O.m(o,u)):O&&(O.d(1),O=null),L[6]?E?E.p(L,A):(E=Eb(L),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!h||A&72&&m!==(m=!L[6]||L[3]))&&(c.disabled=m),(!h||A&8)&&Q(c,"btn-loading",L[3])},i(L){h||(M(e.$$.fragment,L),h=!0)},o(L){D(e.$$.fragment,L),h=!1},d(L){L&&(v(s),v(o)),H(e,L),O&&O.d(),E&&E.d(),_=!1,g()}}}function yF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function Cb(n){var A;let e,t,i,l,s,o,r,a=(A=n[0].s3)!=null&&A.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,k,S,$,T,O,E,I,L;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually from the - `),r=b("strong"),u=W(a),f=W(` + `),r=b("strong"),u=B(a),f=B(` to the - `),c=b("strong"),m=W(d),h=W(`. - `),_=b("br"),g=W(` + `),c=b("strong"),m=B(d),h=B(`. + `),_=b("br"),g=B(` There are numerous command line tools that can help you, such as: `),k=b("a"),k.textContent=`rclone - `,S=W(`, + `,S=B(`, `),$=b("a"),$.textContent=`s5cmd - `,T=W(", etc."),O=C(),M=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,N){y(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,_),w(s,g),w(s,k),w(s,S),w(s,$),w(s,T),w(e,O),w(e,M),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&re(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&re(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=je(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=je(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&v(e),P&&L&&L.end()}}}function _F(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Tb(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),y(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=Tb(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(ae(),D(t,1,1,()=>{t=null}),ue())},d(l){l&&v(e),t&&t.d(l)}}}function $b(n){let e;function t(s,o){return s[4]?kF:s[5]?bF:gF}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function gF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function bF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;y(s,e,o),i||(l=Ee(t=He.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Nt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function kF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Cb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){y(s,e,o),w(e,t),i||(l=B(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function vF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const k=[hF,mF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("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 an S3 compatible storage.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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(T,O){y(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(T,r,O),y(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,_||(g=B(u,"submit",et(n[16])),_=!0)},p(T,O){(!h||O&128)&&re(o,T[7]);let M=d;d=$(T),d===M?S[d].p(T,O):(ae(),D(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),E(m,1),m.m(u,null))},i(T){h||(E(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function yF(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[vF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}const wF="s3_test_request";function SF(n,e,t){let i,l,s;Qe(n,fn,M=>t(7,s=M)),Rn(fn,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await me.settings.getAll()||{};h(M)}catch(M){me.error(M)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{me.cancelRequest(wF);const M=await me.settings.update(V.filterRedactedProps(r));Yt({}),await h(M),Is(),c?aw("Successfully saved but failed to establish S3 connection."):en("Successfully saved files storage settings.")}catch(M){me.error(M)}t(3,u=!1)}}async function h(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function k(M){f=M,t(4,f)}function S(M){c=M,t(5,c)}const $=()=>_(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,_,i,g,k,S,$,T,O]}class TF extends we{constructor(e){super(),ye(this,e,SF,yF,_e,{})}}function Ob(n){let e,t,i,l,s;return{c(){e=W("("),t=W(n[1]),i=W("/"),l=W(n[2]),s=W(")")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),y(o,l,r),y(o,s,r)},p(o,r){r&2&&re(t,o[1]),r&4&&re(l,o[2])},d(o){o&&(v(e),v(t),v(i),v(l),v(s))}}}function $F(n){let e,t,i,l;const s=[MF,EF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function CF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[LF,({uniqueId:_})=>({25:_}),({uniqueId:_})=>_?33554432:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[AF,({uniqueId:_})=>({25:_}),({uniqueId:_})=>_?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=W(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),Q(o,"btn-disabled",n[7]),Q(o,"btn-loading",n[7]),p(e,"class","block")},m(_,g){y(_,e,g),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=B(e,"submit",et(n[13])),m=!0)},p(_,g){const k={};g&100663329&&(k.$$scope={dirty:g,ctx:_}),t.$set(k);const S={};g&100663360&&(S.$$scope={dirty:g,ctx:_}),l.$set(S),(!d||g&4)&&a!==(a=_[2]>1?"Next":"Login")&&re(u,a),(!d||g&128)&&Q(o,"btn-disabled",_[7]),(!d||g&128)&&Q(o,"btn-loading",_[7])},i(_){d||(E(t.$$.fragment,_),E(l.$$.fragment,_),d=!0)},o(_){D(t.$$.fragment,_),D(l.$$.fragment,_),d=!1},d(_){_&&v(e),H(t),H(l),m=!1,h()}}}function OF(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function EF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[11]&&Eb(n);return i=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[DF,({uniqueId:h})=>({25:h}),({uniqueId:h})=>h?33554432:0]},$$scope:{ctx:n}}}),{c(){m&&m.c(),e=C(),t=b("form"),j(i.$$.fragment),l=C(),s=b("button"),s.innerHTML='Login ',o=C(),r=b("div"),a=b("button"),u=W("Request another OTP"),p(s,"type","submit"),p(s,"class","btn btn-lg btn-block btn-next"),Q(s,"btn-disabled",n[9]),Q(s,"btn-loading",n[9]),p(t,"class","block"),p(a,"type","button"),p(a,"class","link-hint"),a.disabled=n[9],p(r,"class","content txt-center m-t-sm")},m(h,_){m&&m.m(h,_),y(h,e,_),y(h,t,_),q(i,t,null),w(t,l),w(t,s),y(h,o,_),y(h,r,_),w(r,a),w(a,u),f=!0,c||(d=[B(t,"submit",et(n[15])),B(a,"click",n[20])],c=!0)},p(h,_){h[11]?m?m.p(h,_):(m=Eb(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null);const g={};_&100667392&&(g.$$scope={dirty:_,ctx:h}),i.$set(g),(!f||_&512)&&Q(s,"btn-disabled",h[9]),(!f||_&512)&&Q(s,"btn-loading",h[9]),(!f||_&512)&&(a.disabled=h[9])},i(h){f||(E(i.$$.fragment,h),f=!0)},o(h){D(i.$$.fragment,h),f=!1},d(h){h&&(v(e),v(t),v(o),v(r)),m&&m.d(h),H(i),c=!1,Ie(d)}}}function MF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[IF,({uniqueId:a})=>({25:a}),({uniqueId:a})=>a?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),l=b("button"),l.innerHTML=' Send OTP',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),Q(l,"btn-disabled",n[8]),Q(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){y(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=B(e,"submit",et(n[14])),o=!0)},p(a,u){const f={};u&100665344&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&Q(l,"btn-disabled",a[8]),(!s||u&256)&&Q(l,"btn-loading",a[8])},i(a){s||(E(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&v(e),H(t),o=!1,r()}}}function Eb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=W("Check your "),l=b("strong"),s=W(n[11]),o=W(` inbox and enter in the input below the received - One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){y(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&2048&&re(s,r[11])},d(r){r&&v(e)}}}function DF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("One-time password"),l=C(),s=b("input"),p(e,"for",i=n[25]),p(s,"type","password"),p(s,"id",o=n[25]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[12]),r||(a=B(s,"input",n[19]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(s,"id",o),f&4096&&s.value!==u[12]&&ce(s,u[12])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function IF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=C(),s=b("input"),p(e,"for",i=n[25]),p(s,"type","email"),p(s,"id",o=n[25]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[11]),r||(a=B(s,"input",n[18]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(s,"id",o),f&2048&&s.value!==u[11]&&ce(s,u[11])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function LF(n){let e,t=V.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=W(t),s=C(),o=b("input"),p(e,"for",l=n[25]),p(o,"id",r=n[25]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){y(c,e,d),w(e,i),y(c,s,d),y(c,o,d),o.focus(),u||(f=B(o,"input",n[16]),u=!0)},p(c,d){d&1&&t!==(t=V.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&re(i,t),d&33554432&&l!==(l=c[25])&&p(e,"for",l),d&33554432&&r!==(r=c[25])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function AF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[25]),p(s,"type","password"),p(s,"id",o=n[25]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),ce(s,n[6]),y(d,r,m),y(d,a,m),w(a,u),f||(c=[B(s,"input",n[17]),Ee(Vn.call(null,u))],f=!0)},p(d,m){m&33554432&&i!==(i=d[25])&&p(e,"for",i),m&33554432&&o!==(o=d[25])&&p(s,"id",o),m&64&&s.value!==d[6]&&ce(s,d[6])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,Ie(c)}}}function PF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&Ob(n);const f=[OF,CF,$F],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login - `),u&&u.c(),l=C(),o&&o.c(),r=ke(),p(e,"class","content txt-center m-b-base")},m(m,h){y(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),y(m,l,h),~s&&c[s].m(m,h),y(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=Ob(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let _=s;s=d(m),s===_?~s&&c[s].p(m,h):(o&&(ae(),D(c[_],1,1,()=>{c[_]=null}),ue()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),E(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(E(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(v(e),v(l),v(r)),u&&u.d(),~s&&c[s].d(m)}}}function NF(n){let e,t;return e=new sk({props:{$$slots:{default:[PF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67117055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function RF(n,e,t){let i;Qe(n,Lu,R=>t(22,i=R));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",_="",g="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await me.collection("_superusers").listAuthMethods())}catch(R){me.error(R)}t(10,m=!1)}}async function T(){var R,z;if(!f){t(7,f=!0);try{await me.collection("_superusers").authWithPassword(s,o),Is(),Yt({}),Il("/")}catch(F){F.status==401?(t(3,h=F.response.mfaId),((z=(R=r==null?void 0:r.password)==null?void 0:R.identityFields)==null?void 0:z.length)==1&&r.password.identityFields[0]=="email"?(t(11,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(11,k=s)):F.status!=400?me.error(F):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const R=await me.collection("_superusers").requestOTP(k);t(4,_=R.otpId),g=_,Is(),Yt({})}catch(R){R.status==429&&t(4,_=g),me.error(R)}t(8,c=!1)}}async function M(){if(!d){t(9,d=!0);try{await me.collection("_superusers").authWithOTP(_,S,{mfaId:h}),Is(),Yt({}),Il("/")}catch(R){me.error(R)}t(9,d=!1)}}const L=R=>{t(5,s=R.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(11,k)}function P(){S=this.value,t(12,S)}const N=()=>{t(4,_="")};return n.$$.update=()=>{var R,z;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(R=r==null?void 0:r.mfa)!=null&&R.enabled&&t(2,u++,u),(z=r==null?void 0:r.otp)!=null&&z.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),_!=""&&t(1,a++,a))},[r,a,u,h,_,s,o,f,c,d,m,k,S,T,O,M,L,I,A,P,N]}class FF extends we{constructor(e){super(),ye(this,e,RF,NF,_e,{})}}function Xt(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{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("pbinstal")?Il("/"):!0}],qF={"/login":Xt({component:FF,conditions:sn.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Xt({asyncComponent:()=>Ct(()=>import("./PageSuperuserRequestPasswordReset-Bpn-_-HR.js"),[],import.meta.url),conditions:sn.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageSuperuserConfirmPasswordReset-DbcUga_c.js"),[],import.meta.url),conditions:sn.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Xt({component:LN,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Xt({component:y5,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Xt({component:C7,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Xt({component:pF,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Xt({component:TF,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Xt({component:OR,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Xt({component:KR,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Xt({component:kR,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmPasswordReset-DzYgUGFK.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmPasswordReset-DzYgUGFK.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmVerification-CBvWw0Cv.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmVerification-CBvWw0Cv.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmEmailChange-DXag49OS.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Xt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmEmailChange-DXag49OS.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Xt({asyncComponent:()=>Ct(()=>import("./PageOAuth2RedirectSuccess-C3IPDfGd.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Xt({asyncComponent:()=>Ct(()=>import("./PageOAuth2RedirectFailure-XymI0BiX.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"*":Xt({component:c3,userData:{showAppSidebar:!1}})};function HF(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Mb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,_,g,k,S,$,T;return g=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[jF]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=W(m),_=C(),j(g.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,M){y(O,e,M),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,_),q(g,c,null),S=!0,$||(T=[Ee(Vn.call(null,t)),Ee(Vn.call(null,s)),Ee(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Ee(He.call(null,s,{text:"Collections",position:"right"})),Ee(Vn.call(null,r)),Ee(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ee(He.call(null,r,{text:"Logs",position:"right"})),Ee(Vn.call(null,u)),Ee(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ee(He.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,M){(!S||M&1)&&m!==(m=V.getInitials(O[0].email)+"")&&re(h,m);const L={};M&4097&&(L.$$scope={dirty:M,ctx:O}),g.$set(L),(!S||M&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(E(g.$$.fragment,O),S=!0)},o(O){D(g.$$.fragment,O),S=!1},d(O){O&&v(e),H(g),$=!1,Ie(T)}}}function jF(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=W(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){y(m,e,h),w(e,i),y(m,s,h),y(m,o,h),y(m,r,h),y(m,a,h),y(m,u,h),y(m,f,h),c||(d=[Ee(Vn.call(null,a)),B(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&re(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(v(e),v(s),v(o),v(r),v(a),v(u),v(f)),c=!1,Ie(d)}}}function Db(n){let e,t,i;return t=new Tu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function zF(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=window.location.protocol=="https:"&&HF(),g=((S=n[0])==null?void 0:S.id)&&n[1]&&Mb(n);r=new zw({props:{routes:qF}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new hw({}),c=new ew({});let k=n[1]&&!n[2]&&Db(n);return{c(){_&&_.c(),t=ke(),i=C(),l=b("div"),g&&g.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ke(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){_&&_.m(document.head,null),w(document.head,t),y($,i,T),y($,l,T),g&&g.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),y($,f,T),q(c,$,T),y($,d,T),k&&k.m($,T),y($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?g?(g.p($,T),T&3&&E(g,1)):(g=Mb($),g.c(),E(g,1),g.m(l,s)):g&&(ae(),D(g,1,1,()=>{g=null}),ue()),$[1]&&!$[2]?k?(k.p($,T),T&6&&E(k,1)):(k=Db($),k.c(),E(k,1),k.m(m.parentNode,m)):k&&(ae(),D(k,1,1,()=>{k=null}),ue())},i($){h||(E(g),E(r.$$.fragment,$),E(u.$$.fragment,$),E(c.$$.fragment,$),E(k),h=!0)},o($){D(g),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(v(i),v(l),v(f),v(d),v(m)),_&&_.d($),v(t),g&&g.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function UF(n,e,t){let i,l,s,o;Qe(n,Dl,_=>t(10,i=_)),Qe(n,gr,_=>t(3,l=_)),Qe(n,Fr,_=>t(0,s=_)),Qe(n,fn,_=>t(4,o=_));let r,a=!1,u=!1;function f(_){var g,k,S,$;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(k=_==null?void 0:_.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=_==null?void 0:_.detail)==null?void 0:$.location,Rn(fn,o="",o),Yt({}),K0())}function c(){Il("/")}async function d(){var _,g;if(s!=null&&s.id)try{const k=await me.settings.getAll({$cancelKey:"initialAppSettings"});Rn(gr,l=((_=k==null?void 0:k.meta)==null?void 0:_.appName)||"",l),Rn(Dl,i=!!((g=k==null?void 0:k.meta)!=null&&g.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){me.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class VF extends we{constructor(e){super(),ye(this,e,UF,zF,_e,{})}}new VF({target:document.getElementById("app")});export{Ie as A,en as B,V as C,Il as D,ke as E,sk as F,po as G,xl as H,Cu as I,Qe as J,Rn as K,Zt as L,fn as M,En as N,bt as O,ie as P,yP as Q,Qu as R,we as S,pe as T,yt as U,pi as V,zt as W,pt as X,jt as Y,Ov as Z,D as a,C as b,j as c,H as d,b as e,p as f,y as g,w as h,ye as i,Ee as j,ae as k,Vn as l,q as m,ue as n,v as o,me as p,fe as q,Q as r,_e as s,E as t,B as u,et as v,W as w,re as x,te as y,ce as z}; + `,T=B(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){y(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,_),w(s,g),w(s,k),w(s,S),w(s,$),w(s,T),w(e,O),w(e,E),L=!0},p(P,N){var R;(!L||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&re(u,a),(!L||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&re(m,d)},i(P){L||(P&&tt(()=>{L&&(I||(I=je(e,mt,{duration:150},!0)),I.run(1))}),L=!0)},o(P){P&&(I||(I=je(e,mt,{duration:150},!1)),I.run(0)),L=!1},d(P){P&&v(e),P&&I&&I.end()}}}function wF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Cb(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),y(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&M(t,1)):(t=Cb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(ae(),D(t,1,1,()=>{t=null}),ue())},d(l){l&&v(e),t&&t.d(l)}}}function Ob(n){let e;function t(s,o){return s[4]?$F:s[5]?TF:SF}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),y(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function SF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function TF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;y(s,e,o),i||(l=Ee(t=He.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Nt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function $F(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){y(t,e,i)},p:te,d(t){t&&v(e)}}}function Eb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){y(s,e,o),w(e,t),i||(l=W(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function CF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const k=[yF,vF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("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 an S3 compatible storage.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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(T,O){y(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),y(T,r,O),y(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,_||(g=W(u,"submit",et(n[16])),_=!0)},p(T,O){(!h||O&128)&&re(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(ae(),D(S[E],1,1,()=>{S[E]=null}),ue(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function OF(n){let e,t,i,l;return e=new ms({}),i=new mi({props:{$$slots:{default:[CF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),y(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}const EF="s3_test_request";function MF(n,e,t){let i,l,s;Qe(n,fn,E=>t(7,s=E)),Rn(fn,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await me.settings.getAll()||{};h(E)}catch(E){me.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{me.cancelRequest(EF);const E=await me.settings.update(V.filterRedactedProps(r));Yt({}),await h(E),Is(),c?fw("Successfully saved but failed to establish S3 connection."):tn("Successfully saved files storage settings.")}catch(E){me.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>_(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,_,i,g,k,S,$,T,O]}class DF extends we{constructor(e){super(),ye(this,e,MF,OF,_e,{})}}function Mb(n){let e,t,i,l,s;return{c(){e=B("("),t=B(n[1]),i=B("/"),l=B(n[2]),s=B(")")},m(o,r){y(o,e,r),y(o,t,r),y(o,i,r),y(o,l,r),y(o,s,r)},p(o,r){r&2&&re(t,o[1]),r&4&&re(l,o[2])},d(o){o&&(v(e),v(t),v(i),v(l),v(s))}}}function IF(n){let e,t,i,l;const s=[NF,PF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),D(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function LF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[qF,({uniqueId:_})=>({25:_}),({uniqueId:_})=>_?33554432:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[HF,({uniqueId:_})=>({25:_}),({uniqueId:_})=>_?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=B(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),Q(o,"btn-disabled",n[7]),Q(o,"btn-loading",n[7]),p(e,"class","block")},m(_,g){y(_,e,g),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=W(e,"submit",et(n[13])),m=!0)},p(_,g){const k={};g&100663329&&(k.$$scope={dirty:g,ctx:_}),t.$set(k);const S={};g&100663360&&(S.$$scope={dirty:g,ctx:_}),l.$set(S),(!d||g&4)&&a!==(a=_[2]>1?"Next":"Login")&&re(u,a),(!d||g&128)&&Q(o,"btn-disabled",_[7]),(!d||g&128)&&Q(o,"btn-loading",_[7])},i(_){d||(M(t.$$.fragment,_),M(l.$$.fragment,_),d=!0)},o(_){D(t.$$.fragment,_),D(l.$$.fragment,_),d=!1},d(_){_&&v(e),H(t),H(l),m=!1,h()}}}function AF(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){y(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function PF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[11]&&Db(n);return i=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[RF,({uniqueId:h})=>({25:h}),({uniqueId:h})=>h?33554432:0]},$$scope:{ctx:n}}}),{c(){m&&m.c(),e=C(),t=b("form"),j(i.$$.fragment),l=C(),s=b("button"),s.innerHTML='Login ',o=C(),r=b("div"),a=b("button"),u=B("Request another OTP"),p(s,"type","submit"),p(s,"class","btn btn-lg btn-block btn-next"),Q(s,"btn-disabled",n[9]),Q(s,"btn-loading",n[9]),p(t,"class","block"),p(a,"type","button"),p(a,"class","link-hint"),a.disabled=n[9],p(r,"class","content txt-center m-t-sm")},m(h,_){m&&m.m(h,_),y(h,e,_),y(h,t,_),q(i,t,null),w(t,l),w(t,s),y(h,o,_),y(h,r,_),w(r,a),w(a,u),f=!0,c||(d=[W(t,"submit",et(n[15])),W(a,"click",n[20])],c=!0)},p(h,_){h[11]?m?m.p(h,_):(m=Db(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null);const g={};_&100667392&&(g.$$scope={dirty:_,ctx:h}),i.$set(g),(!f||_&512)&&Q(s,"btn-disabled",h[9]),(!f||_&512)&&Q(s,"btn-loading",h[9]),(!f||_&512)&&(a.disabled=h[9])},i(h){f||(M(i.$$.fragment,h),f=!0)},o(h){D(i.$$.fragment,h),f=!1},d(h){h&&(v(e),v(t),v(o),v(r)),m&&m.d(h),H(i),c=!1,Ie(d)}}}function NF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[FF,({uniqueId:a})=>({25:a}),({uniqueId:a})=>a?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),l=b("button"),l.innerHTML=' Send OTP',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),Q(l,"btn-disabled",n[8]),Q(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){y(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=W(e,"submit",et(n[14])),o=!0)},p(a,u){const f={};u&100665344&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&Q(l,"btn-disabled",a[8]),(!s||u&256)&&Q(l,"btn-loading",a[8])},i(a){s||(M(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&v(e),H(t),o=!1,r()}}}function Db(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=B("Check your "),l=b("strong"),s=B(n[11]),o=B(` inbox and enter in the input below the received + One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){y(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&2048&&re(s,r[11])},d(r){r&&v(e)}}}function RF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("One-time password"),l=C(),s=b("input"),p(e,"for",i=n[25]),p(s,"type","password"),p(s,"id",o=n[25]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[12]),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(s,"id",o),f&4096&&s.value!==u[12]&&ce(s,u[12])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function FF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Email"),l=C(),s=b("input"),p(e,"for",i=n[25]),p(s,"type","email"),p(s,"id",o=n[25]),s.required=!0},m(u,f){y(u,e,f),w(e,t),y(u,l,f),y(u,s,f),ce(s,n[11]),r||(a=W(s,"input",n[18]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(s,"id",o),f&2048&&s.value!==u[11]&&ce(s,u[11])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function qF(n){let e,t=V.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=B(t),s=C(),o=b("input"),p(e,"for",l=n[25]),p(o,"id",r=n[25]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){y(c,e,d),w(e,i),y(c,s,d),y(c,o,d),o.focus(),u||(f=W(o,"input",n[16]),u=!0)},p(c,d){d&1&&t!==(t=V.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&re(i,t),d&33554432&&l!==(l=c[25])&&p(e,"for",l),d&33554432&&r!==(r=c[25])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function HF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[25]),p(s,"type","password"),p(s,"id",o=n[25]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){y(d,e,m),w(e,t),y(d,l,m),y(d,s,m),ce(s,n[6]),y(d,r,m),y(d,a,m),w(a,u),f||(c=[W(s,"input",n[17]),Ee(Vn.call(null,u))],f=!0)},p(d,m){m&33554432&&i!==(i=d[25])&&p(e,"for",i),m&33554432&&o!==(o=d[25])&&p(s,"id",o),m&64&&s.value!==d[6]&&ce(s,d[6])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,Ie(c)}}}function jF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&Mb(n);const f=[AF,LF,IF],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=B(`Superuser login + `),u&&u.c(),l=C(),o&&o.c(),r=ke(),p(e,"class","content txt-center m-b-base")},m(m,h){y(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),y(m,l,h),~s&&c[s].m(m,h),y(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=Mb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let _=s;s=d(m),s===_?~s&&c[s].p(m,h):(o&&(ae(),D(c[_],1,1,()=>{c[_]=null}),ue()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(v(e),v(l),v(r)),u&&u.d(),~s&&c[s].d(m)}}}function zF(n){let e,t;return e=new rk({props:{$$slots:{default:[jF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67117055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UF(n,e,t){let i;Qe(n,Lu,R=>t(22,i=R));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",_="",g="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await me.collection("_superusers").listAuthMethods())}catch(R){me.error(R)}t(10,m=!1)}}async function T(){var R,z;if(!f){t(7,f=!0);try{await me.collection("_superusers").authWithPassword(s,o),Is(),Yt({}),Il("/")}catch(F){F.status==401?(t(3,h=F.response.mfaId),((z=(R=r==null?void 0:r.password)==null?void 0:R.identityFields)==null?void 0:z.length)==1&&r.password.identityFields[0]=="email"?(t(11,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(11,k=s)):F.status!=400?me.error(F):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const R=await me.collection("_superusers").requestOTP(k);t(4,_=R.otpId),g=_,Is(),Yt({})}catch(R){R.status==429&&t(4,_=g),me.error(R)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await me.collection("_superusers").authWithOTP(_,S,{mfaId:h}),Is(),Yt({}),Il("/")}catch(R){me.error(R)}t(9,d=!1)}}const I=R=>{t(5,s=R.target.value)};function L(){o=this.value,t(6,o)}function A(){k=this.value,t(11,k)}function P(){S=this.value,t(12,S)}const N=()=>{t(4,_="")};return n.$$.update=()=>{var R,z;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(R=r==null?void 0:r.mfa)!=null&&R.enabled&&t(2,u++,u),(z=r==null?void 0:r.otp)!=null&&z.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),_!=""&&t(1,a++,a))},[r,a,u,h,_,s,o,f,c,d,m,k,S,T,O,E,I,L,A,P,N]}class VF extends we{constructor(e){super(),ye(this,e,UF,zF,_e,{})}}function Qt(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{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("pbinstal")?Il("/"):!0}],BF={"/login":Qt({component:VF,conditions:sn.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Qt({asyncComponent:()=>Ct(()=>import("./PageSuperuserRequestPasswordReset-a0MuXZH3.js"),[],import.meta.url),conditions:sn.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageSuperuserConfirmPasswordReset-Dz1f_KSq.js"),[],import.meta.url),conditions:sn.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Qt({component:PN,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Qt({component:S5,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Qt({component:L7,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Qt({component:kF,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Qt({component:DF,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Qt({component:AR,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Qt({component:xR,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Qt({component:$R,conditions:sn.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmPasswordReset-C138mYmB.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmPasswordReset-C138mYmB.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmVerification-C-V4vev_.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmVerification-C-V4vev_.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmEmailChange-Bvexyp_N.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Qt({asyncComponent:()=>Ct(()=>import("./PageRecordConfirmEmailChange-Bvexyp_N.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Qt({asyncComponent:()=>Ct(()=>import("./PageOAuth2RedirectSuccess-RWTsYqU5.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Qt({asyncComponent:()=>Ct(()=>import("./PageOAuth2RedirectFailure-Bg1XyXEO.js"),[],import.meta.url),conditions:sn,userData:{showAppSidebar:!1}}),"*":Qt({component:p3,userData:{showAppSidebar:!1}})};function WF(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){y(t,e,i)},d(t){t&&v(e)}}}function Ib(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,_,g,k,S,$,T;return g=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[YF]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),_=C(),j(g.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){y(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,_),q(g,c,null),S=!0,$||(T=[Ee(Vn.call(null,t)),Ee(Vn.call(null,s)),Ee(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Ee(He.call(null,s,{text:"Collections",position:"right"})),Ee(Vn.call(null,r)),Ee(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ee(He.call(null,r,{text:"Logs",position:"right"})),Ee(Vn.call(null,u)),Ee(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ee(He.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=V.getInitials(O[0].email)+"")&&re(h,m);const I={};E&4097&&(I.$$scope={dirty:E,ctx:O}),g.$set(I),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(g.$$.fragment,O),S=!0)},o(O){D(g.$$.fragment,O),S=!1},d(O){O&&v(e),H(g),$=!1,Ie(T)}}}function YF(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){y(m,e,h),w(e,i),y(m,s,h),y(m,o,h),y(m,r,h),y(m,a,h),y(m,u,h),y(m,f,h),c||(d=[Ee(Vn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&re(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(v(e),v(s),v(o),v(r),v(a),v(u),v(f)),c=!1,Ie(d)}}}function Lb(n){let e,t,i;return t=new Tu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){y(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function KF(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=window.location.protocol=="https:"&&WF(),g=((S=n[0])==null?void 0:S.id)&&n[1]&&Ib(n);r=new Vw({props:{routes:BF}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new gw({}),c=new nw({});let k=n[1]&&!n[2]&&Lb(n);return{c(){_&&_.c(),t=ke(),i=C(),l=b("div"),g&&g.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ke(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){_&&_.m(document.head,null),w(document.head,t),y($,i,T),y($,l,T),g&&g.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),y($,f,T),q(c,$,T),y($,d,T),k&&k.m($,T),y($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?g?(g.p($,T),T&3&&M(g,1)):(g=Ib($),g.c(),M(g,1),g.m(l,s)):g&&(ae(),D(g,1,1,()=>{g=null}),ue()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=Lb($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(ae(),D(k,1,1,()=>{k=null}),ue())},i($){h||(M(g),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(g),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(v(i),v(l),v(f),v(d),v(m)),_&&_.d($),v(t),g&&g.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function JF(n,e,t){let i,l,s,o;Qe(n,Dl,_=>t(10,i=_)),Qe(n,gr,_=>t(3,l=_)),Qe(n,Fr,_=>t(0,s=_)),Qe(n,fn,_=>t(4,o=_));let r,a=!1,u=!1;function f(_){var g,k,S,$;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(k=_==null?void 0:_.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=_==null?void 0:_.detail)==null?void 0:$.location,Rn(fn,o="",o),Yt({}),Z0())}function c(){Il("/")}async function d(){var _,g;if(s!=null&&s.id)try{const k=await me.settings.getAll({$cancelKey:"initialAppSettings"});Rn(gr,l=((_=k==null?void 0:k.meta)==null?void 0:_.appName)||"",l),Rn(Dl,i=!!((g=k==null?void 0:k.meta)!=null&&g.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){me.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class ZF extends we{constructor(e){super(),ye(this,e,JF,KF,_e,{})}}new ZF({target:document.getElementById("app")});export{Ie as A,tn as B,V as C,Il as D,ke as E,rk as F,po as G,xl as H,Cu as I,Qe as J,Rn as K,Zt as L,fn as M,En as N,bt as O,ie as P,SP as Q,Qu as R,we as S,de as T,yt as U,pi as V,zt as W,dt as X,jt as Y,Mv as Z,D as a,C as b,j as c,H as d,b as e,p as f,y as g,w as h,ye as i,Ee as j,ae as k,Vn as l,q as m,ue as n,v as o,me as p,fe as q,Q as r,_e as s,M as t,W as u,et as v,B as w,re as x,te as y,ce as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 6b088c14..8a27f6f8 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -41,7 +41,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/src/components/settings/RateLimitAccordion.svelte b/ui/src/components/settings/RateLimitAccordion.svelte index d0659a07..1c77078c 100644 --- a/ui/src/components/settings/RateLimitAccordion.svelte +++ b/ui/src/components/settings/RateLimitAccordion.svelte @@ -1,12 +1,13 @@