diff --git a/ui/.env b/ui/.env
index c38dd543..4ddd6566 100644
--- a/ui/.env
+++ b/ui/.env
@@ -11,4 +11,4 @@ PB_DOCS_URL            = "https://pocketbase.io/docs/"
 PB_JS_SDK_URL          = "https://github.com/pocketbase/js-sdk"
 PB_DART_SDK_URL        = "https://github.com/pocketbase/dart-sdk"
 PB_RELEASES            = "https://github.com/pocketbase/pocketbase/releases"
-PB_VERSION             = "v0.23.0-rc2"
+PB_VERSION             = "v0.23.0-rc3"
diff --git a/ui/dist/assets/AuthMethodsDocs-DeHPt55D.js b/ui/dist/assets/AuthMethodsDocs-BtaDoWWO.js
similarity index 97%
rename from ui/dist/assets/AuthMethodsDocs-DeHPt55D.js
rename to ui/dist/assets/AuthMethodsDocs-BtaDoWWO.js
index abb8551c..2949538a 100644
--- a/ui/dist/assets/AuthMethodsDocs-DeHPt55D.js
+++ b/ui/dist/assets/AuthMethodsDocs-BtaDoWWO.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 y,b as k,c as ae,f as h,g as u,h as a,m as ne,x as I,U as $e,V as Re,k as Se,W as Ue,n as Qe,t as J,a as N,o as d,d as ie,p as oe,C as je,r as O,u as qe,R as De}from"./index-CN4euoX9.js";import{F as Ee}from"./FieldsQueryParam-BeGMzTy3.js";function ye(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=y(o),b=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(v,w){u(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&&d(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){u(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&&d(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,ue,X,F=n[0].name+"",Y,de,Z,S,x,P,ee,fe,te,T,le,U,se,C,Q,$=[],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 y,b as k,c as ae,f as h,g as u,h as a,m as ne,x as I,U as $e,V as Re,k as Se,W as Ue,n as Qe,t as J,a as N,o as d,d as ie,p as oe,C as je,r as O,u as qe,R as De}from"./index-BaIGfIip.js";import{F as Ee}from"./FieldsQueryParam-U25K5YU1.js";function ye(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=y(o),b=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(v,w){u(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&&d(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){u(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&&d(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,ue,X,F=n[0].name+"",Y,de,Z,S,x,P,ee,fe,te,T,le,U,se,C,Q,$=[],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-D0IAoZLo.js b/ui/dist/assets/AuthRefreshDocs-CgORCLzq.js
similarity index 98%
rename from ui/dist/assets/AuthRefreshDocs-D0IAoZLo.js
rename to ui/dist/assets/AuthRefreshDocs-CgORCLzq.js
index 91d21c56..afaf109d 100644
--- a/ui/dist/assets/AuthRefreshDocs-D0IAoZLo.js
+++ b/ui/dist/assets/AuthRefreshDocs-CgORCLzq.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-CN4euoX9.js";import{F as et}from"./FieldsQueryParam-BeGMzTy3.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-BaIGfIip.js";import{F as et}from"./FieldsQueryParam-U25K5YU1.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-bl3paI1E.js b/ui/dist/assets/AuthWithOAuth2Docs-DcbkfNMl.js
similarity index 98%
rename from ui/dist/assets/AuthWithOAuth2Docs-bl3paI1E.js
rename to ui/dist/assets/AuthWithOAuth2Docs-DcbkfNMl.js
index 08986e63..f0d5cb97 100644
--- a/ui/dist/assets/AuthWithOAuth2Docs-bl3paI1E.js
+++ b/ui/dist/assets/AuthWithOAuth2Docs-DcbkfNMl.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-CN4euoX9.js";import{F as Ye}from"./FieldsQueryParam-BeGMzTy3.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-BaIGfIip.js";import{F as Ye}from"./FieldsQueryParam-U25K5YU1.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]}');
diff --git a/ui/dist/assets/AuthWithOtpDocs-DMGTBbXL.js b/ui/dist/assets/AuthWithOtpDocs-DeZu5Cq6.js
similarity index 99%
rename from ui/dist/assets/AuthWithOtpDocs-DMGTBbXL.js
rename to ui/dist/assets/AuthWithOtpDocs-DeZu5Cq6.js
index 4d981d80..dd58a7cf 100644
--- a/ui/dist/assets/AuthWithOtpDocs-DMGTBbXL.js
+++ b/ui/dist/assets/AuthWithOtpDocs-DeZu5Cq6.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 J,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 Oe,Y as ne}from"./index-CN4euoX9.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){J(a.$$.fragment,r),c=!1},d(r){r&&_(e),X(a)}}}function Te(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,q,W,C,B,A,H,R,I,y,T,w=[],$=new Map,E,D,k=[],N=new Map,M,i=U(s[2]);const v=l=>l[4].code;for(let l=0;l<i.length;l+=1){let o=ce(s,i,l),f=v(o);$.set(f,w[l]=re(f,o))}let P=U(s[2]);const j=l=>l[4].code;for(let l=0;l<P.length;l+=1){let o=ie(s,P,l),f=j(o);N.set(f,k[l]=de(f,o))}return{c(){t=p("div"),e=p("strong"),e.textContent="POST",a=S(),d=p("div"),c=p("p"),r=V("/api/collections/"),n=p("strong"),m=V(u),q=V("/auth-with-otp"),W=S(),C=p("div"),C.textContent="Body Parameters",B=S(),A=p("table"),A.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>otpId</span></div></td> <td><span class="label">String</span></td> <td>The id of the OTP request.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>The one-time password.</td></tr></tbody>',H=S(),R=p("div"),R.textContent="Responses",I=S(),y=p("div"),T=p("div");for(let l=0;l<w.length;l+=1)w[l].c();E=S(),D=p("div");for(let l=0;l<k.length;l+=1)k[l].c();g(e,"class","label label-primary"),g(d,"class","content"),g(t,"class","alert alert-success"),g(C,"class","section-title"),g(A,"class","table-compact table-border m-b-base"),g(R,"class","section-title"),g(T,"class","tabs-header compact combined left"),g(D,"class","tabs-content"),g(y,"class","tabs")},m(l,o){b(l,t,o),h(t,e),h(t,a),h(t,d),h(d,c),h(c,r),h(c,n),h(n,m),h(c,q),b(l,W,o),b(l,C,o),b(l,B,o),b(l,A,o),b(l,H,o),b(l,R,o),b(l,I,o),b(l,y,o),h(y,T);for(let f=0;f<w.length;f+=1)w[f]&&w[f].m(T,null);h(y,E),h(y,D);for(let f=0;f<k.length;f+=1)k[f]&&k[f].m(D,null);M=!0},p(l,[o]){(!M||o&1)&&u!==(u=l[0].name+"")&&z(m,u),o&6&&(i=U(l[2]),w=G(w,o,v,1,l,i,$,T,ge,re,null,ce)),o&6&&(P=U(l[2]),Z(),k=G(k,o,j,1,l,P,N,D,ke,de,null,ie),x())},i(l){if(!M){for(let o=0;o<P.length;o+=1)L(k[o]);M=!0}},o(l){for(let o=0;o<k.length;o+=1)J(k[o]);M=!1},d(l){l&&(_(t),_(W),_(C),_(B),_(A),_(H),_(R),_(I),_(y));for(let o=0;o<w.length;o+=1)w[o].d();for(let o=0;o<k.length;o+=1)k[o].d()}}}function Pe(s,t,e){let{collection:a}=t,d=200,c=[];const r=n=>e(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 J,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 Oe,Y as ne}from"./index-BaIGfIip.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){J(a.$$.fragment,r),c=!1},d(r){r&&_(e),X(a)}}}function Te(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,q,W,C,B,A,H,R,I,y,T,w=[],$=new Map,E,D,k=[],N=new Map,M,i=U(s[2]);const v=l=>l[4].code;for(let l=0;l<i.length;l+=1){let o=ce(s,i,l),f=v(o);$.set(f,w[l]=re(f,o))}let P=U(s[2]);const j=l=>l[4].code;for(let l=0;l<P.length;l+=1){let o=ie(s,P,l),f=j(o);N.set(f,k[l]=de(f,o))}return{c(){t=p("div"),e=p("strong"),e.textContent="POST",a=S(),d=p("div"),c=p("p"),r=V("/api/collections/"),n=p("strong"),m=V(u),q=V("/auth-with-otp"),W=S(),C=p("div"),C.textContent="Body Parameters",B=S(),A=p("table"),A.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>otpId</span></div></td> <td><span class="label">String</span></td> <td>The id of the OTP request.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>The one-time password.</td></tr></tbody>',H=S(),R=p("div"),R.textContent="Responses",I=S(),y=p("div"),T=p("div");for(let l=0;l<w.length;l+=1)w[l].c();E=S(),D=p("div");for(let l=0;l<k.length;l+=1)k[l].c();g(e,"class","label label-primary"),g(d,"class","content"),g(t,"class","alert alert-success"),g(C,"class","section-title"),g(A,"class","table-compact table-border m-b-base"),g(R,"class","section-title"),g(T,"class","tabs-header compact combined left"),g(D,"class","tabs-content"),g(y,"class","tabs")},m(l,o){b(l,t,o),h(t,e),h(t,a),h(t,d),h(d,c),h(c,r),h(c,n),h(n,m),h(c,q),b(l,W,o),b(l,C,o),b(l,B,o),b(l,A,o),b(l,H,o),b(l,R,o),b(l,I,o),b(l,y,o),h(y,T);for(let f=0;f<w.length;f+=1)w[f]&&w[f].m(T,null);h(y,E),h(y,D);for(let f=0;f<k.length;f+=1)k[f]&&k[f].m(D,null);M=!0},p(l,[o]){(!M||o&1)&&u!==(u=l[0].name+"")&&z(m,u),o&6&&(i=U(l[2]),w=G(w,o,v,1,l,i,$,T,ge,re,null,ce)),o&6&&(P=U(l[2]),Z(),k=G(k,o,j,1,l,P,N,D,ke,de,null,ie),x())},i(l){if(!M){for(let o=0;o<P.length;o+=1)L(k[o]);M=!0}},o(l){for(let o=0;o<k.length;o+=1)J(k[o]);M=!1},d(l){l&&(_(t),_(W),_(C),_(B),_(A),_(H),_(R),_(I),_(y));for(let o=0;o<w.length;o+=1)w[o].d();for(let o=0;o<k.length;o+=1)k[o].d()}}}function Pe(s,t,e){let{collection:a}=t,d=200,c=[];const r=n=>e(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-DY-s5WMs.js b/ui/dist/assets/AuthWithPasswordDocs-BEqreZjJ.js
similarity index 98%
rename from ui/dist/assets/AuthWithPasswordDocs-DY-s5WMs.js
rename to ui/dist/assets/AuthWithPasswordDocs-BEqreZjJ.js
index afde12e5..b4c93571 100644
--- a/ui/dist/assets/AuthWithPasswordDocs-DY-s5WMs.js
+++ b/ui/dist/assets/AuthWithPasswordDocs-BEqreZjJ.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-CN4euoX9.js";import{F as Ot}from"./FieldsQueryParam-BeGMzTy3.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-BaIGfIip.js";import{F as Ot}from"./FieldsQueryParam-U25K5YU1.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/CodeEditor-C_5qTJii.js b/ui/dist/assets/CodeEditor-BMLITRTv.js
similarity index 99%
rename from ui/dist/assets/CodeEditor-C_5qTJii.js
rename to ui/dist/assets/CodeEditor-BMLITRTv.js
index 9300385a..2b69aef3 100644
--- a/ui/dist/assets/CodeEditor-C_5qTJii.js
+++ b/ui/dist/assets/CodeEditor-BMLITRTv.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-CN4euoX9.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<this.pos-25;i&&this.setLookAhead(this.pos);let o=s.dynamicPrecedence(r);if(o&&(this.score+=o),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(r,this.reducePos);return}let n=this.stack.length-(t-1)*3-(O&262144?6:0),Q=n?this.stack[n-2]:this.p.ranges[0].from,u=this.reducePos-Q;u>=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.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=Q,this.p.lastBigReductionSize=u));let c=n?this.stack[n-1]:0,f=this.bufferBase+this.buffer.length-c;if(r<s.minRepeatTerm||O&131072){let h=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,Q,h,f+4,!0)}if(O&262144)this.state=this.stack[n];else{let h=this.stack[n-3];this.state=s.getGoto(h,r,!0)}for(;this.stack.length>n;)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]<this.buffer.length+this.bufferBase)){let i=this,o=this.buffer.length;if(o==0&&i.parent&&(o=i.bufferBase-i.parent.bufferBase,i=i.parent),o>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;s<a.length;s+=2)(i=a[s+1])!=this.state&&this.p.parser.hasAction(i,O)&&r.push(a[s],i);if(this.stack.length<120)for(let s=0;r.length<8&&s<a.length;s+=2){let i=a[s+1];r.some((o,n)=>n&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let s=a[r+1];if(s==this.state)continue;let i=this.split();i.pushState(s,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(a[r],this.pos),i.reducePos=this.pos,i.score-=200,t.push(i)}return t}forceReduce(){let{parser:O}=this.p,a=O.stateSlot(this.state,5);if(!(a&65536))return!1;if(!O.validAction(this.state,a)){let t=a>>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;a<this.stack.length;a+=3)if(this.stack[a]!=O.stack[a])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(O){return this.p.parser.dialect.flags[O]}shiftContext(O,a){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,O,this,this.p.stream.reset(a)))}reduceContext(O,a){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,O,this,this.p.stream.reset(a)))}emitContext(){let O=this.buffer.length-1;(O<0||this.buffer[O]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let O=this.buffer.length-1;(O<0||this.buffer[O]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(O){if(O!=this.curContext.context){let a=new KO(this.curContext.tracker,O);a.hash!=this.curContext.hash&&this.emitContext(),this.curContext=a}}setLookAhead(O){O>this.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<e.length;){let s=0;for(;;){let i=e.charCodeAt(t++),o=!1;if(i==126){s=65535;break}i>=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(;s<t.from;){if(!r)return null;let i=this.ranges[--r];s-=t.from-i.to,t=i}for(;a<0?s>t.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&&O<this.range.to)return O;for(let a of this.ranges)if(a.to>O)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a<this.chunk.length)t=this.pos+O,r=this.chunk.charCodeAt(a);else{let s=this.resolveOffset(O,1);if(s==null)return-1;if(t=s,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let i=this.rangeIndex,o=this.range;for(;o.to<=t;)o=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>o.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.token.start)throw new RangeError("Token end out of bounds");this.token.value=O,this.token.end=t}acceptTokenTo(O,a){this.token.value=O,this.token.end=a}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:O,chunkPos:a}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=O,this.chunk2Pos=a,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let O=this.input.chunk(this.pos),a=this.pos+O.length;this.chunk=a>this.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.from;)this.range=this.ranges[--this.rangeIndex];for(;O>=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O<this.chunkPos+this.chunk.length?this.chunkOff=O-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(O,a){if(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<<t,{dialect:n}=a.p.parser;O:for(;o&e[i];){let Q=e[i+1];for(let h=i+3;h<Q;h+=2)if((e[h+1]&o)>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<f;){let h=c+f>>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u<P)f=h;else 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)<r}const Z=typeof process<"u"&&LO&&/\bparse\b/.test(LO.LOG);let pO=null;function Oe(e,O,a){let t=e.cursor(vO.IncludeAnonymous);for(t.moveTo(O);;)if(!(a<0?t.childBefore(O):t.childAfter(O)))for(;;){if((a<0?t.to<O:t.from>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(O<this.nextStart)return null;for(;this.fragment&&this.safeTo<=O;)this.nextFragment();if(!this.fragment)return null;for(;;){let a=this.trees.length-1;if(a<0)return this.nextFragment(),null;let t=this.trees[a],r=this.index[a];if(r==t.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=t.children[r],i=this.start[a]+t.positions[r];if(i>O)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i<this.safeFrom)return null;let o=i+s.length;if(o<=this.safeTo){let n=s.prop(qO.lookAhead);if(!n||o+n<this.fragment.to)return s}}this.index[a]++,i+s.length>=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;Q<s.length;Q++){if(!(1<<Q&i))continue;let u=s[Q],c=this.tokens[Q];if(!(t&&!u.fallback)&&((u.contextual||c.start!=O.pos||c.mask!=i||c.context!=o)&&(this.updateCachedToken(c,u,O),c.mask=i,c.context=o),c.lookAhead>c.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<s.specialized.length;i++)if(s.specialized[i]==O.value){let o=s.specializers[i](this.stream.read(O.start,O.end),t);if(o>=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;s<r;s+=3)if(this.actions[s]==O)return r;return this.actions[r++]=O,this.actions[r++]=a,this.actions[r++]=t,r}addActions(O,a,t,r){let{state:s}=O,{parser:i}=O.p,{data:o}=i;for(let n=0;n<2;n++)for(let Q=i.stateSlot(s,n?2:1);;Q+=3){if(o[Q]==65535)if(o[Q+1]==1)Q=R(o,Q+2);else{r==0&&o[Q+1]==2&&(r=this.putAction(R(o,Q+2),a,t,r));break}o[Q]==a&&(r=this.putAction(R(o,Q+1),a,t,r))}return r}}class ma{constructor(O,a,t,r){this.parser=O,this.input=a,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new da(a,r),this.tokens=new Pa(O,this.stream),this.topTerm=O.top[1];let{from:s}=r[0];this.stacks=[sO.start(this,O.top[0],s)],this.fragments=t.length&&this.stream.end-s>O.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;i<O.length;i++){let o=O[i];for(;;){if(this.tokens.mainToken=null,o.pos>a)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;i<t.length-1;i++){let o=t[i];for(let n=i+1;n<t.length;n++){let Q=t[n];if(o.sameState(Q)||o.buffer.length>500&&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<t.length;i++)t[i].pos<this.minStackPos&&(this.minStackPos=t[i].pos);return null}stopAt(O){if(this.stoppedAt!=null&&this.stoppedAt<O)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=O}advanceStack(O,a,t){let r=O.pos,{parser:s}=this,i=Z?this.stackID(O)+" -> ":"";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;Q<n.length;){let u=n[Q++],c=n[Q++],f=n[Q++],h=Q==n.length||!t,d=h?O:O.split(),P=this.tokens.mainToken;if(d.apply(u,c,P?P.start:d.pos,f),Z&&console.log(i+this.stackID(d)+` (via ${u&65536?`reduce of ${s.getName(u&65535)}`:"shift"} for ${s.getName(c)} @ ${r}${d==O?"":", split"})`),h)return!0;d.pos>r?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<O.length;i++){let o=O[i],n=a[i<<1],Q=a[(i<<1)+1],u=Z?this.stackID(o)+" -> ":"";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.score<o.score)&&(r=o)}return r}stackToTree(O){return O.close(),tO.build({buffer:oO.create(O),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:O.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(O){let a=(pO||(pO=new WeakMap)).get(O);return a||pO.set(O,a=String.fromCodePoint(this.nextStackID++)),a+O}}function ee(e,O){for(let a=0;a<O.length;a++){let t=O[a];if(t.pos==e.pos&&t.sameState(e)){O[a].score<e.score&&(O[a]=e);return}}O.push(e)}class ga{constructor(O,a,t){this.source=O,this.flags=a,this.disabled=t}allows(O){return!this.disabled||this.disabled[O]==0}}const dO=e=>e;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;o<O.repeatNodeCount;o++)a.push("");let t=Object.keys(O.topRules).map(o=>O.topRules[o][1]),r=[];for(let o=0;o<a.length;o++)r.push([]);function s(o,n,Q){r[o].push([n,n.deserialize(String(Q))])}if(O.nodeProps)for(let o of O.nodeProps){let n=o[0];typeof n=="string"&&(n=qO[n]);for(let Q=1;Q<o.length;){let u=o[Q++];if(u>=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;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(te),this.states=N(O.states,Uint32Array),this.data=N(O.stateData),this.goto=N(O.goto),this.maxTerm=O.maxTerm,this.tokenizers=O.tokenizers.map(o=>typeof 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);s<Q;s++)if(r[s]==O)return n;if(o)return-1}}hasAction(O,a){let t=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(O,r?2:1),i;;s+=3){if((i=t[s])==65535)if(t[s+1]==1)i=t[s=R(t,s+2)];else{if(t[s+1]==2)return R(t,s+2);break}if(i==a||i==0)return R(t,s+1)}return 0}stateSlot(O,a){return this.states[O*6+a]}stateFlag(O,a){return(this.stateSlot(O,0)&a)>0}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;s<a.length;s++)if(!t[s])for(let i=this.dialects[a[s]],o;(o=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new ga(O,t,r)}static deserialize(O){return new T(O)}}function R(e,O){return e[O]|e[O+1]<<16}function Sa(e){let O=null;for(let a of e){let t=a.p.stoppedAt;(a.pos==a.p.stream.end||t!=null&&a.pos>t)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.score<a.score)&&(O=a)}return O}function te(e){if(e.external){let O=e.extend?1:0;return(a,t)=>e.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&&s<t&&r.next==e.charCodeAt(s-2))s++,i++;else if((s==2||s==t)&&De(r.next))i++;else if(s==t&&r.next==cO){o>i?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+$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nWR!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:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$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!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ha,La,Ka,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:509},tokenPrec:511});function Je(e,O){let a=Object.create(null);for(let t of e.getChildren(Me)){let r=t.getChild(qa),s=t.getChild(XO)||t.getChild(Ie);r&&(a[O.read(r.from,r.to)]=s?s.type.id==XO?O.read(s.from+1,s.to-1):O.read(s.from,s.to):"")}return a}function ce(e,O){let a=e.getChild(_a);return a?O.read(a.from,a.to):" "}function $O(e,O,a){let t;for(let r of a)if(!r.attrs||r.attrs(t||(t=Je(e.node.parent.firstChild,O))))return{parser:r.parser};return null}function Le(e=[],O=[]){let a=[],t=[],r=[],s=[];for(let o of e)(o.tag=="script"?a:o.tag=="style"?t:o.tag=="textarea"?r:s).push(o);let i=O.length?Object.create(null):null;for(let o of O)(i[o.name]||(i[o.name]=[])).push(o);return Mt((o,n)=>{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-E8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WPP#nPP(_(_(i(_P(_P(_(_P#nP#nP#nP(l#nP(o(r(u(|#nP#nP)R)X)h)v)|*S*^*d*n*t*zPPPPPPPPPP+Q+ZP+v+yP,o,r,x-RRkQ_bOPdhw!n#tkYOPdhotuvw!n#R#h#tkSOPdhotuvw!n#R#h#tQmTR!tnQ{VR!xqQ!x}Q#Z!XR#y!zq![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%Up![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%UU$f#m$h${R$z$eq!XZ]!T!m#S#U#X#q#{$Q$[$k$l$s$x%Up![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%UQ!f^R#l!gT#^!Z#_Q|VR!yqQ!x|R#y!yQ!PWR!{rQ!RXR!|sQxUQ!wpQ#i!cQ#o!jQ#p!kQ$}$gR%Z$|SgPwQ!phQ#s!nR$n#tZfPhw!n#ta!b[`a!V!^!`#d#eR#b!^R!g^R!i_R#n!iS$g#m$hR%X${V$e#m$h${Q!rjR#w!rQdOShPwU!ldh#tR#t!nQ$Q#SU$r$Q$x%UQ$x$[R%U$sQ#_!ZR$Y#_Q$t$QR%V$tQpUS!vp$pR$p#}Q$l#qR%R$lQ!ogS#u!o#vR#v!pQ#f!_R$`#fQ$h#mR%O$hQ$|$gR%Y$|_cOPdhw!n#t^UOPdhw!n#tQ!uoQ!}tQ#OuQ#PvQ#}#RR$a#hR$R#SQ!VZQ!d]Q#V!TQ#q!m[$P#S$Q$[$s$x%UQ$S#UQ$U#XS$j#q$lQ$o#{R%Q$kR$O#RQiPR#QwQ!c[Q!kaR#Y!VU!_[a!VQ!j`Q#c!^Q#g!`Q$^#dR$_#e",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:117,nodeProps:[["isolate",-2,3,24,""],["openedBy",17,"(",32,"[",50,"{"],["closedBy",18,")",33,"]",51,"}"]],propSources:[gr],skippedNodes:[0,3,87],repeatNodeCount:11,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#Z~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#Z~o`OX%^X^'f^p%^pq'fqy%^z#y%^#y#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,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*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i$l)jR3w.|T*Z$x*]T*c${*UQ0l+`Q3P.^Q5i1cQ6q3TQ8V5lQ8v6pQ9j8UQ9|8uQ:b9lQ:j:OQ:r:cR:u:knqOXst!Z#d%k&o&q&r&t,k,p1|2PQ&i!VR,`&ftmOXst!U!V!Z#d%k&f&o&q&r&t,k,p1|2PR,g&lT%jm,gR1],PR,_&dQ&S|R+w&TR+m%}T&m!W&pT&n!W&pT2O,p2P",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : 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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w%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Rp(U!b'x0/l$[#t(O,2j(`$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Oi,ei,ti,2,3,4,5,6,7,8,9,10,11,12,13,14,Hr,new lO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(^~~",141,335),new lO("j~RQYZXz{^~^O'{~~aP!P!Qd~iO'|~~",25,318)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14725},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:322,get:e=>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-BaIGfIip.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<this.pos-25;i&&this.setLookAhead(this.pos);let o=s.dynamicPrecedence(r);if(o&&(this.score+=o),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(r,this.reducePos);return}let n=this.stack.length-(t-1)*3-(O&262144?6:0),Q=n?this.stack[n-2]:this.p.ranges[0].from,u=this.reducePos-Q;u>=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.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=Q,this.p.lastBigReductionSize=u));let c=n?this.stack[n-1]:0,f=this.bufferBase+this.buffer.length-c;if(r<s.minRepeatTerm||O&131072){let h=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,Q,h,f+4,!0)}if(O&262144)this.state=this.stack[n];else{let h=this.stack[n-3];this.state=s.getGoto(h,r,!0)}for(;this.stack.length>n;)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]<this.buffer.length+this.bufferBase)){let i=this,o=this.buffer.length;if(o==0&&i.parent&&(o=i.bufferBase-i.parent.bufferBase,i=i.parent),o>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;s<a.length;s+=2)(i=a[s+1])!=this.state&&this.p.parser.hasAction(i,O)&&r.push(a[s],i);if(this.stack.length<120)for(let s=0;r.length<8&&s<a.length;s+=2){let i=a[s+1];r.some((o,n)=>n&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let s=a[r+1];if(s==this.state)continue;let i=this.split();i.pushState(s,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(a[r],this.pos),i.reducePos=this.pos,i.score-=200,t.push(i)}return t}forceReduce(){let{parser:O}=this.p,a=O.stateSlot(this.state,5);if(!(a&65536))return!1;if(!O.validAction(this.state,a)){let t=a>>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;a<this.stack.length;a+=3)if(this.stack[a]!=O.stack[a])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(O){return this.p.parser.dialect.flags[O]}shiftContext(O,a){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,O,this,this.p.stream.reset(a)))}reduceContext(O,a){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,O,this,this.p.stream.reset(a)))}emitContext(){let O=this.buffer.length-1;(O<0||this.buffer[O]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let O=this.buffer.length-1;(O<0||this.buffer[O]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(O){if(O!=this.curContext.context){let a=new KO(this.curContext.tracker,O);a.hash!=this.curContext.hash&&this.emitContext(),this.curContext=a}}setLookAhead(O){O>this.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<e.length;){let s=0;for(;;){let i=e.charCodeAt(t++),o=!1;if(i==126){s=65535;break}i>=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(;s<t.from;){if(!r)return null;let i=this.ranges[--r];s-=t.from-i.to,t=i}for(;a<0?s>t.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&&O<this.range.to)return O;for(let a of this.ranges)if(a.to>O)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a<this.chunk.length)t=this.pos+O,r=this.chunk.charCodeAt(a);else{let s=this.resolveOffset(O,1);if(s==null)return-1;if(t=s,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let i=this.rangeIndex,o=this.range;for(;o.to<=t;)o=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>o.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.token.start)throw new RangeError("Token end out of bounds");this.token.value=O,this.token.end=t}acceptTokenTo(O,a){this.token.value=O,this.token.end=a}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:O,chunkPos:a}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=O,this.chunk2Pos=a,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let O=this.input.chunk(this.pos),a=this.pos+O.length;this.chunk=a>this.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.from;)this.range=this.ranges[--this.rangeIndex];for(;O>=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O<this.chunkPos+this.chunk.length?this.chunkOff=O-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(O,a){if(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<<t,{dialect:n}=a.p.parser;O:for(;o&e[i];){let Q=e[i+1];for(let h=i+3;h<Q;h+=2)if((e[h+1]&o)>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<f;){let h=c+f>>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u<P)f=h;else 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)<r}const Z=typeof process<"u"&&LO&&/\bparse\b/.test(LO.LOG);let pO=null;function Oe(e,O,a){let t=e.cursor(vO.IncludeAnonymous);for(t.moveTo(O);;)if(!(a<0?t.childBefore(O):t.childAfter(O)))for(;;){if((a<0?t.to<O:t.from>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(O<this.nextStart)return null;for(;this.fragment&&this.safeTo<=O;)this.nextFragment();if(!this.fragment)return null;for(;;){let a=this.trees.length-1;if(a<0)return this.nextFragment(),null;let t=this.trees[a],r=this.index[a];if(r==t.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=t.children[r],i=this.start[a]+t.positions[r];if(i>O)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i<this.safeFrom)return null;let o=i+s.length;if(o<=this.safeTo){let n=s.prop(qO.lookAhead);if(!n||o+n<this.fragment.to)return s}}this.index[a]++,i+s.length>=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;Q<s.length;Q++){if(!(1<<Q&i))continue;let u=s[Q],c=this.tokens[Q];if(!(t&&!u.fallback)&&((u.contextual||c.start!=O.pos||c.mask!=i||c.context!=o)&&(this.updateCachedToken(c,u,O),c.mask=i,c.context=o),c.lookAhead>c.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<s.specialized.length;i++)if(s.specialized[i]==O.value){let o=s.specializers[i](this.stream.read(O.start,O.end),t);if(o>=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;s<r;s+=3)if(this.actions[s]==O)return r;return this.actions[r++]=O,this.actions[r++]=a,this.actions[r++]=t,r}addActions(O,a,t,r){let{state:s}=O,{parser:i}=O.p,{data:o}=i;for(let n=0;n<2;n++)for(let Q=i.stateSlot(s,n?2:1);;Q+=3){if(o[Q]==65535)if(o[Q+1]==1)Q=R(o,Q+2);else{r==0&&o[Q+1]==2&&(r=this.putAction(R(o,Q+2),a,t,r));break}o[Q]==a&&(r=this.putAction(R(o,Q+1),a,t,r))}return r}}class ma{constructor(O,a,t,r){this.parser=O,this.input=a,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new da(a,r),this.tokens=new Pa(O,this.stream),this.topTerm=O.top[1];let{from:s}=r[0];this.stacks=[sO.start(this,O.top[0],s)],this.fragments=t.length&&this.stream.end-s>O.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;i<O.length;i++){let o=O[i];for(;;){if(this.tokens.mainToken=null,o.pos>a)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;i<t.length-1;i++){let o=t[i];for(let n=i+1;n<t.length;n++){let Q=t[n];if(o.sameState(Q)||o.buffer.length>500&&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<t.length;i++)t[i].pos<this.minStackPos&&(this.minStackPos=t[i].pos);return null}stopAt(O){if(this.stoppedAt!=null&&this.stoppedAt<O)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=O}advanceStack(O,a,t){let r=O.pos,{parser:s}=this,i=Z?this.stackID(O)+" -> ":"";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;Q<n.length;){let u=n[Q++],c=n[Q++],f=n[Q++],h=Q==n.length||!t,d=h?O:O.split(),P=this.tokens.mainToken;if(d.apply(u,c,P?P.start:d.pos,f),Z&&console.log(i+this.stackID(d)+` (via ${u&65536?`reduce of ${s.getName(u&65535)}`:"shift"} for ${s.getName(c)} @ ${r}${d==O?"":", split"})`),h)return!0;d.pos>r?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<O.length;i++){let o=O[i],n=a[i<<1],Q=a[(i<<1)+1],u=Z?this.stackID(o)+" -> ":"";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.score<o.score)&&(r=o)}return r}stackToTree(O){return O.close(),tO.build({buffer:oO.create(O),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:O.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(O){let a=(pO||(pO=new WeakMap)).get(O);return a||pO.set(O,a=String.fromCodePoint(this.nextStackID++)),a+O}}function ee(e,O){for(let a=0;a<O.length;a++){let t=O[a];if(t.pos==e.pos&&t.sameState(e)){O[a].score<e.score&&(O[a]=e);return}}O.push(e)}class ga{constructor(O,a,t){this.source=O,this.flags=a,this.disabled=t}allows(O){return!this.disabled||this.disabled[O]==0}}const dO=e=>e;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;o<O.repeatNodeCount;o++)a.push("");let t=Object.keys(O.topRules).map(o=>O.topRules[o][1]),r=[];for(let o=0;o<a.length;o++)r.push([]);function s(o,n,Q){r[o].push([n,n.deserialize(String(Q))])}if(O.nodeProps)for(let o of O.nodeProps){let n=o[0];typeof n=="string"&&(n=qO[n]);for(let Q=1;Q<o.length;){let u=o[Q++];if(u>=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;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(te),this.states=N(O.states,Uint32Array),this.data=N(O.stateData),this.goto=N(O.goto),this.maxTerm=O.maxTerm,this.tokenizers=O.tokenizers.map(o=>typeof 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);s<Q;s++)if(r[s]==O)return n;if(o)return-1}}hasAction(O,a){let t=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(O,r?2:1),i;;s+=3){if((i=t[s])==65535)if(t[s+1]==1)i=t[s=R(t,s+2)];else{if(t[s+1]==2)return R(t,s+2);break}if(i==a||i==0)return R(t,s+1)}return 0}stateSlot(O,a){return this.states[O*6+a]}stateFlag(O,a){return(this.stateSlot(O,0)&a)>0}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;s<a.length;s++)if(!t[s])for(let i=this.dialects[a[s]],o;(o=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new ga(O,t,r)}static deserialize(O){return new T(O)}}function R(e,O){return e[O]|e[O+1]<<16}function Sa(e){let O=null;for(let a of e){let t=a.p.stoppedAt;(a.pos==a.p.stream.end||t!=null&&a.pos>t)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.score<a.score)&&(O=a)}return O}function te(e){if(e.external){let O=e.extend?1:0;return(a,t)=>e.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&&s<t&&r.next==e.charCodeAt(s-2))s++,i++;else if((s==2||s==t)&&De(r.next))i++;else if(s==t&&r.next==cO){o>i?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,Doctype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ag 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:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$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!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&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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!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Or,er,tr,Ha,La,Ka,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:509},tokenPrec:511});function Je(e,O){let a=Object.create(null);for(let t of e.getChildren(Me)){let r=t.getChild(qa),s=t.getChild(XO)||t.getChild(Ie);r&&(a[O.read(r.from,r.to)]=s?s.type.id==XO?O.read(s.from+1,s.to-1):O.read(s.from,s.to):"")}return a}function ce(e,O){let a=e.getChild(_a);return a?O.read(a.from,a.to):" "}function $O(e,O,a){let t;for(let r of a)if(!r.attrs||r.attrs(t||(t=Je(e.node.parent.firstChild,O))))return{parser:r.parser};return null}function Le(e=[],O=[]){let a=[],t=[],r=[],s=[];for(let o of e)(o.tag=="script"?a:o.tag=="style"?t:o.tag=="textarea"?r:s).push(o);let i=O.length?Object.create(null):null;for(let o of O)(i[o.name]||(i[o.name]=[])).push(o);return Mt((o,n)=>{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$_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![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%Up![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%UU$f#m$h${R$z$eq!XZ]!T!m#S#U#X#q#{$Q$[$k$l$s$x%Up![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%UQ!f^R#l!gT#^!Z#_Q|VR!yqQ!x|R#y!yQ!PWR!{rQ!RXR!|sQxUQ!wpQ#i!cQ#o!jQ#p!kQ$}$gR%Z$|SgPwQ!phQ#s!nR$n#tZfPhw!n#ta!b[`a!V!^!`#d#eR#b!^R!g^R!i_R#n!iS$g#m$hR%X${V$e#m$h${Q!rjR#w!rQdOShPwU!ldh#tR#t!nQ$Q#SU$r$Q$x%UQ$x$[R%U$sQ#_!ZR$Y#_Q$t$QR%V$tQpUS!vp$pR$p#}Q$l#qR%R$lQ!ogS#u!o#vR#v!pQ#f!_R$`#fQ$h#mR%O$hQ$|$gR%Y$|_cOPdhw!n#t^UOPdhw!n#tQ!uoQ!}tQ#OuQ#PvQ#}#RR$a#hR$R#SQ!VZQ!d]Q#V!TQ#q!m[$P#S$Q$[$s$x%UQ$S#UQ$U#XS$j#q$lQ$o#{R%Q$kR$O#RQiPR#QwQ!c[Q!kaR#Y!VU!_[a!VQ!j`Q#c!^Q#g!`Q$^#dR$_#e",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:117,nodeProps:[["isolate",-2,3,24,""],["openedBy",17,"(",32,"[",50,"{"],["closedBy",18,")",33,"]",51,"}"]],propSources:[gr],skippedNodes:[0,3,87],repeatNodeCount:11,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#Z~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#Z~o`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^l)[UOy%^z#]%^#]#^)n#^;'S%^;'S;=`%o<%lO%^l)sUo`Oy%^z#a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!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[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&S|R+w&TR+m%}T&m!W&pT&n!W&pT2O,p2P",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : 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$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$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FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Rp(U!b'x0/l$[#t(O,2j(`$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Oi,ei,ti,2,3,4,5,6,7,8,9,10,11,12,13,14,Hr,new lO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(^~~",141,335),new lO("j~RQYZXz{^~^O'{~~aP!P!Qd~iO'|~~",25,318)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14725},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:322,get:e=>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-DwenXKXg.js b/ui/dist/assets/CreateApiDocs-CikqNBE1.js
similarity index 99%
rename from ui/dist/assets/CreateApiDocs-DwenXKXg.js
rename to ui/dist/assets/CreateApiDocs-CikqNBE1.js
index c7a09988..41da7e56 100644
--- a/ui/dist/assets/CreateApiDocs-DwenXKXg.js
+++ b/ui/dist/assets/CreateApiDocs-CikqNBE1.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-CN4euoX9.js";import{F as Rt}from"./FieldsQueryParam-BeGMzTy3.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 <code>Authorization:TOKEN</code> 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='<td colspan="3" class="txt-hint txt-bold">Auth specific fields</td>',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='<span class="label">String</span>',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='<span class="label">Boolean</span>',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='<td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>Auth record password.</td>',K=p(),I=s("tr"),I.innerHTML='<td><div class="inline-flex"><span class="label label-success">Required</span> <span>passwordConfirm</span></div></td> <td><span class="label">String</span></td> <td>Auth record password confirmation.</td>',re=p(),Y=s("tr"),Y.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span> <span>verified</span></div></td> <td><span class="label">Boolean</span></td> <td>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-BaIGfIip.js";import{F as Rt}from"./FieldsQueryParam-U25K5YU1.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 <code>Authorization:TOKEN</code> 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='<td colspan="3" class="txt-hint txt-bold">Auth specific fields</td>',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='<span class="label">String</span>',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='<span class="label">Boolean</span>',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='<td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>Auth record password.</td>',K=p(),I=s("tr"),I.innerHTML='<td><div class="inline-flex"><span class="label label-success">Required</span> <span>passwordConfirm</span></div></td> <td><span class="label">String</span></td> <td>Auth record password confirmation.</td>',re=p(),Y=s("tr"),Y.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span> <span>verified</span></div></td> <td><span class="label">Boolean</span></td> <td>Indicates whether the auth record is verified or not.
                     <br/>
                     This field can be set only by superusers or auth records with &quot;Manage&quot; access.</td>`,x=p(),G=s("tr"),G.innerHTML='<td colspan="3" class="txt-hint txt-bold">Other fields</td>',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-vSv-5m5A.js b/ui/dist/assets/DeleteApiDocs-CznS-igD.js
similarity index 98%
rename from ui/dist/assets/DeleteApiDocs-vSv-5m5A.js
rename to ui/dist/assets/DeleteApiDocs-CznS-igD.js
index 42608e13..1fe4570d 100644
--- a/ui/dist/assets/DeleteApiDocs-vSv-5m5A.js
+++ b/ui/dist/assets/DeleteApiDocs-CznS-igD.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-CN4euoX9.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 <code>Authorization:TOKEN</code> 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-BaIGfIip.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 <code>Authorization:TOKEN</code> 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-BvWiYTd5.js b/ui/dist/assets/EmailChangeDocs-Bof9qVRL.js
similarity index 99%
rename from ui/dist/assets/EmailChangeDocs-BvWiYTd5.js
rename to ui/dist/assets/EmailChangeDocs-Bof9qVRL.js
index b0d53219..fddf8c71 100644
--- a/ui/dist/assets/EmailChangeDocs-BvWiYTd5.js
+++ b/ui/dist/assets/EmailChangeDocs-Bof9qVRL.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 Q,a as V,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-CN4euoX9.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,P){g(k,t,P),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,P){e=k,P&4&&l!==(l=e[4].code+"")&&J(d,l),P&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||(Q(l.$$.fragment,r),i=!0)},o(r){V(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,P,G,H,F,L,z,B,D,S,N,T=[],O=new Map,A,j,q=[],W=new Map,w,E=K(n[2]);const M=c=>c[4].code;for(let c=0;c<E.length;c+=1){let f=ve(n,E,c),s=M(f);O.set(s,T[c]=ke(s,f))}let _=K(n[2]);const X=c=>c[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=X(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),P=U("/confirm-email-change"),G=y(),H=p("div"),H.textContent="Body Parameters",F=y(),L=p("table"),L.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>token</span></div></td> <td><span class="label">String</span></td> <td>The token from the change email request email.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>The account password to confirm the email change.</td></tr></tbody>',z=y(),B=p("div"),B.textContent="Responses",D=y(),S=p("div"),N=p("div");for(let c=0;c<T.length;c+=1)T[c].c();A=y(),j=p("div");for(let c=0;c<q.length;c+=1)q[c].c();b(t,"class","label label-primary"),b(d,"class","content"),b(e,"class","alert alert-success"),b(H,"class","section-title"),b(L,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(N,"class","tabs-header compact combined left"),b(j,"class","tabs-content"),b(S,"class","tabs")},m(c,f){g(c,e,f),u(e,t),u(e,l),u(e,d),u(d,i),u(i,r),u(i,a),u(a,k),u(i,P),g(c,G,f),g(c,H,f),g(c,F,f),g(c,L,f),g(c,z,f),g(c,B,f),g(c,D,f),g(c,S,f),u(S,N);for(let s=0;s<T.length;s+=1)T[s]&&T[s].m(N,null);u(S,A),u(S,j);for(let s=0;s<q.length;s+=1)q[s]&&q[s].m(j,null);w=!0},p(c,[f]){(!w||f&1)&&m!==(m=c[0].name+"")&&J(k,m),f&6&&(E=K(c[2]),T=le(T,f,M,1,c,E,O,N,Re,ke,null,ve)),f&6&&(_=K(c[2]),ne(),q=le(q,f,X,1,c,_,W,j,Se,$e,null,ge),ae())},i(c){if(!w){for(let f=0;f<_.length;f+=1)Q(q[f]);w=!0}},o(c){for(let f=0;f<q.length;f+=1)V(q[f]);w=!1},d(c){c&&(v(e),v(G),v(H),v(F),v(L),v(z),v(B),v(D),v(S));for(let f=0;f<T.length;f+=1)T[f].d();for(let f=0;f<q.length;f+=1)q[f].d()}}}function We(n,e,t){let{collection:l}=e,d=204,i=[];const r=a=>t(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 Q,a as V,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-BaIGfIip.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,P){g(k,t,P),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,P){e=k,P&4&&l!==(l=e[4].code+"")&&J(d,l),P&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||(Q(l.$$.fragment,r),i=!0)},o(r){V(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,P,G,H,F,L,z,B,D,S,N,T=[],O=new Map,A,j,q=[],W=new Map,w,E=K(n[2]);const M=c=>c[4].code;for(let c=0;c<E.length;c+=1){let f=ve(n,E,c),s=M(f);O.set(s,T[c]=ke(s,f))}let _=K(n[2]);const X=c=>c[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=X(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),P=U("/confirm-email-change"),G=y(),H=p("div"),H.textContent="Body Parameters",F=y(),L=p("table"),L.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>token</span></div></td> <td><span class="label">String</span></td> <td>The token from the change email request email.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>The account password to confirm the email change.</td></tr></tbody>',z=y(),B=p("div"),B.textContent="Responses",D=y(),S=p("div"),N=p("div");for(let c=0;c<T.length;c+=1)T[c].c();A=y(),j=p("div");for(let c=0;c<q.length;c+=1)q[c].c();b(t,"class","label label-primary"),b(d,"class","content"),b(e,"class","alert alert-success"),b(H,"class","section-title"),b(L,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(N,"class","tabs-header compact combined left"),b(j,"class","tabs-content"),b(S,"class","tabs")},m(c,f){g(c,e,f),u(e,t),u(e,l),u(e,d),u(d,i),u(i,r),u(i,a),u(a,k),u(i,P),g(c,G,f),g(c,H,f),g(c,F,f),g(c,L,f),g(c,z,f),g(c,B,f),g(c,D,f),g(c,S,f),u(S,N);for(let s=0;s<T.length;s+=1)T[s]&&T[s].m(N,null);u(S,A),u(S,j);for(let s=0;s<q.length;s+=1)q[s]&&q[s].m(j,null);w=!0},p(c,[f]){(!w||f&1)&&m!==(m=c[0].name+"")&&J(k,m),f&6&&(E=K(c[2]),T=le(T,f,M,1,c,E,O,N,Re,ke,null,ve)),f&6&&(_=K(c[2]),ne(),q=le(q,f,X,1,c,_,W,j,Se,$e,null,ge),ae())},i(c){if(!w){for(let f=0;f<_.length;f+=1)Q(q[f]);w=!0}},o(c){for(let f=0;f<q.length;f+=1)V(q[f]);w=!1},d(c){c&&(v(e),v(G),v(H),v(F),v(L),v(z),v(B),v(D),v(S));for(let f=0;f<T.length;f+=1)T[f].d();for(let f=0;f<q.length;f+=1)q[f].d()}}}function We(n,e,t){let{collection:l}=e,d=204,i=[];const r=a=>t(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": "Failed to authenticate.",
diff --git a/ui/dist/assets/FieldsQueryParam-BeGMzTy3.js b/ui/dist/assets/FieldsQueryParam-U25K5YU1.js
similarity index 96%
rename from ui/dist/assets/FieldsQueryParam-BeGMzTy3.js
rename to ui/dist/assets/FieldsQueryParam-U25K5YU1.js
index ce7f43c4..4af9615d 100644
--- a/ui/dist/assets/FieldsQueryParam-BeGMzTy3.js
+++ b/ui/dist/assets/FieldsQueryParam-U25K5YU1.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-CN4euoX9.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='<span class="label">String</span>',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-BaIGfIip.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='<span class="label">String</span>',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="<code>*</code> 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-HCvPk0wu.js b/ui/dist/assets/FilterAutocompleteInput-D8GkPlZA.js
similarity index 99%
rename from ui/dist/assets/FilterAutocompleteInput-HCvPk0wu.js
rename to ui/dist/assets/FilterAutocompleteInput-D8GkPlZA.js
index 3cf4c3a9..150c0e89 100644
--- a/ui/dist/assets/FilterAutocompleteInput-HCvPk0wu.js
+++ b/ui/dist/assets/FilterAutocompleteInput-D8GkPlZA.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-CN4euoX9.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;i<a.length;i++){var o=a[i];f.push(new Me(o,e)),(o.indent||o.dedent)&&(g=!0)}return{name:t.name,startState:function(){return{state:"start",pending:null,indent:g?[]:null}},copyState:function(s){var y={state:s.state,pending:s.pending,indent:s.indent&&s.indent.slice(0)};return s.stack&&(y.stack=s.stack.slice(0)),y},token:Ae(r),indent:Be(r,t),languageData:t}}function V(e,r){if(!e.hasOwnProperty(r))throw new Error("Undefined state "+r+" in simple mode")}function Ie(e,r){if(!e)return/(?:)/;var t="";return e instanceof RegExp?(e.ignoreCase&&(t="i"),e=e.source):e=String(e),new RegExp("^(?:"+e+")",t)}function Je(e){if(!e)return null;if(e.apply)return e;if(typeof e=="string")return e.replace(/\./g," ");for(var r=[],t=0;t<e.length;t++)r.push(e[t]&&e[t].replace(/\./g," "));return r}function Me(e,r){(e.next||e.push)&&V(r,e.next||e.push),this.regex=Ie(e.regex),this.token=Je(e.token),this.data=e}function Ae(e){return function(r,t){if(t.pending){var g=t.pending.shift();return t.pending.length==0&&(t.pending=null),r.pos+=g.text.length,g.token}for(var h=e[t.state],f=0;f<h.length;f++){var a=h[f],i=(!a.data.sol||r.sol())&&r.match(a.regex);if(i){a.data.next?t.state=a.data.next:a.data.push?((t.stack||(t.stack=[])).push(t.state),t.state=a.data.push):a.data.pop&&t.stack&&t.stack.length&&(t.state=t.stack.pop()),a.data.indent&&t.indent.push(r.indentation()+r.indentUnit),a.data.dedent&&t.indent.pop();var o=a.token;if(o&&o.apply&&(o=o(i)),i.length>2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s<i.length;s++)i[s]&&t.pending.push({text:i[s],token:a.token[s-1]});return r.backUp(i[0].length-(i[1]?i[1].length:0)),o[0]}else return o&&o.join?o[0]:o}}return r.next(),null}}function Be(e,r){return function(t,g){if(t.indent==null||r.dontIndentStates&&r.doneIndentState.indexOf(t.state)>-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;a<f.length;a++){var i=f[a];if(i.data.dedent&&i.data.dedentIfLineStart!==!1){var o=i.regex.exec(g);if(o&&o[0]){h--,(i.next||i.push)&&(f=e[i.next||i.push]),g=g.slice(o[0].length);continue e}}}break}return h<0?0:t.indent[h]}}function He(e){let r;return{c(){r=ne("div"),re(r,"class","code-editor")},m(t,g){ie(t,r,g),e[15](r)},p:D,i:D,o:D,d(t){t&&ae(r),e[15](null)}}}function Te(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.fields])}function Fe(e,r,t){let g;oe(e,le,n=>t(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-BaIGfIip.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;i<a.length;i++){var o=a[i];f.push(new Me(o,e)),(o.indent||o.dedent)&&(g=!0)}return{name:t.name,startState:function(){return{state:"start",pending:null,indent:g?[]:null}},copyState:function(s){var y={state:s.state,pending:s.pending,indent:s.indent&&s.indent.slice(0)};return s.stack&&(y.stack=s.stack.slice(0)),y},token:Ae(r),indent:Be(r,t),languageData:t}}function V(e,r){if(!e.hasOwnProperty(r))throw new Error("Undefined state "+r+" in simple mode")}function Ie(e,r){if(!e)return/(?:)/;var t="";return e instanceof RegExp?(e.ignoreCase&&(t="i"),e=e.source):e=String(e),new RegExp("^(?:"+e+")",t)}function Je(e){if(!e)return null;if(e.apply)return e;if(typeof e=="string")return e.replace(/\./g," ");for(var r=[],t=0;t<e.length;t++)r.push(e[t]&&e[t].replace(/\./g," "));return r}function Me(e,r){(e.next||e.push)&&V(r,e.next||e.push),this.regex=Ie(e.regex),this.token=Je(e.token),this.data=e}function Ae(e){return function(r,t){if(t.pending){var g=t.pending.shift();return t.pending.length==0&&(t.pending=null),r.pos+=g.text.length,g.token}for(var h=e[t.state],f=0;f<h.length;f++){var a=h[f],i=(!a.data.sol||r.sol())&&r.match(a.regex);if(i){a.data.next?t.state=a.data.next:a.data.push?((t.stack||(t.stack=[])).push(t.state),t.state=a.data.push):a.data.pop&&t.stack&&t.stack.length&&(t.state=t.stack.pop()),a.data.indent&&t.indent.push(r.indentation()+r.indentUnit),a.data.dedent&&t.indent.pop();var o=a.token;if(o&&o.apply&&(o=o(i)),i.length>2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s<i.length;s++)i[s]&&t.pending.push({text:i[s],token:a.token[s-1]});return r.backUp(i[0].length-(i[1]?i[1].length:0)),o[0]}else return o&&o.join?o[0]:o}}return r.next(),null}}function Be(e,r){return function(t,g){if(t.indent==null||r.dontIndentStates&&r.doneIndentState.indexOf(t.state)>-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;a<f.length;a++){var i=f[a];if(i.data.dedent&&i.data.dedentIfLineStart!==!1){var o=i.regex.exec(g);if(o&&o[0]){h--,(i.next||i.push)&&(f=e[i.next||i.push]),g=g.slice(o[0].length);continue e}}}break}return h<0?0:t.indent[h]}}function He(e){let r;return{c(){r=ne("div"),re(r,"class","code-editor")},m(t,g){ie(t,r,g),e[15](r)},p:D,i:D,o:D,d(t){t&&ae(r),e[15](null)}}}function Te(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.fields])}function Fe(e,r,t){let g;oe(e,le,n=>t(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-Cbzk6gf3.js b/ui/dist/assets/ListApiDocs-B7pwTvY7.js
similarity index 99%
rename from ui/dist/assets/ListApiDocs-Cbzk6gf3.js
rename to ui/dist/assets/ListApiDocs-B7pwTvY7.js
index 0c46beeb..06d55e20 100644
--- a/ui/dist/assets/ListApiDocs-Cbzk6gf3.js
+++ b/ui/dist/assets/ListApiDocs-B7pwTvY7.js
@@ -1,4 +1,4 @@
-import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Ue,o as m,w as _,h as t,Q as nl,R as Fe,T as se,c as Ut,m as Qt,x as ke,U as Qe,V as ol,k as al,W as il,n as rl,t as $t,a as Ct,d as jt,X as cl,C as ve,p as dl,r as Le}from"./index-CN4euoX9.js";import{F as pl}from"./FieldsQueryParam-BeGMzTy3.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,S,Kt,H,rt,R,et,ne,U,Q,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,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 u,u as ll,y as Ue,o as m,w as _,h as t,Q as nl,R as Fe,T as se,c as Ut,m as Qt,x as ke,U as Qe,V as ol,k as al,W as il,n as rl,t as $t,a as Ct,d as jt,X as cl,C as ve,p as dl,r as Le}from"./index-BaIGfIip.js";import{F as pl}from"./FieldsQueryParam-U25K5YU1.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,S,Kt,H,rt,R,et,ne,U,Q,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,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
         <code><span class="txt-success">OPERAND</span> <span class="txt-danger">OPERATOR</span> <span class="txt-success">OPERAND</span></code>, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single
             or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of:
             `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),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"),Q=e("code"),Q.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
diff --git a/ui/dist/assets/PageOAuth2RedirectFailure-2gnIEHBl.js b/ui/dist/assets/PageOAuth2RedirectFailure-CDTl1tTq.js
similarity index 88%
rename from ui/dist/assets/PageOAuth2RedirectFailure-2gnIEHBl.js
rename to ui/dist/assets/PageOAuth2RedirectFailure-CDTl1tTq.js
index 72ac79bb..cd28696c 100644
--- a/ui/dist/assets/PageOAuth2RedirectFailure-2gnIEHBl.js
+++ b/ui/dist/assets/PageOAuth2RedirectFailure-CDTl1tTq.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-CN4euoX9.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='<h3 class="m-b-sm">Auth failed.</h3> <h5>You can close this window and go back to the app to try again.</h5>',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-BaIGfIip.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='<h3 class="m-b-sm">Auth failed.</h3> <h5>You can close this window and go back to the app to try again.</h5>',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-dU_MeWIo.js b/ui/dist/assets/PageOAuth2RedirectSuccess-D88pwV_a.js
similarity index 88%
rename from ui/dist/assets/PageOAuth2RedirectSuccess-dU_MeWIo.js
rename to ui/dist/assets/PageOAuth2RedirectSuccess-D88pwV_a.js
index 19f6b72c..67d908c8 100644
--- a/ui/dist/assets/PageOAuth2RedirectSuccess-dU_MeWIo.js
+++ b/ui/dist/assets/PageOAuth2RedirectSuccess-D88pwV_a.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-CN4euoX9.js";function _(a){let t;return{c(){t=l("div"),t.innerHTML='<h3 class="m-b-sm">Auth completed.</h3> <h5>You can close this window and go back to the app.</h5>',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-BaIGfIip.js";function _(a){let t;return{c(){t=l("div"),t.innerHTML='<h3 class="m-b-sm">Auth completed.</h3> <h5>You can close this window and go back to the app.</h5>',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-BNkhd6Kl.js b/ui/dist/assets/PageRecordConfirmEmailChange-D2B5r6kI.js
similarity index 98%
rename from ui/dist/assets/PageRecordConfirmEmailChange-BNkhd6Kl.js
rename to ui/dist/assets/PageRecordConfirmEmailChange-D2B5r6kI.js
index f8176e5a..4973e420 100644
--- a/ui/dist/assets/PageRecordConfirmEmailChange-BNkhd6Kl.js
+++ b/ui/dist/assets/PageRecordConfirmEmailChange-D2B5r6kI.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-CN4euoX9.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-BaIGfIip.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='<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Successfully changed the user email address.</p> <p>You can now sign in with your new email address.</p></div>',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-Dt6q5hoH.js b/ui/dist/assets/PageRecordConfirmPasswordReset-B-qLfTWn.js
similarity index 98%
rename from ui/dist/assets/PageRecordConfirmPasswordReset-Dt6q5hoH.js
rename to ui/dist/assets/PageRecordConfirmPasswordReset-B-qLfTWn.js
index 3fd5be6a..a5e73f25 100644
--- a/ui/dist/assets/PageRecordConfirmPasswordReset-Dt6q5hoH.js
+++ b/ui/dist/assets/PageRecordConfirmPasswordReset-B-qLfTWn.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-CN4euoX9.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-BaIGfIip.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='<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Successfully changed the user password.</p> <p>You can now sign in with your new password.</p></div>',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-CvRAamHy.js b/ui/dist/assets/PageRecordConfirmVerification-BPX_PYBc.js
similarity index 98%
rename from ui/dist/assets/PageRecordConfirmVerification-CvRAamHy.js
rename to ui/dist/assets/PageRecordConfirmVerification-BPX_PYBc.js
index 6a27bdd9..d817e6d0 100644
--- a/ui/dist/assets/PageRecordConfirmVerification-CvRAamHy.js
+++ b/ui/dist/assets/PageRecordConfirmVerification-BPX_PYBc.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-CN4euoX9.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='<div class="icon"><i class="ri-error-warning-line"></i></div> <div class="content txt-bold"><p>Invalid or expired verification token.</p></div>',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='<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Please check your email for the new verification link.</p></div>',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='<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Successfully verified email address.</p></div>',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='<div class="loader loader-lg"><em>Please wait...</em></div>',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-BaIGfIip.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='<div class="icon"><i class="ri-error-warning-line"></i></div> <div class="content txt-bold"><p>Invalid or expired verification token.</p></div>',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='<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Please check your email for the new verification link.</p></div>',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='<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Successfully verified email address.</p></div>',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='<div class="loader loader-lg"><em>Please wait...</em></div>',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-g9lrmmbf.js b/ui/dist/assets/PageSuperuserConfirmPasswordReset-K6Q1jQaB.js
similarity index 98%
rename from ui/dist/assets/PageSuperuserConfirmPasswordReset-g9lrmmbf.js
rename to ui/dist/assets/PageSuperuserConfirmPasswordReset-K6Q1jQaB.js
index 893683f1..f890f473 100644
--- a/ui/dist/assets/PageSuperuserConfirmPasswordReset-g9lrmmbf.js
+++ b/ui/dist/assets/PageSuperuserConfirmPasswordReset-K6Q1jQaB.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-CN4euoX9.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-BaIGfIip.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-DkL8JGq2.js b/ui/dist/assets/PageSuperuserRequestPasswordReset-BNXIAEy4.js
similarity index 98%
rename from ui/dist/assets/PageSuperuserRequestPasswordReset-DkL8JGq2.js
rename to ui/dist/assets/PageSuperuserRequestPasswordReset-BNXIAEy4.js
index 2d7c2a0c..50c75e7c 100644
--- a/ui/dist/assets/PageSuperuserRequestPasswordReset-DkL8JGq2.js
+++ b/ui/dist/assets/PageSuperuserRequestPasswordReset-BNXIAEy4.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-CN4euoX9.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='<h4 class="m-b-xs">Forgotten superuser password</h4> <p>Enter the email associated with your account and we’ll send you a recovery link:</p>',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='<i class="ri-checkbox-circle-line"></i>',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-BaIGfIip.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='<h4 class="m-b-xs">Forgotten superuser password</h4> <p>Enter the email associated with your account and we’ll send you a recovery link:</p>',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='<i class="ri-checkbox-circle-line"></i>',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-kZP8IVQT.js b/ui/dist/assets/PasswordResetDocs-Blc8Xe1F.js
similarity index 99%
rename from ui/dist/assets/PasswordResetDocs-kZP8IVQT.js
rename to ui/dist/assets/PasswordResetDocs-Blc8Xe1F.js
index 6f286e8a..48957f0a 100644
--- a/ui/dist/assets/PasswordResetDocs-kZP8IVQT.js
+++ b/ui/dist/assets/PasswordResetDocs-Blc8Xe1F.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 k,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-CN4euoX9.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(),k(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,y){b(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&z(d,n),y&6&&H(e,"active",t[1]===t[4].code)},d(g){g&&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(),k(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+"",g,y,I,q,Q,N,L,O,W,T,C,R=[],M=new Map,j,A,h=[],K=new Map,E,P=U(o[2]);const B=l=>l[4].code;for(let l=0;l<P.length;l+=1){let s=_e(o,P,l),_=B(s);M.set(_,R[l]=he(_,s))}let m=U(o[2]);const Y=l=>l[4].code;for(let l=0;l<m.length;l+=1){let s=me(o,m,l),_=Y(s);K.set(_,h[l]=be(_,s))}return{c(){t=p("div"),e=p("strong"),e.textContent="POST",n=S(),d=p("div"),c=p("p"),r=D("/api/collections/"),a=p("strong"),g=D(f),y=D("/confirm-password-reset"),I=S(),q=p("div"),q.textContent="Body Parameters",Q=S(),N=p("table"),N.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>token</span></div></td> <td><span class="label">String</span></td> <td>The token from the password reset request email.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>The new password to set.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>passwordConfirm</span></div></td> <td><span class="label">String</span></td> <td>The new password confirmation.</td></tr></tbody>',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),C=p("div");for(let l=0;l<R.length;l+=1)R[l].c();j=S(),A=p("div");for(let l=0;l<h.length;l+=1)h[l].c();k(e,"class","label label-primary"),k(d,"class","content"),k(t,"class","alert alert-success"),k(q,"class","section-title"),k(N,"class","table-compact table-border m-b-base"),k(O,"class","section-title"),k(C,"class","tabs-header compact combined left"),k(A,"class","tabs-content"),k(T,"class","tabs")},m(l,s){b(l,t,s),u(t,e),u(t,n),u(t,d),u(d,c),u(c,r),u(c,a),u(a,g),u(c,y),b(l,I,s),b(l,q,s),b(l,Q,s),b(l,N,s),b(l,L,s),b(l,O,s),b(l,W,s),b(l,T,s),u(T,C);for(let _=0;_<R.length;_+=1)R[_]&&R[_].m(C,null);u(T,j),u(T,A);for(let _=0;_<h.length;_+=1)h[_]&&h[_].m(A,null);E=!0},p(l,[s]){(!E||s&1)&&f!==(f=l[0].name+"")&&z(g,f),s&6&&(P=U(l[2]),R=ee(R,s,B,1,l,P,M,C,ye,he,null,_e)),s&6&&(m=U(l[2]),te(),h=ee(h,s,Y,1,l,m,K,A,Te,be,null,me),le())},i(l){if(!E){for(let s=0;s<m.length;s+=1)V(h[s]);E=!0}},o(l){for(let s=0;s<h.length;s+=1)X(h[s]);E=!1},d(l){l&&(v(t),v(I),v(q),v(Q),v(N),v(L),v(O),v(W),v(T));for(let s=0;s<R.length;s+=1)R[s].d();for(let s=0;s<h.length;s+=1)h[s].d()}}}function Ne(o,t,e){let{collection:n}=t,d=204,c=[];const r=a=>e(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 k,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-BaIGfIip.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(),k(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,y){b(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&z(d,n),y&6&&H(e,"active",t[1]===t[4].code)},d(g){g&&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(),k(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+"",g,y,I,q,Q,N,L,O,W,T,C,R=[],M=new Map,j,A,h=[],K=new Map,E,P=U(o[2]);const B=l=>l[4].code;for(let l=0;l<P.length;l+=1){let s=_e(o,P,l),_=B(s);M.set(_,R[l]=he(_,s))}let m=U(o[2]);const Y=l=>l[4].code;for(let l=0;l<m.length;l+=1){let s=me(o,m,l),_=Y(s);K.set(_,h[l]=be(_,s))}return{c(){t=p("div"),e=p("strong"),e.textContent="POST",n=S(),d=p("div"),c=p("p"),r=D("/api/collections/"),a=p("strong"),g=D(f),y=D("/confirm-password-reset"),I=S(),q=p("div"),q.textContent="Body Parameters",Q=S(),N=p("table"),N.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>token</span></div></td> <td><span class="label">String</span></td> <td>The token from the password reset request email.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>password</span></div></td> <td><span class="label">String</span></td> <td>The new password to set.</td></tr> <tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>passwordConfirm</span></div></td> <td><span class="label">String</span></td> <td>The new password confirmation.</td></tr></tbody>',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),C=p("div");for(let l=0;l<R.length;l+=1)R[l].c();j=S(),A=p("div");for(let l=0;l<h.length;l+=1)h[l].c();k(e,"class","label label-primary"),k(d,"class","content"),k(t,"class","alert alert-success"),k(q,"class","section-title"),k(N,"class","table-compact table-border m-b-base"),k(O,"class","section-title"),k(C,"class","tabs-header compact combined left"),k(A,"class","tabs-content"),k(T,"class","tabs")},m(l,s){b(l,t,s),u(t,e),u(t,n),u(t,d),u(d,c),u(c,r),u(c,a),u(a,g),u(c,y),b(l,I,s),b(l,q,s),b(l,Q,s),b(l,N,s),b(l,L,s),b(l,O,s),b(l,W,s),b(l,T,s),u(T,C);for(let _=0;_<R.length;_+=1)R[_]&&R[_].m(C,null);u(T,j),u(T,A);for(let _=0;_<h.length;_+=1)h[_]&&h[_].m(A,null);E=!0},p(l,[s]){(!E||s&1)&&f!==(f=l[0].name+"")&&z(g,f),s&6&&(P=U(l[2]),R=ee(R,s,B,1,l,P,M,C,ye,he,null,_e)),s&6&&(m=U(l[2]),te(),h=ee(h,s,Y,1,l,m,K,A,Te,be,null,me),le())},i(l){if(!E){for(let s=0;s<m.length;s+=1)V(h[s]);E=!0}},o(l){for(let s=0;s<h.length;s+=1)X(h[s]);E=!1},d(l){l&&(v(t),v(I),v(q),v(Q),v(N),v(L),v(O),v(W),v(T));for(let s=0;s<R.length;s+=1)R[s].d();for(let s=0;s<h.length;s+=1)h[s].d()}}}function Ne(o,t,e){let{collection:n}=t,d=204,c=[];const r=a=>e(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": "Failed to authenticate.",
diff --git a/ui/dist/assets/RealtimeApiDocs-DcZfgmqs.js b/ui/dist/assets/RealtimeApiDocs-DviwWQmF.js
similarity index 99%
rename from ui/dist/assets/RealtimeApiDocs-DcZfgmqs.js
rename to ui/dist/assets/RealtimeApiDocs-DviwWQmF.js
index b8637252..b50ad842 100644
--- a/ui/dist/assets/RealtimeApiDocs-DcZfgmqs.js
+++ b/ui/dist/assets/RealtimeApiDocs-DviwWQmF.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-CN4euoX9.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-BaIGfIip.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-DRwwrV0b.js b/ui/dist/assets/UpdateApiDocs-D8XSOeHG.js
similarity index 99%
rename from ui/dist/assets/UpdateApiDocs-DRwwrV0b.js
rename to ui/dist/assets/UpdateApiDocs-D8XSOeHG.js
index ab8dfe82..c5821538 100644
--- a/ui/dist/assets/UpdateApiDocs-DRwwrV0b.js
+++ b/ui/dist/assets/UpdateApiDocs-D8XSOeHG.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-CN4euoX9.js";import{F as Pt}from"./FieldsQueryParam-BeGMzTy3.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=`<em>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-BaIGfIip.js";import{F as Pt}from"./FieldsQueryParam-U25K5YU1.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=`<em>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.</em>`},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 <code>Authorization:TOKEN</code> 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='<td colspan="3" class="txt-hint txt-bold">Auth specific fields</td>',t=f(),a=i("tr"),a.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span> <span>email</span></div></td> <td><span class="label">String</span></td> <td>The auth record email address.
                     <br/>
diff --git a/ui/dist/assets/VerificationDocs-C6tW_CBf.js b/ui/dist/assets/VerificationDocs-DcqlnWXO.js
similarity index 99%
rename from ui/dist/assets/VerificationDocs-C6tW_CBf.js
rename to ui/dist/assets/VerificationDocs-DcqlnWXO.js
index 5f4a844c..405f84e5 100644
--- a/ui/dist/assets/VerificationDocs-C6tW_CBf.js
+++ b/ui/dist/assets/VerificationDocs-DcqlnWXO.js
@@ -1,4 +1,4 @@
-import{S as le,i as ne,s as ie,T as D,e as m,b as T,w as M,f as v,g as b,h as u,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 Ie,p as Pe,Y as ue}from"./index-CN4euoX9.js";function de(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 d(){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),u(e,f),u(e,c),r||(a=oe(e,"click",d),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),u(e,f),c=!0},p(r,a){t=r;const d={};a&4&&(d.content=t[4].body),o.$set(d),(!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 Re(s){let t,e,o,f,c,r,a,d=s[0].name+"",g,C,F,R,H,A,B,O,N,q,V,$=[],Q=new Map,U,P,p=[],y=new Map,I,_=D(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=D(s[2]);const W=l=>l[4].code;for(let l=0;l<E.length;l+=1){let i=de(s,E,l),n=W(i);y.set(n,p[l]=_e(n,i))}return{c(){t=m("div"),e=m("strong"),e.textContent="POST",o=T(),f=m("div"),c=m("p"),r=M("/api/collections/"),a=m("strong"),g=M(d),C=M("/confirm-verification"),F=T(),R=m("div"),R.textContent="Body Parameters",H=T(),A=m("table"),A.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>token</span></div></td> <td><span class="label">String</span></td> <td>The token from the verification request email.</td></tr></tbody>',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(),P=m("div");for(let l=0;l<p.length;l+=1)p[l].c();v(e,"class","label label-primary"),v(f,"class","content"),v(t,"class","alert alert-success"),v(R,"class","section-title"),v(A,"class","table-compact table-border m-b-base"),v(O,"class","section-title"),v(V,"class","tabs-header compact combined left"),v(P,"class","tabs-content"),v(q,"class","tabs")},m(l,i){b(l,t,i),u(t,e),u(t,o),u(t,f),u(f,c),u(c,r),u(c,a),u(a,g),u(c,C),b(l,F,i),b(l,R,i),b(l,H,i),b(l,A,i),b(l,B,i),b(l,O,i),b(l,N,i),b(l,q,i),u(q,V);for(let n=0;n<$.length;n+=1)$[n]&&$[n].m(V,null);u(q,U),u(q,P);for(let n=0;n<p.length;n+=1)p[n]&&p[n].m(P,null);I=!0},p(l,[i]){(!I||i&1)&&d!==(d=l[0].name+"")&&Y(g,d),i&6&&(_=D(l[2]),$=x($,i,X,1,l,_,Q,V,ye,pe,null,me)),i&6&&(E=D(l[2]),ee(),p=x(p,i,W,1,l,E,y,P,Ce,_e,null,de),te())},i(l){if(!I){for(let i=0;i<E.length;i+=1)L(p[i]);I=!0}},o(l){for(let i=0;i<p.length;i+=1)j(p[i]);I=!1},d(l){l&&(h(t),h(F),h(R),h(H),h(A),h(B),h(O),h(N),h(q));for(let i=0;i<$.length;i+=1)$[i].d();for(let i=0;i<p.length;i+=1)p[i].d()}}}function Ae(s,t,e){let{collection:o}=t,f=204,c=[];const r=a=>e(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 D,e as m,b as T,w as M,f as v,g as b,h as u,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 Ie,p as Pe,Y as ue}from"./index-BaIGfIip.js";function de(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 d(){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),u(e,f),u(e,c),r||(a=oe(e,"click",d),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),u(e,f),c=!0},p(r,a){t=r;const d={};a&4&&(d.content=t[4].body),o.$set(d),(!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 Re(s){let t,e,o,f,c,r,a,d=s[0].name+"",g,C,F,R,H,A,B,O,N,q,V,$=[],Q=new Map,U,P,p=[],y=new Map,I,_=D(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=D(s[2]);const W=l=>l[4].code;for(let l=0;l<E.length;l+=1){let i=de(s,E,l),n=W(i);y.set(n,p[l]=_e(n,i))}return{c(){t=m("div"),e=m("strong"),e.textContent="POST",o=T(),f=m("div"),c=m("p"),r=M("/api/collections/"),a=m("strong"),g=M(d),C=M("/confirm-verification"),F=T(),R=m("div"),R.textContent="Body Parameters",H=T(),A=m("table"),A.innerHTML='<thead><tr><th>Param</th> <th>Type</th> <th width="50%">Description</th></tr></thead> <tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span> <span>token</span></div></td> <td><span class="label">String</span></td> <td>The token from the verification request email.</td></tr></tbody>',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(),P=m("div");for(let l=0;l<p.length;l+=1)p[l].c();v(e,"class","label label-primary"),v(f,"class","content"),v(t,"class","alert alert-success"),v(R,"class","section-title"),v(A,"class","table-compact table-border m-b-base"),v(O,"class","section-title"),v(V,"class","tabs-header compact combined left"),v(P,"class","tabs-content"),v(q,"class","tabs")},m(l,i){b(l,t,i),u(t,e),u(t,o),u(t,f),u(f,c),u(c,r),u(c,a),u(a,g),u(c,C),b(l,F,i),b(l,R,i),b(l,H,i),b(l,A,i),b(l,B,i),b(l,O,i),b(l,N,i),b(l,q,i),u(q,V);for(let n=0;n<$.length;n+=1)$[n]&&$[n].m(V,null);u(q,U),u(q,P);for(let n=0;n<p.length;n+=1)p[n]&&p[n].m(P,null);I=!0},p(l,[i]){(!I||i&1)&&d!==(d=l[0].name+"")&&Y(g,d),i&6&&(_=D(l[2]),$=x($,i,X,1,l,_,Q,V,ye,pe,null,me)),i&6&&(E=D(l[2]),ee(),p=x(p,i,W,1,l,E,y,P,Ce,_e,null,de),te())},i(l){if(!I){for(let i=0;i<E.length;i+=1)L(p[i]);I=!0}},o(l){for(let i=0;i<p.length;i+=1)j(p[i]);I=!1},d(l){l&&(h(t),h(F),h(R),h(H),h(A),h(B),h(O),h(N),h(q));for(let i=0;i<$.length;i+=1)$[i].d();for(let i=0;i<p.length;i+=1)p[i].d()}}}function Ae(s,t,e){let{collection:o}=t,f=204,c=[];const r=a=>e(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": "Failed to authenticate.",
diff --git a/ui/dist/assets/ViewApiDocs-U3CHHlFs.js b/ui/dist/assets/ViewApiDocs-BhiZdWr9.js
similarity index 98%
rename from ui/dist/assets/ViewApiDocs-U3CHHlFs.js
rename to ui/dist/assets/ViewApiDocs-BhiZdWr9.js
index 4435c342..33d49c7e 100644
--- a/ui/dist/assets/ViewApiDocs-U3CHHlFs.js
+++ b/ui/dist/assets/ViewApiDocs-BhiZdWr9.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-CN4euoX9.js";import{F as ut}from"./FieldsQueryParam-BeGMzTy3.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 <code>Authorization:TOKEN</code> 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-BaIGfIip.js";import{F as ut}from"./FieldsQueryParam-U25K5YU1.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 <code>Authorization:TOKEN</code> 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-CN4euoX9.js b/ui/dist/assets/index-BaIGfIip.js
similarity index 88%
rename from ui/dist/assets/index-CN4euoX9.js
rename to ui/dist/assets/index-BaIGfIip.js
index 8978c657..362cf6da 100644
--- a/ui/dist/assets/index-CN4euoX9.js
+++ b/ui/dist/assets/index-BaIGfIip.js
@@ -1,8 +1,8 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-HCvPk0wu.js","./index-B5ReTu-C.js","./ListApiDocs-Cbzk6gf3.js","./FieldsQueryParam-BeGMzTy3.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-U3CHHlFs.js","./CreateApiDocs-DwenXKXg.js","./UpdateApiDocs-DRwwrV0b.js","./AuthMethodsDocs-DeHPt55D.js","./AuthRefreshDocs-D0IAoZLo.js","./AuthWithPasswordDocs-DY-s5WMs.js","./AuthWithOAuth2Docs-bl3paI1E.js","./CodeEditor-C_5qTJii.js"])))=>i.map(i=>d[i]);
-var mk=Object.defineProperty;var hk=(n,e,t)=>e in n?mk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ct=(n,e,t)=>hk(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 io=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function _k(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ob(n){return n()}function df(){return Object.create(null)}function De(n){n.forEach(Ob)}function Rt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function vn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function gk(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 Eb(n){let e;return uu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(uu(e,t))}function Lt(n,e,t,i){if(n){const l=Mb(n,e,t,i);return n[0](l)}}function Mb(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function At(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;r<o;r+=1)s[r]=e.dirty[r]|l[r];return s}return e.dirty|l}return e.dirty}function Pt(n,e,t,i,l,s){if(l){const o=Mb(e,t,i,s);n.p(o,l)}}function Nt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Ut(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function lt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function js(n){return n??""}function Nn(n,e,t){return n.set(t),e}function Me(n){return n&&Rt(n.destroy)?n.destroy:te}function pf(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Db=typeof window<"u";let Or=Db?()=>window.performance.now():()=>Date.now(),fu=Db?n=>requestAnimationFrame(n):te;const Zl=new Set;function Ib(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&fu(Ib)}function Er(n){let e;return Zl.size===0&&fu(Ib),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Lb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function bk(n){const e=b("style");return e.textContent="/* empty */",yk(Lb(n),e),e.sheet}function yk(n,e){return w(n.head||n,e),e.sheet}function v(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function pt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function Y(n){return document.createTextNode(n)}function C(){return Y(" ")}function ge(){return Y("")}function B(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function tt(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 kk=["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&&kk.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function vk(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 yt(n){return n===""?null:+n}function wk(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function Sk(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Ab(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 fr=new Map;let cr=0;function Tk(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function $k(n,e){const t={stylesheet:bk(e),rules:{}};return fr.set(n,t),t}function zs(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-D8GkPlZA.js","./index-B5ReTu-C.js","./ListApiDocs-B7pwTvY7.js","./FieldsQueryParam-U25K5YU1.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-BhiZdWr9.js","./CreateApiDocs-CikqNBE1.js","./UpdateApiDocs-D8XSOeHG.js","./AuthMethodsDocs-BtaDoWWO.js","./AuthRefreshDocs-CgORCLzq.js","./AuthWithPasswordDocs-BEqreZjJ.js","./AuthWithOAuth2Docs-DcbkfNMl.js","./CodeEditor-BMLITRTv.js"])))=>i.map(i=>d[i]);
+var mk=Object.defineProperty;var hk=(n,e,t)=>e in n?mk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ct=(n,e,t)=>hk(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 io=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function _k(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ob(n){return n()}function df(){return Object.create(null)}function De(n){n.forEach(Ob)}function Rt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function vn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function gk(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 Eb(n){let e;return uu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(uu(e,t))}function Lt(n,e,t,i){if(n){const l=Mb(n,e,t,i);return n[0](l)}}function Mb(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function At(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;r<o;r+=1)s[r]=e.dirty[r]|l[r];return s}return e.dirty|l}return e.dirty}function Pt(n,e,t,i,l,s){if(l){const o=Mb(e,t,i,s);n.p(o,l)}}function Nt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Ut(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function lt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function js(n){return n??""}function Nn(n,e,t){return n.set(t),e}function Me(n){return n&&Rt(n.destroy)?n.destroy:te}function pf(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Db=typeof window<"u";let Or=Db?()=>window.performance.now():()=>Date.now(),fu=Db?n=>requestAnimationFrame(n):te;const Zl=new Set;function Ib(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&fu(Ib)}function Er(n){let e;return Zl.size===0&&fu(Ib),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Lb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function bk(n){const e=b("style");return e.textContent="/* empty */",yk(Lb(n),e),e.sheet}function yk(n,e){return w(n.head||n,e),e.sheet}function v(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function pt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function Y(n){return document.createTextNode(n)}function C(){return Y(" ")}function ge(){return Y("")}function B(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function tt(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 kk=["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&&kk.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function vk(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 _t(n){return n===""?null:+n}function wk(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function Sk(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Ab(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 fr=new Map;let cr=0;function Tk(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function $k(n,e){const t={stylesheet:bk(e),rules:{}};return fr.set(n,t),t}function zs(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{
 `;for(let _=0;_<=1;_+=a){const y=e+(t-e)*s(_);u+=_*100+`%{${o(y,1-y)}}
 `}const f=u+`100% {${o(t,1-t)}}
-}`,c=`__svelte_${Tk(f)}_${r}`,d=Lb(n),{stylesheet:m,rules:h}=fr.get(d)||$k(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${l}ms 1 both`,cr+=1,c}function Us(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(", "),cr-=l,cr||Ck())}function Ck(){fu(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),fr.clear())})}function Ok(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=io,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 g(){c&&(h=zs(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Us(n,h),d=!1}return Er(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),_()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);f(T,1-T)}return!0}),g(),f(0,1),_}function Ek(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,Pb(n,l)}}function Pb(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 Vs;function Ni(n){Vs=n}function lo(){if(!Vs)throw new Error("Function called outside component initialization");return Vs}function Yt(n){lo().$$.on_mount.push(n)}function Mk(n){lo().$$.after_update.push(n)}function so(n){lo().$$.on_destroy.push(n)}function _t(){const n=lo();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Ab(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Yl=[],ie=[];let Gl=[];const Pa=[],Nb=Promise.resolve();let Na=!1;function Rb(){Na||(Na=!0,Nb.then(cu))}function fn(){return Rb(),Nb}function nt(n){Gl.push(n)}function $e(n){Pa.push(n)}const Zr=new Set;let jl=0;function cu(){if(jl!==0)return;const n=Vs;do{try{for(;jl<Yl.length;){const e=Yl[jl];jl++,Ni(e),Dk(e.$$)}}catch(e){throw Yl.length=0,jl=0,e}for(Ni(null),Yl.length=0,jl=0;ie.length;)ie.pop()();for(let e=0;e<Gl.length;e+=1){const t=Gl[e];Zr.has(t)||(Zr.add(t),t())}Gl.length=0}while(Yl.length);for(;Pa.length;)Pa.pop()();Na=!1,Zr.clear(),Ni(n)}function Dk(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(nt)}}function Ik(n){const e=[],t=[];Gl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let gs;function du(){return gs||(gs=Promise.resolve(),gs.then(()=>{gs=null})),gs}function Ol(n,e,t){n.dispatchEvent(Ab(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let wi;function re(){wi={r:0,c:[],p:wi}}function ae(){wi.r||De(wi.c),wi=wi.p}function O(n,e){n&&n.i&&(Xo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Xo.has(n))return;Xo.add(n),wi.c.push(()=>{Xo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pu={duration:0};function Fb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Us(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=io,tick:g=te,css:_}=l||pu;_&&(o=zs(n,0,1,m,d,h,_,a++)),g(0,1);const y=Or()+d,S=y+m;r&&r.abort(),s=!0,nt(()=>Ol(n,!0,"start")),r=Er(T=>{if(s){if(T>=S)return g(1,0),Ol(n,!0,"end"),u(),s=!1;if(T>=y){const $=h((T-y)/m);g($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,Us(n),Rt(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=wi;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=io,tick:m=te,css:h}=l||pu;h&&(o=zs(n,1,0,c,f,d,h));const g=Or()+f,_=g+c;nt(()=>Ol(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Er(y=>{if(s){if(y>=_)return m(0,1),Ol(n,!1,"end"),--r.r||De(r.c),!1;if(y>=g){const S=d((y-g)/c);m(1-S,S)}}return s})}return Rt(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&&Us(n,o),s=!1)}}}function ze(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&&Us(n,u)}function d(h,g){const _=h.b-o;return g*=Math.abs(_),{a:o,b:h.b,d:_,duration:g,start:h.start,end:h.start+g,group:h.group}}function m(h){const{delay:g=0,duration:_=300,easing:y=io,tick:S=te,css:T}=s||pu,$={start:Or()+g,b:h};h||($.group=wi,wi.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),u=zs(n,o,h,_,g,y,T)),h&&S(0,1),r=d($,_),nt(()=>Ol(n,h,"start")),Er(E=>{if(a&&E>a.start&&(r=d(a,_),a=null,Ol(n,r.b,"start"),T&&(c(),u=zs(n,o,r.b,r.duration,0,y,s.css))),r){if(E>=r.end)S(o=r.b,1-o),Ol(n,r.b,"end"),a||(r.b?c():--r.group.r||De(r.group.c)),r=null;else if(E>=r.start){const M=E-r.start;o=r.a+r.d*y(M/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Rt(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&&(re(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),O(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&cu()}if(_k(n)){const l=lo();if(n.then(s=>{Ni(l),i(e.then,1,e.value,s),Ni(null)},s=>{if(Ni(l),i(e.catch,2,e.error,s),Ni(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 Lk(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 ci(n,e){n.d(1),e.delete(n.key)}function zt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Ak(n,e){n.f(),zt(n,e)}function kt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?T.push(()=>A.p(L,e)):(A=u(I,L),A.c()),y.set(I,_[h]=A),I in g&&S.set(I,Math.abs(h-g[I]))}const $=new Set,E=new Set;function M(L){O(L,1),L.m(r,f),o.set(L.key,L),f=L.first,m--}for(;d&&m;){const L=_[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):y.has(P)?!o.has(A)||$.has(A)?M(L):E.has(P)?d--:S.get(A)>S.get(P)?(E.add(A),M(L)):($.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];y.has(L.key)||a(L,o)}for(;m;)M(_[m-1]);return De(T),_}function vt(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 Ft(n){return typeof n=="object"&&n!==null?n:{}}function ve(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function F(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),nt(()=>{const s=n.$$.on_mount.map(Ob).filter(Rt);n.$$.on_destroy?n.$$.on_destroy.push(...s):De(s),n.$$.on_mount=[]}),l.forEach(nt)}function q(n,e){const t=n.$$;t.fragment!==null&&(Ik(t.after_update),De(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Pk(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Rb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function be(n,e,t,i,l,s,o=null,r=[-1]){const a=Vs;Ni(n);const u=n.$$={fragment:null,ctx:[],props:s,update:te,not_equal:l,bound:df(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:df(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...m)=>{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&&Pk(n,c)),d}):[],u.update(),f=!0,De(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=wk(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&O(n.$$.fragment),F(n,e.target,e.anchor),cu()}Ni(a)}class ye{constructor(){ct(this,"$$");ct(this,"$$set")}$destroy(){q(this,1),this.$destroy=te}$on(e,t){if(!Rt(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&&!gk(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Nk="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Nk);class Pl extends Error{}class Rk extends Pl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Fk extends Pl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class qk extends Pl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Pl{}class qb extends Pl{constructor(e){super(`Invalid unit ${e}`)}}class gn extends Pl{}class Vi extends Pl{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ui="short",Vn="long",dr={year:Ue,month:Ue,day:Ue},Hb={year:Ue,month:ui,day:Ue},Hk={year:Ue,month:ui,day:Ue,weekday:ui},jb={year:Ue,month:Vn,day:Ue},zb={year:Ue,month:Vn,day:Ue,weekday:Vn},Ub={hour:Ue,minute:Ue},Vb={hour:Ue,minute:Ue,second:Ue},Bb={hour:Ue,minute:Ue,second:Ue,timeZoneName:ui},Wb={hour:Ue,minute:Ue,second:Ue,timeZoneName:Vn},Yb={hour:Ue,minute:Ue,hourCycle:"h23"},Kb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},Jb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ui},Zb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Vn},Gb={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},Xb={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},Qb={year:Ue,month:ui,day:Ue,hour:Ue,minute:Ue},xb={year:Ue,month:ui,day:Ue,hour:Ue,minute:Ue,second:Ue},jk={year:Ue,month:ui,day:Ue,weekday:ui,hour:Ue,minute:Ue},e0={year:Ue,month:Vn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ui},t0={year:Ue,month:Vn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ui},n0={year:Ue,month:Vn,day:Ue,weekday:Vn,hour:Ue,minute:Ue,timeZoneName:Vn},i0={year:Ue,month:Vn,day:Ue,weekday:Vn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Vn};class oo{get type(){throw new Vi}get name(){throw new Vi}get ianaName(){return this.name}get isUniversal(){throw new Vi}offsetName(e,t){throw new Vi}formatOffset(e,t){throw new Vi}offset(e){throw new Vi}equals(e){throw new Vi}get isValid(){throw new Vi}}let Gr=null;class Mr extends oo{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 d0(e,t,i)}formatOffset(e,t){return Ms(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Qo={};function zk(n){return Qo[n]||(Qo[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"})),Qo[n]}const Uk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Vk(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 Bk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l<t.length;l++){const{type:s,value:o}=t[l],r=Uk[s];s==="era"?i[r]=o:it(r)||(i[r]=parseInt(o,10))}return i}let To={};class Fi extends oo{static create(e){return To[e]||(To[e]=new Fi(e)),To[e]}static resetCache(){To={},Qo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Fi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return d0(e,t,i,this.name)}formatOffset(e,t){return Ms(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=zk(this.name);let[l,s,o,r,a,u,f]=i.formatToParts?Bk(i,t):Vk(i,t);r==="BC"&&(l=-Math.abs(l)+1);const d=Ir({year:l,month:s,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let m=+t;const h=m%1e3;return m-=h>=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 Wk(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 Yk(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 Kk(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 Ts=null;function Jk(){return Ts||(Ts=new Intl.DateTimeFormat().resolvedOptions().locale,Ts)}let _f={};function Zk(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 Gk(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 Xk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Qk(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function xk(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 $o(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function ev(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 tv{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=Yk(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):yu(e,3);return xt(t,this.padTo)}}}class nv{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&&Fi.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 iv{constructor(e,t,i){this.opts={style:"long",...i},!t&&f0()&&(this.rtf=Kk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Cv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const lv={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||Bt.defaultLocale,r=o||(s?"en-US":Jk()),a=t||Bt.defaultNumberingSystem,u=i||Bt.defaultOutputCalendar,f=ja(l)||Bt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){Ts=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]=Gk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=Xk(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=ev(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 $o(this,e,h0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=Qk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return $o(this,e,b0,()=>{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]=xk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return $o(this,void 0,()=>y0,()=>{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 $o(this,e,k0,()=>{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 tv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new nv(e,this.intl,t)}relFormatter(e={}){return new iv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Wk(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:c0()?Zk(this.locale):lv}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 oo{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${Ms(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ms(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Ms(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 sv extends oo{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 Ji(n,e){if(it(n)||n===null)return e;if(n instanceof oo)return n;if(cv(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?Cn.utcInstance:Cn.parseSpecifier(t)||Fi.create(n)}else return Qi(n)?Cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new sv(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]},ov=hu.hanidec.replace(/[\[|\]]/g,"").split("");function rv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);if(n[t].search(hu.hanidec)!==-1)e+=ov.indexOf(n[t]);else for(const l in gf){const[s,o]=gf[l];i>=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function av(){Kl={}}function ii({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(),yf="system",kf=null,vf=null,wf=null,Sf=60,Tf,$f=null;class Bt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){yf=e}static get defaultZone(){return Ji(yf,Mr.instance)}static get defaultLocale(){return kf}static set defaultLocale(e){kf=e}static get defaultNumberingSystem(){return vf}static set defaultNumberingSystem(e){vf=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(),Fi.resetCache(),Xe.resetCache(),av()}}class si{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const l0=[0,31,59,90,120,151,181,212,243,273,304,334],s0=[0,31,60,91,121,152,182,213,244,274,305,335];function Zn(n,e){return new si("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 o0(n,e,t){return t+(ro(n)?s0:l0)[e-1]}function r0(n,e){const t=ro(n)?s0:l0,i=t.findIndex(s=>s<e),l=e-t[i];return{month:i+1,day:l}}function gu(n,e){return(n-e+7)%7+1}function pr(n,e=4,t=1){const{year:i,month:l,day:s}=n,o=o0(i,l,s),r=gu(_u(i,l,s),t);let a=Math.floor((o-r+14-e)/7),u;return a<1?(u=i-1,a=Bs(u,e,t)):a>Bs(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}=r0(u,a);return{year:u,month:f,day:c,...Ar(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=o0(e,t,i);return{year:e,ordinal:l,...Ar(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=r0(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 uv(n,e=4,t=1){const i=Dr(n.weekYear),l=Gn(n.weekNumber,1,Bs(n.weekYear,e,t)),s=Gn(n.weekday,1,7);return i?l?s?!1:Zn("weekday",n.weekday):Zn("week",n.weekNumber):Zn("weekYear",n.weekYear)}function fv(n){const e=Dr(n.year),t=Gn(n.ordinal,1,Xl(n.year));return e?t?!1:Zn("ordinal",n.ordinal):Zn("year",n.year)}function a0(n){const e=Dr(n.year),t=Gn(n.month,1,12),i=Gn(n.day,1,mr(n.year,n.month));return e?t?i?!1:Zn("day",n.day):Zn("month",n.month):Zn("year",n.year)}function u0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Gn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Gn(t,0,59),r=Gn(i,0,59),a=Gn(l,0,999);return s?o?r?a?!1:Zn("millisecond",l):Zn("second",i):Zn("minute",t):Zn("hour",e)}function it(n){return typeof n>"u"}function Qi(n){return typeof n=="number"}function Dr(n){return typeof n=="number"&&n%1===0}function cv(n){return typeof n=="string"}function dv(n){return Object.prototype.toString.call(n)==="[object Date]"}function f0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function c0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function pv(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 mv(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 gn("Week settings must be an object");if(!Gn(n.firstDay,1,7)||!Gn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Gn(e,1,7)))throw new gn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Gn(n,e,t){return Dr(n)&&n>=e&&n<=t}function hv(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 Yi(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 yu(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ro(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ro(n)?366:365}function mr(n,e){const t=hv(e-1,12)+1,i=n+(e-t)/12;return t===2?ro(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 Bs(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>Bt.twoDigitCutoffYear?1900+n:2e3+n}function d0(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 p0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new gn(`Invalid unit value ${n}`);return e}function hr(n,e){const t={};for(const i in n)if(ns(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=p0(l)}return t}function Ms(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 mv(n,["hour","minute","second","millisecond"])}const _v=["January","February","March","April","May","June","July","August","September","October","November","December"],m0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gv=["J","F","M","A","M","J","J","A","S","O","N","D"];function h0(n){switch(n){case"narrow":return[...gv];case"short":return[...m0];case"long":return[..._v];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 _0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],g0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],bv=["M","T","W","T","F","S","S"];function b0(n){switch(n){case"narrow":return[...bv];case"short":return[...g0];case"long":return[..._0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const y0=["AM","PM"],yv=["Before Christ","Anno Domini"],kv=["BC","AD"],vv=["B","A"];function k0(n){switch(n){case"narrow":return[...vv];case"short":return[...kv];case"long":return[...yv];default:return null}}function wv(n){return y0[n.hour<12?0:1]}function Sv(n,e){return b0(e)[n.weekday-1]}function Tv(n,e){return h0(e)[n.month-1]}function $v(n,e){return k0(e)[n.year<0?0:1]}function Cv(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 Ov={D:dr,DD:Hb,DDD:jb,DDDD:zb,t:Ub,tt:Vb,ttt:Bb,tttt:Wb,T:Yb,TT:Kb,TTT:Jb,TTTT:Zb,f:Gb,ff:Qb,fff:e0,ffff:n0,F:Xb,FF:xb,FFF:t0,FFFF:i0};class yn{static create(e,t={}){return new yn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?(i.length>0&&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 Ov[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?wv(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Tv(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Sv(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=yn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?$v(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(yn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=yn.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 v0=/[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 w0(...n){return(e,t)=>{const i={};let l;for(l=0;l<n.length;l++)i[n[l]]=Yi(e[t+l]);return[i,null,t+l]}}const S0=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ev=`(?:${S0.source}?(?:\\[(${v0.source})\\])?)?`,ku=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,T0=RegExp(`${ku.source}${Ev}`),vu=RegExp(`(?:T${T0.source})?`),Mv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Dv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Iv=/(\d{4})-?(\d{3})/,Lv=w0("weekYear","weekNumber","weekDay"),Av=w0("year","ordinal"),Pv=/(\d{4})-(\d\d)-(\d\d)/,$0=RegExp(`${ku.source} ?(?:${S0.source}|(${v0.source}))?`),Nv=RegExp(`(?: ${$0.source})?`);function Ql(n,e,t){const i=n[e];return it(i)?t:Yi(i)}function Rv(n,e){return[{year:Ql(n,e),month:Ql(n,e+1,1),day:Ql(n,e+2,1)},null,e+3]}function us(n,e){return[{hours:Ql(n,e,0),minutes:Ql(n,e+1,0),seconds:Ql(n,e+2,0),milliseconds:bu(n[e+3])},null,e+4]}function ao(n,e){const t=!n[e]&&!n[e+1],i=Lr(n[e+1],n[e+2]),l=t?null:Cn.instance(i);return[{},l,e+3]}function uo(n,e){const t=n[e]?Fi.create(n[e]):null;return[{},t,e+1]}const Fv=RegExp(`^T?${ku.source}$`),qv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Hv(n){const[e,t,i,l,s,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(m,h=!1)=>m!==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 jv={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(Yi(e)):Yi(e),month:m0.indexOf(t)+1,day:Yi(i),hour:Yi(l),minute:Yi(s)};return o&&(r.second=Yi(o)),n&&(r.weekday=n.length>3?_0.indexOf(n)+1:g0.indexOf(n)+1),r}const zv=/^(?:(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 Uv(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=jv[a]:u?m=0:m=Lr(f,c),[d,new Cn(m)]}function Vv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Bv=/^(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$/,Wv=/^(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$/,Yv=/^(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 Kv(n){const[,e,t,i,l,s,o,r]=n;return[wu(e,r,t,i,l,s,o),Cn.utcInstance]}const Jv=os(Mv,vu),Zv=os(Dv,vu),Gv=os(Iv,vu),Xv=os(T0),C0=rs(Rv,us,ao,uo),Qv=rs(Lv,us,ao,uo),xv=rs(Av,us,ao,uo),e2=rs(us,ao,uo);function t2(n){return as(n,[Jv,C0],[Zv,Qv],[Gv,xv],[Xv,e2])}function n2(n){return as(Vv(n),[zv,Uv])}function i2(n){return as(n,[Bv,Lf],[Wv,Lf],[Yv,Kv])}function l2(n){return as(n,[qv,Hv])}const s2=rs(us);function o2(n){return as(n,[Fv,s2])}const r2=os(Pv,Nv),a2=os($0),u2=rs(us,ao,uo);function f2(n){return as(n,[r2,C0],[a2,u2])}const Af="Invalid Duration",O0={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}},c2={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},...O0},Wn=146097/400,zl=146097/4800,d2={years:{quarters:4,months:12,weeks:Wn/7,days:Wn,hours:Wn*24,minutes:Wn*24*60,seconds:Wn*24*60*60,milliseconds:Wn*24*60*60*1e3},quarters:{months:3,weeks:Wn/28,days:Wn/4,hours:Wn*24/4,minutes:Wn*24*60/4,seconds:Wn*24*60*60/4,milliseconds:Wn*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},...O0},Tl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],p2=Tl.slice(0).reverse();function Bi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function E0(n,e){let t=e.milliseconds??0;for(const i of p2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=E0(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 m2(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?d2:c2;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 gn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new St({values:hr(e,St.normalizeUnit),loc:Et.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Qi(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new gn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=l2(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]=o2(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 gn("need to specify a reason the Duration is invalid");const i=e instanceof si?e:new si(e,t);if(Bt.throwOnInvalid)throw new qk(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 qb(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?yn.create(this.loc,i).formatDurationFromString(this,e):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+=yu(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?E0(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 Bi(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]=p0(e(this.values[i],i));return Bi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...hr(e,St.normalizeUnit)};return Bi(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 Bi(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),Bi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=m2(this.normalize().shiftToAll().toObject());return Bi(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;Qi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Qi(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),Bi(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 Bi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,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 h2(n,e){return!n||!n.isValid?Vt.invalid("missing or invalid start"):!e||!e.isValid?Vt.invalid("missing or invalid end"):e<n?Vt.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class Vt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the Interval is invalid");const i=e instanceof si?e:new si(e,t);if(Bt.throwOnInvalid)throw new Fk(i);return new Vt({invalid:i})}static fromDateTimes(e,t){const i=bs(e),l=bs(t),s=h2(i,l);return s??new Vt({start:i,end:l})}static after(e,t){const i=St.fromDurationLike(t),l=bs(e);return Vt.fromDateTimes(l,l.plus(i))}static before(e,t){const i=St.fromDurationLike(t),l=bs(e);return Vt.fromDateTimes(l.minus(i),l)}static fromISO(e,t){const[i,l]=(e||"").split("/",2);if(i&&l){let s,o;try{s=Xe.fromISO(i,t),o=s.isValid}catch{o=!1}let r,a;try{r=Xe.fromISO(l,t),a=r.isValid}catch{a=!1}if(o&&a)return Vt.fromDateTimes(s,r);if(o){const u=St.fromISO(l,t);if(u.isValid)return Vt.after(s,u)}else if(a){const u=St.fromISO(i,t);if(u.isValid)return Vt.before(r,u)}}return Vt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const i=this.start.startOf(e,t);let l;return t!=null&&t.useLocaleWeeks?l=this.end.reconfigure({locale:i.locale}):l=this.end,l=l.startOf(e,t),Math.floor(l.diff(i,e).get(e))+(l.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(bs).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l<this.e;){const o=t[s]||this.e,r=+o>+this.e?this.e:o;i.push(Vt.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(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*l));s=+r>+this.e?this.e:r,o.push(Vt.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}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return t>=i?null:Vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return Vt.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(Vt.fromDateTimes(t,a.time)),t=null);return Vt.merge(l)}difference(...e){return Vt.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=dr,t={}){return this.isValid?yn.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 Vt.fromDateTimes(e(this.s),e(this.e))}}class Co{static hasDST(e=Bt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Fi.isValidZone(e)}static normalizeZone(e){return Ji(e,Bt.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:f0(),localeWeek:c0()}}}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 _2(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 g2(n,e,t,i){let[l,s,o,r]=_2(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=l.plus({[r]:1})),o!==l&&(s[r]=(s[r]||0)+a/(o-l)));const f=St.fromObject(s,i);return u.length>0?St.fromMillis(a,i).shiftTo(...u).plus(f):f}const b2="missing Intl.DateTimeFormat.formatToParts support";function Tt(n,e=t=>t){return{regex:n,deser:([t])=>e(rv(t))}}const y2=" ",M0=`[ ${y2}]`,D0=new RegExp(M0,"g");function k2(n){return n.replace(/\./g,"\\.?").replace(D0,M0)}function Rf(n){return n.replace(/\./g,"").replace(D0," ").toLowerCase()}function li(n,e){return n===null?null:{regex:RegExp(n.map(k2).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 Oo(n){return{regex:n,deser:([e])=>e}}function v2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w2(n,e){const t=ii(e),i=ii(e,"{2}"),l=ii(e,"{3}"),s=ii(e,"{4}"),o=ii(e,"{6}"),r=ii(e,"{1,2}"),a=ii(e,"{1,3}"),u=ii(e,"{1,6}"),f=ii(e,"{1,9}"),c=ii(e,"{2,4}"),d=ii(e,"{4,6}"),m=_=>({regex:RegExp(v2(_.val)),deser:([y])=>y,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return li(e.eras("short"),0);case"GG":return li(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 li(e.months("short",!0),1);case"MMMM":return li(e.months("long",!0),1);case"L":return Tt(r);case"LL":return Tt(i);case"LLL":return li(e.months("short",!1),1);case"LLLL":return li(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 Oo(f);case"uu":return Oo(r);case"uuu":return Tt(t);case"a":return li(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 li(e.weekdays("short",!1),1);case"EEEE":return li(e.weekdays("long",!1),1);case"ccc":return li(e.weekdays("short",!0),1);case"cccc":return li(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 Oo(/[a-z_+-/]{1,256}?/i);case" ":return Oo(/[^\S\n\r]/);default:return m(_)}})(n)||{invalidReason:b2};return g.token=n,g}const S2={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 T2(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=S2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function $2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function C2(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 O2(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=Fi.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 E2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function M2(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val),i=P0(t,e);return i==null||i.includes(void 0)?n:i}function I0(n,e){return Array.prototype.concat(...n.map(t=>M2(t,e)))}class L0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=I0(yn.parseFormat(t),e),this.units=this.tokens.map(i=>w2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=$2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=C2(e,this.regex,this.handlers),[l,s,o]=i?O2(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 A0(n,e,t){return new L0(n,t).explainFromTokens(e)}function D2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=A0(n,e,t);return[i,l,s,o]}function P0(n,e){if(!n)return null;const i=yn.create(e,n).dtFormatter(E2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>T2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function $s(n){return new si("unsupported zone",`the zone "${n.name}" is not supported`)}function ta(n){return n.weekData===null&&(n.weekData=pr(n.c)),n.weekData}function na(n){return n.localWeekData===null&&(n.localWeekData=pr(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 N0(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 Eo(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 xo(n,e,t){return N0(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,mr(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]=N0(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 si("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Mo(n,e,t=!0){return n.isValid?yn.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 R0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},I2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},L2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},F0=["year","month","day","hour","minute","second","millisecond"],A2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],P2=["year","ordinal","hour","minute","second","millisecond"];function N2(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 qb(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 N2(n)}}function R2(n){return tr[n]||(er===void 0&&(er=Bt.now()),tr[n]=n.offset(er)),tr[n]}function Uf(n,e){const t=Ji(e.zone,Bt.defaultZone);if(!t.isValid)return Xe.invalid($s(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Bt.now();else{for(const a of F0)it(n[a])&&(n[a]=R0[a]);const o=a0(n)||u0(n);if(o)return Xe.invalid(o);const r=R2(t);[l,s]=xo(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=yu(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 er,tr={};class Xe{constructor(e){const t=e.zone||Bt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new si("invalid input"):null)||(t.isValid?null:$s(t));this.ts=it(e.ts)?Bt.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=Qi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Eo(this.ts,r),i=Number.isNaN(l.year)?new si("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=dv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Ji(t.zone,Bt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid($s(l))}static fromMillis(e,t={}){if(Qi(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Ji(t.zone,Bt.defaultZone),loc:Et.fromObject(t)});throw new gn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new Xe({ts:e*1e3,zone:Ji(t.zone,Bt.defaultZone),loc:Et.fromObject(t)});throw new gn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ji(t.zone,Bt.defaultZone);if(!i.isValid)return Xe.invalid($s(i));const l=Et.fromObject(t),s=hr(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Ef(s,l),a=Bt.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 g=h||s.weekday&&!m;let _,y,S=Eo(a,u);g?(_=A2,y=I2,S=pr(S,o,r)):f?(_=P2,y=L2,S=Qr(S)):(_=F0,y=R0);let T=!1;for(const P of _){const R=s[P];it(R)?T?s[P]=y[P]:s[P]=S[P]:T=!0}const $=g?uv(s,o,r):f?fv(s):a0(s),E=$||u0(s);if(E)return Xe.invalid(E);const M=g?Cf(s,o,r):f?Of(s):s,[L,I]=xo(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]=t2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=n2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=i2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new gn("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]=D2(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]=f2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the DateTime is invalid");const i=e instanceof si?e:new si(e,t);if(Bt.throwOnInvalid)throw new Rk(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=P0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return I0(yn.parseFormat(e),Et.fromObject(t)).map(l=>l.val).join("")}static resetCache(){er=void 0,tr={}}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?Co.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Co.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Co.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Co.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=Eo(a,o),c=Eo(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 ro(this.year)}get daysInMonth(){return mr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Bs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Bs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=yn.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(Bt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ji(e,Bt.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]=xo(o,s,e)}return _l(this,{ts:l,zone:e})}else return Xe.invalid($s(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=hr(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({...pr(this.c,i,l),...t},i,l):it(t.ordinal)?(c={...this.toObject(),...t},it(t.day)&&(c.day=Math.min(mr(c.year,c.month),c.day))):c=Of({...Qr(this.c),...t});const[d,m]=xo(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;o<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if(l==="quarters"){const s=Math.ceil(this.month/3);i.month=(s-1)*3+1}return this.set(i)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?yn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ea}toLocaleString(e=dr,t={}){return this.isValid?yn.create(this.loc.clone(t),e).formatDateTime(this):ea}toLocaleParts(e={}){return this.isValid?yn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:l=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=ia(this,o);return r+="T",r+=jf(this,o,t,i,l,s),r}toISODate({format:e="extended"}={}){return this.isValid?ia(this,e==="extended"):null}toISOWeekDate(){return Mo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(l?"T":"")+jf(this,o==="extended",t,e,i,s):null}toRFC2822(){return Mo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ia(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),Mo(this,l,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ea}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return St.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=pv(t).map(St.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=g2(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?Vt.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?this<t?-e.padding:e.padding:0;let l=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(l=e.unit,s=void 0),Vf(t,this.plus(i),{...e,numeric:"always",units:l,unit:s})}toRelativeCalendar(e={}){return this.isValid?Vf(e.base||Xe.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Xe.isDateTime))throw new gn("min requires all arguments be DateTimes");return Mf(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new gn("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 A0(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 L0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new gn("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 gn(`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 dr}static get DATE_MED(){return Hb}static get DATE_MED_WITH_WEEKDAY(){return Hk}static get DATE_FULL(){return jb}static get DATE_HUGE(){return zb}static get TIME_SIMPLE(){return Ub}static get TIME_WITH_SECONDS(){return Vb}static get TIME_WITH_SHORT_OFFSET(){return Bb}static get TIME_WITH_LONG_OFFSET(){return Wb}static get TIME_24_SIMPLE(){return Yb}static get TIME_24_WITH_SECONDS(){return Kb}static get TIME_24_WITH_SHORT_OFFSET(){return Jb}static get TIME_24_WITH_LONG_OFFSET(){return Zb}static get DATETIME_SHORT(){return Gb}static get DATETIME_SHORT_WITH_SECONDS(){return Xb}static get DATETIME_MED(){return Qb}static get DATETIME_MED_WITH_SECONDS(){return xb}static get DATETIME_MED_WITH_WEEKDAY(){return jk}static get DATETIME_FULL(){return e0}static get DATETIME_FULL_WITH_SECONDS(){return t0}static get DATETIME_HUGE(){return n0}static get DATETIME_HUGE_WITH_SECONDS(){return i0}}function bs(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new gn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const F2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],q2=[".mp4",".avi",".mov",".3gp",".wmv"],H2=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],j2=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],q0=[{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 z{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static 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||z.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return z.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!z.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!z.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){z.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)z.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]=z.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(!z.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)(!z.isObject(s)&&!Array.isArray(s)||!z.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)(!z.isObject(l)&&!Array.isArray(l)||!z.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):z.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||z.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||z.isObject(e)&&Object.keys(e).length>0)&&z.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l<e;l++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static randomSecret(e=15){if(typeof crypto>"u")return z.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;s<e;s++)l+=i.charAt(t[s]%i.length);return l}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=""+e,e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let l=e[i];typeof l=="string"&&(l=z.truncate(l,150,!0)),t[i]=l}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const l={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let s in l)e=e.replace(l[s],s);return e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=[],l=(e||"").replaceAll("\\"+t,"{_PB_ESCAPED_}").split(t).map(s=>s.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),z.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():"",z.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 z.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.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);z.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||"",!!F2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!q2.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!H2.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!j2.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return z.hasImageExtension(e)?"image":z.hasDocumentExtension(e)?"document":z.hasVideoExtension(e)?"video":z.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(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(z.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)z.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):z.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},z.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<String>";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)&&!z.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=z.isObject(u)&&z.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.name<r.name?-1:0}return[].concat(t.sort(s),i.sort(s),l.sort(s))}static getExpandPresentableRelField(e,t,i=2){for(const l of t){if(e.collectionId!=l.id)continue;let s=e.name;for(const o of l.fields)if(!(!o.presentable||o.type!="relation")&&i>0){const r=z.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=z.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=z.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(z.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?z.plainText(e):e,z.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return z.truncate(e.join(","),i);if(typeof e=="object")try{return z.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 z.extractColumnsFromQuery(e.viewQuery))z.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)z.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=z.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=z.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=z.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=z.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=z.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)z.pushUnique(i,r)}if(t){const s=z.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=!z.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 g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[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_"+z.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=`
+}`,c=`__svelte_${Tk(f)}_${r}`,d=Lb(n),{stylesheet:m,rules:h}=fr.get(d)||$k(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${l}ms 1 both`,cr+=1,c}function Us(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(", "),cr-=l,cr||Ck())}function Ck(){fu(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),fr.clear())})}function Ok(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=io,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 g(){c&&(h=zs(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Us(n,h),d=!1}return Er(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),_()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);f(T,1-T)}return!0}),g(),f(0,1),_}function Ek(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,Pb(n,l)}}function Pb(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 Vs;function Ni(n){Vs=n}function lo(){if(!Vs)throw new Error("Function called outside component initialization");return Vs}function Yt(n){lo().$$.on_mount.push(n)}function Mk(n){lo().$$.after_update.push(n)}function so(n){lo().$$.on_destroy.push(n)}function gt(){const n=lo();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Ab(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Yl=[],ie=[];let Gl=[];const Pa=[],Nb=Promise.resolve();let Na=!1;function Rb(){Na||(Na=!0,Nb.then(cu))}function fn(){return Rb(),Nb}function nt(n){Gl.push(n)}function $e(n){Pa.push(n)}const Zr=new Set;let jl=0;function cu(){if(jl!==0)return;const n=Vs;do{try{for(;jl<Yl.length;){const e=Yl[jl];jl++,Ni(e),Dk(e.$$)}}catch(e){throw Yl.length=0,jl=0,e}for(Ni(null),Yl.length=0,jl=0;ie.length;)ie.pop()();for(let e=0;e<Gl.length;e+=1){const t=Gl[e];Zr.has(t)||(Zr.add(t),t())}Gl.length=0}while(Yl.length);for(;Pa.length;)Pa.pop()();Na=!1,Zr.clear(),Ni(n)}function Dk(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(nt)}}function Ik(n){const e=[],t=[];Gl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let gs;function du(){return gs||(gs=Promise.resolve(),gs.then(()=>{gs=null})),gs}function Ol(n,e,t){n.dispatchEvent(Ab(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let wi;function re(){wi={r:0,c:[],p:wi}}function ae(){wi.r||De(wi.c),wi=wi.p}function O(n,e){n&&n.i&&(Xo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Xo.has(n))return;Xo.add(n),wi.c.push(()=>{Xo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pu={duration:0};function Fb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Us(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=io,tick:g=te,css:_}=l||pu;_&&(o=zs(n,0,1,m,d,h,_,a++)),g(0,1);const y=Or()+d,S=y+m;r&&r.abort(),s=!0,nt(()=>Ol(n,!0,"start")),r=Er(T=>{if(s){if(T>=S)return g(1,0),Ol(n,!0,"end"),u(),s=!1;if(T>=y){const $=h((T-y)/m);g($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,Us(n),Rt(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=wi;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=io,tick:m=te,css:h}=l||pu;h&&(o=zs(n,1,0,c,f,d,h));const g=Or()+f,_=g+c;nt(()=>Ol(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Er(y=>{if(s){if(y>=_)return m(0,1),Ol(n,!1,"end"),--r.r||De(r.c),!1;if(y>=g){const S=d((y-g)/c);m(1-S,S)}}return s})}return Rt(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&&Us(n,o),s=!1)}}}function ze(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&&Us(n,u)}function d(h,g){const _=h.b-o;return g*=Math.abs(_),{a:o,b:h.b,d:_,duration:g,start:h.start,end:h.start+g,group:h.group}}function m(h){const{delay:g=0,duration:_=300,easing:y=io,tick:S=te,css:T}=s||pu,$={start:Or()+g,b:h};h||($.group=wi,wi.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),u=zs(n,o,h,_,g,y,T)),h&&S(0,1),r=d($,_),nt(()=>Ol(n,h,"start")),Er(E=>{if(a&&E>a.start&&(r=d(a,_),a=null,Ol(n,r.b,"start"),T&&(c(),u=zs(n,o,r.b,r.duration,0,y,s.css))),r){if(E>=r.end)S(o=r.b,1-o),Ol(n,r.b,"end"),a||(r.b?c():--r.group.r||De(r.group.c)),r=null;else if(E>=r.start){const M=E-r.start;o=r.a+r.d*y(M/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Rt(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&&(re(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),O(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&cu()}if(_k(n)){const l=lo();if(n.then(s=>{Ni(l),i(e.then,1,e.value,s),Ni(null)},s=>{if(Ni(l),i(e.catch,2,e.error,s),Ni(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 Lk(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 ci(n,e){n.d(1),e.delete(n.key)}function zt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Ak(n,e){n.f(),zt(n,e)}function kt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?T.push(()=>A.p(L,e)):(A=u(I,L),A.c()),y.set(I,_[h]=A),I in g&&S.set(I,Math.abs(h-g[I]))}const $=new Set,E=new Set;function M(L){O(L,1),L.m(r,f),o.set(L.key,L),f=L.first,m--}for(;d&&m;){const L=_[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):y.has(P)?!o.has(A)||$.has(A)?M(L):E.has(P)?d--:S.get(A)>S.get(P)?(E.add(A),M(L)):($.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];y.has(L.key)||a(L,o)}for(;m;)M(_[m-1]);return De(T),_}function vt(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 Ft(n){return typeof n=="object"&&n!==null?n:{}}function ve(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function F(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),nt(()=>{const s=n.$$.on_mount.map(Ob).filter(Rt);n.$$.on_destroy?n.$$.on_destroy.push(...s):De(s),n.$$.on_mount=[]}),l.forEach(nt)}function q(n,e){const t=n.$$;t.fragment!==null&&(Ik(t.after_update),De(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Pk(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Rb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function be(n,e,t,i,l,s,o=null,r=[-1]){const a=Vs;Ni(n);const u=n.$$={fragment:null,ctx:[],props:s,update:te,not_equal:l,bound:df(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:df(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...m)=>{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&&Pk(n,c)),d}):[],u.update(),f=!0,De(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=wk(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&O(n.$$.fragment),F(n,e.target,e.anchor),cu()}Ni(a)}class ye{constructor(){ct(this,"$$");ct(this,"$$set")}$destroy(){q(this,1),this.$destroy=te}$on(e,t){if(!Rt(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&&!gk(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Nk="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Nk);class Pl extends Error{}class Rk extends Pl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Fk extends Pl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class qk extends Pl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Pl{}class qb extends Pl{constructor(e){super(`Invalid unit ${e}`)}}class gn extends Pl{}class Vi extends Pl{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ui="short",Vn="long",dr={year:Ue,month:Ue,day:Ue},Hb={year:Ue,month:ui,day:Ue},Hk={year:Ue,month:ui,day:Ue,weekday:ui},jb={year:Ue,month:Vn,day:Ue},zb={year:Ue,month:Vn,day:Ue,weekday:Vn},Ub={hour:Ue,minute:Ue},Vb={hour:Ue,minute:Ue,second:Ue},Bb={hour:Ue,minute:Ue,second:Ue,timeZoneName:ui},Wb={hour:Ue,minute:Ue,second:Ue,timeZoneName:Vn},Yb={hour:Ue,minute:Ue,hourCycle:"h23"},Kb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},Jb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ui},Zb={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Vn},Gb={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},Xb={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},Qb={year:Ue,month:ui,day:Ue,hour:Ue,minute:Ue},xb={year:Ue,month:ui,day:Ue,hour:Ue,minute:Ue,second:Ue},jk={year:Ue,month:ui,day:Ue,weekday:ui,hour:Ue,minute:Ue},e0={year:Ue,month:Vn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ui},t0={year:Ue,month:Vn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ui},n0={year:Ue,month:Vn,day:Ue,weekday:Vn,hour:Ue,minute:Ue,timeZoneName:Vn},i0={year:Ue,month:Vn,day:Ue,weekday:Vn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Vn};class oo{get type(){throw new Vi}get name(){throw new Vi}get ianaName(){return this.name}get isUniversal(){throw new Vi}offsetName(e,t){throw new Vi}formatOffset(e,t){throw new Vi}offset(e){throw new Vi}equals(e){throw new Vi}get isValid(){throw new Vi}}let Gr=null;class Mr extends oo{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 d0(e,t,i)}formatOffset(e,t){return Ms(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Qo={};function zk(n){return Qo[n]||(Qo[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"})),Qo[n]}const Uk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Vk(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 Bk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l<t.length;l++){const{type:s,value:o}=t[l],r=Uk[s];s==="era"?i[r]=o:it(r)||(i[r]=parseInt(o,10))}return i}let To={};class Fi extends oo{static create(e){return To[e]||(To[e]=new Fi(e)),To[e]}static resetCache(){To={},Qo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Fi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return d0(e,t,i,this.name)}formatOffset(e,t){return Ms(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=zk(this.name);let[l,s,o,r,a,u,f]=i.formatToParts?Bk(i,t):Vk(i,t);r==="BC"&&(l=-Math.abs(l)+1);const d=Ir({year:l,month:s,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let m=+t;const h=m%1e3;return m-=h>=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 Wk(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 Yk(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 Kk(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 Ts=null;function Jk(){return Ts||(Ts=new Intl.DateTimeFormat().resolvedOptions().locale,Ts)}let _f={};function Zk(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 Gk(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 Xk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Qk(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function xk(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 $o(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function ev(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 tv{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=Yk(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):yu(e,3);return xt(t,this.padTo)}}}class nv{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&&Fi.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 iv{constructor(e,t,i){this.opts={style:"long",...i},!t&&f0()&&(this.rtf=Kk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Cv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const lv={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||Bt.defaultLocale,r=o||(s?"en-US":Jk()),a=t||Bt.defaultNumberingSystem,u=i||Bt.defaultOutputCalendar,f=ja(l)||Bt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){Ts=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]=Gk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=Xk(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=ev(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 $o(this,e,h0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=Qk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return $o(this,e,b0,()=>{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]=xk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return $o(this,void 0,()=>y0,()=>{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 $o(this,e,k0,()=>{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 tv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new nv(e,this.intl,t)}relFormatter(e={}){return new iv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Wk(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:c0()?Zk(this.locale):lv}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 oo{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${Ms(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ms(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Ms(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 sv extends oo{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 Ji(n,e){if(it(n)||n===null)return e;if(n instanceof oo)return n;if(cv(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?Cn.utcInstance:Cn.parseSpecifier(t)||Fi.create(n)}else return Qi(n)?Cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new sv(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]},ov=hu.hanidec.replace(/[\[|\]]/g,"").split("");function rv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);if(n[t].search(hu.hanidec)!==-1)e+=ov.indexOf(n[t]);else for(const l in gf){const[s,o]=gf[l];i>=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function av(){Kl={}}function ii({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(),yf="system",kf=null,vf=null,wf=null,Sf=60,Tf,$f=null;class Bt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){yf=e}static get defaultZone(){return Ji(yf,Mr.instance)}static get defaultLocale(){return kf}static set defaultLocale(e){kf=e}static get defaultNumberingSystem(){return vf}static set defaultNumberingSystem(e){vf=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(),Fi.resetCache(),Xe.resetCache(),av()}}class si{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const l0=[0,31,59,90,120,151,181,212,243,273,304,334],s0=[0,31,60,91,121,152,182,213,244,274,305,335];function Zn(n,e){return new si("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 o0(n,e,t){return t+(ro(n)?s0:l0)[e-1]}function r0(n,e){const t=ro(n)?s0:l0,i=t.findIndex(s=>s<e),l=e-t[i];return{month:i+1,day:l}}function gu(n,e){return(n-e+7)%7+1}function pr(n,e=4,t=1){const{year:i,month:l,day:s}=n,o=o0(i,l,s),r=gu(_u(i,l,s),t);let a=Math.floor((o-r+14-e)/7),u;return a<1?(u=i-1,a=Bs(u,e,t)):a>Bs(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}=r0(u,a);return{year:u,month:f,day:c,...Ar(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=o0(e,t,i);return{year:e,ordinal:l,...Ar(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=r0(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 uv(n,e=4,t=1){const i=Dr(n.weekYear),l=Gn(n.weekNumber,1,Bs(n.weekYear,e,t)),s=Gn(n.weekday,1,7);return i?l?s?!1:Zn("weekday",n.weekday):Zn("week",n.weekNumber):Zn("weekYear",n.weekYear)}function fv(n){const e=Dr(n.year),t=Gn(n.ordinal,1,Xl(n.year));return e?t?!1:Zn("ordinal",n.ordinal):Zn("year",n.year)}function a0(n){const e=Dr(n.year),t=Gn(n.month,1,12),i=Gn(n.day,1,mr(n.year,n.month));return e?t?i?!1:Zn("day",n.day):Zn("month",n.month):Zn("year",n.year)}function u0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Gn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Gn(t,0,59),r=Gn(i,0,59),a=Gn(l,0,999);return s?o?r?a?!1:Zn("millisecond",l):Zn("second",i):Zn("minute",t):Zn("hour",e)}function it(n){return typeof n>"u"}function Qi(n){return typeof n=="number"}function Dr(n){return typeof n=="number"&&n%1===0}function cv(n){return typeof n=="string"}function dv(n){return Object.prototype.toString.call(n)==="[object Date]"}function f0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function c0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function pv(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 mv(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 gn("Week settings must be an object");if(!Gn(n.firstDay,1,7)||!Gn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Gn(e,1,7)))throw new gn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Gn(n,e,t){return Dr(n)&&n>=e&&n<=t}function hv(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 Yi(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 yu(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ro(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ro(n)?366:365}function mr(n,e){const t=hv(e-1,12)+1,i=n+(e-t)/12;return t===2?ro(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 Bs(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>Bt.twoDigitCutoffYear?1900+n:2e3+n}function d0(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 p0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new gn(`Invalid unit value ${n}`);return e}function hr(n,e){const t={};for(const i in n)if(ns(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=p0(l)}return t}function Ms(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 mv(n,["hour","minute","second","millisecond"])}const _v=["January","February","March","April","May","June","July","August","September","October","November","December"],m0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gv=["J","F","M","A","M","J","J","A","S","O","N","D"];function h0(n){switch(n){case"narrow":return[...gv];case"short":return[...m0];case"long":return[..._v];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 _0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],g0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],bv=["M","T","W","T","F","S","S"];function b0(n){switch(n){case"narrow":return[...bv];case"short":return[...g0];case"long":return[..._0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const y0=["AM","PM"],yv=["Before Christ","Anno Domini"],kv=["BC","AD"],vv=["B","A"];function k0(n){switch(n){case"narrow":return[...vv];case"short":return[...kv];case"long":return[...yv];default:return null}}function wv(n){return y0[n.hour<12?0:1]}function Sv(n,e){return b0(e)[n.weekday-1]}function Tv(n,e){return h0(e)[n.month-1]}function $v(n,e){return k0(e)[n.year<0?0:1]}function Cv(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 Ov={D:dr,DD:Hb,DDD:jb,DDDD:zb,t:Ub,tt:Vb,ttt:Bb,tttt:Wb,T:Yb,TT:Kb,TTT:Jb,TTTT:Zb,f:Gb,ff:Qb,fff:e0,ffff:n0,F:Xb,FF:xb,FFF:t0,FFFF:i0};class yn{static create(e,t={}){return new yn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?(i.length>0&&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 Ov[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?wv(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Tv(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Sv(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=yn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?$v(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(yn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=yn.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 v0=/[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 w0(...n){return(e,t)=>{const i={};let l;for(l=0;l<n.length;l++)i[n[l]]=Yi(e[t+l]);return[i,null,t+l]}}const S0=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ev=`(?:${S0.source}?(?:\\[(${v0.source})\\])?)?`,ku=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,T0=RegExp(`${ku.source}${Ev}`),vu=RegExp(`(?:T${T0.source})?`),Mv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Dv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Iv=/(\d{4})-?(\d{3})/,Lv=w0("weekYear","weekNumber","weekDay"),Av=w0("year","ordinal"),Pv=/(\d{4})-(\d\d)-(\d\d)/,$0=RegExp(`${ku.source} ?(?:${S0.source}|(${v0.source}))?`),Nv=RegExp(`(?: ${$0.source})?`);function Ql(n,e,t){const i=n[e];return it(i)?t:Yi(i)}function Rv(n,e){return[{year:Ql(n,e),month:Ql(n,e+1,1),day:Ql(n,e+2,1)},null,e+3]}function us(n,e){return[{hours:Ql(n,e,0),minutes:Ql(n,e+1,0),seconds:Ql(n,e+2,0),milliseconds:bu(n[e+3])},null,e+4]}function ao(n,e){const t=!n[e]&&!n[e+1],i=Lr(n[e+1],n[e+2]),l=t?null:Cn.instance(i);return[{},l,e+3]}function uo(n,e){const t=n[e]?Fi.create(n[e]):null;return[{},t,e+1]}const Fv=RegExp(`^T?${ku.source}$`),qv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Hv(n){const[e,t,i,l,s,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(m,h=!1)=>m!==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 jv={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(Yi(e)):Yi(e),month:m0.indexOf(t)+1,day:Yi(i),hour:Yi(l),minute:Yi(s)};return o&&(r.second=Yi(o)),n&&(r.weekday=n.length>3?_0.indexOf(n)+1:g0.indexOf(n)+1),r}const zv=/^(?:(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 Uv(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=jv[a]:u?m=0:m=Lr(f,c),[d,new Cn(m)]}function Vv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Bv=/^(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$/,Wv=/^(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$/,Yv=/^(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 Kv(n){const[,e,t,i,l,s,o,r]=n;return[wu(e,r,t,i,l,s,o),Cn.utcInstance]}const Jv=os(Mv,vu),Zv=os(Dv,vu),Gv=os(Iv,vu),Xv=os(T0),C0=rs(Rv,us,ao,uo),Qv=rs(Lv,us,ao,uo),xv=rs(Av,us,ao,uo),e2=rs(us,ao,uo);function t2(n){return as(n,[Jv,C0],[Zv,Qv],[Gv,xv],[Xv,e2])}function n2(n){return as(Vv(n),[zv,Uv])}function i2(n){return as(n,[Bv,Lf],[Wv,Lf],[Yv,Kv])}function l2(n){return as(n,[qv,Hv])}const s2=rs(us);function o2(n){return as(n,[Fv,s2])}const r2=os(Pv,Nv),a2=os($0),u2=rs(us,ao,uo);function f2(n){return as(n,[r2,C0],[a2,u2])}const Af="Invalid Duration",O0={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}},c2={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},...O0},Wn=146097/400,zl=146097/4800,d2={years:{quarters:4,months:12,weeks:Wn/7,days:Wn,hours:Wn*24,minutes:Wn*24*60,seconds:Wn*24*60*60,milliseconds:Wn*24*60*60*1e3},quarters:{months:3,weeks:Wn/28,days:Wn/4,hours:Wn*24/4,minutes:Wn*24*60/4,seconds:Wn*24*60*60/4,milliseconds:Wn*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},...O0},Tl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],p2=Tl.slice(0).reverse();function Bi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function E0(n,e){let t=e.milliseconds??0;for(const i of p2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=E0(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 m2(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?d2:c2;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 gn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new St({values:hr(e,St.normalizeUnit),loc:Et.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Qi(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new gn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=l2(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]=o2(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 gn("need to specify a reason the Duration is invalid");const i=e instanceof si?e:new si(e,t);if(Bt.throwOnInvalid)throw new qk(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 qb(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?yn.create(this.loc,i).formatDurationFromString(this,e):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+=yu(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?E0(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 Bi(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]=p0(e(this.values[i],i));return Bi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...hr(e,St.normalizeUnit)};return Bi(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 Bi(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),Bi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=m2(this.normalize().shiftToAll().toObject());return Bi(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;Qi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Qi(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),Bi(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 Bi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,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 h2(n,e){return!n||!n.isValid?Vt.invalid("missing or invalid start"):!e||!e.isValid?Vt.invalid("missing or invalid end"):e<n?Vt.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class Vt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the Interval is invalid");const i=e instanceof si?e:new si(e,t);if(Bt.throwOnInvalid)throw new Fk(i);return new Vt({invalid:i})}static fromDateTimes(e,t){const i=bs(e),l=bs(t),s=h2(i,l);return s??new Vt({start:i,end:l})}static after(e,t){const i=St.fromDurationLike(t),l=bs(e);return Vt.fromDateTimes(l,l.plus(i))}static before(e,t){const i=St.fromDurationLike(t),l=bs(e);return Vt.fromDateTimes(l.minus(i),l)}static fromISO(e,t){const[i,l]=(e||"").split("/",2);if(i&&l){let s,o;try{s=Xe.fromISO(i,t),o=s.isValid}catch{o=!1}let r,a;try{r=Xe.fromISO(l,t),a=r.isValid}catch{a=!1}if(o&&a)return Vt.fromDateTimes(s,r);if(o){const u=St.fromISO(l,t);if(u.isValid)return Vt.after(s,u)}else if(a){const u=St.fromISO(i,t);if(u.isValid)return Vt.before(r,u)}}return Vt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const i=this.start.startOf(e,t);let l;return t!=null&&t.useLocaleWeeks?l=this.end.reconfigure({locale:i.locale}):l=this.end,l=l.startOf(e,t),Math.floor(l.diff(i,e).get(e))+(l.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(bs).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l<this.e;){const o=t[s]||this.e,r=+o>+this.e?this.e:o;i.push(Vt.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(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*l));s=+r>+this.e?this.e:r,o.push(Vt.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}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return t>=i?null:Vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return Vt.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(Vt.fromDateTimes(t,a.time)),t=null);return Vt.merge(l)}difference(...e){return Vt.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=dr,t={}){return this.isValid?yn.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 Vt.fromDateTimes(e(this.s),e(this.e))}}class Co{static hasDST(e=Bt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Fi.isValidZone(e)}static normalizeZone(e){return Ji(e,Bt.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:f0(),localeWeek:c0()}}}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 _2(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 g2(n,e,t,i){let[l,s,o,r]=_2(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=l.plus({[r]:1})),o!==l&&(s[r]=(s[r]||0)+a/(o-l)));const f=St.fromObject(s,i);return u.length>0?St.fromMillis(a,i).shiftTo(...u).plus(f):f}const b2="missing Intl.DateTimeFormat.formatToParts support";function Tt(n,e=t=>t){return{regex:n,deser:([t])=>e(rv(t))}}const y2=" ",M0=`[ ${y2}]`,D0=new RegExp(M0,"g");function k2(n){return n.replace(/\./g,"\\.?").replace(D0,M0)}function Rf(n){return n.replace(/\./g,"").replace(D0," ").toLowerCase()}function li(n,e){return n===null?null:{regex:RegExp(n.map(k2).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 Oo(n){return{regex:n,deser:([e])=>e}}function v2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w2(n,e){const t=ii(e),i=ii(e,"{2}"),l=ii(e,"{3}"),s=ii(e,"{4}"),o=ii(e,"{6}"),r=ii(e,"{1,2}"),a=ii(e,"{1,3}"),u=ii(e,"{1,6}"),f=ii(e,"{1,9}"),c=ii(e,"{2,4}"),d=ii(e,"{4,6}"),m=_=>({regex:RegExp(v2(_.val)),deser:([y])=>y,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return li(e.eras("short"),0);case"GG":return li(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 li(e.months("short",!0),1);case"MMMM":return li(e.months("long",!0),1);case"L":return Tt(r);case"LL":return Tt(i);case"LLL":return li(e.months("short",!1),1);case"LLLL":return li(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 Oo(f);case"uu":return Oo(r);case"uuu":return Tt(t);case"a":return li(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 li(e.weekdays("short",!1),1);case"EEEE":return li(e.weekdays("long",!1),1);case"ccc":return li(e.weekdays("short",!0),1);case"cccc":return li(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 Oo(/[a-z_+-/]{1,256}?/i);case" ":return Oo(/[^\S\n\r]/);default:return m(_)}})(n)||{invalidReason:b2};return g.token=n,g}const S2={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 T2(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=S2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function $2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function C2(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 O2(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=Fi.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 E2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function M2(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val),i=P0(t,e);return i==null||i.includes(void 0)?n:i}function I0(n,e){return Array.prototype.concat(...n.map(t=>M2(t,e)))}class L0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=I0(yn.parseFormat(t),e),this.units=this.tokens.map(i=>w2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=$2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=C2(e,this.regex,this.handlers),[l,s,o]=i?O2(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 A0(n,e,t){return new L0(n,t).explainFromTokens(e)}function D2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=A0(n,e,t);return[i,l,s,o]}function P0(n,e){if(!n)return null;const i=yn.create(e,n).dtFormatter(E2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>T2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function $s(n){return new si("unsupported zone",`the zone "${n.name}" is not supported`)}function ta(n){return n.weekData===null&&(n.weekData=pr(n.c)),n.weekData}function na(n){return n.localWeekData===null&&(n.localWeekData=pr(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 N0(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 Eo(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 xo(n,e,t){return N0(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,mr(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]=N0(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 si("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Mo(n,e,t=!0){return n.isValid?yn.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 R0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},I2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},L2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},F0=["year","month","day","hour","minute","second","millisecond"],A2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],P2=["year","ordinal","hour","minute","second","millisecond"];function N2(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 qb(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 N2(n)}}function R2(n){return tr[n]||(er===void 0&&(er=Bt.now()),tr[n]=n.offset(er)),tr[n]}function Uf(n,e){const t=Ji(e.zone,Bt.defaultZone);if(!t.isValid)return Xe.invalid($s(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Bt.now();else{for(const a of F0)it(n[a])&&(n[a]=R0[a]);const o=a0(n)||u0(n);if(o)return Xe.invalid(o);const r=R2(t);[l,s]=xo(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=yu(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 er,tr={};class Xe{constructor(e){const t=e.zone||Bt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new si("invalid input"):null)||(t.isValid?null:$s(t));this.ts=it(e.ts)?Bt.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=Qi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Eo(this.ts,r),i=Number.isNaN(l.year)?new si("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=dv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Ji(t.zone,Bt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid($s(l))}static fromMillis(e,t={}){if(Qi(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Ji(t.zone,Bt.defaultZone),loc:Et.fromObject(t)});throw new gn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new Xe({ts:e*1e3,zone:Ji(t.zone,Bt.defaultZone),loc:Et.fromObject(t)});throw new gn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ji(t.zone,Bt.defaultZone);if(!i.isValid)return Xe.invalid($s(i));const l=Et.fromObject(t),s=hr(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Ef(s,l),a=Bt.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 g=h||s.weekday&&!m;let _,y,S=Eo(a,u);g?(_=A2,y=I2,S=pr(S,o,r)):f?(_=P2,y=L2,S=Qr(S)):(_=F0,y=R0);let T=!1;for(const P of _){const R=s[P];it(R)?T?s[P]=y[P]:s[P]=S[P]:T=!0}const $=g?uv(s,o,r):f?fv(s):a0(s),E=$||u0(s);if(E)return Xe.invalid(E);const M=g?Cf(s,o,r):f?Of(s):s,[L,I]=xo(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]=t2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=n2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=i2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new gn("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]=D2(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]=f2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the DateTime is invalid");const i=e instanceof si?e:new si(e,t);if(Bt.throwOnInvalid)throw new Rk(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=P0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return I0(yn.parseFormat(e),Et.fromObject(t)).map(l=>l.val).join("")}static resetCache(){er=void 0,tr={}}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?Co.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Co.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Co.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Co.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=Eo(a,o),c=Eo(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 ro(this.year)}get daysInMonth(){return mr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Bs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Bs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=yn.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(Bt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ji(e,Bt.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]=xo(o,s,e)}return _l(this,{ts:l,zone:e})}else return Xe.invalid($s(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=hr(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({...pr(this.c,i,l),...t},i,l):it(t.ordinal)?(c={...this.toObject(),...t},it(t.day)&&(c.day=Math.min(mr(c.year,c.month),c.day))):c=Of({...Qr(this.c),...t});const[d,m]=xo(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;o<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if(l==="quarters"){const s=Math.ceil(this.month/3);i.month=(s-1)*3+1}return this.set(i)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?yn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ea}toLocaleString(e=dr,t={}){return this.isValid?yn.create(this.loc.clone(t),e).formatDateTime(this):ea}toLocaleParts(e={}){return this.isValid?yn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:l=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=ia(this,o);return r+="T",r+=jf(this,o,t,i,l,s),r}toISODate({format:e="extended"}={}){return this.isValid?ia(this,e==="extended"):null}toISOWeekDate(){return Mo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(l?"T":"")+jf(this,o==="extended",t,e,i,s):null}toRFC2822(){return Mo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ia(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),Mo(this,l,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ea}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return St.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=pv(t).map(St.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=g2(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?Vt.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?this<t?-e.padding:e.padding:0;let l=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(l=e.unit,s=void 0),Vf(t,this.plus(i),{...e,numeric:"always",units:l,unit:s})}toRelativeCalendar(e={}){return this.isValid?Vf(e.base||Xe.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Xe.isDateTime))throw new gn("min requires all arguments be DateTimes");return Mf(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new gn("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 A0(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 L0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new gn("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 gn(`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 dr}static get DATE_MED(){return Hb}static get DATE_MED_WITH_WEEKDAY(){return Hk}static get DATE_FULL(){return jb}static get DATE_HUGE(){return zb}static get TIME_SIMPLE(){return Ub}static get TIME_WITH_SECONDS(){return Vb}static get TIME_WITH_SHORT_OFFSET(){return Bb}static get TIME_WITH_LONG_OFFSET(){return Wb}static get TIME_24_SIMPLE(){return Yb}static get TIME_24_WITH_SECONDS(){return Kb}static get TIME_24_WITH_SHORT_OFFSET(){return Jb}static get TIME_24_WITH_LONG_OFFSET(){return Zb}static get DATETIME_SHORT(){return Gb}static get DATETIME_SHORT_WITH_SECONDS(){return Xb}static get DATETIME_MED(){return Qb}static get DATETIME_MED_WITH_SECONDS(){return xb}static get DATETIME_MED_WITH_WEEKDAY(){return jk}static get DATETIME_FULL(){return e0}static get DATETIME_FULL_WITH_SECONDS(){return t0}static get DATETIME_HUGE(){return n0}static get DATETIME_HUGE_WITH_SECONDS(){return i0}}function bs(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new gn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const F2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],q2=[".mp4",".avi",".mov",".3gp",".wmv"],H2=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],j2=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],q0=[{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 z{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static 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||z.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return z.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!z.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!z.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){z.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)z.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]=z.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(!z.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)(!z.isObject(s)&&!Array.isArray(s)||!z.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)(!z.isObject(l)&&!Array.isArray(l)||!z.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):z.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||z.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||z.isObject(e)&&Object.keys(e).length>0)&&z.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l<e;l++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static randomSecret(e=15){if(typeof crypto>"u")return z.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;s<e;s++)l+=i.charAt(t[s]%i.length);return l}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=""+e,e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let l=e[i];typeof l=="string"&&(l=z.truncate(l,150,!0)),t[i]=l}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const l={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let s in l)e=e.replace(l[s],s);return e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=[],l=(e||"").replaceAll("\\"+t,"{_PB_ESCAPED_}").split(t).map(s=>s.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),z.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():"",z.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 z.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.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);z.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||"",!!F2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!q2.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!H2.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!j2.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return z.hasImageExtension(e)?"image":z.hasDocumentExtension(e)?"document":z.hasVideoExtension(e)?"video":z.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(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(z.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)z.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):z.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},z.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<String>";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)&&!z.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=z.isObject(u)&&z.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.name<r.name?-1:0}return[].concat(t.sort(s),i.sort(s),l.sort(s))}static getExpandPresentableRelField(e,t,i=2){for(const l of t){if(e.collectionId!=l.id)continue;let s=e.name;for(const o of l.fields)if(!(!o.presentable||o.type!="relation")&&i>0){const r=z.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=z.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=z.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(z.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?z.plainText(e):e,z.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return z.truncate(e.join(","),i);if(typeof e=="object")try{return z.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 z.extractColumnsFromQuery(e.viewQuery))z.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)z.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=z.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=z.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=z.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=z.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=z.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)z.pushUnique(i,r)}if(t){const s=z.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=!z.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 g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[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_"+z.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=z.parseIndex(e);return i.tableName=t,z.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=z.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?z.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 z.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 xi(){return gl=gl||document.querySelector("."+Va),gl||(gl=document.createElement("div"),gl.classList.add(Va),document.body.appendChild(gl)),gl}function H0(n,e){let t=xi();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),xi().classList.remove("active"),xi().activeNode=void 0}function z2(n,e){xi().activeNode=n,clearTimeout(Ua),Ua=setTimeout(()=>{xi().classList.add("active"),H0(n,e)},isNaN(e.delay)?0:e.delay)}function He(n,e){let t=Wf(e);function i(){z2(n,t)}function l(){Ba()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&z.isFocusable(n))&&n.addEventListener("click",l),xi(),{update(s){var o,r;t=Wf(s),(r=(o=xi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&H0(n,t)},destroy(){var s,o;(o=(s=xi())==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 Ws(n,{delay:e=0,duration:t=400,easing:i=io}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(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,_)=>`
@@ -10,11 +10,11 @@ var mk=Object.defineProperty;var hk=(n,e,t)=>e in n?mk(n,e,{enumerable:!0,config
 			opacity: ${a-f*_}`}}function wt(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(y=>`${y[0].toUpperCase()}${y.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]}`]),g=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*m}px;margin-${u[1]}: ${y*h}px;border-${u[0]}-width: ${y*g}px;border-${u[1]}-width: ${y*_}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 U2=n=>({}),Yf=n=>({}),V2=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T=n[4]&&!n[2]&&Zf(n);const $=n[19].header,E=Lt($,n,n[18],Kf);let M=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),T&&T.c(),r=C(),E&&E.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]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(R,N){v(R,e,N),w(e,t),w(e,l),w(e,s),w(s,o),T&&T.m(o,null),w(o,r),E&&E.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),_=!0,y||(S=[B(t,"click",tt(n[20])),B(f,"scroll",n[22])],y=!0)},p(R,N){n=R,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&O(T,1)):(T=Zf(n),T.c(),O(T,1),T.m(o,r)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),E&&E.p&&(!_||N[0]&262144)&&Pt(E,$,n,n[18],_?At($,n[18],N,V2):Nt(n[18]),Kf),n[4]&&n[2]?M?M.p(n,N):(M=Gf(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!_||N[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],N,null):Nt(n[18]),null),P&&P.p&&(!_||N[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],N,U2):Nt(n[18]),Yf),(!_||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||N[0]&262)&&x(s,"popup",n[2]),(!_||N[0]&4)&&x(e,"padded",n[2]),(!_||N[0]&1)&&x(e,"active",n[0])},i(R){_||(R&&nt(()=>{_&&(i||(i=ze(t,Ws,{duration:Ki,opacity:0},!0)),i.run(1))}),O(T),O(E,R),O(I,R),O(P,R),R&&nt(()=>{_&&(g&&g.end(1),h=Fb(s,Fn,n[2]?{duration:Ki,y:-10}:{duration:Ki,x:50}),h.start())}),_=!0)},o(R){R&&(i||(i=ze(t,Ws,{duration:Ki,opacity:0},!1)),i.run(0)),D(T),D(E,R),D(I,R),D(P,R),h&&h.invalidate(),R&&(g=mu(s,Fn,n[2]?{duration:Ki,y:10}:{duration:Ki,x:50})),_=!1},d(R){R&&k(e),R&&i&&i.end(),T&&T.d(),E&&E.d(R),M&&M.d(),I&&I.d(R),n[21](null),P&&P.d(R),R&&g&&g.end(),y=!1,De(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=B(e,"click",tt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Ws,{duration:Ki},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Ws,{duration:Ki},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line txt-lg" aria-hidden="true"></i>',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){v(l,e,s),t||(i=B(e,"click",tt(n[5])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function B2(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){v(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&&O(s,1)):(s=Jf(o),s.c(),O(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(O(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[23](null),i=!1,De(l)}}}let bl,la=[];function j0(){return bl=bl||document.querySelector(".overlays"),bl||(bl=document.createElement("div"),bl.classList.add("overlays"),document.body.appendChild(bl)),bl}let Ki=150;function Xf(){return 1e3+j0().querySelectorAll(".overlay-panel-container.active").length}function W2(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=_t(),h="op_"+z.randomString(10);let g,_,y,S,T="",$=o;function E(){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,$=X),X?(y=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await fn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){z.pushUnique(la,h),document.body.classList.add("overlay-active")}function R(){z.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function N(X){o&&f&&X.code=="Escape"&&!z.isInput(X.target)&&g&&g.style.zIndex==Xf()&&(X.preventDefault(),M())}function U(X){o&&j(_)}function j(X,oe){oe&&t(8,T=""),!(!X||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}X.scrollTop==0?t(8,T+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Yt(()=>(j0().appendChild(g),()=>{var X;clearTimeout(S),R(),(X=g==null?void 0:g.classList)==null||X.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const V=()=>a?M():!0;function K(X){ie[X?"unshift":"push"](()=>{_=X,t(7,_)})}const J=X=>j(X.target);function ee(X){ie[X?"unshift":"push"](()=>{g=X,t(6,g)})}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&&$!=o&&I(o),n.$$.dirty[0]&128&&j(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():R())},[o,s,r,a,u,M,g,_,T,N,U,j,f,c,d,E,L,$,l,i,V,K,J,ee]}class ln extends ye{constructor(e){super(),be(this,e,W2,B2,_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 z0(n,e){return{subscribe:qn(n,e).subscribe}}function qn(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<Bl.length;u+=2)Bl[u][0](Bl[u+1]);Bl.length=0}}}function s(r){l(r(n))}function o(r,a=te){const u=[r,a];return i.add(u),i.size===1&&(t=e(l,s)||te),r(n),()=>{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function U0(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 z0(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=Rt(h)?h:te},m=l.map((h,g)=>uu(h,_=>{u[g]=_,f&=~(1<<g),a&&d()},()=>{f|=1<<g}));return a=!0,d(),function(){De(m),c(),a=!1}})}const Su=qn({});function pn(n,e,t){Su.set({text:n,yesCallback:e,noCallback:t})}function V0(){Su.set({})}function Y2(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=Y(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){v(s,e,o),w(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&ue(i,t)},d(s){s&&k(e)}}}function K2(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],x(l,"btn-loading",n[2])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(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&&x(l,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(l)),o=!1,De(r)}}}function J2(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:[K2],header:[Y2]},$$scope:{ctx:n}};return e=new ln({props:i}),n[6](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[6](null),q(e,l)}}}function Z2(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 fn(),t(3,o=!1),V0()};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 G2 extends ye{constructor(e){super(),be(this,e,Z2,J2,_e,{})}}function X2(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Sk(e,"visibility","hidden")},m(t,i){v(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[15](null)}}}function Q2(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){v(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[14](null)}}}function x2(n){let e;function t(s,o){return s[1]?Q2:X2}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){v(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&&k(e),l.d(),n[16](null)}}}function ew(){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 tw=ew();function sa(){return window&&window.tinymce?window.tinymce:null}function nw(n,e,t){let{id:i="tinymce_svelte"+z.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,R=>{A(P.toLowerCase(),{eventName:P,event:R,editor:I})})})};let h,g,_,y=u,S=s;const T=_t();function $(){const I={...r,target:g,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,y=A.getContent()),y!==u&&(t(5,u=y),t(6,f=A.getContent({format:"text"})))})}),m(A,T),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}Yt(()=>(sa()!==null?$():tw.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function E(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function M(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}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{_&&y!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,g,u,f,s,o,r,a,_,y,S,E,M,L]}class Tu extends ye{constructor(e){super(),be(this,e,nw,x2,_e,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function iw(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:Rt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${g}px, ${_}px) scale(${y}, ${S});`}}}const Nr=qn([]);function Ys(n,e=4e3){return Rr(n,"info",e)}function tn(n,e=3e3){return Rr(n,"success",e)}function $i(n,e=4500){return Rr(n,"error",e)}function lw(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(()=>{B0(i)},t)};Nr.update(l=>($u(l,i.message),z.pushOrReplaceByKey(l,i,"message"),l))}function B0(n){Nr.update(e=>($u(e,n),e))}function Ds(){Nr.update(n=>{for(let e of n)$u(n,e);return[]})}function $u(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function sw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function ow(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function rw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function aw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,y;function S(M,L){return M[2].type==="info"?aw:M[2].type==="success"?rw:M[2].type==="warning"?ow:sw}let T=S(e),$=T(e);function E(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=C(),s=b("div"),r=Y(o),a=C(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=C(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,L){v(M,t,L),w(t,i),$.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(y=B(u,"click",tt(E)),_=!0)},p(M,L){e=M,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&ue(r,o),(!g||L&1)&&x(t,"alert-info",e[2].type=="info"),(!g||L&1)&&x(t,"alert-success",e[2].type=="success"),(!g||L&1)&&x(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){Ek(t),h(),Pb(t,m)},a(){h(),h=Ok(t,m,iw,{duration:150})},i(M){g||(M&&nt(()=>{g&&(d&&d.end(1),c=Fb(t,wt,{duration:150}),c.start())}),g=!0)},o(M){c&&c.invalidate(),M&&(d=mu(t,Ws,{duration:150})),g=!1},d(M){M&&k(t),$.d(),M&&d&&d.end(),_=!1,y()}}}function uw(n){let e,t=[],i=new Map,l,s=pe(n[0]);const o=r=>r[2].message;for(let r=0;r<s.length;r+=1){let a=Qf(n,s,r),u=o(a);i.set(u,t[r]=xf(u,a))}return{c(){e=b("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","toasts-wrapper")},m(r,a){v(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);l=!0},p(r,[a]){if(a&1){s=pe(r[0]),re();for(let u=0;u<t.length;u+=1)t[u].r();t=kt(t,a,o,1,r,s,i,e,Ak,xf,null,Qf);for(let u=0;u<t.length;u+=1)t[u].a();ae()}},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(t[a]);l=!0}},o(r){for(let a=0;a<t.length;a+=1)D(t[a]);l=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function fw(n,e,t){let i;return Qe(n,Nr,s=>t(0,i=s)),[i,s=>B0(s)]}class cw extends ye{constructor(e){super(),be(this,e,fw,uw,_e,{})}}function ec(n){let e,t,i;const l=n[18].default,s=Lt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){v(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Pt(s,l,o,o[17],i?At(l,o[17],r,null):Nt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(O(s,o),o&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=ze(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function dw(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){v(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&&O(s,1)):(s=ec(o),s.c(),O(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(O(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[20](null),i=!1,De(l)}}}function pw(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 y=_t();function S(X=0){o&&(clearTimeout(g),g=setTimeout(T,X))}function T(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function $(){clearTimeout(g),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 E(){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",R),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",R),m==null||m.removeEventListener("keydown",N)}function A(X){X.stopPropagation(),M(X.target)&&T()}function P(X){(X.code==="Enter"||X.code==="Space")&&(X.stopPropagation(),M(X.target)&&S(150))}function R(X){X.preventDefault(),X.stopPropagation(),E()}function N(X){(X.code==="Enter"||X.code==="Space")&&(X.preventDefault(),X.stopPropagation(),E())}function U(X){o&&!(m!=null&&m.contains(X.target))&&!(c!=null&&c.contains(X.target))&&E()}function j(X){o&&r&&X.code==="Escape"&&(X.preventDefault(),T())}function V(X){o&&(_=!(c!=null&&c.contains(X.target)))}function K(X){var oe;o&&_&&!(c!=null&&c.contains(X.target))&&!(m!=null&&m.contains(X.target))&&!((oe=X.target)!=null&&oe.closest(".flatpickr-calendar"))&&T()}Yt(()=>(L(),()=>I()));function J(X){ie[X?"unshift":"push"](()=>{d=X,t(3,d)})}function ee(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),y("show")):((oe=m==null?void 0:m.classList)==null||oe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,f,c,d,U,j,V,K,s,r,a,u,S,T,$,E,m,l,i,J,ee]}class Hn extends ye{constructor(e){super(),be(this,e,pw,dw,_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 cn=qn(""),_r=qn(""),Dl=qn(!1),Sn=qn({});function Wt(n){Sn.set(n||{})}function fi(n){Sn.update(e=>(z.deleteByPath(e,n),e))}const Fr=qn({});function tc(n){Fr.set(n||{})}class Rn 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,Rn.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 Rn||(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 Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function mw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||hw;let l=0;for(;l<n.length;){const s=n.indexOf("=",l);if(s===-1)break;let o=n.indexOf(";",l);if(o===-1)o=n.length;else if(o<s){l=n.lastIndexOf(";",s-1)+1;continue}const r=n.slice(l,s).trim();if(t[r]===void 0){let a=n.slice(s+1,o).trim();a.charCodeAt(0)===34&&(a=a.slice(1,-1));try{t[r]=i(a)}catch{t[r]=a}}l=o+1}return t}function nc(n,e,t){const i=Object.assign({},t||{}),l=i.encode||_w;if(!Do.test(n))throw new TypeError("argument name is invalid");const s=l(e);if(s&&!Do.test(s))throw new TypeError("argument val is invalid");let o=n+"="+s;if(i.maxAge!=null){const r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(r)}if(i.domain){if(!Do.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!Do.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(a){return Object.prototype.toString.call(a)==="[object Date]"||a instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}function hw(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function _w(n){return encodeURIComponent(n)}const gw=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal;let W0;function xl(n){if(n)try{const e=decodeURIComponent(W0(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function Cu(n,e=0){let t=xl(n);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}W0=typeof atob!="function"||gw?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=mw(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 Y0 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 ol{constructor(e){this.client=e}}class bw extends ol{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 yw=["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)yw.includes(e)||(n.query[e]=n[e],delete n[e])}}function K0(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 J0 extends ol{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 Rn(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 Z0 extends ol{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 Rn({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 Rn({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 Wi(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 kw extends Z0{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,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var T;const _=r.authStore.token;if((T=g.query)!=null&&T.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let y=r.authStore.isValid;if(y&&Cu(r.authStore.token,a))try{await u()}catch{y=!1}y||await f();const S=g.headers||{};for(let $ in S)if($.toLowerCase()=="authorization"&&_==S[$]&&r.authStore.token){S[$]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(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=Wi("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 J0(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 Rn(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 g;try{await l.subscribe("@oauth2",async T=>{var E;const $=l.clientId;try{if(!T.state||$!==T.state)throw new Error("State parameters don't match.");if(T.error||!T.code)throw new Error("OAuth2 redirect error or missing code: "+T.error);const M=Object.assign({},t);delete M.provider,delete M.scopes,delete M.createData,delete M.urlCallback,(E=c==null?void 0:c.signal)!=null&&E.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,T.code,u.codeVerifier,f,t.createData,M);m(L)}catch(M){h(new Rn(M))}s()});const _={state:l.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const y=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function(T){i?i.location.href=T:i=lc(T)})(y)}catch(_){s(),h(new Rn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Wi("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=Wi("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=Wi("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=Wi("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=Wi("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=Wi("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=Wi("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 fo(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 Rn(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 vw extends Z0{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 ww extends ol{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 Rn({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 Sw extends ol{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class Tw extends ol{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 $w extends ol{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 Cw extends ol{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Ow(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l<this.requests.length;l++){const s=this.requests[l];if(i.push({method:s.method,url:s.url,headers:s.headers,body:s.json}),s.files)for(let o in s.files){const r=s.files[o]||[];for(let a of r)t.append("requests."+l+"."+o,a)}}return t.append("@jsonPayload",JSON.stringify({requests:i})),e=Object.assign({method:"POST",body:t},e),this.client.send("/api/batch",e)}}class Ow{constructor(e,t){this.requests=[],this.requests=e,this.collectionIdOrName=t}upsert(e,t){t=Object.assign({body:e||{}},t);const i={method:"PUT",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(i,t),this.requests.push(i)}create(e,t){t=Object.assign({body:e||{}},t);const i={method:"POST",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(i,t),this.requests.push(i)}update(e,t,i){i=Object.assign({body:t||{}},i);const l={method:"PATCH",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(l,i),this.requests.push(l)}delete(e,t){t=Object.assign({},t);const i={method:"DELETE",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(i,t),this.requests.push(i)}prepareRequest(e,t){if(Eu(t),e.headers=t.headers,e.json={},e.files={},t.query!==void 0){const i=K0(t.query);i&&(e.url+=(e.url.includes("?")?"&":"?")+i)}for(const i in t.body){const l=t.body[i];if(Wa(l))e.files[i]=e.files[i]||[],e.files[i].push(l);else if(Array.isArray(l)){const s=[],o=[];for(const r of l)Wa(r)?s.push(r):o.push(r);if(s.length>0&&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 fo{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 Y0,this.collections=new vw(this),this.files=new Tw(this),this.logs=new ww(this),this.settings=new bw(this),this.realtime=new J0(this),this.health=new Sw(this),this.backups=new $w(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Cw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new kw(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=K0(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 Rn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Rn(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=qn([]),Qn=qn({}),gr=qn(!1),G0=qn({}),Mu=qn({});let Is;typeof BroadcastChannel<"u"&&(Is=new BroadcastChannel("collections"),Is.onmessage=()=>{var n;Du((n=Eb(Qn))==null?void 0:n.id)});function X0(){Is==null||Is.postMessage("reload")}function Ew(n){En.update(e=>{const t=z.findByKey(e,"id",n);return t?Qn.set(t):e.length&&Qn.set(e[0]),e})}function Mw(n){Qn.update(e=>z.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),En.update(e=>(z.pushOrReplaceByKey(e,n,"id"),Iu(),X0(),z.sortCollections(e)))}function Dw(n){En.update(e=>(z.removeByKey(e,"id",n.id),Qn.update(t=>t.id===n.id?e[0]:t),Iu(),X0(),e))}async function Du(n=null){gr.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),En.set(e);const t=n&&z.findByKey(e,"id",n);t?Qn.set(t):e.length&&Qn.set(e.find(i=>!i.system)||e[0]),Iu(),Mu.set(await me.collections.getScaffolds())}catch(e){me.error(e)}gr.set(!1)}function Iu(){G0.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 Q0(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 Iw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a&4&&(u=je(u,vt(l,[Ft(r[2])]))),{props:u}}return s&&(e=jt(s,o(n)),e.$on("routeEvent",n[7])),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a&1&&s!==(s=r[0])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[7]),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a&4?vt(l,[Ft(r[2])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Lw(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<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a&6&&(u=je(u,vt(l,[a&2&&{params:r[1]},a&4&&Ft(r[2])]))),{props:u}}return s&&(e=jt(s,o(n)),e.$on("routeEvent",n[6])),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a&1&&s!==(s=r[0])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[6]),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a&6?vt(l,[a&2&&{params:r[1]},a&4&&Ft(r[2])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Aw(n){let e,t,i,l;const s=[Lw,Iw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(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=z0(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});U0(qr,n=>n.location);const Lu=U0(qr,n=>n.querystring),ac=qn(void 0);async function Il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await fn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function Un(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function Pw(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||Nw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Nw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Rw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(E,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!E||typeof E=="string"&&(E.length<1||E.charAt(0)!="/"&&E.charAt(0)!="*")||typeof E=="object"&&!(E instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=Q0(E);this.path=E,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(E){if(l){if(typeof l=="string")if(E.startsWith(l))E=E.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=E.match(l);if(A&&A[0])E=E.substr(A[0].length)||"/";else return null}}const M=this._pattern.exec(E);if(M===null)return null;if(this._keys===!1)return M;const L={};let I=0;for(;I<this._keys.length;){try{L[this._keys[I]]=decodeURIComponent(M[I+1]||"")||null}catch{L[this._keys[I]]=null}I++}return L}async checkConditions(E){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](E))return!1;return!0}}const r=[];i instanceof Map?i.forEach(($,E)=>{r.push(new o(E,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=_t();async function d($,E){await fn(),c($,E)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),Mk(()=>{Pw(m)}));let g=null,_=null;const y=qr.subscribe(async $=>{g=$;let E=0;for(;E<r.length;){const M=r[E].match($.location);if(!M){E++;continue}const L={route:r[E].path,location:$.location,querystring:$.querystring,userData:r[E].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await r[E].checkConditions(L)){t(0,a=null),_=null,d("conditionsFailed",L);return}d("routeLoading",Object.assign({},L));const I=r[E].component;if(_!=I){I.loading?(t(0,a=I.loading),_=I,t(1,u=I.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u}))):(t(0,a=null),_=null);const A=await I();if($!=g)return;t(0,a=A&&A.default||A),_=I}M&&typeof M=="object"&&Object.keys(M).length?t(1,u=M):t(1,u=null),t(2,f=r[E].props),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u})).then(()=>{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});so(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Pe.call(this,n,$)}function T($){Pe.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,T]}class Fw extends ye{constructor(e){super(),be(this,e,Rw,Aw,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";fo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Il("/login")};fo.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&&$i(s),z.isEmpty(l.data)||Wt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Il("/")};fo.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Eb(G0);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 qw extends Y0{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 fo("../",new qw);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 nr=[];let x0;function ey(n){const e=n.pattern.test(x0);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=>{x0=n.location+(n.querystring?"?"+n.querystring:""),nr.map(ey)});function Ri(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"?Q0(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),ey(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const Hw="modulepreload",jw=function(n,e){return new URL(n,e).href},dc={},Ot=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=jw(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 g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":Hw,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(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)})},zw=n=>({}),pc=n=>({});function mc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.0-rc2",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){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(k(e),k(t),k(i),k(l),k(s))}}}function Uw(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=Lt(a,n,n[3],null),f=n[4].footer,c=Lt(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]),x(e,"center-content",n[0])},m(h,g){v(h,e,g),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,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?At(a,h[3],g,null):Nt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?At(f,h[3],g,zw):Nt(h[3]),pc),(_=h[2])!=null&&_.id?d||(d=mc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",h[0])},i(h){r||(O(u,h),O(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&k(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function Vw(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 di extends ye{constructor(e){super(),be(this,e,Vw,Uw,_e,{center:0,class:1})}}function hc(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/> <span class="txt">Pocket<strong>Base</strong></span></figure>',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function Bw(n){let e,t,i,l=!n[0]&&hc();const s=n[1].default,o=Lt(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){v(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)&&Pt(o,s,r,r[2],i?At(s,r[2],a,null):Nt(r[2]),null)},i(r){i||(O(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&k(e),l&&l.d(),o&&o.d(r)}}}function Ww(n){let e,t;return e=new di({props:{class:"full-page",center:!0,$$slots:{default:[Bw]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Yw(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 ty extends ye{constructor(e){super(),be(this,e,Yw,Ww,_e,{nobranding:0})}}function _c(n,e,t){const i=n.slice();return i[12]=e[t],i}const Kw=n=>({}),gc=n=>({uniqueId:n[4]});function Jw(n){let e,t,i=pe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=bc(_c(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ge()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);v(o,e,r),t=!0},p(o,r){if(r&8){i=pe(o[3]);let a;for(a=0;a<i.length;a+=1){const u=_c(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=bc(u),l[a].c(),O(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function Zw(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon inline-error-icon")},m(a,u){v(a,e,u),w(e,t),s=!0,o||(r=Me(i=He.call(null,t,{position:"left",text:n[3].map(br).join(`
+		`}}const U2=n=>({}),Yf=n=>({}),V2=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T=n[4]&&!n[2]&&Zf(n);const $=n[19].header,E=Lt($,n,n[18],Kf);let M=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),T&&T.c(),r=C(),E&&E.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]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(R,N){v(R,e,N),w(e,t),w(e,l),w(e,s),w(s,o),T&&T.m(o,null),w(o,r),E&&E.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),_=!0,y||(S=[B(t,"click",tt(n[20])),B(f,"scroll",n[22])],y=!0)},p(R,N){n=R,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&O(T,1)):(T=Zf(n),T.c(),O(T,1),T.m(o,r)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),E&&E.p&&(!_||N[0]&262144)&&Pt(E,$,n,n[18],_?At($,n[18],N,V2):Nt(n[18]),Kf),n[4]&&n[2]?M?M.p(n,N):(M=Gf(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!_||N[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],N,null):Nt(n[18]),null),P&&P.p&&(!_||N[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],N,U2):Nt(n[18]),Yf),(!_||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||N[0]&262)&&x(s,"popup",n[2]),(!_||N[0]&4)&&x(e,"padded",n[2]),(!_||N[0]&1)&&x(e,"active",n[0])},i(R){_||(R&&nt(()=>{_&&(i||(i=ze(t,Ws,{duration:Ki,opacity:0},!0)),i.run(1))}),O(T),O(E,R),O(I,R),O(P,R),R&&nt(()=>{_&&(g&&g.end(1),h=Fb(s,Fn,n[2]?{duration:Ki,y:-10}:{duration:Ki,x:50}),h.start())}),_=!0)},o(R){R&&(i||(i=ze(t,Ws,{duration:Ki,opacity:0},!1)),i.run(0)),D(T),D(E,R),D(I,R),D(P,R),h&&h.invalidate(),R&&(g=mu(s,Fn,n[2]?{duration:Ki,y:10}:{duration:Ki,x:50})),_=!1},d(R){R&&k(e),R&&i&&i.end(),T&&T.d(),E&&E.d(R),M&&M.d(),I&&I.d(R),n[21](null),P&&P.d(R),R&&g&&g.end(),y=!1,De(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=B(e,"click",tt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Ws,{duration:Ki},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Ws,{duration:Ki},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line txt-lg" aria-hidden="true"></i>',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){v(l,e,s),t||(i=B(e,"click",tt(n[5])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function B2(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){v(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&&O(s,1)):(s=Jf(o),s.c(),O(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(O(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[23](null),i=!1,De(l)}}}let bl,la=[];function j0(){return bl=bl||document.querySelector(".overlays"),bl||(bl=document.createElement("div"),bl.classList.add("overlays"),document.body.appendChild(bl)),bl}let Ki=150;function Xf(){return 1e3+j0().querySelectorAll(".overlay-panel-container.active").length}function W2(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=gt(),h="op_"+z.randomString(10);let g,_,y,S,T="",$=o;function E(){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,$=X),X?(y=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await fn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){z.pushUnique(la,h),document.body.classList.add("overlay-active")}function R(){z.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function N(X){o&&f&&X.code=="Escape"&&!z.isInput(X.target)&&g&&g.style.zIndex==Xf()&&(X.preventDefault(),M())}function U(X){o&&j(_)}function j(X,oe){oe&&t(8,T=""),!(!X||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}X.scrollTop==0?t(8,T+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Yt(()=>(j0().appendChild(g),()=>{var X;clearTimeout(S),R(),(X=g==null?void 0:g.classList)==null||X.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const V=()=>a?M():!0;function K(X){ie[X?"unshift":"push"](()=>{_=X,t(7,_)})}const J=X=>j(X.target);function ee(X){ie[X?"unshift":"push"](()=>{g=X,t(6,g)})}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&&$!=o&&I(o),n.$$.dirty[0]&128&&j(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():R())},[o,s,r,a,u,M,g,_,T,N,U,j,f,c,d,E,L,$,l,i,V,K,J,ee]}class ln extends ye{constructor(e){super(),be(this,e,W2,B2,_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 z0(n,e){return{subscribe:qn(n,e).subscribe}}function qn(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<Bl.length;u+=2)Bl[u][0](Bl[u+1]);Bl.length=0}}}function s(r){l(r(n))}function o(r,a=te){const u=[r,a];return i.add(u),i.size===1&&(t=e(l,s)||te),r(n),()=>{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function U0(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 z0(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=Rt(h)?h:te},m=l.map((h,g)=>uu(h,_=>{u[g]=_,f&=~(1<<g),a&&d()},()=>{f|=1<<g}));return a=!0,d(),function(){De(m),c(),a=!1}})}const Su=qn({});function pn(n,e,t){Su.set({text:n,yesCallback:e,noCallback:t})}function V0(){Su.set({})}function Y2(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=Y(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){v(s,e,o),w(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&ue(i,t)},d(s){s&&k(e)}}}function K2(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],x(l,"btn-loading",n[2])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(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&&x(l,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(l)),o=!1,De(r)}}}function J2(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:[K2],header:[Y2]},$$scope:{ctx:n}};return e=new ln({props:i}),n[6](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[6](null),q(e,l)}}}function Z2(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 fn(),t(3,o=!1),V0()};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 G2 extends ye{constructor(e){super(),be(this,e,Z2,J2,_e,{})}}function X2(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Sk(e,"visibility","hidden")},m(t,i){v(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[15](null)}}}function Q2(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){v(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[14](null)}}}function x2(n){let e;function t(s,o){return s[1]?Q2:X2}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){v(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&&k(e),l.d(),n[16](null)}}}function ew(){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 tw=ew();function sa(){return window&&window.tinymce?window.tinymce:null}function nw(n,e,t){let{id:i="tinymce_svelte"+z.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,R=>{A(P.toLowerCase(),{eventName:P,event:R,editor:I})})})};let h,g,_,y=u,S=s;const T=gt();function $(){const I={...r,target:g,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,y=A.getContent()),y!==u&&(t(5,u=y),t(6,f=A.getContent({format:"text"})))})}),m(A,T),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}Yt(()=>(sa()!==null?$():tw.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function E(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function M(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}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{_&&y!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,g,u,f,s,o,r,a,_,y,S,E,M,L]}class Tu extends ye{constructor(e){super(),be(this,e,nw,x2,_e,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function iw(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:Rt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${g}px, ${_}px) scale(${y}, ${S});`}}}const Nr=qn([]);function Ys(n,e=4e3){return Rr(n,"info",e)}function tn(n,e=3e3){return Rr(n,"success",e)}function $i(n,e=4500){return Rr(n,"error",e)}function lw(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(()=>{B0(i)},t)};Nr.update(l=>($u(l,i.message),z.pushOrReplaceByKey(l,i,"message"),l))}function B0(n){Nr.update(e=>($u(e,n),e))}function Ds(){Nr.update(n=>{for(let e of n)$u(n,e);return[]})}function $u(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function sw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function ow(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function rw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function aw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,y;function S(M,L){return M[2].type==="info"?aw:M[2].type==="success"?rw:M[2].type==="warning"?ow:sw}let T=S(e),$=T(e);function E(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=C(),s=b("div"),r=Y(o),a=C(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=C(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,L){v(M,t,L),w(t,i),$.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(y=B(u,"click",tt(E)),_=!0)},p(M,L){e=M,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&ue(r,o),(!g||L&1)&&x(t,"alert-info",e[2].type=="info"),(!g||L&1)&&x(t,"alert-success",e[2].type=="success"),(!g||L&1)&&x(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){Ek(t),h(),Pb(t,m)},a(){h(),h=Ok(t,m,iw,{duration:150})},i(M){g||(M&&nt(()=>{g&&(d&&d.end(1),c=Fb(t,wt,{duration:150}),c.start())}),g=!0)},o(M){c&&c.invalidate(),M&&(d=mu(t,Ws,{duration:150})),g=!1},d(M){M&&k(t),$.d(),M&&d&&d.end(),_=!1,y()}}}function uw(n){let e,t=[],i=new Map,l,s=pe(n[0]);const o=r=>r[2].message;for(let r=0;r<s.length;r+=1){let a=Qf(n,s,r),u=o(a);i.set(u,t[r]=xf(u,a))}return{c(){e=b("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","toasts-wrapper")},m(r,a){v(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);l=!0},p(r,[a]){if(a&1){s=pe(r[0]),re();for(let u=0;u<t.length;u+=1)t[u].r();t=kt(t,a,o,1,r,s,i,e,Ak,xf,null,Qf);for(let u=0;u<t.length;u+=1)t[u].a();ae()}},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(t[a]);l=!0}},o(r){for(let a=0;a<t.length;a+=1)D(t[a]);l=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function fw(n,e,t){let i;return Qe(n,Nr,s=>t(0,i=s)),[i,s=>B0(s)]}class cw extends ye{constructor(e){super(),be(this,e,fw,uw,_e,{})}}function ec(n){let e,t,i;const l=n[18].default,s=Lt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){v(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Pt(s,l,o,o[17],i?At(l,o[17],r,null):Nt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(O(s,o),o&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=ze(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function dw(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){v(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&&O(s,1)):(s=ec(o),s.c(),O(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(O(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[20](null),i=!1,De(l)}}}function pw(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 y=gt();function S(X=0){o&&(clearTimeout(g),g=setTimeout(T,X))}function T(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function $(){clearTimeout(g),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 E(){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",R),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",R),m==null||m.removeEventListener("keydown",N)}function A(X){X.stopPropagation(),M(X.target)&&T()}function P(X){(X.code==="Enter"||X.code==="Space")&&(X.stopPropagation(),M(X.target)&&S(150))}function R(X){X.preventDefault(),X.stopPropagation(),E()}function N(X){(X.code==="Enter"||X.code==="Space")&&(X.preventDefault(),X.stopPropagation(),E())}function U(X){o&&!(m!=null&&m.contains(X.target))&&!(c!=null&&c.contains(X.target))&&E()}function j(X){o&&r&&X.code==="Escape"&&(X.preventDefault(),T())}function V(X){o&&(_=!(c!=null&&c.contains(X.target)))}function K(X){var oe;o&&_&&!(c!=null&&c.contains(X.target))&&!(m!=null&&m.contains(X.target))&&!((oe=X.target)!=null&&oe.closest(".flatpickr-calendar"))&&T()}Yt(()=>(L(),()=>I()));function J(X){ie[X?"unshift":"push"](()=>{d=X,t(3,d)})}function ee(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),y("show")):((oe=m==null?void 0:m.classList)==null||oe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,f,c,d,U,j,V,K,s,r,a,u,S,T,$,E,m,l,i,J,ee]}class Hn extends ye{constructor(e){super(),be(this,e,pw,dw,_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 cn=qn(""),_r=qn(""),Dl=qn(!1),Sn=qn({});function Wt(n){Sn.set(n||{})}function fi(n){Sn.update(e=>(z.deleteByPath(e,n),e))}const Fr=qn({});function tc(n){Fr.set(n||{})}class Rn 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,Rn.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 Rn||(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 Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function mw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||hw;let l=0;for(;l<n.length;){const s=n.indexOf("=",l);if(s===-1)break;let o=n.indexOf(";",l);if(o===-1)o=n.length;else if(o<s){l=n.lastIndexOf(";",s-1)+1;continue}const r=n.slice(l,s).trim();if(t[r]===void 0){let a=n.slice(s+1,o).trim();a.charCodeAt(0)===34&&(a=a.slice(1,-1));try{t[r]=i(a)}catch{t[r]=a}}l=o+1}return t}function nc(n,e,t){const i=Object.assign({},t||{}),l=i.encode||_w;if(!Do.test(n))throw new TypeError("argument name is invalid");const s=l(e);if(s&&!Do.test(s))throw new TypeError("argument val is invalid");let o=n+"="+s;if(i.maxAge!=null){const r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(r)}if(i.domain){if(!Do.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!Do.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(a){return Object.prototype.toString.call(a)==="[object Date]"||a instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}function hw(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function _w(n){return encodeURIComponent(n)}const gw=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal;let W0;function xl(n){if(n)try{const e=decodeURIComponent(W0(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function Cu(n,e=0){let t=xl(n);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}W0=typeof atob!="function"||gw?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=mw(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 Y0 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 ol{constructor(e){this.client=e}}class bw extends ol{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 yw=["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)yw.includes(e)||(n.query[e]=n[e],delete n[e])}}function K0(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 J0 extends ol{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 Rn(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 Z0 extends ol{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 Rn({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 Rn({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 Wi(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 kw extends Z0{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,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var T;const _=r.authStore.token;if((T=g.query)!=null&&T.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let y=r.authStore.isValid;if(y&&Cu(r.authStore.token,a))try{await u()}catch{y=!1}y||await f();const S=g.headers||{};for(let $ in S)if($.toLowerCase()=="authorization"&&_==S[$]&&r.authStore.token){S[$]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(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=Wi("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 J0(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 Rn(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 g;try{await l.subscribe("@oauth2",async T=>{var E;const $=l.clientId;try{if(!T.state||$!==T.state)throw new Error("State parameters don't match.");if(T.error||!T.code)throw new Error("OAuth2 redirect error or missing code: "+T.error);const M=Object.assign({},t);delete M.provider,delete M.scopes,delete M.createData,delete M.urlCallback,(E=c==null?void 0:c.signal)!=null&&E.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,T.code,u.codeVerifier,f,t.createData,M);m(L)}catch(M){h(new Rn(M))}s()});const _={state:l.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const y=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function(T){i?i.location.href=T:i=lc(T)})(y)}catch(_){s(),h(new Rn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Wi("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=Wi("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=Wi("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=Wi("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=Wi("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=Wi("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=Wi("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 fo(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 Rn(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 vw extends Z0{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 ww extends ol{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 Rn({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 Sw extends ol{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class Tw extends ol{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 $w extends ol{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 Cw extends ol{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Ow(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l<this.requests.length;l++){const s=this.requests[l];if(i.push({method:s.method,url:s.url,headers:s.headers,body:s.json}),s.files)for(let o in s.files){const r=s.files[o]||[];for(let a of r)t.append("requests."+l+"."+o,a)}}return t.append("@jsonPayload",JSON.stringify({requests:i})),e=Object.assign({method:"POST",body:t},e),this.client.send("/api/batch",e)}}class Ow{constructor(e,t){this.requests=[],this.requests=e,this.collectionIdOrName=t}upsert(e,t){t=Object.assign({body:e||{}},t);const i={method:"PUT",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(i,t),this.requests.push(i)}create(e,t){t=Object.assign({body:e||{}},t);const i={method:"POST",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(i,t),this.requests.push(i)}update(e,t,i){i=Object.assign({body:t||{}},i);const l={method:"PATCH",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(l,i),this.requests.push(l)}delete(e,t){t=Object.assign({},t);const i={method:"DELETE",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(i,t),this.requests.push(i)}prepareRequest(e,t){if(Eu(t),e.headers=t.headers,e.json={},e.files={},t.query!==void 0){const i=K0(t.query);i&&(e.url+=(e.url.includes("?")?"&":"?")+i)}for(const i in t.body){const l=t.body[i];if(Wa(l))e.files[i]=e.files[i]||[],e.files[i].push(l);else if(Array.isArray(l)){const s=[],o=[];for(const r of l)Wa(r)?s.push(r):o.push(r);if(s.length>0&&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 fo{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 Y0,this.collections=new vw(this),this.files=new Tw(this),this.logs=new ww(this),this.settings=new bw(this),this.realtime=new J0(this),this.health=new Sw(this),this.backups=new $w(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Cw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new kw(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=K0(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 Rn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Rn(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=qn([]),Qn=qn({}),gr=qn(!1),G0=qn({}),Mu=qn({});let Is;typeof BroadcastChannel<"u"&&(Is=new BroadcastChannel("collections"),Is.onmessage=()=>{var n;Du((n=Eb(Qn))==null?void 0:n.id)});function X0(){Is==null||Is.postMessage("reload")}function Ew(n){En.update(e=>{const t=z.findByKey(e,"id",n);return t?Qn.set(t):e.length&&Qn.set(e[0]),e})}function Mw(n){Qn.update(e=>z.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),En.update(e=>(z.pushOrReplaceByKey(e,n,"id"),Iu(),X0(),z.sortCollections(e)))}function Dw(n){En.update(e=>(z.removeByKey(e,"id",n.id),Qn.update(t=>t.id===n.id?e[0]:t),Iu(),X0(),e))}async function Du(n=null){gr.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),En.set(e);const t=n&&z.findByKey(e,"id",n);t?Qn.set(t):e.length&&Qn.set(e.find(i=>!i.system)||e[0]),Iu(),Mu.set(await me.collections.getScaffolds())}catch(e){me.error(e)}gr.set(!1)}function Iu(){G0.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 Q0(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 Iw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a&4&&(u=je(u,vt(l,[Ft(r[2])]))),{props:u}}return s&&(e=jt(s,o(n)),e.$on("routeEvent",n[7])),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a&1&&s!==(s=r[0])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[7]),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a&4?vt(l,[Ft(r[2])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Lw(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<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a&6&&(u=je(u,vt(l,[a&2&&{params:r[1]},a&4&&Ft(r[2])]))),{props:u}}return s&&(e=jt(s,o(n)),e.$on("routeEvent",n[6])),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a&1&&s!==(s=r[0])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),e.$on("routeEvent",r[6]),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a&6?vt(l,[a&2&&{params:r[1]},a&4&&Ft(r[2])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Aw(n){let e,t,i,l;const s=[Lw,Iw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(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=z0(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});U0(qr,n=>n.location);const Lu=U0(qr,n=>n.querystring),ac=qn(void 0);async function Il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await fn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function Un(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function Pw(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||Nw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Nw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Rw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(E,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!E||typeof E=="string"&&(E.length<1||E.charAt(0)!="/"&&E.charAt(0)!="*")||typeof E=="object"&&!(E instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=Q0(E);this.path=E,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(E){if(l){if(typeof l=="string")if(E.startsWith(l))E=E.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=E.match(l);if(A&&A[0])E=E.substr(A[0].length)||"/";else return null}}const M=this._pattern.exec(E);if(M===null)return null;if(this._keys===!1)return M;const L={};let I=0;for(;I<this._keys.length;){try{L[this._keys[I]]=decodeURIComponent(M[I+1]||"")||null}catch{L[this._keys[I]]=null}I++}return L}async checkConditions(E){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](E))return!1;return!0}}const r=[];i instanceof Map?i.forEach(($,E)=>{r.push(new o(E,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=gt();async function d($,E){await fn(),c($,E)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),Mk(()=>{Pw(m)}));let g=null,_=null;const y=qr.subscribe(async $=>{g=$;let E=0;for(;E<r.length;){const M=r[E].match($.location);if(!M){E++;continue}const L={route:r[E].path,location:$.location,querystring:$.querystring,userData:r[E].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await r[E].checkConditions(L)){t(0,a=null),_=null,d("conditionsFailed",L);return}d("routeLoading",Object.assign({},L));const I=r[E].component;if(_!=I){I.loading?(t(0,a=I.loading),_=I,t(1,u=I.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u}))):(t(0,a=null),_=null);const A=await I();if($!=g)return;t(0,a=A&&A.default||A),_=I}M&&typeof M=="object"&&Object.keys(M).length?t(1,u=M):t(1,u=null),t(2,f=r[E].props),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u})).then(()=>{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});so(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Pe.call(this,n,$)}function T($){Pe.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,T]}class Fw extends ye{constructor(e){super(),be(this,e,Rw,Aw,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";fo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Il("/login")};fo.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&&$i(s),z.isEmpty(l.data)||Wt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Il("/")};fo.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Eb(G0);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 qw extends Y0{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 fo("../",new qw);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 nr=[];let x0;function ey(n){const e=n.pattern.test(x0);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=>{x0=n.location+(n.querystring?"?"+n.querystring:""),nr.map(ey)});function Ri(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"?Q0(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),ey(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const Hw="modulepreload",jw=function(n,e){return new URL(n,e).href},dc={},Ot=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=jw(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 g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":Hw,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(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)})},zw=n=>({}),pc=n=>({});function mc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.0-rc3",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){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(k(e),k(t),k(i),k(l),k(s))}}}function Uw(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=Lt(a,n,n[3],null),f=n[4].footer,c=Lt(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]),x(e,"center-content",n[0])},m(h,g){v(h,e,g),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,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?At(a,h[3],g,null):Nt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?At(f,h[3],g,zw):Nt(h[3]),pc),(_=h[2])!=null&&_.id?d||(d=mc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",h[0])},i(h){r||(O(u,h),O(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&k(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function Vw(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 di extends ye{constructor(e){super(),be(this,e,Vw,Uw,_e,{center:0,class:1})}}function hc(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/> <span class="txt">Pocket<strong>Base</strong></span></figure>',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function Bw(n){let e,t,i,l=!n[0]&&hc();const s=n[1].default,o=Lt(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){v(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)&&Pt(o,s,r,r[2],i?At(s,r[2],a,null):Nt(r[2]),null)},i(r){i||(O(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&k(e),l&&l.d(),o&&o.d(r)}}}function Ww(n){let e,t;return e=new di({props:{class:"full-page",center:!0,$$slots:{default:[Bw]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Yw(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 ty extends ye{constructor(e){super(),be(this,e,Yw,Ww,_e,{nobranding:0})}}function _c(n,e,t){const i=n.slice();return i[12]=e[t],i}const Kw=n=>({}),gc=n=>({uniqueId:n[4]});function Jw(n){let e,t,i=pe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=bc(_c(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ge()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);v(o,e,r),t=!0},p(o,r){if(r&8){i=pe(o[3]);let a;for(a=0;a<i.length;a+=1){const u=_c(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=bc(u),l[a].c(),O(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function Zw(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon inline-error-icon")},m(a,u){v(a,e,u),w(e,t),s=!0,o||(r=Me(i=He.call(null,t,{position:"left",text:n[3].map(br).join(`
 `)})),o=!0)},p(a,u){i&&Rt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(br).join(`
-`)})},i(a){s||(a&&nt(()=>{s&&(l||(l=ze(t,Mt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=ze(t,Mt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&k(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=Y(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(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])+"")&&ue(l,i)},i(a){r||(a&&nt(()=>{r&&(o||(o=ze(e,wt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=ze(e,wt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Gw(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],gc),f=[Zw,Jw],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]),x(e,"error",n[3].length)},m(m,h){v(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)&&Pt(u,a,m,m[8],s?At(a,m[8],h,Kw):Nt(m[8]),gc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),O(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(O(u,m),O(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const yc="Invalid value";function br(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||yc:n||yc}function Xw(n,e,t){let i;Qe(n,Sn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){fi(r)}Yt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=z.toArray(z.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends ye{constructor(e){super(),be(this,e,Xw,Gw,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Qw(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function xw(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[3]),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function e3(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function t3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T;return l=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[Qw,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[xw,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[e3,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first superuser account in order to continue</h4>",i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),f=b("button"),f.innerHTML='<span class="txt">Create superuser and login</span> <i class="ri-arrow-right-line"></i>',c=C(),d=b("hr"),m=C(),h=b("label"),h.innerHTML='<i class="ri-upload-cloud-line"></i> <span class="txt">Or initialize from backup</span>',g=C(),_=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"),x(f,"btn-disabled",n[6]),x(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"),x(h,"btn-disabled",n[6]),x(h,"btn-loading",n[1]),p(_,"id","backupFileInput"),p(_,"type","file"),p(_,"class","hidden"),p(_,"accept",".zip")},m($,E){v($,e,E),w(e,t),w(e,i),F(l,e,null),w(e,s),F(o,e,null),w(e,r),F(a,e,null),w(e,u),w(e,f),v($,c,E),v($,d,E),v($,m,E),v($,h,E),v($,g,E),v($,_,E),n[12](_),y=!0,S||(T=[B(e,"submit",tt(n[7])),B(_,"change",n[13])],S=!0)},p($,[E]){const M={};E&393220&&(M.$$scope={dirty:E,ctx:$}),l.$set(M);const L={};E&393224&&(L.$$scope={dirty:E,ctx:$}),o.$set(L);const I={};E&393232&&(I.$$scope={dirty:E,ctx:$}),a.$set(I),(!y||E&64)&&x(f,"btn-disabled",$[6]),(!y||E&1)&&x(f,"btn-loading",$[0]),(!y||E&64)&&x(h,"btn-disabled",$[6]),(!y||E&2)&&x(h,"btn-loading",$[1])},i($){y||(O(l.$$.fragment,$),O(o.$$.fragment,$),O(a.$$.fragment,$),y=!0)},o($){D(l.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),y=!1},d($){$&&(k(e),k(c),k(d),k(m),k(h),k(g),k(_)),q(l),q(o),q(a),n[12](null),S=!1,De(T)}}}function n3(n,e,t){let i;const l=_t();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($){me.error($)}t(0,a=!1)}}function d(){f&&t(5,f.value="",f)}function m($){$&&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&&nt(()=>{s&&(l||(l=ze(t,Mt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=ze(t,Mt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&k(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=Y(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(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])+"")&&ue(l,i)},i(a){r||(a&&nt(()=>{r&&(o||(o=ze(e,wt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=ze(e,wt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Gw(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],gc),f=[Zw,Jw],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]),x(e,"error",n[3].length)},m(m,h){v(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)&&Pt(u,a,m,m[8],s?At(a,m[8],h,Kw):Nt(m[8]),gc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),O(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(O(u,m),O(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const yc="Invalid value";function br(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||yc:n||yc}function Xw(n,e,t){let i;Qe(n,Sn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){fi(r)}Yt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=z.toArray(z.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends ye{constructor(e){super(),be(this,e,Xw,Gw,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Qw(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function xw(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[3]),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function e3(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function t3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T;return l=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[Qw,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[xw,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[e3,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first superuser account in order to continue</h4>",i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),f=b("button"),f.innerHTML='<span class="txt">Create superuser and login</span> <i class="ri-arrow-right-line"></i>',c=C(),d=b("hr"),m=C(),h=b("label"),h.innerHTML='<i class="ri-upload-cloud-line"></i> <span class="txt">Or initialize from backup</span>',g=C(),_=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"),x(f,"btn-disabled",n[6]),x(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"),x(h,"btn-disabled",n[6]),x(h,"btn-loading",n[1]),p(_,"id","backupFileInput"),p(_,"type","file"),p(_,"class","hidden"),p(_,"accept",".zip")},m($,E){v($,e,E),w(e,t),w(e,i),F(l,e,null),w(e,s),F(o,e,null),w(e,r),F(a,e,null),w(e,u),w(e,f),v($,c,E),v($,d,E),v($,m,E),v($,h,E),v($,g,E),v($,_,E),n[12](_),y=!0,S||(T=[B(e,"submit",tt(n[7])),B(_,"change",n[13])],S=!0)},p($,[E]){const M={};E&393220&&(M.$$scope={dirty:E,ctx:$}),l.$set(M);const L={};E&393224&&(L.$$scope={dirty:E,ctx:$}),o.$set(L);const I={};E&393232&&(I.$$scope={dirty:E,ctx:$}),a.$set(I),(!y||E&64)&&x(f,"btn-disabled",$[6]),(!y||E&1)&&x(f,"btn-loading",$[0]),(!y||E&64)&&x(h,"btn-disabled",$[6]),(!y||E&2)&&x(h,"btn-loading",$[1])},i($){y||(O(l.$$.fragment,$),O(o.$$.fragment,$),O(a.$$.fragment,$),y=!0)},o($){D(l.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),y=!1},d($){$&&(k(e),k(c),k(d),k(m),k(h),k(g),k(_)),q(l),q(o),q(a),n[12](null),S=!1,De(T)}}}function n3(n,e,t){let i;const l=gt();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($){me.error($)}t(0,a=!1)}}function d(){f&&t(5,f.value="",f)}function m($){$&&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 "${$.name}"?`,()=>{h($)},()=>{d()})}async function h($){if(!(!$||i)){t(1,u=!0);try{await me.backups.upload({file:$}),await me.backups.restore($.name),Ys("Please wait while extracting the uploaded archive!"),await new Promise(E=>setTimeout(E,2e3)),l("submit")}catch(E){me.error(E)}d(),t(1,u=!1)}}function g(){s=this.value,t(2,s)}function _(){o=this.value,t(3,o)}function y(){r=this.value,t(4,r)}function S($){ie[$?"unshift":"push"](()=>{f=$,t(5,f)})}const T=$=>{var E,M;m((M=(E=$.target)==null?void 0:E.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,_,y,S,T]}class i3 extends ye{constructor(e){super(),be(this,e,n3,t3,_e,{})}}function kc(n){let e,t;return e=new ty({props:{$$slots:{default:[l3]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function l3(n){let e,t;return e=new i3({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p:te,i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s3(n){let e,t,i=n[0]&&kc(n);return{c(){i&&i.c(),e=ge()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&O(i,1)):(i=kc(l),i.c(),O(i,1),i.m(e.parentNode,e)):i&&(re(),D(i,1,1,()=>{i=null}),ae())},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function o3(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 fn(),window.location.search=""}]}class r3 extends ye{constructor(e){super(),be(this,e,o3,s3,_e,{})}}function a3(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){v(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&&k(e),n[13](null),i=!1,l()}}}function u3(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(()=>ve(e,"value",s)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{q(f,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),e.$on("submit",a[10]),H(e.$$.fragment),O(e.$$.fragment,1),F(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],$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function vc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=ze(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end()}}}function wc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',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){v(o,e,r),i=!0,l||(s=B(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function f3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[u3,a3],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&vc(),_=(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(),g&&g.c(),a=C(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){v(y,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),g&&g.m(e,null),w(e,a),_&&_.m(e,null),u=!0,f||(c=[B(e,"click",On(n[11])),B(e,"submit",tt(n[10]))],f=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(re(),D(m[T],1,1,()=>{m[T]=null}),ae(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),O(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?g?S&129&&O(g,1):(g=vc(),g.c(),O(g,1),g.m(e,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&O(_,1)):(_=wc(y),_.c(),O(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(y){u||(O(o),O(g),O(_),u=!0)},o(y){D(o),D(g),D(_),u=!1},d(y){y&&k(e),m[s].d(),g&&g.d(),_&&_.d(),f=!1,De(c)}}}function c3(n,e,t){const i=_t(),l="search_"+z.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(E=!0){t(7,d=""),E&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Ot(async()=>{const{default:E}=await import("./FilterAutocompleteInput-HCvPk0wu.js");return{default:E}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Yt(()=>{g()});function _(E){Pe.call(this,n,E)}function y(E){d=E,t(7,d),t(0,s)}function S(E){ie[E?"unshift":"push"](()=>{c=E,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=E=>{"value"in E&&t(0,s=E.value),"placeholder"in E&&t(1,o=E.placeholder),"autocompleteCollection"in E&&t(2,r=E.autocompleteCollection),"extraAutocompleteKeys"in E&&t(3,a=E.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,y,S,T,$]}class Hr extends ye{constructor(e){super(),be(this,e,c3,f3,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function d3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){v(r,e,a),w(e,t),s||(o=[Me(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&&Rt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:te,o:te,d(r){r&&k(e),s=!1,De(o)}}}function p3(n,e,t){const i=_t();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 Yt(()=>()=>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 ye{constructor(e){super(),be(this,e,p3,d3,_e,{tooltip:0,class:1})}}const m3=n=>({}),Sc=n=>({}),h3=n=>({}),Tc=n=>({});function _3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],Tc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(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,_){v(g,e,_),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||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,h3):Nt(g[10]),Tc),d&&d.p&&(!o||_&1024)&&Pt(d,c,g,g[10],o?At(c,g[10],_,null):Nt(g[10]),null),(!o||_&9&&l!==(l="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||_&1024)&&Pt(h,m,g,g[10],o?At(m,g[10],_,m3):Nt(g[10]),Sc)},i(g){o||(O(f,g),O(d,g),O(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&k(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,De(a)}}}function g3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=_t();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function T(){f&&t(2,f.scrollLeft=0,f)}function $(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&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>=g&&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 E(){d||(d=setTimeout(()=>{$(),d=null},150))}Yt(()=>(E(),y=new MutationObserver(E),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.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,E,f,c,r,a,u,S,T,$,l,i,M]}class Pu extends ye{constructor(e){super(),be(this,e,g3,_3,_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 b3(n){let e,t,i,l,s;const o=n[6].default,r=Lt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){v(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)&&Pt(r,o,a,a[5],i?At(o,a[5],u,null):Nt(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)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(O(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,De(s)}}}function y3(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 ir extends ye{constructor(e){super(),be(this,e,y3,b3,_e,{class:1,name:2,sort:0,disable:3})}}function k3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Me(He.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&ue(i,t)},i:te,o:te,d(o){o&&k(e),l=!1,s()}}}function v3(n,e,t){let{date:i}=e;const l={get text(){return z.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 ny extends ye{constructor(e){super(),be(this,e,v3,k3,_e,{date:0})}}function w3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Y(i),s=Y(" ("),o=Y(n[0]),r=Y(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){v(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")+"")&&ue(l,i),f&1&&ue(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&&k(e)}}}function S3(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=q0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class iy extends ye{constructor(e){super(),be(this,e,S3,w3,_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=N3(i[32]);return i[34]=s,i}function Cc(n,e,t){const i=n.slice();return i[37]=e[t],i}function T3(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){v(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&&k(e),o=!1,r()}}}function $3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function C3(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-bookmark-line"></i> <span class="txt">level</span>',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-file-list-2-line"></i> <span class="txt">message</span>',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function E3(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${z.getFieldTypeIcon("date")} svelte-91v05h"></i> <span class="txt">created</span>`,p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function Oc(n){let e;function t(s,o){return s[7]?D3:M3}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function M3(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){v(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&&k(e),o&&o.d()}}}function D3(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td> '},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function Ec(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[26]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Mc(n){let e,t=pe(n[34]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Dc(Cc(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","flex flex-wrap flex-gap-10 m-t-10")},m(l,s){v(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s[0]&8){t=pe(l[34]);let o;for(o=0;o<t.length;o+=1){const r=Cc(l,t,o);i[o]?i[o].p(r,s):(i[o]=Dc(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function I3(n){let e=n[37].key+"",t,i,l=z.stringifyValue(n[32].data[n[37].key],"N/A",80)+"",s;return{c(){t=Y(e),i=Y(": "),s=Y(l)},m(o,r){v(o,t,r),v(o,i,r),v(o,s,r)},p(o,r){r[0]&8&&e!==(e=o[37].key+"")&&ue(t,e),r[0]&8&&l!==(l=z.stringifyValue(o[32].data[o[37].key],"N/A",80)+"")&&ue(s,l)},d(o){o&&(k(t),k(i),k(s))}}}function L3(n){let e=n[37].key+"",t,i,l=n[32].data[n[37].key]+"",s,o;return{c(){t=Y(e),i=Y(": "),s=Y(l),o=Y("ms")},m(r,a){v(r,t,a),v(r,i,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&8&&e!==(e=r[37].key+"")&&ue(t,e),a[0]&8&&l!==(l=r[32].data[r[37].key]+"")&&ue(s,l)},d(r){r&&(k(t),k(i),k(s),k(o))}}}function Dc(n){let e,t,i;function l(r,a){return r[33]&&r[37].key=="execTime"?L3:I3}let s=l(n),o=s(n);return{c(){e=b("span"),o.c(),t=C(),p(e,"class",i="label label-sm "+(n[37].label||"")+" svelte-91v05h")},m(r,a){v(r,e,a),o.m(e,null),w(e,t)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,t))),a[0]&8&&i!==(i="label label-sm "+(r[37].label||"")+" svelte-91v05h")&&p(e,"class",i)},d(r){r&&k(e),o.d()}}}function Ic(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=e[32].message+"",T,$,E,M,L,I,A,P,R,N,U;function j(){return e[23](e[32])}m=new iy({props:{level:e[32].level}});let V=e[34].length&&Mc(e);L=new ny({props:{date:e[32].created}});function K(){return e[24](e[32])}function J(...ee){return e[25](e[32],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=C(),u=b("label"),c=C(),d=b("td"),H(m.$$.fragment),h=C(),g=b("td"),_=b("div"),y=b("span"),T=Y(S),$=C(),V&&V.c(),E=C(),M=b("td"),H(L.$$.fragment),I=C(),A=b("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',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(y,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"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(ee,X){v(ee,t,X),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),F(m,d,null),w(t,h),w(t,g),w(g,_),w(_,y),w(y,T),w(g,$),V&&V.m(g,null),w(t,E),w(t,M),F(L,M,null),w(t,I),w(t,A),w(t,P),R=!0,N||(U=[B(s,"change",j),B(l,"click",On(e[18])),B(t,"click",K),B(t,"keydown",J)],N=!0)},p(ee,X){e=ee,(!R||X[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!R||X[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!R||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),(!R||X[0]&8)&&S!==(S=e[32].message+"")&&ue(T,S),e[34].length?V?V.p(e,X):(V=Mc(e),V.c(),V.m(g,null)):V&&(V.d(1),V=null);const Se={};X[0]&8&&(Se.date=e[32].created),L.$set(Se)},i(ee){R||(O(m.$$.fragment,ee),O(L.$$.fragment,ee),R=!0)},o(ee){D(m.$$.fragment,ee),D(L.$$.fragment,ee),R=!1},d(ee){ee&&k(t),q(m),V&&V.d(),q(L),N=!1,De(U)}}}function A3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=[],T=new Map,$;function E(J,ee){return J[7]?$3:T3}let M=E(n),L=M(n);function I(J){n[20](J)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[C3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>ve(o,"sort",I));function P(J){n[21](J)}let R={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[O3]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),u=new ir({props:R}),ie.push(()=>ve(u,"sort",P));function N(J){n[22](J)}let U={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[E3]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),d=new ir({props:U}),ie.push(()=>ve(d,"sort",N));let j=pe(n[3]);const V=J=>J[32].id;for(let J=0;J<j.length;J+=1){let ee=$c(n,j,J),X=V(ee);T.set(X,S[J]=Ic(X,ee))}let K=null;return j.length||(K=Oc(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),l=b("th"),L.c(),s=C(),H(o.$$.fragment),a=C(),H(u.$$.fragment),c=C(),H(d.$$.fragment),h=C(),g=b("th"),_=C(),y=b("tbody");for(let J=0;J<S.length;J+=1)S[J].c();K&&K.c(),p(l,"class","bulk-select-col min-width"),p(g,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[7])},m(J,ee){v(J,e,ee),w(e,t),w(t,i),w(i,l),L.m(l,null),w(i,s),F(o,i,null),w(i,a),F(u,i,null),w(i,c),F(d,i,null),w(i,h),w(i,g),w(e,_),w(e,y);for(let X=0;X<S.length;X+=1)S[X]&&S[X].m(y,null);K&&K.m(y,null),$=!0},p(J,ee){M===(M=E(J))&&L?L.p(J,ee):(L.d(1),L=M(J),L&&(L.c(),L.m(l,null)));const X={};ee[1]&512&&(X.$$scope={dirty:ee,ctx:J}),!r&&ee[0]&2&&(r=!0,X.sort=J[1],$e(()=>r=!1)),o.$set(X);const oe={};ee[1]&512&&(oe.$$scope={dirty:ee,ctx:J}),!f&&ee[0]&2&&(f=!0,oe.sort=J[1],$e(()=>f=!1)),u.$set(oe);const Se={};ee[1]&512&&(Se.$$scope={dirty:ee,ctx:J}),!m&&ee[0]&2&&(m=!0,Se.sort=J[1],$e(()=>m=!1)),d.$set(Se),ee[0]&9369&&(j=pe(J[3]),re(),S=kt(S,ee,V,1,J,j,T,y,zt,Ic,null,$c),ae(),!j.length&&K?K.p(J,ee):j.length?K&&(K.d(1),K=null):(K=Oc(J),K.c(),K.m(y,null))),(!$||ee[0]&128)&&x(e,"table-loading",J[7])},i(J){if(!$){O(o.$$.fragment,J),O(u.$$.fragment,J),O(d.$$.fragment,J);for(let ee=0;ee<j.length;ee+=1)O(S[ee]);$=!0}},o(J){D(o.$$.fragment,J),D(u.$$.fragment,J),D(d.$$.fragment,J);for(let ee=0;ee<S.length;ee+=1)D(S[ee]);$=!1},d(J){J&&k(e),L.d(),q(o),q(u),q(d);for(let ee=0;ee<S.length;ee+=1)S[ee].d();K&&K.d()}}}function Lc(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<span class="txt">Load more</span>',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){v(s,e,o),w(e,t),i||(l=B(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&k(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,_,y,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[5]),o=C(),a=Y(r),u=C(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='<span class="txt">Download as JSON</span>',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,$){v(T,e,$),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),_=!0,y||(S=[B(f,"click",n[28]),B(h,"click",n[14])],y=!0)},p(T,$){(!_||$[0]&32)&&ue(s,T[5]),(!_||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&ue(a,r)},i(T){_||(T&&nt(()=>{_&&(g||(g=ze(e,Fn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(T){T&&(g||(g=ze(e,Fn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(T){T&&k(e),T&&g&&g.end(),y=!1,De(S)}}}function P3(n){let e,t,i,l,s;e=new Pu({props:{class:"table-wrapper",$$slots:{default:[A3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Lc(n),r=n[5]&&Ac(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ge()},m(a,u){F(e,a,u),v(a,t,u),o&&o.m(a,u),v(a,i,u),r&&r.m(a,u),v(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&&O(r,1)):(r=Ac(a),r.c(),O(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(O(e.$$.fragment,a),O(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(k(t),k(i),k(l)),q(e,a),o&&o.d(a),r&&r.d(a)}}}const Pc=50,aa=/[-:\. ]/gi;function N3(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 R3(n,e,t){let i,l,s;const o=_t();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function y(X=1,oe=!0){t(7,h=!0);const Se=[a,z.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 ke=>{var We;X<=1&&S();const Ce=z.toArray(ke.items);if(t(7,h=!1),t(6,d=ke.page),t(17,m=((We=ke.items)==null?void 0:We.length)||0),o("load",c.concat(Ce)),oe){const st=++g;for(;Ce.length&&g==st;){const et=Ce.splice(0,10);for(let Be of et)z.pushOrReplaceByKey(c,Be);t(3,c),await z.yieldToMain()}}else{for(let st of Ce)z.pushOrReplaceByKey(c,st);t(3,c)}}).catch(ke=>{ke!=null&&ke.isAbort||(t(7,h=!1),console.warn(ke),S(),me.error(ke,!Se||(ke==null?void 0:ke.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function T(){s?$():E()}function $(){t(4,_={})}function E(){for(const X of c)t(4,_[X.id]=X,_);t(4,_)}function M(X){_[X.id]?delete _[X.id]:t(4,_[X.id]=X,_),t(4,_)}function L(){const X=Object.values(_).sort((ke,Ce)=>ke.created<Ce.created?1:ke.created>Ce.created?-1:0);if(!X.length)return;if(X.length==1)return z.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 z.downloadJson(X,`${X.length}_logs_${Se}_to_${oe}.json`)}function I(X){Pe.call(this,n,X)}const A=()=>T();function P(X){f=X,t(1,f)}function R(X){f=X,t(1,f)}function N(X){f=X,t(1,f)}const U=X=>M(X),j=X=>o("select",X),V=(X,oe)=>{oe.code==="Enter"&&(oe.preventDefault(),o("select",X))},K=()=>t(0,r=""),J=()=>y(d+1),ee=()=>$();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(),y(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Pc),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,y,c,_,l,d,h,s,i,o,T,$,M,L,a,u,m,I,A,P,R,N,U,j,V,K,J,ee]}class F3 extends ye{constructor(e){super(),be(this,e,R3,P3,_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 "${$.name}"?`,()=>{h($)},()=>{d()})}async function h($){if(!(!$||i)){t(1,u=!0);try{await me.backups.upload({file:$}),await me.backups.restore($.name),Ys("Please wait while extracting the uploaded archive!"),await new Promise(E=>setTimeout(E,2e3)),l("submit")}catch(E){me.error(E)}d(),t(1,u=!1)}}function g(){s=this.value,t(2,s)}function _(){o=this.value,t(3,o)}function y(){r=this.value,t(4,r)}function S($){ie[$?"unshift":"push"](()=>{f=$,t(5,f)})}const T=$=>{var E,M;m((M=(E=$.target)==null?void 0:E.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,_,y,S,T]}class i3 extends ye{constructor(e){super(),be(this,e,n3,t3,_e,{})}}function kc(n){let e,t;return e=new ty({props:{$$slots:{default:[l3]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function l3(n){let e,t;return e=new i3({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p:te,i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s3(n){let e,t,i=n[0]&&kc(n);return{c(){i&&i.c(),e=ge()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&O(i,1)):(i=kc(l),i.c(),O(i,1),i.m(e.parentNode,e)):i&&(re(),D(i,1,1,()=>{i=null}),ae())},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function o3(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 fn(),window.location.search=""}]}class r3 extends ye{constructor(e){super(),be(this,e,o3,s3,_e,{})}}function a3(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){v(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&&k(e),n[13](null),i=!1,l()}}}function u3(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(()=>ve(e,"value",s)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{q(f,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),e.$on("submit",a[10]),H(e.$$.fragment),O(e.$$.fragment,1),F(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],$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function vc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=ze(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end()}}}function wc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',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){v(o,e,r),i=!0,l||(s=B(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function f3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[u3,a3],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&vc(),_=(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(),g&&g.c(),a=C(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){v(y,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),g&&g.m(e,null),w(e,a),_&&_.m(e,null),u=!0,f||(c=[B(e,"click",On(n[11])),B(e,"submit",tt(n[10]))],f=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(re(),D(m[T],1,1,()=>{m[T]=null}),ae(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),O(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?g?S&129&&O(g,1):(g=vc(),g.c(),O(g,1),g.m(e,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&O(_,1)):(_=wc(y),_.c(),O(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(y){u||(O(o),O(g),O(_),u=!0)},o(y){D(o),D(g),D(_),u=!1},d(y){y&&k(e),m[s].d(),g&&g.d(),_&&_.d(),f=!1,De(c)}}}function c3(n,e,t){const i=gt(),l="search_"+z.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(E=!0){t(7,d=""),E&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Ot(async()=>{const{default:E}=await import("./FilterAutocompleteInput-D8GkPlZA.js");return{default:E}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Yt(()=>{g()});function _(E){Pe.call(this,n,E)}function y(E){d=E,t(7,d),t(0,s)}function S(E){ie[E?"unshift":"push"](()=>{c=E,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=E=>{"value"in E&&t(0,s=E.value),"placeholder"in E&&t(1,o=E.placeholder),"autocompleteCollection"in E&&t(2,r=E.autocompleteCollection),"extraAutocompleteKeys"in E&&t(3,a=E.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,y,S,T,$]}class Hr extends ye{constructor(e){super(),be(this,e,c3,f3,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function d3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){v(r,e,a),w(e,t),s||(o=[Me(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&&Rt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:te,o:te,d(r){r&&k(e),s=!1,De(o)}}}function p3(n,e,t){const i=gt();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 Yt(()=>()=>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 ye{constructor(e){super(),be(this,e,p3,d3,_e,{tooltip:0,class:1})}}const m3=n=>({}),Sc=n=>({}),h3=n=>({}),Tc=n=>({});function _3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],Tc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(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,_){v(g,e,_),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||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,h3):Nt(g[10]),Tc),d&&d.p&&(!o||_&1024)&&Pt(d,c,g,g[10],o?At(c,g[10],_,null):Nt(g[10]),null),(!o||_&9&&l!==(l="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||_&1024)&&Pt(h,m,g,g[10],o?At(m,g[10],_,m3):Nt(g[10]),Sc)},i(g){o||(O(f,g),O(d,g),O(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&k(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,De(a)}}}function g3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=gt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function T(){f&&t(2,f.scrollLeft=0,f)}function $(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&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>=g&&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 E(){d||(d=setTimeout(()=>{$(),d=null},150))}Yt(()=>(E(),y=new MutationObserver(E),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.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,E,f,c,r,a,u,S,T,$,l,i,M]}class Pu extends ye{constructor(e){super(),be(this,e,g3,_3,_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 b3(n){let e,t,i,l,s;const o=n[6].default,r=Lt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){v(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)&&Pt(r,o,a,a[5],i?At(o,a[5],u,null):Nt(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)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(O(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,De(s)}}}function y3(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 ir extends ye{constructor(e){super(),be(this,e,y3,b3,_e,{class:1,name:2,sort:0,disable:3})}}function k3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Me(He.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&ue(i,t)},i:te,o:te,d(o){o&&k(e),l=!1,s()}}}function v3(n,e,t){let{date:i}=e;const l={get text(){return z.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 ny extends ye{constructor(e){super(),be(this,e,v3,k3,_e,{date:0})}}function w3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Y(i),s=Y(" ("),o=Y(n[0]),r=Y(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){v(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")+"")&&ue(l,i),f&1&&ue(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&&k(e)}}}function S3(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=q0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class iy extends ye{constructor(e){super(),be(this,e,S3,w3,_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=N3(i[32]);return i[34]=s,i}function Cc(n,e,t){const i=n.slice();return i[37]=e[t],i}function T3(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){v(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&&k(e),o=!1,r()}}}function $3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function C3(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-bookmark-line"></i> <span class="txt">level</span>',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-file-list-2-line"></i> <span class="txt">message</span>',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function E3(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${z.getFieldTypeIcon("date")} svelte-91v05h"></i> <span class="txt">created</span>`,p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function Oc(n){let e;function t(s,o){return s[7]?D3:M3}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function M3(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){v(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&&k(e),o&&o.d()}}}function D3(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td> '},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function Ec(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[26]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Mc(n){let e,t=pe(n[34]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Dc(Cc(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","flex flex-wrap flex-gap-10 m-t-10")},m(l,s){v(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s[0]&8){t=pe(l[34]);let o;for(o=0;o<t.length;o+=1){const r=Cc(l,t,o);i[o]?i[o].p(r,s):(i[o]=Dc(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function I3(n){let e=n[37].key+"",t,i,l=z.stringifyValue(n[32].data[n[37].key],"N/A",80)+"",s;return{c(){t=Y(e),i=Y(": "),s=Y(l)},m(o,r){v(o,t,r),v(o,i,r),v(o,s,r)},p(o,r){r[0]&8&&e!==(e=o[37].key+"")&&ue(t,e),r[0]&8&&l!==(l=z.stringifyValue(o[32].data[o[37].key],"N/A",80)+"")&&ue(s,l)},d(o){o&&(k(t),k(i),k(s))}}}function L3(n){let e=n[37].key+"",t,i,l=n[32].data[n[37].key]+"",s,o;return{c(){t=Y(e),i=Y(": "),s=Y(l),o=Y("ms")},m(r,a){v(r,t,a),v(r,i,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&8&&e!==(e=r[37].key+"")&&ue(t,e),a[0]&8&&l!==(l=r[32].data[r[37].key]+"")&&ue(s,l)},d(r){r&&(k(t),k(i),k(s),k(o))}}}function Dc(n){let e,t,i;function l(r,a){return r[33]&&r[37].key=="execTime"?L3:I3}let s=l(n),o=s(n);return{c(){e=b("span"),o.c(),t=C(),p(e,"class",i="label label-sm "+(n[37].label||"")+" svelte-91v05h")},m(r,a){v(r,e,a),o.m(e,null),w(e,t)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,t))),a[0]&8&&i!==(i="label label-sm "+(r[37].label||"")+" svelte-91v05h")&&p(e,"class",i)},d(r){r&&k(e),o.d()}}}function Ic(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=e[32].message+"",T,$,E,M,L,I,A,P,R,N,U;function j(){return e[23](e[32])}m=new iy({props:{level:e[32].level}});let V=e[34].length&&Mc(e);L=new ny({props:{date:e[32].created}});function K(){return e[24](e[32])}function J(...ee){return e[25](e[32],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=C(),u=b("label"),c=C(),d=b("td"),H(m.$$.fragment),h=C(),g=b("td"),_=b("div"),y=b("span"),T=Y(S),$=C(),V&&V.c(),E=C(),M=b("td"),H(L.$$.fragment),I=C(),A=b("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',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(y,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"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(ee,X){v(ee,t,X),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),F(m,d,null),w(t,h),w(t,g),w(g,_),w(_,y),w(y,T),w(g,$),V&&V.m(g,null),w(t,E),w(t,M),F(L,M,null),w(t,I),w(t,A),w(t,P),R=!0,N||(U=[B(s,"change",j),B(l,"click",On(e[18])),B(t,"click",K),B(t,"keydown",J)],N=!0)},p(ee,X){e=ee,(!R||X[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!R||X[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!R||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),(!R||X[0]&8)&&S!==(S=e[32].message+"")&&ue(T,S),e[34].length?V?V.p(e,X):(V=Mc(e),V.c(),V.m(g,null)):V&&(V.d(1),V=null);const Se={};X[0]&8&&(Se.date=e[32].created),L.$set(Se)},i(ee){R||(O(m.$$.fragment,ee),O(L.$$.fragment,ee),R=!0)},o(ee){D(m.$$.fragment,ee),D(L.$$.fragment,ee),R=!1},d(ee){ee&&k(t),q(m),V&&V.d(),q(L),N=!1,De(U)}}}function A3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=[],T=new Map,$;function E(J,ee){return J[7]?$3:T3}let M=E(n),L=M(n);function I(J){n[20](J)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[C3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>ve(o,"sort",I));function P(J){n[21](J)}let R={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[O3]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),u=new ir({props:R}),ie.push(()=>ve(u,"sort",P));function N(J){n[22](J)}let U={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[E3]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),d=new ir({props:U}),ie.push(()=>ve(d,"sort",N));let j=pe(n[3]);const V=J=>J[32].id;for(let J=0;J<j.length;J+=1){let ee=$c(n,j,J),X=V(ee);T.set(X,S[J]=Ic(X,ee))}let K=null;return j.length||(K=Oc(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),l=b("th"),L.c(),s=C(),H(o.$$.fragment),a=C(),H(u.$$.fragment),c=C(),H(d.$$.fragment),h=C(),g=b("th"),_=C(),y=b("tbody");for(let J=0;J<S.length;J+=1)S[J].c();K&&K.c(),p(l,"class","bulk-select-col min-width"),p(g,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[7])},m(J,ee){v(J,e,ee),w(e,t),w(t,i),w(i,l),L.m(l,null),w(i,s),F(o,i,null),w(i,a),F(u,i,null),w(i,c),F(d,i,null),w(i,h),w(i,g),w(e,_),w(e,y);for(let X=0;X<S.length;X+=1)S[X]&&S[X].m(y,null);K&&K.m(y,null),$=!0},p(J,ee){M===(M=E(J))&&L?L.p(J,ee):(L.d(1),L=M(J),L&&(L.c(),L.m(l,null)));const X={};ee[1]&512&&(X.$$scope={dirty:ee,ctx:J}),!r&&ee[0]&2&&(r=!0,X.sort=J[1],$e(()=>r=!1)),o.$set(X);const oe={};ee[1]&512&&(oe.$$scope={dirty:ee,ctx:J}),!f&&ee[0]&2&&(f=!0,oe.sort=J[1],$e(()=>f=!1)),u.$set(oe);const Se={};ee[1]&512&&(Se.$$scope={dirty:ee,ctx:J}),!m&&ee[0]&2&&(m=!0,Se.sort=J[1],$e(()=>m=!1)),d.$set(Se),ee[0]&9369&&(j=pe(J[3]),re(),S=kt(S,ee,V,1,J,j,T,y,zt,Ic,null,$c),ae(),!j.length&&K?K.p(J,ee):j.length?K&&(K.d(1),K=null):(K=Oc(J),K.c(),K.m(y,null))),(!$||ee[0]&128)&&x(e,"table-loading",J[7])},i(J){if(!$){O(o.$$.fragment,J),O(u.$$.fragment,J),O(d.$$.fragment,J);for(let ee=0;ee<j.length;ee+=1)O(S[ee]);$=!0}},o(J){D(o.$$.fragment,J),D(u.$$.fragment,J),D(d.$$.fragment,J);for(let ee=0;ee<S.length;ee+=1)D(S[ee]);$=!1},d(J){J&&k(e),L.d(),q(o),q(u),q(d);for(let ee=0;ee<S.length;ee+=1)S[ee].d();K&&K.d()}}}function Lc(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<span class="txt">Load more</span>',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){v(s,e,o),w(e,t),i||(l=B(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&k(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,_,y,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[5]),o=C(),a=Y(r),u=C(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='<span class="txt">Download as JSON</span>',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,$){v(T,e,$),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),_=!0,y||(S=[B(f,"click",n[28]),B(h,"click",n[14])],y=!0)},p(T,$){(!_||$[0]&32)&&ue(s,T[5]),(!_||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&ue(a,r)},i(T){_||(T&&nt(()=>{_&&(g||(g=ze(e,Fn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(T){T&&(g||(g=ze(e,Fn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(T){T&&k(e),T&&g&&g.end(),y=!1,De(S)}}}function P3(n){let e,t,i,l,s;e=new Pu({props:{class:"table-wrapper",$$slots:{default:[A3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Lc(n),r=n[5]&&Ac(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ge()},m(a,u){F(e,a,u),v(a,t,u),o&&o.m(a,u),v(a,i,u),r&&r.m(a,u),v(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&&O(r,1)):(r=Ac(a),r.c(),O(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(O(e.$$.fragment,a),O(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(k(t),k(i),k(l)),q(e,a),o&&o.d(a),r&&r.d(a)}}}const Pc=50,aa=/[-:\. ]/gi;function N3(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 R3(n,e,t){let i,l,s;const o=gt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function y(X=1,oe=!0){t(7,h=!0);const Se=[a,z.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 ke=>{var We;X<=1&&S();const Ce=z.toArray(ke.items);if(t(7,h=!1),t(6,d=ke.page),t(17,m=((We=ke.items)==null?void 0:We.length)||0),o("load",c.concat(Ce)),oe){const st=++g;for(;Ce.length&&g==st;){const et=Ce.splice(0,10);for(let Be of et)z.pushOrReplaceByKey(c,Be);t(3,c),await z.yieldToMain()}}else{for(let st of Ce)z.pushOrReplaceByKey(c,st);t(3,c)}}).catch(ke=>{ke!=null&&ke.isAbort||(t(7,h=!1),console.warn(ke),S(),me.error(ke,!Se||(ke==null?void 0:ke.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function T(){s?$():E()}function $(){t(4,_={})}function E(){for(const X of c)t(4,_[X.id]=X,_);t(4,_)}function M(X){_[X.id]?delete _[X.id]:t(4,_[X.id]=X,_),t(4,_)}function L(){const X=Object.values(_).sort((ke,Ce)=>ke.created<Ce.created?1:ke.created>Ce.created?-1:0);if(!X.length)return;if(X.length==1)return z.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 z.downloadJson(X,`${X.length}_logs_${Se}_to_${oe}.json`)}function I(X){Pe.call(this,n,X)}const A=()=>T();function P(X){f=X,t(1,f)}function R(X){f=X,t(1,f)}function N(X){f=X,t(1,f)}const U=X=>M(X),j=X=>o("select",X),V=(X,oe)=>{oe.code==="Enter"&&(oe.preventDefault(),o("select",X))},K=()=>t(0,r=""),J=()=>y(d+1),ee=()=>$();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(),y(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Pc),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,y,c,_,l,d,h,s,i,o,T,$,M,L,a,u,m,I,A,P,R,N,U,j,V,K,J,ee]}class F3 extends ye{constructor(e){super(),be(this,e,R3,P3,_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
@@ -24,14 +24,14 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
  * https://www.chartjs.org
  * (c) 2024 Chart.js Contributors
  * Released under the MIT License
- */function Ii(){}const oS=(()=>{let n=0;return()=>n++})();function Kt(n){return n===null||typeof n>"u"}function un(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 bt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function wn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return wn(n)?n:e}function Ct(n,e){return typeof n>"u"?e:n}const rS=(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 ht(n,e,t,i){let l,s,o;if(un(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(bt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function yr(n,e){let t,i,l,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(l=n[t],s=e[t],l.datasetIndex!==s.datasetIndex||l.index!==s.index)return!1;return!0}function kr(n){if(un(n))return n.map(kr);if(bt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=kr(n[t[l]]);return e}return n}function ry(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function aS(n,e,t,i){if(!ry(n))return;const l=e[n],s=t[n];bt(l)&&bt(s)?Js(l,s,i):e[n]=kr(s)}function Js(n,e,t){const i=un(e)?e:[e],l=i.length;if(!bt(n))return n;t=t||{};const s=t.merger||aS;let o;for(let r=0;r<l;++r){if(o=i[r],!bt(o))continue;const a=Object.keys(o);for(let u=0,f=a.length;u<f;++u)s(a[u],n,o,t)}return n}function Ls(n,e){return Js(n,e,{merger:uS})}function uS(n,e,t){if(!ry(n))return;const i=e[n],l=t[n];bt(i)&&bt(l)?Ls(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=kr(l))}const Hc={"":n=>n,x:n=>n.x,y:n=>n.y};function fS(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 cS(n){const e=fS(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function vr(n,e){return(Hc[e]||(Hc[e]=cS(e)))(n)}function qu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const wr=n=>typeof n<"u",nl=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 dS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const kn=Math.PI,Ti=2*kn,pS=Ti+kn,Sr=Number.POSITIVE_INFINITY,mS=kn/180,oi=kn/2,yl=kn/4,zc=kn*2/3,Ka=Math.log10,il=Math.sign;function As(n,e,t){return Math.abs(n-e)<t}function Uc(n){const e=Math.round(n);n=As(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Ka(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function hS(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((l,s)=>l-s).pop(),e}function Zs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function _S(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function gS(n,e,t){let i,l,s;for(i=0,l=n.length;i<l;i++)s=n[i][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function $l(n){return n*(kn/180)}function bS(n){return n*(180/kn)}function Vc(n){if(!wn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function yS(n,e){const t=e.x-n.x,i=e.y-n.y,l=Math.sqrt(t*t+i*i);let s=Math.atan2(i,t);return s<-.5*kn&&(s+=Ti),{angle:s,distance:l}}function Ja(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function kS(n,e){return(n-e+pS)%Ti-kn}function yi(n){return(n%Ti+Ti)%Ti}function ay(n,e,t,i){const l=yi(n),s=yi(e),o=yi(t),r=yi(s-l),a=yi(o-l),u=yi(l-s),f=yi(l-o);return l===s||l===o||i&&s===o||r>a&&u<f}function ri(n,e,t){return Math.max(e,Math.min(t,n))}function vS(n){return ri(n,-32768,32767)}function uy(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Hu(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>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 s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),wS=(n,e,t)=>Hu(n,t,i=>n[i][e]>=t);function SS(n,e,t){let i=0,l=n.length;for(;i<l&&n[i]<e;)i++;for(;l>i&&n[l-1]>t;)l--;return i>0||l<n.length?n.slice(i,l):n}const fy=["push","pop","shift","splice","unshift"];function TS(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),fy.forEach(t=>{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)&&(fy.forEach(s=>{delete n[s]}),delete n._chartjs)}function $S(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const cy=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function dy(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,cy.call(window,()=>{i=!1,n.apply(e,t)}))}}function CS(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const OS=n=>n==="start"?"left":n==="end"?"right":"center",Wc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ES(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=ri(Math.min(Cl(r,a,u).lo,t?i:Cl(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=ri(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 MS(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 Po=n=>n===0||n===1,Yc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ti/t)),Kc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ti/t)+1,Ps={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*oi)+1,easeOutSine:n=>Math.sin(n*oi),easeInOutSine:n=>-.5*(Math.cos(kn*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=>Po(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=>Po(n)?n:Yc(n,.075,.3),easeOutElastic:n=>Po(n)?n:Kc(n,.075,.3),easeInOutElastic(n){return Po(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-Ps.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?Ps.easeInBounce(n*2)*.5:Ps.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 Ks(n)}function fa(n){return ju(n)?n:new Ks(n).saturate(.5).darken(.1).hexString()}const DS=["x","y","borderWidth","radius","tension"],IS=["color","borderColor","backgroundColor"];function LS(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:IS},numbers:{type:"number",properties:DS}}),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 AS(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Zc=new Map;function PS(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 py(n,e,t){return PS(e,t).format(n)}const my={values(n){return un(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=NS(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),py(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?my.numeric.call(this,n,e,t):""}};function NS(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 hy={formatters:my};function RS(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:hy.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 Ns(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;i<l;++i){const s=t[i];n=n[s]||(n[s]=Object.create(null))}return n}function ca(n,e,t){return typeof e=="string"?Js(Ns(n,e),t):Js(Ns(n,""),e)}class FS{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.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 Ns(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=Ns(this,e),o=Ns(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 bt(a)?Object.assign({},u,a):Ct(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var nn=new FS({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[LS,AS,RS]);function qS(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 kl(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){HS(n,e,t,i)}function HS(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*mS;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:n.arc(t,i,g,0,Ti),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=zc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=zc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+yl)*a,c=Math.cos(_+yl)*a,r=Math.sin(_+yl)*a,d=Math.sin(_+yl)*a,n.arc(t-c,i-r,u,_-kn,_-oi),n.arc(t+d,i-o,u,_-oi,_),n.arc(t+c,i+r,u,_,_+oi),n.arc(t-d,i+o,u,_+oi,_+kn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}_+=yl;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":_+=yl;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),_+=yl,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 Gs(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function zu(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Uu(n){n.restore()}function jS(n,e,t,i,l){if(!e)return n.lineTo(t.x,t.y);if(l==="middle"){const s=(e.x+t.x)/2;n.lineTo(s,e.y),n.lineTo(s,t.y)}else l==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function zS(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function US(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Kt(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function VS(n,e,t,i,l){if(l.strikethrough||l.underline){const s=n.measureText(i),o=e-s.actualBoundingBoxLeft,r=e+s.actualBoundingBoxRight,a=t-s.actualBoundingBoxAscent,u=t+s.actualBoundingBoxDescent,f=l.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=l.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function BS(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function Qc(n,e,t,i,l,s={}){const o=un(e)?e:[e],r=s.strokeWidth>0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,US(n,s),a=0;a<o.length;++a)u=o[a],s.backdrop&&BS(n,s.backdrop),r&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Kt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(u,t,i,s.maxWidth)),n.fillText(u,t,i,s.maxWidth),VS(n,t,i,u,s),i+=Number(l.lineHeight);n.restore()}function xc(n,e){const{x:t,y:i,w:l,h:s,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,1.5*kn,kn,!0),n.lineTo(t,i+s-o.bottomLeft),n.arc(t+o.bottomLeft,i+s-o.bottomLeft,o.bottomLeft,kn,oi,!0),n.lineTo(t+l-o.bottomRight,i+s),n.arc(t+l-o.bottomRight,i+s-o.bottomRight,o.bottomRight,oi,0,!0),n.lineTo(t+l,i+o.topRight),n.arc(t+l-o.topRight,i+o.topRight,o.topRight,0,-oi,!0),n.lineTo(t+o.topLeft,i)}const WS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,YS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function KS(n,e){const t=(""+n).match(WS);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const JS=n=>+n||0;function _y(n,e){const t={},i=bt(e),l=i?Object.keys(e):e,s=bt(n)?i?o=>Ct(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=JS(s(o));return t}function ZS(n){return _y(n,{top:"y",right:"x",bottom:"y",left:"x"})}function lr(n){return _y(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ll(n){const e=ZS(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Si(n,e){n=n||{},e=e||nn.font;let t=Ct(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Ct(n.style,e.style);i&&!(""+i).match(YS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Ct(n.family,e.family),lineHeight:KS(Ct(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Ct(n.weight,e.weight),string:""};return l.string=qS(l),l}function No(n,e,t,i){let l,s,o;for(l=0,s=n.length;l<s;++l)if(o=n[l],o!==void 0&&o!==void 0)return o}function GS(n,e,t){const{min:i,max:l}=n,s=rS(e,(l-i)/2),o=(r,a)=>t&&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=ky("_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 by(r,a,()=>l4(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:gy(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 by(s,o,()=>QS(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 gy(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:nl(t)?t:()=>t,isIndexable:nl(i)?i:()=>i}}const XS=(n,e)=>n?n+qu(e):e,Bu=(n,e)=>bt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function by(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function QS(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return nl(r)&&o.isScriptable(e)&&(r=xS(e,r,n,t)),un(r)&&r.length&&(r=e4(e,r,n,o.isIndexable)),Bu(e,r)&&(r=is(r,l,s&&s[e],o)),r}function xS(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 e4(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(bt(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 yy(n,e,t){return nl(n)?n(e,t):n}const t4=(n,e)=>n===!0?e:typeof n=="string"?vr(e,n):void 0;function n4(n,e,t,i,l){for(const s of e){const o=t4(t,s);if(o){n.add(o);const r=yy(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=yy(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,()=>i4(e,t,i))}function ed(n,e,t,i,l){for(;t;)t=n4(n,e,t,i,l);return t}function i4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return un(l)&&bt(t)?t:l||{}}function l4(n,e,t,i){let l;for(const s of e)if(l=ky(XS(s,n),t),typeof l<"u")return Bu(n,l)?Wu(t,i,n,l):l}function ky(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=s4(n._scopes)),e}function s4(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 o4=Number.EPSILON||1e-14,ls=(n,e)=>e<n.length&&!n[e].skip&&n[e],vy=n=>n==="x"?"y":"x";function r4(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 a4(n,e,t){const i=n.length;let l,s,o,r,a,u=ls(n,0);for(let f=0;f<i-1;++f)if(a=u,u=ls(n,f+1),!(!a||!u)){if(As(e[f],0,o4)){t[f]=t[f+1]=0;continue}l=t[f]/e[f],s=t[f+1]/e[f],r=Math.pow(l,2)+Math.pow(s,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=l*o*e[f],t[f+1]=s*o*e[f])}}function u4(n,e,t="x"){const i=vy(t),l=n.length;let s,o,r,a=ls(n,0);for(let u=0;u<l;++u){if(o=r,r=a,a=ls(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(s=(f-o[t])/3,r[`cp1${t}`]=f-s,r[`cp1${i}`]=c-s*e[u]),a&&(s=(a[t]-f)/3,r[`cp2${t}`]=f+s,r[`cp2${i}`]=c+s*e[u])}}function f4(n,e="x"){const t=vy(e),i=n.length,l=Array(i).fill(0),s=Array(i);let o,r,a,u=ls(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=ls(n,o+1),!!a){if(u){const f=u[e]-a[e];l[o]=f!==0?(u[t]-a[t])/f:0}s[o]=r?u?il(l[o-1])!==il(l[o])?0:(l[o-1]+l[o])/2:l[o-1]:l[o]}a4(n,l,s),u4(n,s,e)}function Ro(n,e,t){return Math.max(Math.min(n,t),e)}function c4(n,e){let t,i,l,s,o,r=Gs(n[0],e);for(t=0,i=n.length;t<i;++t)o=s,s=r,r=t<i-1&&Gs(n[t+1],e),s&&(l=n[t],o&&(l.cp1x=Ro(l.cp1x,e.left,e.right),l.cp1y=Ro(l.cp1y,e.top,e.bottom)),r&&(l.cp2x=Ro(l.cp2x,e.left,e.right),l.cp2y=Ro(l.cp2y,e.top,e.bottom)))}function d4(n,e,t,i,l){let s,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")f4(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;s<o;++s)r=n[s],a=r4(u,r,n[Math.min(s+1,o-(i?0:1))%o],e.tension),r.cp1x=a.previous.x,r.cp1y=a.previous.y,r.cp2x=a.next.x,r.cp2y=a.next.y,u=r}e.capBezierPoints&&c4(n,t)}function Yu(){return typeof window<"u"&&typeof document<"u"}function Ku(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Tr(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const jr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function p4(n,e){return jr(n).getPropertyValue(e)}const m4=["top","right","bottom","left"];function El(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=m4[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const h4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function _4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(h4(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 ki(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}=_4(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 g4(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 Fo=n=>Math.round(n*10)/10;function b4(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=g4(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=Fo(Math.min(u,o,a.maxWidth)),f=Fo(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Fo(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Fo(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 y4=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=p4(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 k4(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 v4(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 w4=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}}},S4=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?w4(e,t):S4()}function T4(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 $4(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function wy(n){return n==="angle"?{between:ay,compare:kS,normalize:yi}:{between:uy,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 C4(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=wy(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;d<m&&o(r(e[u%a][i]),l,s);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function Sy(n,e,t){if(!t)return[n];const{property:i,start:l,end:s}=t,o=e.length,{compare:r,between:a,normalize:u}=wy(i),{start:f,end:c,loop:d,style:m}=C4(n,e,t),h=[];let g=!1,_=null,y,S,T;const $=()=>a(l,T,y)&&r(l,T)!==0,E=()=>r(s,y)===0||a(s,T,y),M=()=>g||$(),L=()=>!g||E();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(y=u(S[i]),y!==T&&(g=a(y,l,s),_===null&&M()&&(_=r(y,l)===0?I:A),_!==null&&L()&&(h.push(ld({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,T=y));return _!==null&&h.push(ld({start:_,end:c,loop:d,count:o,style:m})),h}function Ty(n,e){const t=[],i=n.segments;for(let l=0;l<i.length;l++){const s=Sy(i[l],n.points,e);s.length&&t.push(...s)}return t}function O4(n,e,t,i){let l=0,s=e-1;if(t&&!i)for(;l<e&&!n[l].skip;)l++;for(;l<e&&n[l].skip;)l++;for(l%=e,t&&(s+=l);s>l&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function E4(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 M4(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=O4(t,l,s,i);if(i===!0)return sd(n,[{start:o,end:r,loop:s}],t,e);const a=r<o?r+l:r,u=!!n._fullLoop&&o===0&&r===l-1;return sd(n,E4(t,o,a,u),t,e)}function sd(n,e,t,i){return!i||!i.setContext||!t?e:D4(n,e,t,i)}function D4(n,e,t,i){const l=n._chart.getContext(),s=od(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=s,c=e[0].start,d=c;function m(h,g,_,y){const S=r?-1:1;if(h!==g){for(h+=a;t[h%a].skip;)h-=S;for(;t[g%a].skip;)g+=S;h%a!==g%a&&(u.push({start:h%a,end:g%a,loop:_,style:y}),f=y,c=g%a)}}for(const h of e){c=r?c:h.start;let g=t[c%a],_;for(d=c+1;d<=h.end;d++){const y=t[d%a];_=od(i.setContext(Nl(l,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),I4(_,f)&&m(c,d-1,h.loop,f),g=y,f=_}c<d-1&&m(c,d-1,h.loop,f)}return u}function od(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function I4(n,e){if(!e)return!1;const t=[],i=function(l,s){return ju(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(e,i)}/*!
+ */function Ii(){}const oS=(()=>{let n=0;return()=>n++})();function Kt(n){return n===null||typeof n>"u"}function un(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 yt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function wn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return wn(n)?n:e}function Ct(n,e){return typeof n>"u"?e:n}const rS=(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 ht(n,e,t,i){let l,s,o;if(un(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(yt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function yr(n,e){let t,i,l,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(l=n[t],s=e[t],l.datasetIndex!==s.datasetIndex||l.index!==s.index)return!1;return!0}function kr(n){if(un(n))return n.map(kr);if(yt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=kr(n[t[l]]);return e}return n}function ry(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function aS(n,e,t,i){if(!ry(n))return;const l=e[n],s=t[n];yt(l)&&yt(s)?Js(l,s,i):e[n]=kr(s)}function Js(n,e,t){const i=un(e)?e:[e],l=i.length;if(!yt(n))return n;t=t||{};const s=t.merger||aS;let o;for(let r=0;r<l;++r){if(o=i[r],!yt(o))continue;const a=Object.keys(o);for(let u=0,f=a.length;u<f;++u)s(a[u],n,o,t)}return n}function Ls(n,e){return Js(n,e,{merger:uS})}function uS(n,e,t){if(!ry(n))return;const i=e[n],l=t[n];yt(i)&&yt(l)?Ls(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=kr(l))}const Hc={"":n=>n,x:n=>n.x,y:n=>n.y};function fS(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 cS(n){const e=fS(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function vr(n,e){return(Hc[e]||(Hc[e]=cS(e)))(n)}function qu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const wr=n=>typeof n<"u",nl=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 dS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const kn=Math.PI,Ti=2*kn,pS=Ti+kn,Sr=Number.POSITIVE_INFINITY,mS=kn/180,oi=kn/2,yl=kn/4,zc=kn*2/3,Ka=Math.log10,il=Math.sign;function As(n,e,t){return Math.abs(n-e)<t}function Uc(n){const e=Math.round(n);n=As(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Ka(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function hS(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((l,s)=>l-s).pop(),e}function Zs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function _S(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function gS(n,e,t){let i,l,s;for(i=0,l=n.length;i<l;i++)s=n[i][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function $l(n){return n*(kn/180)}function bS(n){return n*(180/kn)}function Vc(n){if(!wn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function yS(n,e){const t=e.x-n.x,i=e.y-n.y,l=Math.sqrt(t*t+i*i);let s=Math.atan2(i,t);return s<-.5*kn&&(s+=Ti),{angle:s,distance:l}}function Ja(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function kS(n,e){return(n-e+pS)%Ti-kn}function yi(n){return(n%Ti+Ti)%Ti}function ay(n,e,t,i){const l=yi(n),s=yi(e),o=yi(t),r=yi(s-l),a=yi(o-l),u=yi(l-s),f=yi(l-o);return l===s||l===o||i&&s===o||r>a&&u<f}function ri(n,e,t){return Math.max(e,Math.min(t,n))}function vS(n){return ri(n,-32768,32767)}function uy(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Hu(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>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 s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),wS=(n,e,t)=>Hu(n,t,i=>n[i][e]>=t);function SS(n,e,t){let i=0,l=n.length;for(;i<l&&n[i]<e;)i++;for(;l>i&&n[l-1]>t;)l--;return i>0||l<n.length?n.slice(i,l):n}const fy=["push","pop","shift","splice","unshift"];function TS(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),fy.forEach(t=>{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)&&(fy.forEach(s=>{delete n[s]}),delete n._chartjs)}function $S(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const cy=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function dy(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,cy.call(window,()=>{i=!1,n.apply(e,t)}))}}function CS(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const OS=n=>n==="start"?"left":n==="end"?"right":"center",Wc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ES(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=ri(Math.min(Cl(r,a,u).lo,t?i:Cl(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=ri(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 MS(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 Po=n=>n===0||n===1,Yc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ti/t)),Kc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ti/t)+1,Ps={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*oi)+1,easeOutSine:n=>Math.sin(n*oi),easeInOutSine:n=>-.5*(Math.cos(kn*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=>Po(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=>Po(n)?n:Yc(n,.075,.3),easeOutElastic:n=>Po(n)?n:Kc(n,.075,.3),easeInOutElastic(n){return Po(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-Ps.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?Ps.easeInBounce(n*2)*.5:Ps.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 Ks(n)}function fa(n){return ju(n)?n:new Ks(n).saturate(.5).darken(.1).hexString()}const DS=["x","y","borderWidth","radius","tension"],IS=["color","borderColor","backgroundColor"];function LS(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:IS},numbers:{type:"number",properties:DS}}),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 AS(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Zc=new Map;function PS(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 py(n,e,t){return PS(e,t).format(n)}const my={values(n){return un(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=NS(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),py(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?my.numeric.call(this,n,e,t):""}};function NS(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 hy={formatters:my};function RS(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:hy.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 Ns(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;i<l;++i){const s=t[i];n=n[s]||(n[s]=Object.create(null))}return n}function ca(n,e,t){return typeof e=="string"?Js(Ns(n,e),t):Js(Ns(n,""),e)}class FS{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.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 Ns(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=Ns(this,e),o=Ns(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 yt(a)?Object.assign({},u,a):Ct(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var nn=new FS({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[LS,AS,RS]);function qS(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 kl(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){HS(n,e,t,i)}function HS(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*mS;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:n.arc(t,i,g,0,Ti),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=zc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=zc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+yl)*a,c=Math.cos(_+yl)*a,r=Math.sin(_+yl)*a,d=Math.sin(_+yl)*a,n.arc(t-c,i-r,u,_-kn,_-oi),n.arc(t+d,i-o,u,_-oi,_),n.arc(t+c,i+r,u,_,_+oi),n.arc(t-d,i+o,u,_+oi,_+kn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}_+=yl;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":_+=yl;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),_+=yl,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 Gs(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function zu(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Uu(n){n.restore()}function jS(n,e,t,i,l){if(!e)return n.lineTo(t.x,t.y);if(l==="middle"){const s=(e.x+t.x)/2;n.lineTo(s,e.y),n.lineTo(s,t.y)}else l==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function zS(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function US(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Kt(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function VS(n,e,t,i,l){if(l.strikethrough||l.underline){const s=n.measureText(i),o=e-s.actualBoundingBoxLeft,r=e+s.actualBoundingBoxRight,a=t-s.actualBoundingBoxAscent,u=t+s.actualBoundingBoxDescent,f=l.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=l.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function BS(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function Qc(n,e,t,i,l,s={}){const o=un(e)?e:[e],r=s.strokeWidth>0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,US(n,s),a=0;a<o.length;++a)u=o[a],s.backdrop&&BS(n,s.backdrop),r&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Kt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(u,t,i,s.maxWidth)),n.fillText(u,t,i,s.maxWidth),VS(n,t,i,u,s),i+=Number(l.lineHeight);n.restore()}function xc(n,e){const{x:t,y:i,w:l,h:s,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,1.5*kn,kn,!0),n.lineTo(t,i+s-o.bottomLeft),n.arc(t+o.bottomLeft,i+s-o.bottomLeft,o.bottomLeft,kn,oi,!0),n.lineTo(t+l-o.bottomRight,i+s),n.arc(t+l-o.bottomRight,i+s-o.bottomRight,o.bottomRight,oi,0,!0),n.lineTo(t+l,i+o.topRight),n.arc(t+l-o.topRight,i+o.topRight,o.topRight,0,-oi,!0),n.lineTo(t+o.topLeft,i)}const WS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,YS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function KS(n,e){const t=(""+n).match(WS);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const JS=n=>+n||0;function _y(n,e){const t={},i=yt(e),l=i?Object.keys(e):e,s=yt(n)?i?o=>Ct(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=JS(s(o));return t}function ZS(n){return _y(n,{top:"y",right:"x",bottom:"y",left:"x"})}function lr(n){return _y(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ll(n){const e=ZS(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Si(n,e){n=n||{},e=e||nn.font;let t=Ct(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Ct(n.style,e.style);i&&!(""+i).match(YS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Ct(n.family,e.family),lineHeight:KS(Ct(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Ct(n.weight,e.weight),string:""};return l.string=qS(l),l}function No(n,e,t,i){let l,s,o;for(l=0,s=n.length;l<s;++l)if(o=n[l],o!==void 0&&o!==void 0)return o}function GS(n,e,t){const{min:i,max:l}=n,s=rS(e,(l-i)/2),o=(r,a)=>t&&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=ky("_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 by(r,a,()=>l4(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:gy(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 by(s,o,()=>QS(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 gy(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:nl(t)?t:()=>t,isIndexable:nl(i)?i:()=>i}}const XS=(n,e)=>n?n+qu(e):e,Bu=(n,e)=>yt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function by(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function QS(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return nl(r)&&o.isScriptable(e)&&(r=xS(e,r,n,t)),un(r)&&r.length&&(r=e4(e,r,n,o.isIndexable)),Bu(e,r)&&(r=is(r,l,s&&s[e],o)),r}function xS(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 e4(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(yt(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 yy(n,e,t){return nl(n)?n(e,t):n}const t4=(n,e)=>n===!0?e:typeof n=="string"?vr(e,n):void 0;function n4(n,e,t,i,l){for(const s of e){const o=t4(t,s);if(o){n.add(o);const r=yy(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=yy(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,()=>i4(e,t,i))}function ed(n,e,t,i,l){for(;t;)t=n4(n,e,t,i,l);return t}function i4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return un(l)&&yt(t)?t:l||{}}function l4(n,e,t,i){let l;for(const s of e)if(l=ky(XS(s,n),t),typeof l<"u")return Bu(n,l)?Wu(t,i,n,l):l}function ky(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=s4(n._scopes)),e}function s4(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 o4=Number.EPSILON||1e-14,ls=(n,e)=>e<n.length&&!n[e].skip&&n[e],vy=n=>n==="x"?"y":"x";function r4(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 a4(n,e,t){const i=n.length;let l,s,o,r,a,u=ls(n,0);for(let f=0;f<i-1;++f)if(a=u,u=ls(n,f+1),!(!a||!u)){if(As(e[f],0,o4)){t[f]=t[f+1]=0;continue}l=t[f]/e[f],s=t[f+1]/e[f],r=Math.pow(l,2)+Math.pow(s,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=l*o*e[f],t[f+1]=s*o*e[f])}}function u4(n,e,t="x"){const i=vy(t),l=n.length;let s,o,r,a=ls(n,0);for(let u=0;u<l;++u){if(o=r,r=a,a=ls(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(s=(f-o[t])/3,r[`cp1${t}`]=f-s,r[`cp1${i}`]=c-s*e[u]),a&&(s=(a[t]-f)/3,r[`cp2${t}`]=f+s,r[`cp2${i}`]=c+s*e[u])}}function f4(n,e="x"){const t=vy(e),i=n.length,l=Array(i).fill(0),s=Array(i);let o,r,a,u=ls(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=ls(n,o+1),!!a){if(u){const f=u[e]-a[e];l[o]=f!==0?(u[t]-a[t])/f:0}s[o]=r?u?il(l[o-1])!==il(l[o])?0:(l[o-1]+l[o])/2:l[o-1]:l[o]}a4(n,l,s),u4(n,s,e)}function Ro(n,e,t){return Math.max(Math.min(n,t),e)}function c4(n,e){let t,i,l,s,o,r=Gs(n[0],e);for(t=0,i=n.length;t<i;++t)o=s,s=r,r=t<i-1&&Gs(n[t+1],e),s&&(l=n[t],o&&(l.cp1x=Ro(l.cp1x,e.left,e.right),l.cp1y=Ro(l.cp1y,e.top,e.bottom)),r&&(l.cp2x=Ro(l.cp2x,e.left,e.right),l.cp2y=Ro(l.cp2y,e.top,e.bottom)))}function d4(n,e,t,i,l){let s,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")f4(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;s<o;++s)r=n[s],a=r4(u,r,n[Math.min(s+1,o-(i?0:1))%o],e.tension),r.cp1x=a.previous.x,r.cp1y=a.previous.y,r.cp2x=a.next.x,r.cp2y=a.next.y,u=r}e.capBezierPoints&&c4(n,t)}function Yu(){return typeof window<"u"&&typeof document<"u"}function Ku(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Tr(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const jr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function p4(n,e){return jr(n).getPropertyValue(e)}const m4=["top","right","bottom","left"];function El(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=m4[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const h4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function _4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(h4(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 ki(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}=_4(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 g4(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 Fo=n=>Math.round(n*10)/10;function b4(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=g4(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=Fo(Math.min(u,o,a.maxWidth)),f=Fo(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Fo(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Fo(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 y4=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=p4(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 k4(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 v4(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 w4=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}}},S4=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?w4(e,t):S4()}function T4(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 $4(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function wy(n){return n==="angle"?{between:ay,compare:kS,normalize:yi}:{between:uy,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 C4(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=wy(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;d<m&&o(r(e[u%a][i]),l,s);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function Sy(n,e,t){if(!t)return[n];const{property:i,start:l,end:s}=t,o=e.length,{compare:r,between:a,normalize:u}=wy(i),{start:f,end:c,loop:d,style:m}=C4(n,e,t),h=[];let g=!1,_=null,y,S,T;const $=()=>a(l,T,y)&&r(l,T)!==0,E=()=>r(s,y)===0||a(s,T,y),M=()=>g||$(),L=()=>!g||E();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(y=u(S[i]),y!==T&&(g=a(y,l,s),_===null&&M()&&(_=r(y,l)===0?I:A),_!==null&&L()&&(h.push(ld({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,T=y));return _!==null&&h.push(ld({start:_,end:c,loop:d,count:o,style:m})),h}function Ty(n,e){const t=[],i=n.segments;for(let l=0;l<i.length;l++){const s=Sy(i[l],n.points,e);s.length&&t.push(...s)}return t}function O4(n,e,t,i){let l=0,s=e-1;if(t&&!i)for(;l<e&&!n[l].skip;)l++;for(;l<e&&n[l].skip;)l++;for(l%=e,t&&(s+=l);s>l&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function E4(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 M4(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=O4(t,l,s,i);if(i===!0)return sd(n,[{start:o,end:r,loop:s}],t,e);const a=r<o?r+l:r,u=!!n._fullLoop&&o===0&&r===l-1;return sd(n,E4(t,o,a,u),t,e)}function sd(n,e,t,i){return!i||!i.setContext||!t?e:D4(n,e,t,i)}function D4(n,e,t,i){const l=n._chart.getContext(),s=od(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=s,c=e[0].start,d=c;function m(h,g,_,y){const S=r?-1:1;if(h!==g){for(h+=a;t[h%a].skip;)h-=S;for(;t[g%a].skip;)g+=S;h%a!==g%a&&(u.push({start:h%a,end:g%a,loop:_,style:y}),f=y,c=g%a)}}for(const h of e){c=r?c:h.start;let g=t[c%a],_;for(d=c+1;d<=h.end;d++){const y=t[d%a];_=od(i.setContext(Nl(l,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),I4(_,f)&&m(c,d-1,h.loop,f),g=y,f=_}c<d-1&&m(c,d-1,h.loop,f)}return u}function od(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function I4(n,e){if(!e)return!1;const t=[],i=function(l,s){return ju(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(e,i)}/*!
  * Chart.js v4.4.4
  * https://www.chartjs.org
  * (c) 2024 Chart.js Contributors
  * Released under the MIT License
- */class L4{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,l){const s=t.listeners[l],o=t.duration;s.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=cy.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 Li=new L4;const rd="transparent",A4={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 P4{constructor(e,t,i,l){const s=t[i];l=No([e.to,l,s,e.from]);const o=No([e.from,s,l]);this._active=!0,this._fn=e.fn||A4[e.type||typeof o],this._easing=Ps[e.easing]||Ps.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=No([e.to,t,l,e.from]),this._from=No([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||t<i),!this._active){this._target[l]=r,this._notify(!0);return}if(t<0){this._target[l]=s;return}a=t/i%2,a=o&&a>1?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<i.length;l++)i[l][t]()}}class $y{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!bt(e))return;const t=Object.keys(nn.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!bt(s))return;const o={};for(const r of t)o[r]=s[r];(un(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=R4(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&N4(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 P4(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 Li.add(this._chart,i),!0}}function N4(n,e){const t=[],i=Object.keys(e);for(let l=0;l<i.length;l++){const s=n[i[l]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function R4(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function ad(n,e){const t=n&&n.options||{},i=t.reverse,l=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:i?s:l,end:i?l:s}}function F4(n,e,t){if(t===!1)return!1;const i=ad(n,t),l=ad(e,t);return{top:l.end,right:i.end,bottom:l.start,left:i.start}}function q4(n){let e,t,i,l;return bt(n)?(e=n.top,t=n.right,i=n.bottom,l=n.left):e=t=i=l=n,{top:e,right:t,bottom:i,left:l,disabled:n===!1}}function Cy(n,e){const t=[],i=n._getSortedDatasetMetas(e);let l,s;for(l=0,s=i.length;l<s;++l)t.push(i[l].index);return t}function ud(n,e,t,i={}){const l=n.keys,s=i.mode==="single";let o,r,a,u;if(e!==null){for(o=0,r=l.length;o<r;++o){if(a=+l[o],a===t){if(i.all)continue;break}u=n.values[a],wn(u)&&(s||e===0||il(e)===il(u))&&(e+=u)}return e}}function H4(n,e){const{iScale:t,vScale:i}=e,l=t.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",o=Object.keys(n),r=new Array(o.length);let a,u,f;for(a=0,u=o.length;a<u;++a)f=o[a],r[a]={[l]:f,[s]:n[f]};return r}function fd(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function j4(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function z4(n){const{min:e,max:t,minDefined:i,maxDefined:l}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:l?t:Number.POSITIVE_INFINITY}}function U4(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function cd(n,e,t,i){for(const l of e.getMatchingVisibleMetas(i).reverse()){const s=n[l.index];if(t&&s>0||!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=j4(s,o,i),c=e.length;let d;for(let m=0;m<c;++m){const h=e[m],{[a]:g,[u]:_}=h,y=h._stacks||(h._stacks={});d=y[u]=U4(l,f,g),d[r]=_,d._top=cd(d,o,!0,i.type),d._bottom=cd(d,o,!1,i.type);const S=d._visualValues||(d._visualValues={});S[r]=_}}function pa(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function V4(n,e){return Nl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function B4(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 ys(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),W4=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Cy(t,!0),values:null};class Rs{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&&ys(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=Ct(i.xAxisID,pa(e,"x")),o=t.yAxisID=Ct(i.yAxisID,pa(e,"y")),r=t.rAxisID=Ct(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&&ys(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(bt(t)){const l=this._cachedMeta;this._data=H4(t,l)}else if(i!==t){if(i){Bc(i,this);const l=this._cachedMeta;ys(l),l._parsed=[]}t&&Object.isExtensible(t)&&TS(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,ys(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{un(l[e])?d=this.parseArrayData(i,l,e,t):bt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(m()&&(a=!1),u=c);i._sorted=a}o&&dd(this,d)}parsePrimitiveData(e,t,i,l){const{iScale:s,vScale:o}=e,r=s.axis,a=o.axis,u=s.getLabels(),f=s===o,c=new Array(l);let d,m,h;for(d=0,m=l;d<m;++d)h=d+i,c[d]={[r]:f||s.parse(u[h],h),[a]:o.parse(t[h],h)};return c}parseArrayData(e,t,i,l){const{xScale:s,yScale:o}=e,r=new Array(l);let a,u,f,c;for(a=0,u=l;a<u;++a)f=a+i,c=t[f],r[a]={x:s.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,l){const{xScale:s,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(l);let f,c,d,m;for(f=0,c=l;f<c;++f)d=f+i,m=t[d],u[f]={x:s.parse(vr(m,r),d),y:o.parse(vr(m,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const l=this.chart,s=this._cachedMeta,o=t[e.axis],r={keys:Cy(l,!0),values:t._stacks[e.axis]._visualValues};return ud(r,o,s.index,{mode:i})}updateRangeFromParsed(e,t,i,l){const s=i[t.axis];let o=s===null?NaN:s;const r=l&&i._stacks[t.axis];l&&r&&(l.values=r,o=ud(l,s,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,l=i._parsed,s=i._sorted&&e===i.iScale,o=l.length,r=this._getOtherScale(e),a=W4(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=z4(r);let d,m;function h(){m=l[d];const g=m[r.axis];return!wn(m[e.axis])||f>g||c<g}for(d=0;d<o&&!(!h()&&(this.updateRangeFromParsed(u,e,m,a),s));++d);if(s){for(d=o-1;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<s;++l)o=t[l][e.axis],wn(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,l=t.vScale,s=this.getParsed(e);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:l?""+l.getLabelForValue(s[l.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=q4(Ct(this.options.clip,F4(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,l=i.data||[],s=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||l.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,s,r,a),f=r;f<r+a;++f){const c=l[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,s))}for(f=0;f<o.length;++f)o[f].draw(e,s)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const l=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];s=o.$context||(o.$context=B4(this.getContext(),e,o)),s.parsed=this.getParsed(e),s.raw=l.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=V4(this.chart.getContext(),this.index)),s.dataset=l,s.index=s.datasetIndex=this.index;return s.active=!!t,s.mode=i,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const l=t==="active",s=this._cachedDataOpts,o=e+"-"+t,r=s[o],a=this.enableOptionSharing&&wr(i);if(r)return pd(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=l?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),m=Object.keys(nn.elements[e]),h=()=>this.getContext(i,l,t),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,s[o]=Object.freeze(pd(g,a))),g}_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 $y(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<l&&this._removeElements(s,l-s)}_insertElements(e,t,i=!0){const l=this._cachedMeta,s=l.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(l._parsed),this.parse(e,t),i&&this.updateElements(s,e,t,"reset")}updateElements(e,t,i,l){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const l=i._parsed.splice(e,t);i._stacked&&ys(i,l)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,l]=e;this[t](i,l)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ct(Rs,"defaults",{}),ct(Rs,"datasetElementType",null),ct(Rs,"dataElementType",null);class sr extends Rs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:l=[],_dataset:s}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=ES(t,l,o);this._drawStart=r,this._drawCount=a,MS(t)&&(r=0,a=l.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=l;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(l,r,a,e)}updateElements(e,t,i,l){const s=l==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,l),d=o.axis,m=r.axis,{spanGaps:h,segment:g}=this.options,_=Zs(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||l==="none",S=t+i,T=e.length;let $=t>0&&this.getParsed(t-1);for(let E=0;E<T;++E){const M=e[E],L=y?M:{};if(E<t||E>=S){L.skip=!0;continue}const I=this.getParsed(E),A=Kt(I[m]),P=L[d]=o.getPixelForValue(I[d],E),R=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],E);L.skip=isNaN(P)||isNaN(R)||A,L.stop=E>0&&Math.abs(I[d]-$[d])>_,g&&(L.parsed=I,L.raw=u.data[E]),c&&(L.options=f||this.resolveDataElementOptions(E,M.active?"active":l)),y||this.updateElement(M,E,L,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ct(sr,"id","line"),ct(sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ct(sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function vl(){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 vl()}parse(){return vl()}format(){return vl()}add(){return vl()}diff(){return vl()}startOf(){return vl()}endOf(){return vl()}}var Oy={_date:Ju};function Y4(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?wS: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 po(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r<a;++r){const{index:u,data:f}=s[r],{lo:c,hi:d}=Y4(s[r],e,o,l);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function K4(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,l){const s=e?Math.abs(i.x-l.x):0,o=t?Math.abs(i.y-l.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function ha(n,e,t,i,l){const s=[];return!l&&!n.isPointInArea(e)||po(n,t,e,function(r,a,u){!l&&!Gs(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&s.push({element:r,datasetIndex:a,index:u})},!0),s}function J4(n,e,t,i){let l=[];function s(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=yS(o,{x:e.x,y:e.y});ay(c,u,f)&&l.push({element:o,datasetIndex:r,index:a})}return po(n,t,e,s),l}function Z4(n,e,t,i,l,s){let o=[];const r=K4(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const m=f.inRange(e.x,e.y,l);if(i&&!m)return;const h=f.getCenterPoint(l);if(!(!!s||n.isPointInArea(h))&&!m)return;const _=r(e,h);_<a?(o=[{element:f,datasetIndex:c,index:d}],a=_):_===a&&o.push({element:f,datasetIndex:c,index:d})}return po(n,t,e,u),o}function _a(n,e,t,i,l,s){return!s&&!n.isPointInArea(e)?[]:t==="r"&&!i?J4(n,e,t,l):Z4(n,e,t,i,l,s)}function md(n,e,t,i,l){const s=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return po(n,t,e,(a,u,f)=>{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 G4={evaluateInteractionItems:po,modes:{index(n,e,t,i){const l=ki(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=ki(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;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const l=ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return ha(n,l,s,i,o)},nearest(n,e,t,i){const l=ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return _a(n,l,s,t.intersect,i,o)},x(n,e,t,i){const l=ki(e,n);return md(n,l,"x",t.intersect,i)},y(n,e,t,i){const l=ki(e,n);return md(n,l,"y",t.intersect,i)}}};const Ey=["left","top","right","bottom"];function ks(n,e){return n.filter(t=>t.pos===e)}function hd(n,e){return n.filter(t=>Ey.indexOf(t.pos)===-1&&t.box.axis===e)}function vs(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 X4(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;t<i;++t)l=n[t],{position:s,options:{stack:o,stackWeight:r=1}}=l,e.push({index:t,box:l,pos:s,horizontal:l.isHorizontal(),weight:l.weight,stack:o&&s+o,stackWeight:r});return e}function Q4(n){const e={};for(const t of n){const{stack:i,pos:l,stackWeight:s}=t;if(!i||!Ey.includes(l))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function x4(n,e){const t=Q4(n),{vBoxMaxWidth:i,hBoxMaxHeight:l}=e;let s,o,r;for(s=0,o=n.length;s<o;++s){r=n[s];const{fullSize:a}=r.box,u=t[r.stack],f=u&&r.stackWeight/u.weight;r.horizontal?(r.width=f?f*i:a&&e.availableWidth,r.height=l):(r.width=i,r.height=f?f*l:a&&e.availableHeight)}return t}function eT(n){const e=X4(n),t=vs(e.filter(u=>u.box.fullSize),!0),i=vs(ks(e,"left"),!0),l=vs(ks(e,"right")),s=vs(ks(e,"top"),!0),o=vs(ks(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:ks(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 My(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 tT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!bt(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&&My(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 nT(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 iT(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 Os(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s<o;++s){r=n[s],a=r.box,a.update(r.width||e.w,r.height||e.h,iT(r.horizontal,e));const{same:c,other:d}=tT(e,t,r,i);u|=c&&l.length,f=f||d,a.fullSize||l.push(r)}return u&&Os(l,e,t,i)||f}function qo(n,e,t,i,l){n.top=t,n.left=e,n.right=e+i,n.bottom=t+l,n.width=i,n.height=l}function gd(n,e,t,i){const l=t.padding;let{x:s,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;wr(u.start)&&(o=u.start),a.fullSize?qo(a,l.left,o,t.outerWidth-l.right-l.left,d):qo(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;wr(u.start)&&(s=u.start),a.fullSize?qo(a,s,l.top,d,t.outerHeight-l.bottom-l.top):qo(a,s,e.top+u.placed,d,c),u.start=s,u.placed+=c,s=a.right}}e.x=s,e.y=o}var Ho={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const l=ll(n.options.layout.padding),s=Math.max(e-l.width,0),o=Math.max(t-l.height,0),r=eT(n.boxes),a=r.vertical,u=r.horizontal;ht(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+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);My(d,ll(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=x4(a.concat(u),c);Os(r.fullSize,m,c,h),Os(a,m,c,h),Os(u,m,c,h)&&Os(a,m,c,h),nT(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},ht(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Dy{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 lT extends Dy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",sT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bd=n=>n===null||n==="";function oT(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[or]={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 Iy=y4?{passive:!0}:!1;function rT(n,e,t){n&&n.addEventListener(e,t,Iy)}function aT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Iy)}function uT(n,e){const t=sT[n.type]||n.type,{x:i,y:l}=ki(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 fT(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 cT(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 yd=0;function Ly(){const n=window.devicePixelRatio;n!==yd&&(yd=n,Xs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function dT(n,e){Xs.size||window.addEventListener("resize",Ly),Xs.set(n,e)}function pT(n){Xs.delete(n),Xs.size||window.removeEventListener("resize",Ly)}function mT(n,e,t){const i=n.canvas,l=i&&Ku(i);if(!l)return;const s=dy((r,a)=>{const u=l.clientWidth;t(r,a),u<l.clientWidth&&t()},window),o=new ResizeObserver(r=>{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),dT(n,s),o}function ga(n,e,t){t&&t.disconnect(),e==="resize"&&pT(n)}function hT(n,e,t){const i=n.canvas,l=dy(s=>{n.ctx!==null&&t(uT(s,n))},n);return rT(i,e,l),l}class _T extends Dy{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(oT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[or])return!1;const i=t[or].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[or],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:fT,detach:cT,resize:mT}[t]||hT;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]||aT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return b4(e,t,i,l)}isAttached(e){const t=e&&Ku(e);return!!(t&&t.isConnected)}}function gT(n){return!Yu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?lT:_T}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 Zs(this.x)&&Zs(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 bT(n,e){const t=n.options.ticks,i=yT(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?vT(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return wT(e,u,s,o/l),u;const f=kT(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Kt(m)?0:r-m,r),c=0,d=o-1;c<d;c++)jo(e,u,f,s[c],s[c+1]);return jo(e,u,f,a,Kt(m)?e.length:a+m),u}return jo(e,u,f),u}function yT(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),l=n._maxLength/t;return Math.floor(Math.min(i,l))}function kT(n,e,t){const i=ST(n),l=e.length/t;if(!i)return Math.max(l,1);const s=hS(i);for(let o=0,r=s.length-1;o<r;o++){const a=s[o];if(a>l)return a}return Math.max(l,1)}function vT(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function wT(n,e,t,i){let l=0,s=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===s&&(e.push(n[o]),l++,s=t[l*i])}function jo(n,e,t,i,l){const s=Ct(i,0),o=Math.min(Ct(l,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),l&&(a=l-i,t=a/Math.floor(a/t)),f=s;f<0;)r++,f=Math.round(s+r*t);for(u=Math.max(s,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(s+r*t))}function ST(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const TT=n=>n==="left"?"right":n==="right"?"left":n,kd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,vd=(n,e)=>Math.min(e||n,n);function wd(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;s<l;s+=i)t.push(n[Math.floor(s)]);return t}function $T(n,e,t){const i=n.ticks.length,l=Math.min(e,i-1),s=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(l),u;if(!(t&&(i===1?u=Math.max(a-s,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(l-1))/2,a+=l<e?u:-u,a<s-r||a>o+r)))return a}function CT(n,e){ht(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;s<l;++s)delete t.data[i[s]];i.splice(0,l)}})}function ws(n){return n.drawTicks?n.tickLength:0}function Sd(n,e){if(!n.display)return 0;const t=Si(n.font,e),i=ll(n.padding);return(un(n.text)?n.text.length:1)*t.lineHeight+i.height}function OT(n,e){return Nl(n,{scale:e,type:"scale"})}function ET(n,e,t){return Nl(n,{tick:t,index:e,type:"tick"})}function MT(n,e,t){let i=OS(n);return(t&&e!=="right"||!t&&e==="right")&&(i=TT(i)),i}function DT(n,e,t,i){const{top:l,left:s,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,m,h;const g=o-l,_=r-s;if(n.isHorizontal()){if(m=Wc(i,s,r),bt(t)){const y=Object.keys(t)[0],S=t[y];h=f[y].getPixelForValue(S)+g-e}else t==="center"?h=(u.bottom+u.top)/2+g-e:h=kd(n,t,e);d=r-s}else{if(bt(t)){const y=Object.keys(t)[0],S=t[y];m=f[y].getPixelForValue(S)-_+e}else t==="center"?m=(u.left+u.right)/2-_+e:m=kd(n,t,e);h=Wc(i,o,l),c=t==="left"?-oi:oi}return{titleX:m,titleY:h,maxWidth:d,rotation:c}}class mo extends Al{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:l}=this;return e=_i(e,Number.POSITIVE_INFINITY),t=_i(t,Number.NEGATIVE_INFINITY),i=_i(i,Number.POSITIVE_INFINITY),l=_i(l,Number.NEGATIVE_INFINITY),{min:_i(e,i),max:_i(t,l),minDefined:wn(e),maxDefined:wn(t)}}getMinMax(e){let{min:t,max:i,minDefined:l,maxDefined:s}=this.getUserBounds(),o;if(l&&s)return{min:t,max:i};const r=this.getMatchingVisibleMetas();for(let a=0,u=r.length;a<u;++a)o=r[a].controller.getMinMax(this,e),l||(t=Math.min(t,o.min)),s||(i=Math.max(i,o.max));return t=s&&t>i?i:t,i=l&&t>i?t:i,{min:_i(t,_i(i,t)),max:_i(i,_i(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=GS(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?wd(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=bT(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){dt(this.options.afterUpdate,[this])}beforeSetDimensions(){dt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){dt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),dt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,l,s;for(i=0,l=e.length;i<l;i++)s=e[i],s.label=dt(t.callback,[s.value,i,e],this)}afterTickToLabelConversion(){dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=vd(this.ticks.length,e.ticks.maxTicksLimit),l=t.minRotation||0,s=t.maxRotation;let o=l,r,a,u;if(!this._isVisible()||!t.display||l>=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=ri(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-ws(e.grid)-t.padding-Sd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=bS(Math.min(Math.asin(ri((f.highest.height+6)/r,-1,1)),Math.asin(ri(a/u,-1,1))-Math.asin(ri(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=ws(s)+a):(e.height=this.maxHeight,e.width=ws(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),g=Math.cos(h),_=Math.sin(h);if(r){const y=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+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<i;t++)Kt(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=wd(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:l,_longestTextCache:s}=this,o=[],r=[],a=Math.floor(t/vd(t,i));let u=0,f=0,c,d,m,h,g,_,y,S,T,$,E;for(c=0;c<t;c+=a){if(h=e[c].label,g=this._resolveTickFontOptions(c),l.font=_=g.string,y=s[_]=s[_]||{data:{},gc:[]},S=g.lineHeight,T=$=0,!Kt(h)&&!un(h))T=Gc(l,y.data,y.gc,T,h),$=S;else if(un(h))for(d=0,m=h.length;d<m;++d)E=h[d],!Kt(E)&&!un(E)&&(T=Gc(l,y.data,y.gc,T,E),$+=S);o.push(T),r.push($),u=Math.max(T,u),f=Math.max($,f)}CT(s,t);const M=o.indexOf(u),L=r.indexOf(f),I=A=>({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 vS(this._alignToPixels?kl(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&&e<t.length){const i=t[e];return i.$context||(i.$context=ET(this.getContext(),e,i))}return this.$context||(this.$context=OT(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=$l(this.labelRotation),i=Math.abs(Math.cos(t)),l=Math.abs(Math.sin(t)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,r=s?s.widest.width+o:0,a=s?s.highest.height+o:0;return this.isHorizontal()?a*i>r*l?r/i:a/l:a*l<r*i?a/i:r/l}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_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=ws(s),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,y=function(K){return kl(i,K,g)};let S,T,$,E,M,L,I,A,P,R,N,U;if(o==="top")S=y(this.bottom),L=this.bottom-d,A=S-_,R=y(e.top)+_,U=e.bottom;else if(o==="bottom")S=y(this.top),R=e.top,U=y(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=y(this.right),M=this.right-d,I=S-_,P=y(e.left)+_,N=e.right;else if(o==="right")S=y(this.left),P=e.left,N=y(e.right)-_,M=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(bt(o)){const K=Object.keys(o)[0],J=o[K];S=y(this.chart.scales[K].getPixelForValue(J))}R=e.top,U=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(bt(o)){const K=Object.keys(o)[0],J=o[K];S=y(this.chart.scales[K].getPixelForValue(J))}M=S-_,I=M-d,P=e.left,N=e.right}const j=Ct(l.ticks.maxTicksLimit,c),V=Math.max(1,Math.ceil(c/j));for(T=0;T<c;T+=V){const K=this.getContext(T),J=s.setContext(K),ee=r.setContext(K),X=J.lineWidth,oe=J.color,Se=ee.dash||[],ke=ee.dashOffset,Ce=J.tickWidth,We=J.tickColor,st=J.tickBorderDash||[],et=J.tickBorderDashOffset;$=$T(this,T,a),$!==void 0&&(E=kl(i,$,X),u?M=I=P=N=E:L=A=R=U=E,m.push({tx1:M,ty1:L,tx2:I,ty2:A,x1:P,y1:R,x2:N,y2:U,width:X,color:oe,borderDash:Se,borderDashOffset:ke,tickWidth:Ce,tickColor:We,tickBorderDash:st,tickBorderDashOffset:et}))}return this._ticksLength=c,this._borderValue=S,m}_computeLabelItems(e){const t=this.axis,i=this.options,{position:l,ticks:s}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=s,d=ws(i.grid),m=d+f,h=c?-f:m,g=-$l(this.labelRotation),_=[];let y,S,T,$,E,M,L,I,A,P,R,N,U="middle";if(l==="top")M=this.bottom-h,L=this._getXAxisLabelAlignment();else if(l==="bottom")M=this.top+h,L=this._getXAxisLabelAlignment();else if(l==="left"){const V=this._getYAxisLabelAlignment(d);L=V.textAlign,E=V.x}else if(l==="right"){const V=this._getYAxisLabelAlignment(d);L=V.textAlign,E=V.x}else if(t==="x"){if(l==="center")M=(e.top+e.bottom)/2+m;else if(bt(l)){const V=Object.keys(l)[0],K=l[V];M=this.chart.scales[V].getPixelForValue(K)+m}L=this._getXAxisLabelAlignment()}else if(t==="y"){if(l==="center")E=(e.left+e.right)/2-m;else if(bt(l)){const V=Object.keys(l)[0],K=l[V];E=this.chart.scales[V].getPixelForValue(K)}L=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?U="top":a==="end"&&(U="bottom"));const j=this._getLabelSizes();for(y=0,S=r.length;y<S;++y){T=r[y],$=T.label;const V=s.setContext(this.getContext(y));I=this.getPixelForTick(y)+s.labelOffset,A=this._resolveTickFontOptions(y),P=A.lineHeight,R=un($)?$.length:1;const K=R/2,J=V.color,ee=V.textStrokeColor,X=V.textStrokeWidth;let oe=L;o?(E=I,L==="inner"&&(y===S-1?oe=this.options.reverse?"left":"right":y===0?oe=this.options.reverse?"right":"left":oe="center"),l==="top"?u==="near"||g!==0?N=-R*P+P/2:u==="center"?N=-j.highest.height/2-K*P+P:N=-j.highest.height+P/2:u==="near"||g!==0?N=P/2:u==="center"?N=j.highest.height/2-K*P:N=j.highest.height-R*P,c&&(N*=-1),g!==0&&!V.showLabelBackdrop&&(E+=P/2*Math.sin(g))):(M=I,N=(1-R)*P/2);let Se;if(V.showLabelBackdrop){const ke=ll(V.backdropPadding),Ce=j.heights[y],We=j.widths[y];let st=N-ke.top,et=0-ke.left;switch(U){case"middle":st-=Ce/2;break;case"bottom":st-=Ce;break}switch(L){case"center":et-=We/2;break;case"right":et-=We;break;case"inner":y===S-1?et-=We:y>0&&(et-=We/2);break}Se={left:et,top:st,width:We+ke.width,height:Ce+ke.height,color:V.backdropColor}}_.push({label:$,font:A,textOffset:N,options:{rotation:g,color:J,strokeColor:ee,strokeWidth:X,textAlign:oe,textBaseline:U,translation:[E,M],backdrop:Se}})}return _}_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<o;++s){const a=l[s];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:l}}=this,s=i.setContext(this.getContext()),o=i.display?s.width:0;if(!o)return;const r=l.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let u,f,c,d;this.isHorizontal()?(u=kl(e,this.left,o)-o/2,f=kl(e,this.right,r)+r/2,c=d=a):(c=kl(e,this.top,o)-o/2,d=kl(e,this.bottom,r)+r/2,u=f=a),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(u,c),t.lineTo(f,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,l=this._computeLabelArea();l&&zu(i,l);const s=this.getLabelItems(e);for(const o of s){const r=o.options,a=o.font,u=o.label,f=o.textOffset;Qc(i,u,0,f,a,r)}l&&Uu(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:l}}=this;if(!i.display)return;const s=Si(i.font),o=ll(i.padding),r=i.align;let a=s.lineHeight/2;t==="bottom"||t==="center"||bt(t)?(a+=o.bottom,un(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=DT(this,a,t,r);Qc(e,i.text,0,0,s,{color:i.color,maxWidth:c,rotation:d,textAlign:MT(r,t,l),textBaseline:"middle",translation:[u,f]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=Ct(e.grid&&e.grid.z,-1),l=Ct(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==mo.prototype.draw?[{z:t,draw: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<o;++s){const r=t[s];r[i]===this.id&&(!e||r.type===e)&&l.push(r)}return l}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return Si(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class zo{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;AT(t)&&(i=this.register(t));const l=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in l||(l[s]=e,IT(e,o,i),this.override&&nn.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,l=this.scope;i in t&&delete t[i],l&&i in nn[l]&&(delete nn[l][i],this.override&&delete Ll[i])}}function IT(n,e,t){const i=Js(Object.create(null),[t?nn.get(t):{},nn.get(e),n.defaults]);nn.set(e,i),n.defaultRoutes&&LT(e,n.defaultRoutes),n.descriptors&&nn.describe(e,n.descriptors)}function LT(n,e){Object.keys(e).forEach(t=>{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 AT(n){return"id"in n&&"defaults"in n}class PT{constructor(){this.controllers=new zo(Rs,"datasets",!0),this.elements=new zo(Al,"elements"),this.plugins=new zo(Object,"plugins"),this.scales=new zo(mo,"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):ht(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;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const l=t.get(e);if(l===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return l}}var bi=new PT;class NT{constructor(){this._init=[]}notify(e,t,i,l){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const s=l?this._descriptors(e).filter(l):this._descriptors(e),o=this._notify(s,e,t,i);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,l){l=l||{};for(const s of e){const o=s.plugin,r=o[i],a=[t,l,s.options];if(dt(r,a,o)===!1&&l.cancelable)return!1}return!0}invalidate(){Kt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,l=Ct(i.options&&i.options.plugins,{}),s=RT(i);return l===!1&&!t?[]:qT(e,s,l,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,l=(s,o)=>s.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 RT(n){const e={},t=[],i=Object.keys(bi.plugins.items);for(let s=0;s<i.length;s++)t.push(bi.getPlugin(i[s]));const l=n.plugins||[];for(let s=0;s<l.length;s++){const o=l[s];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function FT(n,e){return!e&&n===!1?null:n===!0?{}:n}function qT(n,{plugins:e,localIds:t},i,l){const s=[],o=n.getContext();for(const r of e){const a=r.id,u=FT(i[a],l);u!==null&&s.push({plugin:r,options:HT(n.config,{plugin:r,local:t[a]},u,o)})}return s}function HT(n,{plugin:e,local:t},i,l){const s=n.pluginScopeKeys(e),o=n.getOptionScopes(i,s);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,l,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Xa(n,e){const t=nn.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function jT(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function zT(n,e){return n===e?"_index_":"_value_"}function Td(n){if(n==="x"||n==="y"||n==="r")return n}function UT(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qa(n,...e){if(Td(n))return n;for(const t of e){const i=t.axis||UT(t.position)||n.length>1&&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 VT(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 BT(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(!bt(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,VT(o,n),nn.scales[r.type]),u=zT(a,l),f=t.scales||{};s[o]=Ls(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=jT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Ls(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Ls(r,[nn.scales[r.type],nn.scale])}),s}function Ay(n){const e=n.options||(n.options={});e.plugins=Ct(e.plugins,{}),e.scales=BT(n,e)}function Py(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function WT(n){return n=n||{},n.data=Py(n.data),Ay(n),n}const Cd=new Map,Ny=new Set;function Uo(n,e){let t=Cd.get(n);return t||(t=e(),Cd.set(n,t),Ny.add(t)),t}const Ss=(n,e,t)=>{const i=vr(e,t);i!==void 0&&n.add(i)};class YT{constructor(e){this._config=WT(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=Py(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(),Ay(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Uo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Uo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Uo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Uo(`${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=>Ss(a,e,c))),f.forEach(c=>Ss(a,l,c)),f.forEach(c=>Ss(a,Ll[s]||{},c)),f.forEach(c=>Ss(a,nn,c)),f.forEach(c=>Ss(a,Za,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Ny.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(JT(o,t)){s.$shared=!1,i=nl(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 bt(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 KT=n=>bt(n)&&Object.getOwnPropertyNames(n).some(e=>nl(n[e]));function JT(n,e){const{isScriptable:t,isIndexable:i}=gy(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(nl(r)||KT(r))||o&&un(r))return!0}return!1}var ZT="4.4.4";const GT=["top","bottom","left","right","chartArea"];function Ed(n,e){return n==="top"||n==="bottom"||GT.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 XT(n){const e=n.chart,t=e.options.animation;dt(t&&t.onProgress,[n],e)}function Ry(n){return Yu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const rr={},Id=n=>{const e=Ry(n);return Object.values(rr).filter(t=>t.canvas===e).pop()};function QT(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 xT(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Vo(n,e,t){return n.options.clip?n[t]:e[t]}function e$(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Vo(t,e,"left"),right:Vo(t,e,"right"),top:Vo(i,e,"top"),bottom:Vo(i,e,"bottom")}:e}class vi{static register(...e){bi.add(...e),Ld()}static unregister(...e){bi.remove(...e),Ld()}constructor(e,t){const i=this.config=new YT(t),l=Ry(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||gT(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=oS(),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 NT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=CS(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],rr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Li.listen(this,"complete",Dd),Li.listen(this,"progress",XT),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 bi}_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 Li.stop(this),this}resize(e,t){Li.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||{};ht(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"}}))),ht(s,o=>{const r=o.options,a=r.id,u=Qa(a,r),f=Ct(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=bi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ht(l,(o,r)=>{o||delete i[r]}),ht(i,o=>{Ho.configure(this,o,o.options),Ho.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;l<i;++l)this._destroyDatasetMeta(l);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Md("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.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<l;i++){const s=t[i];let o=this.getDatasetMeta(i);const r=s.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=s.indexAxis||Xa(r,this.options),o.order=s.order||0,o.index=i,o.label=""+s.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=bi.getController(r),{datasetElementType:u,dataElementType:f}=nn.datasets[r];Object.assign(a,{dataElementType:bi.getElement(f),datasetElementType:u&&bi.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ht(this.data.datasets,(e,t)=>{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<f;u++){const{controller:c}=this.getDatasetMeta(u),d=!l&&s.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),l||ht(s,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(){ht(this.scales,e=>{Ho.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;QT(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;s<t;s++)if(!jc(l,i(s)))return;return Array.from(l).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ho.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ht(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<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,nl(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),l={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",l)!==!1&&(i.controller._update(t),l.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",l))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Li.has(this)?this.attached&&!Li.running(this)&&Li.start(this):(this.draw(),Dd({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:l}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,l)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let l,s;for(l=0,s=t.length;l<s;++l){const o=t[l];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=e$(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 Gs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=G4.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(),Li.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Xc(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete rr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(s,o)=>{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};ht(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(){ht(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ht(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<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[l+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:s,index:o})=>{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}});!yr(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=dS(e),u=xT(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=!yr(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(vi,"defaults",nn),ct(vi,"instances",rr),ct(vi,"overrides",Ll),ct(vi,"registry",bi),ct(vi,"version",ZT),ct(vi,"getChart",Id);function Ld(){return ht(vi.instances,n=>n._plugins.invalidate())}function Fy(n,e,t=e){n.lineCap=Ct(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Ct(t.borderDash,e.borderDash)),n.lineDashOffset=Ct(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Ct(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Ct(t.borderWidth,e.borderWidth),n.strokeStyle=Ct(t.borderColor,e.borderColor)}function t$(n,e,t){n.lineTo(t.x,t.y)}function n$(n){return n.stepped?jS:n.tension||n.cubicInterpolationMode==="monotone"?zS:t$}function qy(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=l<o&&s<o||l>r&&s>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function i$(n,e,t,i){const{points:l,options:s}=e,{count:o,start:r,loop:a,ilen:u}=qy(l,t,i),f=n$(s);let{move:c=!0,reverse:d}=i||{},m,h,g;for(m=0;m<=u;++m)h=l[(r+(d?u-m:m))%o],!h.skip&&(c?(n.moveTo(h.x,h.y),c=!1):f(n,g,h,d,s.stepped),g=h);return a&&(h=l[(r+(d?u:0))%o],f(n,g,h,d,s.stepped)),!!a}function l$(n,e,t,i){const l=e.points,{count:s,start:o,ilen:r}=qy(l,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,m,h,g,_,y;const S=$=>(o+(u?r-$:$))%s,T=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,E=m.y,M=$|0;M===h?(E<g?g=E:E>_&&(_=E),f=(c*f+$)/++c):(T(),n.lineTo($,E),h=M,c=0,g=_=E),y=E}T()}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?l$:i$}function s$(n){return n.stepped?k4:n.tension||n.cubicInterpolationMode==="monotone"?v4:wl}function o$(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Fy(n,e.options),n.stroke(l)}function r$(n,e,t,i){const{segments:l,options:s}=e,o=xa(e);for(const r of l)Fy(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const a$=typeof Path2D=="function";function u$(n,e,t,i){a$&&!e.options.segment?o$(n,e,t,i):r$(n,e,t,i)}class Gi 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;d4(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=M4(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=Ty(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=s$(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],m=s[c],h=s[d];if(m===h){r.push(m);continue}const g=Math.abs((l-m[t])/(h[t]-m[t])),_=a(m,h,g,i.stepped);_[t]=e[t],r.push(_)}return r.length===1?r[0]:r}pathSegment(e,t,i){return xa(this)(e,this,t,i)}path(e,t,i){const l=this.segments,s=xa(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of l)o&=s(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,l){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),u$(e,this,i,l),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ct(Gi,"id","line"),ct(Gi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ct(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ct(Gi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Ad(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s)<l.radius+l.hitRadius}class ar extends Al{constructor(t){super();ct(this,"parsed");ct(this,"skip");ct(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,l){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],l);return Math.pow(t-o,2)+Math.pow(i-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,i){return Ad(this,t,"x",i)}inYRange(t,i){return Ad(this,t,"y",i)}getCenterPoint(t){const{x:i,y:l}=this.getProps(["x","y"],t);return{x:i,y:l}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const l=i&&t.borderWidth||0;return(i+l)*2}draw(t,i){const l=this.options;this.skip||l.radius<.1||!Gs(this,i,this.size(l)/2)||(t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.fillStyle=l.backgroundColor,Ga(t,l,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}ct(ar,"id","point"),ct(ar,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ct(ar,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function f$(n,e,t){const i=n.segments,l=n.points,s=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Zu(a,u,l);const f=eu(t,l[a],l[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:l[a],end:l[u]});continue}const c=Ty(e,f);for(const d of c){const m=eu(t,s[d.start],s[d.end],d.loop),h=Sy(r,l,m);for(const g of h)o.push({source:g,target:d,start:{[t]:Pd(f,m,"start",Math.max)},end:{[t]:Pd(f,m,"end",Math.min)}})}}return o}function eu(n,e,t,i){if(i)return;let l=e[n],s=t[n];return n==="angle"&&(l=yi(l),s=yi(s)),{property:n,start:l,end:s}}function c$(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{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 Hy(n,e){let t=[],i=!1;return un(n)?(i=!0,t=n):t=c$(n,e),t.length?new Gi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Nd(n){return n&&n.fill!==!1}function d$(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(!wn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function p$(n,e,t){const i=g$(n);if(bt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return wn(l)&&Math.floor(l)===l?m$(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function m$(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function h$(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:bt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function _$(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:bt(n)?i=n.value:i=e.getBaseValue(),i}function g$(n){const e=n.options,t=e.fill;let i=Ct(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function b$(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=y$(e,t);r.push(Hy({x:null,y:e.bottom},i));for(let a=0;a<s.length;a++){const u=s[a];for(let f=u.start;f<=u.end;f++)k$(l,o[f],r)}return new Gi({points:l,options:{}})}function y$(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let l=0;l<i.length;l++){const s=i[l];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function k$(n,e,t){const i=[];for(let l=0;l<t.length;l++){const s=t[l],{first:o,last:r,point:a}=v$(s,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function v$(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const l=i[t],s=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<s.length;u++){const f=s[u],c=o[f.start][t],d=o[f.end][t];if(uy(l,c,d)){r=l===c,a=l===d;break}}return{first:r,last:a,point:i}}class jy{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:l,y:s,radius:o}=this;return t=t||{start:0,end:Ti},e.arc(l,s,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:l}=this,s=e.angle;return{x:t+Math.cos(s)*l,y:i+Math.sin(s)*l,angle:s}}}function w$(n){const{chart:e,fill:t,line:i}=n;if(wn(t))return S$(e,t);if(t==="stack")return b$(n);if(t==="shape")return!0;const l=T$(n);return l instanceof jy?l:Hy(l,i)}function S$(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function T$(n){return(n.scale||{}).getPointPositionForValue?C$(n):$$(n)}function $$(n){const{scale:e={},fill:t}=n,i=h$(t,e);if(wn(i)){const l=e.isHorizontal();return{x:l?i:null,y:l?null:i}}return null}function C$(n){const{scale:e,fill:t}=n,i=e.options,l=e.getLabels().length,s=i.reverse?e.max:e.min,o=_$(t,e,s),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,s);return new jy({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<l;++a)r.push(e.getPointPositionForValue(a,o));return r}function ba(n,e,t){const i=w$(e),{line:l,scale:s,axis:o}=e,r=l.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&l.points.length&&(zu(n,t),O$(n,{line:l,target:i,above:f,below:c,area:t,scale:s,axis:o}),Uu(n))}function O$(n,e){const{line:t,target:i,above:l,below:s,area:o,scale:r}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&s!==l&&(Rd(n,i,o.top),Fd(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore(),n.save(),Rd(n,i,o.bottom)),Fd(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore()}function Rd(n,e,t){const{segments:i,points:l}=e;let s=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=l[a],c=l[Zu(a,u,l)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function Fd(n,e){const{line:t,target:i,property:l,color:s,scale:o}=e,r=f$(t,i,l);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=s}={}}=a,m=i!==!0;n.save(),n.fillStyle=d,E$(n,o,m&&eu(l,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let g;if(m){h?n.closePath():qd(n,i,c,l);const _=!!i.pathSegment(n,u,{move:h,reverse:!0});g=h&&_,g||qd(n,i,f,l)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function E$(n,e,t){const{top:i,bottom:l}=e.chart.chartArea,{property:s,start:o,end:r}=t||{};s==="x"&&(n.beginPath(),n.rect(o,i,r-o,l-i),n.clip())}function qd(n,e,t,i){const l=e.interpolate(t,i);l&&n.lineTo(l.x,l.y)}var M$={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,l=[];let s,o,r,a;for(o=0;o<i;++o)s=n.getDatasetMeta(o),r=s.dataset,a=null,r&&r.options&&r instanceof Gi&&(a={visible:n.isDatasetVisible(o),index:o,fill:p$(r,o,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=a,l.push(a);for(o=0;o<i;++o)a=l[o],!(!a||a.fill===!1)&&(a.fill=d$(l,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",l=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let o=l.length-1;o>=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 Es={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;e<t;++e){const r=n[e].element;if(r&&r.hasValue()){const a=r.tooltipPosition();i.add(a.x),l+=a.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((r,a)=>r+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<o;++s){const a=n[s].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=Ja(e,u);f<l&&(l=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function gi(n,e){return e&&(un(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function Ai(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
+ */class L4{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,l){const s=t.listeners[l],o=t.duration;s.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=cy.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 Li=new L4;const rd="transparent",A4={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 P4{constructor(e,t,i,l){const s=t[i];l=No([e.to,l,s,e.from]);const o=No([e.from,s,l]);this._active=!0,this._fn=e.fn||A4[e.type||typeof o],this._easing=Ps[e.easing]||Ps.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=No([e.to,t,l,e.from]),this._from=No([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||t<i),!this._active){this._target[l]=r,this._notify(!0);return}if(t<0){this._target[l]=s;return}a=t/i%2,a=o&&a>1?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<i.length;l++)i[l][t]()}}class $y{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!yt(e))return;const t=Object.keys(nn.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!yt(s))return;const o={};for(const r of t)o[r]=s[r];(un(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=R4(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&N4(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 P4(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 Li.add(this._chart,i),!0}}function N4(n,e){const t=[],i=Object.keys(e);for(let l=0;l<i.length;l++){const s=n[i[l]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function R4(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function ad(n,e){const t=n&&n.options||{},i=t.reverse,l=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:i?s:l,end:i?l:s}}function F4(n,e,t){if(t===!1)return!1;const i=ad(n,t),l=ad(e,t);return{top:l.end,right:i.end,bottom:l.start,left:i.start}}function q4(n){let e,t,i,l;return yt(n)?(e=n.top,t=n.right,i=n.bottom,l=n.left):e=t=i=l=n,{top:e,right:t,bottom:i,left:l,disabled:n===!1}}function Cy(n,e){const t=[],i=n._getSortedDatasetMetas(e);let l,s;for(l=0,s=i.length;l<s;++l)t.push(i[l].index);return t}function ud(n,e,t,i={}){const l=n.keys,s=i.mode==="single";let o,r,a,u;if(e!==null){for(o=0,r=l.length;o<r;++o){if(a=+l[o],a===t){if(i.all)continue;break}u=n.values[a],wn(u)&&(s||e===0||il(e)===il(u))&&(e+=u)}return e}}function H4(n,e){const{iScale:t,vScale:i}=e,l=t.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",o=Object.keys(n),r=new Array(o.length);let a,u,f;for(a=0,u=o.length;a<u;++a)f=o[a],r[a]={[l]:f,[s]:n[f]};return r}function fd(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function j4(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function z4(n){const{min:e,max:t,minDefined:i,maxDefined:l}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:l?t:Number.POSITIVE_INFINITY}}function U4(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function cd(n,e,t,i){for(const l of e.getMatchingVisibleMetas(i).reverse()){const s=n[l.index];if(t&&s>0||!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=j4(s,o,i),c=e.length;let d;for(let m=0;m<c;++m){const h=e[m],{[a]:g,[u]:_}=h,y=h._stacks||(h._stacks={});d=y[u]=U4(l,f,g),d[r]=_,d._top=cd(d,o,!0,i.type),d._bottom=cd(d,o,!1,i.type);const S=d._visualValues||(d._visualValues={});S[r]=_}}function pa(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function V4(n,e){return Nl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function B4(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 ys(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),W4=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Cy(t,!0),values:null};class Rs{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&&ys(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=Ct(i.xAxisID,pa(e,"x")),o=t.yAxisID=Ct(i.yAxisID,pa(e,"y")),r=t.rAxisID=Ct(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&&ys(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(yt(t)){const l=this._cachedMeta;this._data=H4(t,l)}else if(i!==t){if(i){Bc(i,this);const l=this._cachedMeta;ys(l),l._parsed=[]}t&&Object.isExtensible(t)&&TS(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,ys(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{un(l[e])?d=this.parseArrayData(i,l,e,t):yt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(m()&&(a=!1),u=c);i._sorted=a}o&&dd(this,d)}parsePrimitiveData(e,t,i,l){const{iScale:s,vScale:o}=e,r=s.axis,a=o.axis,u=s.getLabels(),f=s===o,c=new Array(l);let d,m,h;for(d=0,m=l;d<m;++d)h=d+i,c[d]={[r]:f||s.parse(u[h],h),[a]:o.parse(t[h],h)};return c}parseArrayData(e,t,i,l){const{xScale:s,yScale:o}=e,r=new Array(l);let a,u,f,c;for(a=0,u=l;a<u;++a)f=a+i,c=t[f],r[a]={x:s.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,l){const{xScale:s,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(l);let f,c,d,m;for(f=0,c=l;f<c;++f)d=f+i,m=t[d],u[f]={x:s.parse(vr(m,r),d),y:o.parse(vr(m,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const l=this.chart,s=this._cachedMeta,o=t[e.axis],r={keys:Cy(l,!0),values:t._stacks[e.axis]._visualValues};return ud(r,o,s.index,{mode:i})}updateRangeFromParsed(e,t,i,l){const s=i[t.axis];let o=s===null?NaN:s;const r=l&&i._stacks[t.axis];l&&r&&(l.values=r,o=ud(l,s,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,l=i._parsed,s=i._sorted&&e===i.iScale,o=l.length,r=this._getOtherScale(e),a=W4(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=z4(r);let d,m;function h(){m=l[d];const g=m[r.axis];return!wn(m[e.axis])||f>g||c<g}for(d=0;d<o&&!(!h()&&(this.updateRangeFromParsed(u,e,m,a),s));++d);if(s){for(d=o-1;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<s;++l)o=t[l][e.axis],wn(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,l=t.vScale,s=this.getParsed(e);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:l?""+l.getLabelForValue(s[l.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=q4(Ct(this.options.clip,F4(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,l=i.data||[],s=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||l.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,s,r,a),f=r;f<r+a;++f){const c=l[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,s))}for(f=0;f<o.length;++f)o[f].draw(e,s)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const l=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];s=o.$context||(o.$context=B4(this.getContext(),e,o)),s.parsed=this.getParsed(e),s.raw=l.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=V4(this.chart.getContext(),this.index)),s.dataset=l,s.index=s.datasetIndex=this.index;return s.active=!!t,s.mode=i,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const l=t==="active",s=this._cachedDataOpts,o=e+"-"+t,r=s[o],a=this.enableOptionSharing&&wr(i);if(r)return pd(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=l?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),m=Object.keys(nn.elements[e]),h=()=>this.getContext(i,l,t),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,s[o]=Object.freeze(pd(g,a))),g}_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 $y(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<l&&this._removeElements(s,l-s)}_insertElements(e,t,i=!0){const l=this._cachedMeta,s=l.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(l._parsed),this.parse(e,t),i&&this.updateElements(s,e,t,"reset")}updateElements(e,t,i,l){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const l=i._parsed.splice(e,t);i._stacked&&ys(i,l)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,l]=e;this[t](i,l)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ct(Rs,"defaults",{}),ct(Rs,"datasetElementType",null),ct(Rs,"dataElementType",null);class sr extends Rs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:l=[],_dataset:s}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=ES(t,l,o);this._drawStart=r,this._drawCount=a,MS(t)&&(r=0,a=l.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=l;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(l,r,a,e)}updateElements(e,t,i,l){const s=l==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,l),d=o.axis,m=r.axis,{spanGaps:h,segment:g}=this.options,_=Zs(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||l==="none",S=t+i,T=e.length;let $=t>0&&this.getParsed(t-1);for(let E=0;E<T;++E){const M=e[E],L=y?M:{};if(E<t||E>=S){L.skip=!0;continue}const I=this.getParsed(E),A=Kt(I[m]),P=L[d]=o.getPixelForValue(I[d],E),R=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],E);L.skip=isNaN(P)||isNaN(R)||A,L.stop=E>0&&Math.abs(I[d]-$[d])>_,g&&(L.parsed=I,L.raw=u.data[E]),c&&(L.options=f||this.resolveDataElementOptions(E,M.active?"active":l)),y||this.updateElement(M,E,L,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ct(sr,"id","line"),ct(sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ct(sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function vl(){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 vl()}parse(){return vl()}format(){return vl()}add(){return vl()}diff(){return vl()}startOf(){return vl()}endOf(){return vl()}}var Oy={_date:Ju};function Y4(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?wS: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 po(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r<a;++r){const{index:u,data:f}=s[r],{lo:c,hi:d}=Y4(s[r],e,o,l);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function K4(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,l){const s=e?Math.abs(i.x-l.x):0,o=t?Math.abs(i.y-l.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function ha(n,e,t,i,l){const s=[];return!l&&!n.isPointInArea(e)||po(n,t,e,function(r,a,u){!l&&!Gs(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&s.push({element:r,datasetIndex:a,index:u})},!0),s}function J4(n,e,t,i){let l=[];function s(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=yS(o,{x:e.x,y:e.y});ay(c,u,f)&&l.push({element:o,datasetIndex:r,index:a})}return po(n,t,e,s),l}function Z4(n,e,t,i,l,s){let o=[];const r=K4(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const m=f.inRange(e.x,e.y,l);if(i&&!m)return;const h=f.getCenterPoint(l);if(!(!!s||n.isPointInArea(h))&&!m)return;const _=r(e,h);_<a?(o=[{element:f,datasetIndex:c,index:d}],a=_):_===a&&o.push({element:f,datasetIndex:c,index:d})}return po(n,t,e,u),o}function _a(n,e,t,i,l,s){return!s&&!n.isPointInArea(e)?[]:t==="r"&&!i?J4(n,e,t,l):Z4(n,e,t,i,l,s)}function md(n,e,t,i,l){const s=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return po(n,t,e,(a,u,f)=>{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 G4={evaluateInteractionItems:po,modes:{index(n,e,t,i){const l=ki(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=ki(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;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const l=ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return ha(n,l,s,i,o)},nearest(n,e,t,i){const l=ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return _a(n,l,s,t.intersect,i,o)},x(n,e,t,i){const l=ki(e,n);return md(n,l,"x",t.intersect,i)},y(n,e,t,i){const l=ki(e,n);return md(n,l,"y",t.intersect,i)}}};const Ey=["left","top","right","bottom"];function ks(n,e){return n.filter(t=>t.pos===e)}function hd(n,e){return n.filter(t=>Ey.indexOf(t.pos)===-1&&t.box.axis===e)}function vs(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 X4(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;t<i;++t)l=n[t],{position:s,options:{stack:o,stackWeight:r=1}}=l,e.push({index:t,box:l,pos:s,horizontal:l.isHorizontal(),weight:l.weight,stack:o&&s+o,stackWeight:r});return e}function Q4(n){const e={};for(const t of n){const{stack:i,pos:l,stackWeight:s}=t;if(!i||!Ey.includes(l))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function x4(n,e){const t=Q4(n),{vBoxMaxWidth:i,hBoxMaxHeight:l}=e;let s,o,r;for(s=0,o=n.length;s<o;++s){r=n[s];const{fullSize:a}=r.box,u=t[r.stack],f=u&&r.stackWeight/u.weight;r.horizontal?(r.width=f?f*i:a&&e.availableWidth,r.height=l):(r.width=i,r.height=f?f*l:a&&e.availableHeight)}return t}function eT(n){const e=X4(n),t=vs(e.filter(u=>u.box.fullSize),!0),i=vs(ks(e,"left"),!0),l=vs(ks(e,"right")),s=vs(ks(e,"top"),!0),o=vs(ks(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:ks(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 My(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 tT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!yt(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&&My(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 nT(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 iT(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 Os(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s<o;++s){r=n[s],a=r.box,a.update(r.width||e.w,r.height||e.h,iT(r.horizontal,e));const{same:c,other:d}=tT(e,t,r,i);u|=c&&l.length,f=f||d,a.fullSize||l.push(r)}return u&&Os(l,e,t,i)||f}function qo(n,e,t,i,l){n.top=t,n.left=e,n.right=e+i,n.bottom=t+l,n.width=i,n.height=l}function gd(n,e,t,i){const l=t.padding;let{x:s,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;wr(u.start)&&(o=u.start),a.fullSize?qo(a,l.left,o,t.outerWidth-l.right-l.left,d):qo(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;wr(u.start)&&(s=u.start),a.fullSize?qo(a,s,l.top,d,t.outerHeight-l.bottom-l.top):qo(a,s,e.top+u.placed,d,c),u.start=s,u.placed+=c,s=a.right}}e.x=s,e.y=o}var Ho={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const l=ll(n.options.layout.padding),s=Math.max(e-l.width,0),o=Math.max(t-l.height,0),r=eT(n.boxes),a=r.vertical,u=r.horizontal;ht(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+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);My(d,ll(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=x4(a.concat(u),c);Os(r.fullSize,m,c,h),Os(a,m,c,h),Os(u,m,c,h)&&Os(a,m,c,h),nT(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},ht(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Dy{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 lT extends Dy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",sT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bd=n=>n===null||n==="";function oT(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[or]={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 Iy=y4?{passive:!0}:!1;function rT(n,e,t){n&&n.addEventListener(e,t,Iy)}function aT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Iy)}function uT(n,e){const t=sT[n.type]||n.type,{x:i,y:l}=ki(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 fT(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 cT(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 yd=0;function Ly(){const n=window.devicePixelRatio;n!==yd&&(yd=n,Xs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function dT(n,e){Xs.size||window.addEventListener("resize",Ly),Xs.set(n,e)}function pT(n){Xs.delete(n),Xs.size||window.removeEventListener("resize",Ly)}function mT(n,e,t){const i=n.canvas,l=i&&Ku(i);if(!l)return;const s=dy((r,a)=>{const u=l.clientWidth;t(r,a),u<l.clientWidth&&t()},window),o=new ResizeObserver(r=>{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),dT(n,s),o}function ga(n,e,t){t&&t.disconnect(),e==="resize"&&pT(n)}function hT(n,e,t){const i=n.canvas,l=dy(s=>{n.ctx!==null&&t(uT(s,n))},n);return rT(i,e,l),l}class _T extends Dy{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(oT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[or])return!1;const i=t[or].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[or],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:fT,detach:cT,resize:mT}[t]||hT;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]||aT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return b4(e,t,i,l)}isAttached(e){const t=e&&Ku(e);return!!(t&&t.isConnected)}}function gT(n){return!Yu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?lT:_T}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 Zs(this.x)&&Zs(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 bT(n,e){const t=n.options.ticks,i=yT(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?vT(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return wT(e,u,s,o/l),u;const f=kT(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Kt(m)?0:r-m,r),c=0,d=o-1;c<d;c++)jo(e,u,f,s[c],s[c+1]);return jo(e,u,f,a,Kt(m)?e.length:a+m),u}return jo(e,u,f),u}function yT(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),l=n._maxLength/t;return Math.floor(Math.min(i,l))}function kT(n,e,t){const i=ST(n),l=e.length/t;if(!i)return Math.max(l,1);const s=hS(i);for(let o=0,r=s.length-1;o<r;o++){const a=s[o];if(a>l)return a}return Math.max(l,1)}function vT(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function wT(n,e,t,i){let l=0,s=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===s&&(e.push(n[o]),l++,s=t[l*i])}function jo(n,e,t,i,l){const s=Ct(i,0),o=Math.min(Ct(l,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),l&&(a=l-i,t=a/Math.floor(a/t)),f=s;f<0;)r++,f=Math.round(s+r*t);for(u=Math.max(s,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(s+r*t))}function ST(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const TT=n=>n==="left"?"right":n==="right"?"left":n,kd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,vd=(n,e)=>Math.min(e||n,n);function wd(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;s<l;s+=i)t.push(n[Math.floor(s)]);return t}function $T(n,e,t){const i=n.ticks.length,l=Math.min(e,i-1),s=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(l),u;if(!(t&&(i===1?u=Math.max(a-s,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(l-1))/2,a+=l<e?u:-u,a<s-r||a>o+r)))return a}function CT(n,e){ht(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;s<l;++s)delete t.data[i[s]];i.splice(0,l)}})}function ws(n){return n.drawTicks?n.tickLength:0}function Sd(n,e){if(!n.display)return 0;const t=Si(n.font,e),i=ll(n.padding);return(un(n.text)?n.text.length:1)*t.lineHeight+i.height}function OT(n,e){return Nl(n,{scale:e,type:"scale"})}function ET(n,e,t){return Nl(n,{tick:t,index:e,type:"tick"})}function MT(n,e,t){let i=OS(n);return(t&&e!=="right"||!t&&e==="right")&&(i=TT(i)),i}function DT(n,e,t,i){const{top:l,left:s,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,m,h;const g=o-l,_=r-s;if(n.isHorizontal()){if(m=Wc(i,s,r),yt(t)){const y=Object.keys(t)[0],S=t[y];h=f[y].getPixelForValue(S)+g-e}else t==="center"?h=(u.bottom+u.top)/2+g-e:h=kd(n,t,e);d=r-s}else{if(yt(t)){const y=Object.keys(t)[0],S=t[y];m=f[y].getPixelForValue(S)-_+e}else t==="center"?m=(u.left+u.right)/2-_+e:m=kd(n,t,e);h=Wc(i,o,l),c=t==="left"?-oi:oi}return{titleX:m,titleY:h,maxWidth:d,rotation:c}}class mo extends Al{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:l}=this;return e=_i(e,Number.POSITIVE_INFINITY),t=_i(t,Number.NEGATIVE_INFINITY),i=_i(i,Number.POSITIVE_INFINITY),l=_i(l,Number.NEGATIVE_INFINITY),{min:_i(e,i),max:_i(t,l),minDefined:wn(e),maxDefined:wn(t)}}getMinMax(e){let{min:t,max:i,minDefined:l,maxDefined:s}=this.getUserBounds(),o;if(l&&s)return{min:t,max:i};const r=this.getMatchingVisibleMetas();for(let a=0,u=r.length;a<u;++a)o=r[a].controller.getMinMax(this,e),l||(t=Math.min(t,o.min)),s||(i=Math.max(i,o.max));return t=s&&t>i?i:t,i=l&&t>i?t:i,{min:_i(t,_i(i,t)),max:_i(i,_i(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=GS(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?wd(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=bT(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){dt(this.options.afterUpdate,[this])}beforeSetDimensions(){dt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){dt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),dt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,l,s;for(i=0,l=e.length;i<l;i++)s=e[i],s.label=dt(t.callback,[s.value,i,e],this)}afterTickToLabelConversion(){dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=vd(this.ticks.length,e.ticks.maxTicksLimit),l=t.minRotation||0,s=t.maxRotation;let o=l,r,a,u;if(!this._isVisible()||!t.display||l>=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=ri(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-ws(e.grid)-t.padding-Sd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=bS(Math.min(Math.asin(ri((f.highest.height+6)/r,-1,1)),Math.asin(ri(a/u,-1,1))-Math.asin(ri(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=ws(s)+a):(e.height=this.maxHeight,e.width=ws(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),g=Math.cos(h),_=Math.sin(h);if(r){const y=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+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<i;t++)Kt(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=wd(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:l,_longestTextCache:s}=this,o=[],r=[],a=Math.floor(t/vd(t,i));let u=0,f=0,c,d,m,h,g,_,y,S,T,$,E;for(c=0;c<t;c+=a){if(h=e[c].label,g=this._resolveTickFontOptions(c),l.font=_=g.string,y=s[_]=s[_]||{data:{},gc:[]},S=g.lineHeight,T=$=0,!Kt(h)&&!un(h))T=Gc(l,y.data,y.gc,T,h),$=S;else if(un(h))for(d=0,m=h.length;d<m;++d)E=h[d],!Kt(E)&&!un(E)&&(T=Gc(l,y.data,y.gc,T,E),$+=S);o.push(T),r.push($),u=Math.max(T,u),f=Math.max($,f)}CT(s,t);const M=o.indexOf(u),L=r.indexOf(f),I=A=>({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 vS(this._alignToPixels?kl(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&&e<t.length){const i=t[e];return i.$context||(i.$context=ET(this.getContext(),e,i))}return this.$context||(this.$context=OT(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=$l(this.labelRotation),i=Math.abs(Math.cos(t)),l=Math.abs(Math.sin(t)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,r=s?s.widest.width+o:0,a=s?s.highest.height+o:0;return this.isHorizontal()?a*i>r*l?r/i:a/l:a*l<r*i?a/i:r/l}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_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=ws(s),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,y=function(K){return kl(i,K,g)};let S,T,$,E,M,L,I,A,P,R,N,U;if(o==="top")S=y(this.bottom),L=this.bottom-d,A=S-_,R=y(e.top)+_,U=e.bottom;else if(o==="bottom")S=y(this.top),R=e.top,U=y(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=y(this.right),M=this.right-d,I=S-_,P=y(e.left)+_,N=e.right;else if(o==="right")S=y(this.left),P=e.left,N=y(e.right)-_,M=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(yt(o)){const K=Object.keys(o)[0],J=o[K];S=y(this.chart.scales[K].getPixelForValue(J))}R=e.top,U=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(yt(o)){const K=Object.keys(o)[0],J=o[K];S=y(this.chart.scales[K].getPixelForValue(J))}M=S-_,I=M-d,P=e.left,N=e.right}const j=Ct(l.ticks.maxTicksLimit,c),V=Math.max(1,Math.ceil(c/j));for(T=0;T<c;T+=V){const K=this.getContext(T),J=s.setContext(K),ee=r.setContext(K),X=J.lineWidth,oe=J.color,Se=ee.dash||[],ke=ee.dashOffset,Ce=J.tickWidth,We=J.tickColor,st=J.tickBorderDash||[],et=J.tickBorderDashOffset;$=$T(this,T,a),$!==void 0&&(E=kl(i,$,X),u?M=I=P=N=E:L=A=R=U=E,m.push({tx1:M,ty1:L,tx2:I,ty2:A,x1:P,y1:R,x2:N,y2:U,width:X,color:oe,borderDash:Se,borderDashOffset:ke,tickWidth:Ce,tickColor:We,tickBorderDash:st,tickBorderDashOffset:et}))}return this._ticksLength=c,this._borderValue=S,m}_computeLabelItems(e){const t=this.axis,i=this.options,{position:l,ticks:s}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=s,d=ws(i.grid),m=d+f,h=c?-f:m,g=-$l(this.labelRotation),_=[];let y,S,T,$,E,M,L,I,A,P,R,N,U="middle";if(l==="top")M=this.bottom-h,L=this._getXAxisLabelAlignment();else if(l==="bottom")M=this.top+h,L=this._getXAxisLabelAlignment();else if(l==="left"){const V=this._getYAxisLabelAlignment(d);L=V.textAlign,E=V.x}else if(l==="right"){const V=this._getYAxisLabelAlignment(d);L=V.textAlign,E=V.x}else if(t==="x"){if(l==="center")M=(e.top+e.bottom)/2+m;else if(yt(l)){const V=Object.keys(l)[0],K=l[V];M=this.chart.scales[V].getPixelForValue(K)+m}L=this._getXAxisLabelAlignment()}else if(t==="y"){if(l==="center")E=(e.left+e.right)/2-m;else if(yt(l)){const V=Object.keys(l)[0],K=l[V];E=this.chart.scales[V].getPixelForValue(K)}L=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?U="top":a==="end"&&(U="bottom"));const j=this._getLabelSizes();for(y=0,S=r.length;y<S;++y){T=r[y],$=T.label;const V=s.setContext(this.getContext(y));I=this.getPixelForTick(y)+s.labelOffset,A=this._resolveTickFontOptions(y),P=A.lineHeight,R=un($)?$.length:1;const K=R/2,J=V.color,ee=V.textStrokeColor,X=V.textStrokeWidth;let oe=L;o?(E=I,L==="inner"&&(y===S-1?oe=this.options.reverse?"left":"right":y===0?oe=this.options.reverse?"right":"left":oe="center"),l==="top"?u==="near"||g!==0?N=-R*P+P/2:u==="center"?N=-j.highest.height/2-K*P+P:N=-j.highest.height+P/2:u==="near"||g!==0?N=P/2:u==="center"?N=j.highest.height/2-K*P:N=j.highest.height-R*P,c&&(N*=-1),g!==0&&!V.showLabelBackdrop&&(E+=P/2*Math.sin(g))):(M=I,N=(1-R)*P/2);let Se;if(V.showLabelBackdrop){const ke=ll(V.backdropPadding),Ce=j.heights[y],We=j.widths[y];let st=N-ke.top,et=0-ke.left;switch(U){case"middle":st-=Ce/2;break;case"bottom":st-=Ce;break}switch(L){case"center":et-=We/2;break;case"right":et-=We;break;case"inner":y===S-1?et-=We:y>0&&(et-=We/2);break}Se={left:et,top:st,width:We+ke.width,height:Ce+ke.height,color:V.backdropColor}}_.push({label:$,font:A,textOffset:N,options:{rotation:g,color:J,strokeColor:ee,strokeWidth:X,textAlign:oe,textBaseline:U,translation:[E,M],backdrop:Se}})}return _}_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<o;++s){const a=l[s];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:l}}=this,s=i.setContext(this.getContext()),o=i.display?s.width:0;if(!o)return;const r=l.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let u,f,c,d;this.isHorizontal()?(u=kl(e,this.left,o)-o/2,f=kl(e,this.right,r)+r/2,c=d=a):(c=kl(e,this.top,o)-o/2,d=kl(e,this.bottom,r)+r/2,u=f=a),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(u,c),t.lineTo(f,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,l=this._computeLabelArea();l&&zu(i,l);const s=this.getLabelItems(e);for(const o of s){const r=o.options,a=o.font,u=o.label,f=o.textOffset;Qc(i,u,0,f,a,r)}l&&Uu(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:l}}=this;if(!i.display)return;const s=Si(i.font),o=ll(i.padding),r=i.align;let a=s.lineHeight/2;t==="bottom"||t==="center"||yt(t)?(a+=o.bottom,un(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=DT(this,a,t,r);Qc(e,i.text,0,0,s,{color:i.color,maxWidth:c,rotation:d,textAlign:MT(r,t,l),textBaseline:"middle",translation:[u,f]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=Ct(e.grid&&e.grid.z,-1),l=Ct(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==mo.prototype.draw?[{z:t,draw: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<o;++s){const r=t[s];r[i]===this.id&&(!e||r.type===e)&&l.push(r)}return l}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return Si(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class zo{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;AT(t)&&(i=this.register(t));const l=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in l||(l[s]=e,IT(e,o,i),this.override&&nn.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,l=this.scope;i in t&&delete t[i],l&&i in nn[l]&&(delete nn[l][i],this.override&&delete Ll[i])}}function IT(n,e,t){const i=Js(Object.create(null),[t?nn.get(t):{},nn.get(e),n.defaults]);nn.set(e,i),n.defaultRoutes&&LT(e,n.defaultRoutes),n.descriptors&&nn.describe(e,n.descriptors)}function LT(n,e){Object.keys(e).forEach(t=>{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 AT(n){return"id"in n&&"defaults"in n}class PT{constructor(){this.controllers=new zo(Rs,"datasets",!0),this.elements=new zo(Al,"elements"),this.plugins=new zo(Object,"plugins"),this.scales=new zo(mo,"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):ht(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;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const l=t.get(e);if(l===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return l}}var bi=new PT;class NT{constructor(){this._init=[]}notify(e,t,i,l){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const s=l?this._descriptors(e).filter(l):this._descriptors(e),o=this._notify(s,e,t,i);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,l){l=l||{};for(const s of e){const o=s.plugin,r=o[i],a=[t,l,s.options];if(dt(r,a,o)===!1&&l.cancelable)return!1}return!0}invalidate(){Kt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,l=Ct(i.options&&i.options.plugins,{}),s=RT(i);return l===!1&&!t?[]:qT(e,s,l,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,l=(s,o)=>s.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 RT(n){const e={},t=[],i=Object.keys(bi.plugins.items);for(let s=0;s<i.length;s++)t.push(bi.getPlugin(i[s]));const l=n.plugins||[];for(let s=0;s<l.length;s++){const o=l[s];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function FT(n,e){return!e&&n===!1?null:n===!0?{}:n}function qT(n,{plugins:e,localIds:t},i,l){const s=[],o=n.getContext();for(const r of e){const a=r.id,u=FT(i[a],l);u!==null&&s.push({plugin:r,options:HT(n.config,{plugin:r,local:t[a]},u,o)})}return s}function HT(n,{plugin:e,local:t},i,l){const s=n.pluginScopeKeys(e),o=n.getOptionScopes(i,s);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,l,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Xa(n,e){const t=nn.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function jT(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function zT(n,e){return n===e?"_index_":"_value_"}function Td(n){if(n==="x"||n==="y"||n==="r")return n}function UT(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qa(n,...e){if(Td(n))return n;for(const t of e){const i=t.axis||UT(t.position)||n.length>1&&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 VT(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 BT(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(!yt(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,VT(o,n),nn.scales[r.type]),u=zT(a,l),f=t.scales||{};s[o]=Ls(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=jT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Ls(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Ls(r,[nn.scales[r.type],nn.scale])}),s}function Ay(n){const e=n.options||(n.options={});e.plugins=Ct(e.plugins,{}),e.scales=BT(n,e)}function Py(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function WT(n){return n=n||{},n.data=Py(n.data),Ay(n),n}const Cd=new Map,Ny=new Set;function Uo(n,e){let t=Cd.get(n);return t||(t=e(),Cd.set(n,t),Ny.add(t)),t}const Ss=(n,e,t)=>{const i=vr(e,t);i!==void 0&&n.add(i)};class YT{constructor(e){this._config=WT(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=Py(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(),Ay(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Uo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Uo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Uo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Uo(`${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=>Ss(a,e,c))),f.forEach(c=>Ss(a,l,c)),f.forEach(c=>Ss(a,Ll[s]||{},c)),f.forEach(c=>Ss(a,nn,c)),f.forEach(c=>Ss(a,Za,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Ny.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(JT(o,t)){s.$shared=!1,i=nl(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 yt(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 KT=n=>yt(n)&&Object.getOwnPropertyNames(n).some(e=>nl(n[e]));function JT(n,e){const{isScriptable:t,isIndexable:i}=gy(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(nl(r)||KT(r))||o&&un(r))return!0}return!1}var ZT="4.4.4";const GT=["top","bottom","left","right","chartArea"];function Ed(n,e){return n==="top"||n==="bottom"||GT.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 XT(n){const e=n.chart,t=e.options.animation;dt(t&&t.onProgress,[n],e)}function Ry(n){return Yu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const rr={},Id=n=>{const e=Ry(n);return Object.values(rr).filter(t=>t.canvas===e).pop()};function QT(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 xT(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Vo(n,e,t){return n.options.clip?n[t]:e[t]}function e$(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Vo(t,e,"left"),right:Vo(t,e,"right"),top:Vo(i,e,"top"),bottom:Vo(i,e,"bottom")}:e}class vi{static register(...e){bi.add(...e),Ld()}static unregister(...e){bi.remove(...e),Ld()}constructor(e,t){const i=this.config=new YT(t),l=Ry(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||gT(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=oS(),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 NT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=CS(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],rr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Li.listen(this,"complete",Dd),Li.listen(this,"progress",XT),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 bi}_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 Li.stop(this),this}resize(e,t){Li.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||{};ht(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"}}))),ht(s,o=>{const r=o.options,a=r.id,u=Qa(a,r),f=Ct(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=bi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ht(l,(o,r)=>{o||delete i[r]}),ht(i,o=>{Ho.configure(this,o,o.options),Ho.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;l<i;++l)this._destroyDatasetMeta(l);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Md("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.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<l;i++){const s=t[i];let o=this.getDatasetMeta(i);const r=s.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=s.indexAxis||Xa(r,this.options),o.order=s.order||0,o.index=i,o.label=""+s.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=bi.getController(r),{datasetElementType:u,dataElementType:f}=nn.datasets[r];Object.assign(a,{dataElementType:bi.getElement(f),datasetElementType:u&&bi.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ht(this.data.datasets,(e,t)=>{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<f;u++){const{controller:c}=this.getDatasetMeta(u),d=!l&&s.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),l||ht(s,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(){ht(this.scales,e=>{Ho.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;QT(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;s<t;s++)if(!jc(l,i(s)))return;return Array.from(l).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ho.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ht(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<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,nl(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),l={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",l)!==!1&&(i.controller._update(t),l.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",l))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Li.has(this)?this.attached&&!Li.running(this)&&Li.start(this):(this.draw(),Dd({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:l}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,l)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let l,s;for(l=0,s=t.length;l<s;++l){const o=t[l];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=e$(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 Gs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=G4.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(),Li.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Xc(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete rr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(s,o)=>{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};ht(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(){ht(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ht(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<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[l+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:s,index:o})=>{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}});!yr(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=dS(e),u=xT(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=!yr(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(vi,"defaults",nn),ct(vi,"instances",rr),ct(vi,"overrides",Ll),ct(vi,"registry",bi),ct(vi,"version",ZT),ct(vi,"getChart",Id);function Ld(){return ht(vi.instances,n=>n._plugins.invalidate())}function Fy(n,e,t=e){n.lineCap=Ct(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Ct(t.borderDash,e.borderDash)),n.lineDashOffset=Ct(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Ct(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Ct(t.borderWidth,e.borderWidth),n.strokeStyle=Ct(t.borderColor,e.borderColor)}function t$(n,e,t){n.lineTo(t.x,t.y)}function n$(n){return n.stepped?jS:n.tension||n.cubicInterpolationMode==="monotone"?zS:t$}function qy(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=l<o&&s<o||l>r&&s>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function i$(n,e,t,i){const{points:l,options:s}=e,{count:o,start:r,loop:a,ilen:u}=qy(l,t,i),f=n$(s);let{move:c=!0,reverse:d}=i||{},m,h,g;for(m=0;m<=u;++m)h=l[(r+(d?u-m:m))%o],!h.skip&&(c?(n.moveTo(h.x,h.y),c=!1):f(n,g,h,d,s.stepped),g=h);return a&&(h=l[(r+(d?u:0))%o],f(n,g,h,d,s.stepped)),!!a}function l$(n,e,t,i){const l=e.points,{count:s,start:o,ilen:r}=qy(l,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,m,h,g,_,y;const S=$=>(o+(u?r-$:$))%s,T=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,E=m.y,M=$|0;M===h?(E<g?g=E:E>_&&(_=E),f=(c*f+$)/++c):(T(),n.lineTo($,E),h=M,c=0,g=_=E),y=E}T()}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?l$:i$}function s$(n){return n.stepped?k4:n.tension||n.cubicInterpolationMode==="monotone"?v4:wl}function o$(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Fy(n,e.options),n.stroke(l)}function r$(n,e,t,i){const{segments:l,options:s}=e,o=xa(e);for(const r of l)Fy(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const a$=typeof Path2D=="function";function u$(n,e,t,i){a$&&!e.options.segment?o$(n,e,t,i):r$(n,e,t,i)}class Gi 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;d4(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=M4(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=Ty(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=s$(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],m=s[c],h=s[d];if(m===h){r.push(m);continue}const g=Math.abs((l-m[t])/(h[t]-m[t])),_=a(m,h,g,i.stepped);_[t]=e[t],r.push(_)}return r.length===1?r[0]:r}pathSegment(e,t,i){return xa(this)(e,this,t,i)}path(e,t,i){const l=this.segments,s=xa(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of l)o&=s(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,l){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),u$(e,this,i,l),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ct(Gi,"id","line"),ct(Gi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ct(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ct(Gi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Ad(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s)<l.radius+l.hitRadius}class ar extends Al{constructor(t){super();ct(this,"parsed");ct(this,"skip");ct(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,l){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],l);return Math.pow(t-o,2)+Math.pow(i-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,i){return Ad(this,t,"x",i)}inYRange(t,i){return Ad(this,t,"y",i)}getCenterPoint(t){const{x:i,y:l}=this.getProps(["x","y"],t);return{x:i,y:l}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const l=i&&t.borderWidth||0;return(i+l)*2}draw(t,i){const l=this.options;this.skip||l.radius<.1||!Gs(this,i,this.size(l)/2)||(t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.fillStyle=l.backgroundColor,Ga(t,l,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}ct(ar,"id","point"),ct(ar,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ct(ar,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function f$(n,e,t){const i=n.segments,l=n.points,s=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Zu(a,u,l);const f=eu(t,l[a],l[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:l[a],end:l[u]});continue}const c=Ty(e,f);for(const d of c){const m=eu(t,s[d.start],s[d.end],d.loop),h=Sy(r,l,m);for(const g of h)o.push({source:g,target:d,start:{[t]:Pd(f,m,"start",Math.max)},end:{[t]:Pd(f,m,"end",Math.min)}})}}return o}function eu(n,e,t,i){if(i)return;let l=e[n],s=t[n];return n==="angle"&&(l=yi(l),s=yi(s)),{property:n,start:l,end:s}}function c$(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{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 Hy(n,e){let t=[],i=!1;return un(n)?(i=!0,t=n):t=c$(n,e),t.length?new Gi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Nd(n){return n&&n.fill!==!1}function d$(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(!wn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function p$(n,e,t){const i=g$(n);if(yt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return wn(l)&&Math.floor(l)===l?m$(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function m$(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function h$(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:yt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function _$(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:yt(n)?i=n.value:i=e.getBaseValue(),i}function g$(n){const e=n.options,t=e.fill;let i=Ct(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function b$(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=y$(e,t);r.push(Hy({x:null,y:e.bottom},i));for(let a=0;a<s.length;a++){const u=s[a];for(let f=u.start;f<=u.end;f++)k$(l,o[f],r)}return new Gi({points:l,options:{}})}function y$(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let l=0;l<i.length;l++){const s=i[l];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function k$(n,e,t){const i=[];for(let l=0;l<t.length;l++){const s=t[l],{first:o,last:r,point:a}=v$(s,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function v$(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const l=i[t],s=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<s.length;u++){const f=s[u],c=o[f.start][t],d=o[f.end][t];if(uy(l,c,d)){r=l===c,a=l===d;break}}return{first:r,last:a,point:i}}class jy{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:l,y:s,radius:o}=this;return t=t||{start:0,end:Ti},e.arc(l,s,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:l}=this,s=e.angle;return{x:t+Math.cos(s)*l,y:i+Math.sin(s)*l,angle:s}}}function w$(n){const{chart:e,fill:t,line:i}=n;if(wn(t))return S$(e,t);if(t==="stack")return b$(n);if(t==="shape")return!0;const l=T$(n);return l instanceof jy?l:Hy(l,i)}function S$(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function T$(n){return(n.scale||{}).getPointPositionForValue?C$(n):$$(n)}function $$(n){const{scale:e={},fill:t}=n,i=h$(t,e);if(wn(i)){const l=e.isHorizontal();return{x:l?i:null,y:l?null:i}}return null}function C$(n){const{scale:e,fill:t}=n,i=e.options,l=e.getLabels().length,s=i.reverse?e.max:e.min,o=_$(t,e,s),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,s);return new jy({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<l;++a)r.push(e.getPointPositionForValue(a,o));return r}function ba(n,e,t){const i=w$(e),{line:l,scale:s,axis:o}=e,r=l.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&l.points.length&&(zu(n,t),O$(n,{line:l,target:i,above:f,below:c,area:t,scale:s,axis:o}),Uu(n))}function O$(n,e){const{line:t,target:i,above:l,below:s,area:o,scale:r}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&s!==l&&(Rd(n,i,o.top),Fd(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore(),n.save(),Rd(n,i,o.bottom)),Fd(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore()}function Rd(n,e,t){const{segments:i,points:l}=e;let s=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=l[a],c=l[Zu(a,u,l)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function Fd(n,e){const{line:t,target:i,property:l,color:s,scale:o}=e,r=f$(t,i,l);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=s}={}}=a,m=i!==!0;n.save(),n.fillStyle=d,E$(n,o,m&&eu(l,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let g;if(m){h?n.closePath():qd(n,i,c,l);const _=!!i.pathSegment(n,u,{move:h,reverse:!0});g=h&&_,g||qd(n,i,f,l)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function E$(n,e,t){const{top:i,bottom:l}=e.chart.chartArea,{property:s,start:o,end:r}=t||{};s==="x"&&(n.beginPath(),n.rect(o,i,r-o,l-i),n.clip())}function qd(n,e,t,i){const l=e.interpolate(t,i);l&&n.lineTo(l.x,l.y)}var M$={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,l=[];let s,o,r,a;for(o=0;o<i;++o)s=n.getDatasetMeta(o),r=s.dataset,a=null,r&&r.options&&r instanceof Gi&&(a={visible:n.isDatasetVisible(o),index:o,fill:p$(r,o,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=a,l.push(a);for(o=0;o<i;++o)a=l[o],!(!a||a.fill===!1)&&(a.fill=d$(l,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",l=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let o=l.length-1;o>=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 Es={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;e<t;++e){const r=n[e].element;if(r&&r.hasValue()){const a=r.tooltipPosition();i.add(a.x),l+=a.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((r,a)=>r+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<o;++s){const a=n[s].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=Ja(e,u);f<l&&(l=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function gi(n,e){return e&&(un(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function Ai(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
 `)>-1?n.split(`
-`):n}function D$(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=Si(e.bodyFont),u=Si(e.titleFont),f=Si(e.footerFont),c=s.length,d=l.length,m=i.length,h=ll(e.padding);let g=h.height,_=0,y=i.reduce(($,E)=>$+E.before.length+E.lines.length+E.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){_=Math.max(_,t.measureText($).width+S)};return t.save(),t.font=u.string,ht(n.title,T),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,ht(i,$=>{ht($.before,T),ht($.lines,T),ht($.after,T)}),S=0,t.font=f.string,ht(n.footer,T),t.restore(),_+=h.width,{width:_,height:g}}function I$(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function L$(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 A$(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"),L$(u,n,e,t)&&(u="center"),u}function jd(n,e,t){const i=t.yAlign||e.yAlign||I$(n,t);return{xAlign:t.xAlign||e.xAlign||A$(n,e,t,i),yAlign:i}}function P$(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function N$(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}=lr(o);let h=P$(e,r);const g=N$(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:ri(h,0,i.width-e.width),y:ri(g,0,i.height-e.height)}}function Bo(n,e,t){const i=ll(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 gi([],Ai(n))}function R$(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 zy={beforeTitle:Ii,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<i)return t[e.dataIndex]}return""},afterTitle:Ii,beforeBody:Ii,beforeLabel:Ii,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Kt(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ii,afterBody:Ii,beforeFooter:Ii,footer:Ii,afterFooter:Ii};function Dn(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?zy[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 $y(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=R$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=Dn(i,"beforeTitle",this,e),s=Dn(i,"title",this,e),o=Dn(i,"afterTitle",this,e);let r=[];return r=gi(r,Ai(l)),r=gi(r,Ai(s)),r=gi(r,Ai(o)),r}getBeforeBody(e,t){return Ud(Dn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return ht(e,s=>{const o={before:[],lines:[],after:[]},r=Vd(i,s);gi(o.before,Ai(Dn(r,"beforeLabel",this,s))),gi(o.lines,Dn(r,"label",this,s)),gi(o.after,Ai(Dn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Ud(Dn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=Dn(i,"beforeFooter",this,e),s=Dn(i,"footer",this,e),o=Dn(i,"afterFooter",this,e);let r=[];return r=gi(r,Ai(l)),r=gi(r,Ai(s)),r=gi(r,Ai(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;a<u;++a)r.push(D$(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ht(r,f=>{const c=Vd(e.callbacks,f);l.push(Dn(c,"labelColor",this,f)),s.push(Dn(c,"labelPointStyle",this,f)),o.push(Dn(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=Es[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}=lr(r),{x:d,y:m}=e,{width:h,height:g}=t;let _,y,S,T,$,E;return s==="center"?($=m+g/2,l==="left"?(_=d,y=_-o,T=$+o,E=$-o):(_=d+h,y=_+o,T=$-o,E=$+o),S=_):(l==="left"?y=d+Math.max(a,f)+o:l==="right"?y=d+h-Math.max(u,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,_=y-o,S=y+o):(T=m+g,$=T+o,_=y+o,S=y-o),E=T),{x1:_,x2:y,x3:S,y1:T,y2:$,y3:E}}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=Bo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Si(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<s;++a)t.fillText(l[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===s&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,l,s){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u}=s,f=Si(s.bodyFont),c=Bo(this,"left",s),d=l.x(c),m=a<f.lineHeight?(f.lineHeight-a)/2:0,h=t.y+m;if(s.usePointStyle){const g={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},_=l.leftForLtr(d,u)+u/2,y=h+a/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Ga(e,g,_,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Ga(e,g,_,y)}else{e.lineWidth=bt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const g=l.leftForLtr(d,u),_=l.leftForLtr(l.xPlus(d,1),u-2),y=lr(o.borderRadius);Object.values(y).some(S=>S!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,xc(e,{x:g,y:h,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),xc(e,{x:_,y:h+1,w:u-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,h,u,a),e.strokeRect(g,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,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=Si(i.bodyFont);let d=c.lineHeight,m=0;const h=da(i.rtl,this.x,this.width),g=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},_=h.textAlign(o);let y,S,T,$,E,M,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Bo(this,_,i),t.fillStyle=i.bodyColor,ht(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,M=l.length;$<M;++$){for(y=l[$],S=this.labelTextColors[$],t.fillStyle=S,ht(y.before,g),T=y.lines,r&&T.length&&(this._drawColorBox(t,e,$,h,i),d=Math.max(c.lineHeight,a)),E=0,L=T.length;E<L;++E)g(T[E]),d=c.lineHeight;ht(y.after,g)}m=0,d=c.lineHeight,ht(this.afterBody,g),e.y-=s}drawFooter(e,t,i){const l=this.footer,s=l.length;let o,r;if(s){const a=da(i.rtl,this.x,this.width);for(e.x=Bo(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=Si(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<s;++r)t.fillText(l[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,l){const{xAlign:s,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:m,bottomRight:h}=lr(l.cornerRadius);t.fillStyle=l.backgroundColor,t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,l),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&s==="right"&&this.drawCaret(e,t,i,l),t.lineTo(r+u,a+f-h),t.quadraticCurveTo(r+u,a+f,r+u-h,a+f),o==="bottom"&&this.drawCaret(e,t,i,l),t.lineTo(r+m,a+f),t.quadraticCurveTo(r,a+f,r,a+f-m),o==="center"&&s==="left"&&this.drawCaret(e,t,i,l),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),l.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Es[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=ll(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),T4(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),$4(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=!yr(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||!yr(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=Es[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}ct(tu,"positioners",Es);var F$={id:"tooltip",_element:tu,positioners:Es,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:zy},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 q$(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:g,max:_}=e,y=!Kt(o),S=!Kt(r),T=!Kt(u),$=(_-g)/(c+1);let E=Uc((_-g)/h/m)*m,M,L,I,A;if(E<1e-14&&!y&&!S)return[{value:g},{value:_}];A=Math.ceil(_/E)-Math.floor(g/E),A>h&&(E=Uc(A*E/h/m)*m),Kt(a)||(M=Math.pow(10,a),E=Math.ceil(E*M)/M),l==="ticks"?(L=Math.floor(g/E)*E,I=Math.ceil(_/E)*E):(L=g,I=_),y&&S&&s&&_S((r-o)/s,E/1e3)?(A=Math.round(Math.min((r-o)/E,f)),E=(r-o)/A,L=o,I=r):T?(L=y?o:L,I=S?r:I,A=u-1,E=(I-L)/A):(A=(I-L)/E,As(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Vc(E),Vc(L));M=Math.pow(10,Kt(a)?P:a),L=Math.round(L*M)/M,I=Math.round(I*M)/M;let R=0;for(y&&(d&&L!==o?(t.push({value:o}),L<o&&R++,As(Math.round((L+R*E)*M)/M,o,Bd(o,$,n))&&R++):L<o&&R++);R<A;++R){const N=Math.round((L+R*E)*M)/M;if(S&&N>r)break;t.push({value:N})}return S&&d&&I!==r?t.length&&As(t[t.length-1].value,r,Bd(r,$,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 H$ extends mo{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=il(l),u=il(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=q$(l,s);return e.bounds==="ticks"&&gS(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 py(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends H${determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=wn(e)?e:0,this.max=wn(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:hy.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}},Pn=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)),wn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Zs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Kd(n,e,t,i){const l=Pn.length;for(let s=Pn.indexOf(n);s<l-1;++s){const o=zr[Pn[s]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return Pn[s]}return Pn[l-1]}function j$(n,e,t,i,l){for(let s=Pn.length-1;s>=Pn.indexOf(t);s--){const o=Pn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Pn[t?Pn.indexOf(t):0]}function z$(n){for(let e=Pn.indexOf(n)+1,t=Pn.length;e<t;++e)if(zr[Pn[e]].common)return Pn[e]}function Jd(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:l}=Hu(t,e),s=t[i]>=e?t[i]:t[l];n[s]=!0}}function U$(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<s;++o)r=e[o],l[r]=o,i.push({value:r,major:!1});return s===0||!t?i:U$(n,i,l,t)}class Qs extends mo{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const i=e.time||(e.time={}),l=this._adapter=new Oy._date(e.adapters.date);l.init(t),Ls(i.displayFormats,l.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Yd(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:l,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(l=Math.min(l,u.min)),!r&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),l=wn(l)&&!isNaN(l)?l:+t.startOf(Date.now(),i),s=wn(s)&&!isNaN(s)?s:+t.endOf(Date.now(),i)+1,this.min=Math.min(l,s-1),this.max=Math.max(l+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,l=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&l.length&&(this.min=this._userMin||l[0],this.max=this._userMax||l[l.length-1]);const s=this.min,o=this.max,r=SS(l,s,o);return this._unit=t.unit||(i.autoSkip?Kd(t.minUnit,this.min,this.max,this._getLabelCapacity(s)):j$(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:z$(this._unit),this.initOffsets(l),e.reverse&&r.reverse(),Zd(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+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=ri(t,0,o),i=ri(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=Ct(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Zs(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<i;d=+e.add(d,r,o),m++)Jd(f,d,h);return(d===i||l.bounds==="ticks"||m===1)&&Jd(f,d,h),Object.keys(f).sort(Wd).map(g=>+g)}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;t<i;++t)l=e[t],l.label=this._tickFormatFunction(l.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,l=$l(this.isHorizontal()?t.maxRotation:t.minRotation),s=Math.cos(l),o=Math.sin(l),r=this._resolveTickFontOptions(0).size;return{w:i*s+r*o,h:i*o+r*s}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,l=i[t.unit]||i.millisecond,s=this._tickFormatFunction(e,0,Zd(this,[e],this._majorUnit),l),o=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?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<i;++t)e=e.concat(l[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const l=this.getLabels();for(t=0,i=l.length;t<i;++t)e.push(Yd(this,l[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return $S(e.sort(Wd))}}ct(Qs,"id","time"),ct(Qs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Wo(n,e,t){let i=0,l=n.length-1,s,o,r,a;t?(e>=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 Qs{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=Wo(t,this.min),this._tableRange=Wo(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<r;++o)u=e[o],u>=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;o<r;++o)f=l[o+1],a=l[o-1],u=l[o],Math.round((f+a)/2)!==u&&s.push({time:u,pos:o/(r-1)});return s}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((l,s)=>l-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(Wo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Wo(this._table,i*this._tableRange+this._minPos,!0)}}ct(Gd,"id","timeseries"),ct(Gd,"defaults",Qs.defaults);/*!
+`):n}function D$(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=Si(e.bodyFont),u=Si(e.titleFont),f=Si(e.footerFont),c=s.length,d=l.length,m=i.length,h=ll(e.padding);let g=h.height,_=0,y=i.reduce(($,E)=>$+E.before.length+E.lines.length+E.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){_=Math.max(_,t.measureText($).width+S)};return t.save(),t.font=u.string,ht(n.title,T),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,ht(i,$=>{ht($.before,T),ht($.lines,T),ht($.after,T)}),S=0,t.font=f.string,ht(n.footer,T),t.restore(),_+=h.width,{width:_,height:g}}function I$(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function L$(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 A$(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"),L$(u,n,e,t)&&(u="center"),u}function jd(n,e,t){const i=t.yAlign||e.yAlign||I$(n,t);return{xAlign:t.xAlign||e.xAlign||A$(n,e,t,i),yAlign:i}}function P$(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function N$(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}=lr(o);let h=P$(e,r);const g=N$(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:ri(h,0,i.width-e.width),y:ri(g,0,i.height-e.height)}}function Bo(n,e,t){const i=ll(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 gi([],Ai(n))}function R$(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 zy={beforeTitle:Ii,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<i)return t[e.dataIndex]}return""},afterTitle:Ii,beforeBody:Ii,beforeLabel:Ii,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Kt(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ii,afterBody:Ii,beforeFooter:Ii,footer:Ii,afterFooter:Ii};function Dn(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?zy[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 $y(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=R$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=Dn(i,"beforeTitle",this,e),s=Dn(i,"title",this,e),o=Dn(i,"afterTitle",this,e);let r=[];return r=gi(r,Ai(l)),r=gi(r,Ai(s)),r=gi(r,Ai(o)),r}getBeforeBody(e,t){return Ud(Dn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return ht(e,s=>{const o={before:[],lines:[],after:[]},r=Vd(i,s);gi(o.before,Ai(Dn(r,"beforeLabel",this,s))),gi(o.lines,Dn(r,"label",this,s)),gi(o.after,Ai(Dn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Ud(Dn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=Dn(i,"beforeFooter",this,e),s=Dn(i,"footer",this,e),o=Dn(i,"afterFooter",this,e);let r=[];return r=gi(r,Ai(l)),r=gi(r,Ai(s)),r=gi(r,Ai(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;a<u;++a)r.push(D$(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ht(r,f=>{const c=Vd(e.callbacks,f);l.push(Dn(c,"labelColor",this,f)),s.push(Dn(c,"labelPointStyle",this,f)),o.push(Dn(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=Es[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}=lr(r),{x:d,y:m}=e,{width:h,height:g}=t;let _,y,S,T,$,E;return s==="center"?($=m+g/2,l==="left"?(_=d,y=_-o,T=$+o,E=$-o):(_=d+h,y=_+o,T=$-o,E=$+o),S=_):(l==="left"?y=d+Math.max(a,f)+o:l==="right"?y=d+h-Math.max(u,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,_=y-o,S=y+o):(T=m+g,$=T+o,_=y+o,S=y-o),E=T),{x1:_,x2:y,x3:S,y1:T,y2:$,y3:E}}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=Bo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Si(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<s;++a)t.fillText(l[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===s&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,l,s){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u}=s,f=Si(s.bodyFont),c=Bo(this,"left",s),d=l.x(c),m=a<f.lineHeight?(f.lineHeight-a)/2:0,h=t.y+m;if(s.usePointStyle){const g={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},_=l.leftForLtr(d,u)+u/2,y=h+a/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Ga(e,g,_,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Ga(e,g,_,y)}else{e.lineWidth=yt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const g=l.leftForLtr(d,u),_=l.leftForLtr(l.xPlus(d,1),u-2),y=lr(o.borderRadius);Object.values(y).some(S=>S!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,xc(e,{x:g,y:h,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),xc(e,{x:_,y:h+1,w:u-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,h,u,a),e.strokeRect(g,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,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=Si(i.bodyFont);let d=c.lineHeight,m=0;const h=da(i.rtl,this.x,this.width),g=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},_=h.textAlign(o);let y,S,T,$,E,M,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Bo(this,_,i),t.fillStyle=i.bodyColor,ht(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,M=l.length;$<M;++$){for(y=l[$],S=this.labelTextColors[$],t.fillStyle=S,ht(y.before,g),T=y.lines,r&&T.length&&(this._drawColorBox(t,e,$,h,i),d=Math.max(c.lineHeight,a)),E=0,L=T.length;E<L;++E)g(T[E]),d=c.lineHeight;ht(y.after,g)}m=0,d=c.lineHeight,ht(this.afterBody,g),e.y-=s}drawFooter(e,t,i){const l=this.footer,s=l.length;let o,r;if(s){const a=da(i.rtl,this.x,this.width);for(e.x=Bo(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=Si(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<s;++r)t.fillText(l[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,l){const{xAlign:s,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:m,bottomRight:h}=lr(l.cornerRadius);t.fillStyle=l.backgroundColor,t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,l),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&s==="right"&&this.drawCaret(e,t,i,l),t.lineTo(r+u,a+f-h),t.quadraticCurveTo(r+u,a+f,r+u-h,a+f),o==="bottom"&&this.drawCaret(e,t,i,l),t.lineTo(r+m,a+f),t.quadraticCurveTo(r,a+f,r,a+f-m),o==="center"&&s==="left"&&this.drawCaret(e,t,i,l),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),l.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Es[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=ll(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),T4(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),$4(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=!yr(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||!yr(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=Es[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}ct(tu,"positioners",Es);var F$={id:"tooltip",_element:tu,positioners:Es,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:zy},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 q$(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:g,max:_}=e,y=!Kt(o),S=!Kt(r),T=!Kt(u),$=(_-g)/(c+1);let E=Uc((_-g)/h/m)*m,M,L,I,A;if(E<1e-14&&!y&&!S)return[{value:g},{value:_}];A=Math.ceil(_/E)-Math.floor(g/E),A>h&&(E=Uc(A*E/h/m)*m),Kt(a)||(M=Math.pow(10,a),E=Math.ceil(E*M)/M),l==="ticks"?(L=Math.floor(g/E)*E,I=Math.ceil(_/E)*E):(L=g,I=_),y&&S&&s&&_S((r-o)/s,E/1e3)?(A=Math.round(Math.min((r-o)/E,f)),E=(r-o)/A,L=o,I=r):T?(L=y?o:L,I=S?r:I,A=u-1,E=(I-L)/A):(A=(I-L)/E,As(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Vc(E),Vc(L));M=Math.pow(10,Kt(a)?P:a),L=Math.round(L*M)/M,I=Math.round(I*M)/M;let R=0;for(y&&(d&&L!==o?(t.push({value:o}),L<o&&R++,As(Math.round((L+R*E)*M)/M,o,Bd(o,$,n))&&R++):L<o&&R++);R<A;++R){const N=Math.round((L+R*E)*M)/M;if(S&&N>r)break;t.push({value:N})}return S&&d&&I!==r?t.length&&As(t[t.length-1].value,r,Bd(r,$,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 H$ extends mo{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=il(l),u=il(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=q$(l,s);return e.bounds==="ticks"&&gS(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 py(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends H${determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=wn(e)?e:0,this.max=wn(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:hy.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}},Pn=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)),wn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Zs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Kd(n,e,t,i){const l=Pn.length;for(let s=Pn.indexOf(n);s<l-1;++s){const o=zr[Pn[s]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return Pn[s]}return Pn[l-1]}function j$(n,e,t,i,l){for(let s=Pn.length-1;s>=Pn.indexOf(t);s--){const o=Pn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Pn[t?Pn.indexOf(t):0]}function z$(n){for(let e=Pn.indexOf(n)+1,t=Pn.length;e<t;++e)if(zr[Pn[e]].common)return Pn[e]}function Jd(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:l}=Hu(t,e),s=t[i]>=e?t[i]:t[l];n[s]=!0}}function U$(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<s;++o)r=e[o],l[r]=o,i.push({value:r,major:!1});return s===0||!t?i:U$(n,i,l,t)}class Qs extends mo{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const i=e.time||(e.time={}),l=this._adapter=new Oy._date(e.adapters.date);l.init(t),Ls(i.displayFormats,l.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Yd(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:l,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(l=Math.min(l,u.min)),!r&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),l=wn(l)&&!isNaN(l)?l:+t.startOf(Date.now(),i),s=wn(s)&&!isNaN(s)?s:+t.endOf(Date.now(),i)+1,this.min=Math.min(l,s-1),this.max=Math.max(l+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,l=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&l.length&&(this.min=this._userMin||l[0],this.max=this._userMax||l[l.length-1]);const s=this.min,o=this.max,r=SS(l,s,o);return this._unit=t.unit||(i.autoSkip?Kd(t.minUnit,this.min,this.max,this._getLabelCapacity(s)):j$(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:z$(this._unit),this.initOffsets(l),e.reverse&&r.reverse(),Zd(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+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=ri(t,0,o),i=ri(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=Ct(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Zs(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<i;d=+e.add(d,r,o),m++)Jd(f,d,h);return(d===i||l.bounds==="ticks"||m===1)&&Jd(f,d,h),Object.keys(f).sort(Wd).map(g=>+g)}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;t<i;++t)l=e[t],l.label=this._tickFormatFunction(l.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,l=$l(this.isHorizontal()?t.maxRotation:t.minRotation),s=Math.cos(l),o=Math.sin(l),r=this._resolveTickFontOptions(0).size;return{w:i*s+r*o,h:i*o+r*s}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,l=i[t.unit]||i.millisecond,s=this._tickFormatFunction(e,0,Zd(this,[e],this._majorUnit),l),o=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?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<i;++t)e=e.concat(l[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const l=this.getLabels();for(t=0,i=l.length;t<i;++t)e.push(Yd(this,l[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return $S(e.sort(Wd))}}ct(Qs,"id","time"),ct(Qs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Wo(n,e,t){let i=0,l=n.length-1,s,o,r,a;t?(e>=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 Qs{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=Wo(t,this.min),this._tableRange=Wo(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<r;++o)u=e[o],u>=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;o<r;++o)f=l[o+1],a=l[o-1],u=l[o],Math.round((f+a)/2)!==u&&s.push({time:u,pos:o/(r-1)});return s}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((l,s)=>l-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(Wo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Wo(this._table,i*this._tableRange+this._minPos,!0)}}ct(Gd,"id","timeseries"),ct(Gd,"defaults",Qs.defaults);/*!
  * chartjs-adapter-luxon v1.3.1
  * https://www.chartjs.org
  * (c) 2023 chartjs-adapter-luxon Contributors
@@ -42,24 +42,24 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
  * 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(W,G,ne){return setTimeout(T(W,ne),G)}function d(W,G,ne){return Array.isArray(W)?(m(W,ne[G],ne),!0):!1}function m(W,G,ne){var de;if(W)if(W.forEach)W.forEach(G,ne);else if(W.length!==l)for(de=0;de<W.length;)G.call(ne,W[de],de,W),de++;else for(de in W)W.hasOwnProperty(de)&&G.call(ne,W[de],de,W)}function h(W,G,ne){var de="DEPRECATED METHOD: "+G+`
 `+ne+` AT 
-`;return function(){var Ie=new Error("get-stack-trace"),Ye=Ie&&Ie.stack?Ie.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",mt=e.console&&(e.console.warn||e.console.log);return mt&&mt.call(e.console,de,Ye),W.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=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<arguments.length;de++){var Ie=arguments[de];if(Ie!==l&&Ie!==null)for(var Ye in Ie)Ie.hasOwnProperty(Ye)&&(ne[Ye]=Ie[Ye])}return ne}:g=Object.assign;var _=h(function(G,ne,de){for(var Ie=Object.keys(ne),Ye=0;Ye<Ie.length;)(!de||de&&G[Ie[Ye]]===l)&&(G[Ie[Ye]]=ne[Ie[Ye]]),Ye++;return G},"extend","Use `assign`."),y=h(function(G,ne){return _(G,ne,!0)},"merge","Use `assign`.");function S(W,G,ne){var de=G.prototype,Ie;Ie=W.prototype=Object.create(de),Ie.constructor=W,Ie._super=de,ne&&g(Ie,ne)}function T(W,G){return function(){return W.apply(G,arguments)}}function $(W,G){return typeof W==r?W.apply(G&&G[0]||l,G):W}function E(W,G){return W===l?G:W}function M(W,G,ne){m(P(G),function(de){W.addEventListener(de,ne,!1)})}function L(W,G,ne){m(P(G),function(de){W.removeEventListener(de,ne,!1)})}function I(W,G){for(;W;){if(W==G)return!0;W=W.parentNode}return!1}function A(W,G){return W.indexOf(G)>-1}function P(W){return W.trim().split(/\s+/g)}function R(W,G,ne){if(W.indexOf&&!ne)return W.indexOf(G);for(var de=0;de<W.length;){if(ne&&W[de][ne]==G||!ne&&W[de]===G)return de;de++}return-1}function N(W){return Array.prototype.slice.call(W,0)}function U(W,G,ne){for(var de=[],Ie=[],Ye=0;Ye<W.length;){var mt=W[Ye][G];R(Ie,mt)<0&&de.push(W[Ye]),Ie[Ye]=mt,Ye++}return de=de.sort(function(dn,Tn){return dn[G]>Tn[G]}),de}function j(W,G){for(var ne,de,Ie=G[0].toUpperCase()+G.slice(1),Ye=0;Ye<s.length;){if(ne=s[Ye],de=ne?ne+Ie:G,de in W)return de;Ye++}return l}var V=1;function K(){return V++}function J(W){var G=W.ownerDocument||W;return G.defaultView||G.parentWindow||e}var ee=/mobile|tablet|ip(ad|hone|od)|android/i,X="ontouchstart"in e,oe=j(e,"PointerEvent")!==l,Se=X&&ee.test(navigator.userAgent),ke="touch",Ce="pen",We="mouse",st="kinect",et=25,Be=1,rt=2,Je=4,at=8,Ht=1,Te=2,Ze=4,ot=8,Le=16,Ve=Te|Ze,we=ot|Le,Oe=Ve|we,ut=["x","y"],Ne=["clientX","clientY"];function xe(W,G){var ne=this;this.manager=W,this.callback=G,this.element=W.element,this.target=W.options.inputTarget,this.domHandler=function(de){$(W.options.enable,[W])&&ne.handler(de)},this.init()}xe.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(J(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(J(this.element),this.evWin,this.domHandler)}};function qt(W){var G,ne=W.options.inputClass;return ne?G=ne:oe?G=cl:Se?G=Re:X?G=ft:G=Hi,new G(W,Zt)}function Zt(W,G,ne){var de=ne.pointers.length,Ie=ne.changedPointers.length,Ye=G&Be&&de-Ie===0,mt=G&(Je|at)&&de-Ie===0;ne.isFirst=!!Ye,ne.isFinal=!!mt,Ye&&(W.session={}),ne.eventType=G,Fe(W,ne),W.emit("hammer.input",ne),W.recognize(ne),W.session.prevInput=ne}function Fe(W,G){var ne=W.session,de=G.pointers,Ie=de.length;ne.firstInput||(ne.firstInput=mn(G)),Ie>1&&!ne.firstMultiple?ne.firstMultiple=mn(G):Ie===1&&(ne.firstMultiple=!1);var Ye=ne.firstInput,mt=ne.firstMultiple,an=mt?mt.center:Ye.center,dn=G.center=hn(de);G.timeStamp=f(),G.deltaTime=G.timeStamp-Ye.timeStamp,G.angle=rn(an,dn),G.distance=gt(an,dn),Dt(ne,G),G.offsetDirection=Ci(G.deltaX,G.deltaY);var Tn=pi(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=mt?rl(mt.pointers,de):1,G.rotation=mt?sn(mt.pointers,de):0,G.maxPointers=ne.prevInput?G.pointers.length>ne.prevInput.maxPointers?G.pointers.length:ne.prevInput.maxPointers:G.pointers.length,Gt(ne,G);var hi=W.element;I(G.srcEvent.target,hi)&&(hi=G.srcEvent.target),G.target=hi}function Dt(W,G){var ne=G.center,de=W.offsetDelta||{},Ie=W.prevDelta||{},Ye=W.prevInput||{};(G.eventType===Be||Ye.eventType===Je)&&(Ie=W.prevDelta={x:Ye.deltaX||0,y:Ye.deltaY||0},de=W.offsetDelta={x:ne.x,y:ne.y}),G.deltaX=Ie.x+(ne.x-de.x),G.deltaY=Ie.y+(ne.y-de.y)}function Gt(W,G){var ne=W.lastInterval||G,de=G.timeStamp-ne.timeStamp,Ie,Ye,mt,an;if(G.eventType!=at&&(de>et||ne.velocity===l)){var dn=G.deltaX-ne.deltaX,Tn=G.deltaY-ne.deltaY,hi=pi(de,dn,Tn);Ye=hi.x,mt=hi.y,Ie=u(hi.x)>u(hi.y)?hi.x:hi.y,an=Ci(dn,Tn),W.lastInterval=G}else Ie=ne.velocity,Ye=ne.velocityX,mt=ne.velocityY,an=ne.direction;G.velocity=Ie,G.velocityX=Ye,G.velocityY=mt,G.direction=an}function mn(W){for(var G=[],ne=0;ne<W.pointers.length;)G[ne]={clientX:a(W.pointers[ne].clientX),clientY:a(W.pointers[ne].clientY)},ne++;return{timeStamp:f(),pointers:G,center:hn(G),deltaX:W.deltaX,deltaY:W.deltaY}}function hn(W){var G=W.length;if(G===1)return{x:a(W[0].clientX),y:a(W[0].clientY)};for(var ne=0,de=0,Ie=0;Ie<G;)ne+=W[Ie].clientX,de+=W[Ie].clientY,Ie++;return{x:a(ne/G),y:a(de/G)}}function pi(W,G,ne){return{x:G/W||0,y:ne/W||0}}function Ci(W,G){return W===G?Ht:u(W)>=u(G)?W<0?Te:Ze:G<0?ot:Le}function gt(W,G,ne){ne||(ne=ut);var de=G[ne[0]]-W[ne[0]],Ie=G[ne[1]]-W[ne[1]];return Math.sqrt(de*de+Ie*Ie)}function rn(W,G,ne){ne||(ne=ut);var de=G[ne[0]]-W[ne[0]],Ie=G[ne[1]]-W[ne[1]];return Math.atan2(Ie,de)*180/Math.PI}function sn(W,G){return rn(G[1],G[0],Ne)+rn(W[1],W[0],Ne)}function rl(W,G){return gt(G[0],G[1],Ne)/gt(W[0],W[1],Ne)}var It={mousedown:Be,mousemove:rt,mouseup:Je},al="mousedown",ul="mousemove mouseup";function Hi(){this.evEl=al,this.evWin=ul,this.pressed=!1,xe.apply(this,arguments)}S(Hi,xe,{handler:function(G){var ne=It[G.type];ne&Be&&G.button===0&&(this.pressed=!0),ne&rt&&G.which!==1&&(ne=Je),this.pressed&&(ne&Je&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[G],changedPointers:[G],pointerType:We,srcEvent:G}))}});var ji={pointerdown:Be,pointermove:rt,pointerup:Je,pointercancel:at,pointerout:at},fl={2:ke,3:Ce,4:We,5:st},Mn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Mn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Mn,this.evWin=Rl,xe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,xe,{handler:function(G){var ne=this.store,de=!1,Ie=G.type.toLowerCase().replace("ms",""),Ye=ji[Ie],mt=fl[G.pointerType]||G.pointerType,an=mt==ke,dn=R(ne,G.pointerId,"pointerId");Ye&Be&&(G.button===0||an)?dn<0&&(ne.push(G),dn=ne.length-1):Ye&(Je|at)&&(de=!0),!(dn<0)&&(ne[dn]=G,this.callback(this.manager,Ye,{pointers:ne,changedPointers:[G],pointerType:mt,srcEvent:G}),de&&ne.splice(dn,1))}});var Z={touchstart:Be,touchmove:rt,touchend:Je,touchcancel:at},Q="touchstart",se="touchstart touchmove touchend touchcancel";function he(){this.evTarget=Q,this.evWin=se,this.started=!1,xe.apply(this,arguments)}S(he,xe,{handler:function(G){var ne=Z[G.type];if(ne===Be&&(this.started=!0),!!this.started){var de=qe.call(this,G,ne);ne&(Je|at)&&de[0].length-de[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:de[0],changedPointers:de[1],pointerType:ke,srcEvent:G})}}});function qe(W,G){var ne=N(W.touches),de=N(W.changedTouches);return G&(Je|at)&&(ne=U(ne.concat(de),"identifier")),[ne,de]}var le={touchstart:Be,touchmove:rt,touchend:Je,touchcancel:at},Ee="touchstart touchmove touchend touchcancel";function Re(){this.evTarget=Ee,this.targetIds={},xe.apply(this,arguments)}S(Re,xe,{handler:function(G){var ne=le[G.type],de=Ke.call(this,G,ne);de&&this.callback(this.manager,ne,{pointers:de[0],changedPointers:de[1],pointerType:ke,srcEvent:G})}});function Ke(W,G){var ne=N(W.touches),de=this.targetIds;if(G&(Be|rt)&&ne.length===1)return de[ne[0].identifier]=!0,[ne,ne];var Ie,Ye,mt=N(W.changedTouches),an=[],dn=this.target;if(Ye=ne.filter(function(Tn){return I(Tn.target,dn)}),G===Be)for(Ie=0;Ie<Ye.length;)de[Ye[Ie].identifier]=!0,Ie++;for(Ie=0;Ie<mt.length;)de[mt[Ie].identifier]&&an.push(mt[Ie]),G&(Je|at)&&delete de[mt[Ie].identifier],Ie++;if(an.length)return[U(Ye.concat(an),"identifier"),an]}var Ae=2500,Ge=25;function ft(){xe.apply(this,arguments);var W=T(this.handler,this);this.touch=new Re(this.manager,W),this.mouse=new Hi(this.manager,W),this.primaryTouch=null,this.lastTouches=[]}S(ft,xe,{handler:function(G,ne,de){var Ie=de.pointerType==ke,Ye=de.pointerType==We;if(!(Ye&&de.sourceCapabilities&&de.sourceCapabilities.firesTouchEvents)){if(Ie)Xt.call(this,ne,de);else if(Ye&&dl.call(this,de))return;this.callback(G,ne,de)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Xt(W,G){W&Be?(this.primaryTouch=G.changedPointers[0].identifier,_n.call(this,G)):W&(Je|at)&&_n.call(this,G)}function _n(W){var G=W.changedPointers[0];if(G.identifier===this.primaryTouch){var ne={x:G.clientX,y:G.clientY};this.lastTouches.push(ne);var de=this.lastTouches,Ie=function(){var Ye=de.indexOf(ne);Ye>-1&&de.splice(Ye,1)};setTimeout(Ie,Ae)}}function dl(W){for(var G=W.srcEvent.clientX,ne=W.srcEvent.clientY,de=0;de<this.lastTouches.length;de++){var Ie=this.lastTouches[de],Ye=Math.abs(G-Ie.x),mt=Math.abs(ne-Ie.y);if(Ye<=Ge&&mt<=Ge)return!0}return!1}var Oi=j(o.style,"touchAction"),go=Oi!==l,Fl="compute",bo="auto",ms="manipulation",Ei="none",pl="pan-x",ml="pan-y",ql=fk();function hs(W,G){this.manager=W,this.set(G)}hs.prototype={set:function(W){W==Fl&&(W=this.compute()),go&&this.manager.element.style&&ql[W]&&(this.manager.element.style[Oi]=W),this.actions=W.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var W=[];return m(this.manager.recognizers,function(G){$(G.options.enable,[G])&&(W=W.concat(G.getTouchAction()))}),Vr(W.join(" "))},preventDefaults:function(W){var G=W.srcEvent,ne=W.offsetDirection;if(this.manager.session.prevented){G.preventDefault();return}var de=this.actions,Ie=A(de,Ei)&&!ql[Ei],Ye=A(de,ml)&&!ql[ml],mt=A(de,pl)&&!ql[pl];if(Ie){var an=W.pointers.length===1,dn=W.distance<2,Tn=W.deltaTime<250;if(an&&dn&&Tn)return}if(!(mt&&Ye)&&(Ie||Ye&&ne&Ve||mt&&ne&we))return this.preventSrc(G)},preventSrc:function(W){this.manager.session.prevented=!0,W.preventDefault()}};function Vr(W){if(A(W,Ei))return Ei;var G=A(W,pl),ne=A(W,ml);return G&&ne?Ei:G||ne?G?pl:ml:A(W,ms)?ms:bo}function fk(){if(!go)return!1;var W={},G=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(ne){W[ne]=G?e.CSS.supports("touch-action",ne):!0}),W}var yo=1,Bn=2,Hl=4,zi=8,Mi=zi,_s=16,mi=32;function Di(W){this.options=g({},this.defaults,W||{}),this.id=K(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=yo,this.simultaneous={},this.requireFail=[]}Di.prototype={defaults:{},set:function(W){return g(this.options,W),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(W){if(d(W,"recognizeWith",this))return this;var G=this.simultaneous;return W=ko(W,this),G[W.id]||(G[W.id]=W,W.recognizeWith(this)),this},dropRecognizeWith:function(W){return d(W,"dropRecognizeWith",this)?this:(W=ko(W,this),delete this.simultaneous[W.id],this)},requireFailure:function(W){if(d(W,"requireFailure",this))return this;var G=this.requireFail;return W=ko(W,this),R(G,W)===-1&&(G.push(W),W.requireFailure(this)),this},dropRequireFailure:function(W){if(d(W,"dropRequireFailure",this))return this;W=ko(W,this);var G=R(this.requireFail,W);return G>-1&&this.requireFail.splice(G,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(W){return!!this.simultaneous[W.id]},emit:function(W){var G=this,ne=this.state;function de(Ie){G.manager.emit(Ie,W)}ne<zi&&de(G.options.event+af(ne)),de(G.options.event),W.additionalEvent&&de(W.additionalEvent),ne>=zi&&de(G.options.event+af(ne))},tryEmit:function(W){if(this.canEmit())return this.emit(W);this.state=mi},canEmit:function(){for(var W=0;W<this.requireFail.length;){if(!(this.requireFail[W].state&(mi|yo)))return!1;W++}return!0},recognize:function(W){var G=g({},W);if(!$(this.options.enable,[this,G])){this.reset(),this.state=mi;return}this.state&(Mi|_s|mi)&&(this.state=yo),this.state=this.process(G),this.state&(Bn|Hl|zi|_s)&&this.tryEmit(G)},process:function(W){},getTouchAction:function(){},reset:function(){}};function af(W){return W&_s?"cancel":W&zi?"end":W&Hl?"move":W&Bn?"start":""}function uf(W){return W==Le?"down":W==ot?"up":W==Te?"left":W==Ze?"right":""}function ko(W,G){var ne=G.manager;return ne?ne.get(W):W}function ni(){Di.apply(this,arguments)}S(ni,Di,{defaults:{pointers:1},attrTest:function(W){var G=this.options.pointers;return G===0||W.pointers.length===G},process:function(W){var G=this.state,ne=W.eventType,de=G&(Bn|Hl),Ie=this.attrTest(W);return de&&(ne&at||!Ie)?G|_s:de||Ie?ne&Je?G|zi:G&Bn?G|Hl:Bn:mi}});function vo(){ni.apply(this,arguments),this.pX=null,this.pY=null}S(vo,ni,{defaults:{event:"pan",threshold:10,pointers:1,direction:Oe},getTouchAction:function(){var W=this.options.direction,G=[];return W&Ve&&G.push(ml),W&we&&G.push(pl),G},directionTest:function(W){var G=this.options,ne=!0,de=W.distance,Ie=W.direction,Ye=W.deltaX,mt=W.deltaY;return Ie&G.direction||(G.direction&Ve?(Ie=Ye===0?Ht:Ye<0?Te:Ze,ne=Ye!=this.pX,de=Math.abs(W.deltaX)):(Ie=mt===0?Ht:mt<0?ot:Le,ne=mt!=this.pY,de=Math.abs(W.deltaY))),W.direction=Ie,ne&&de>G.threshold&&Ie&G.direction},attrTest:function(W){return ni.prototype.attrTest.call(this,W)&&(this.state&Bn||!(this.state&Bn)&&this.directionTest(W))},emit:function(W){this.pX=W.deltaX,this.pY=W.deltaY;var G=uf(W.direction);G&&(W.additionalEvent=this.options.event+G),this._super.emit.call(this,W)}});function Br(){ni.apply(this,arguments)}S(Br,ni,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ei]},attrTest:function(W){return this._super.attrTest.call(this,W)&&(Math.abs(W.scale-1)>this.options.threshold||this.state&Bn)},emit:function(W){if(W.scale!==1){var G=W.scale<1?"in":"out";W.additionalEvent=this.options.event+G}this._super.emit.call(this,W)}});function Wr(){Di.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Di,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(W){var G=this.options,ne=W.pointers.length===G.pointers,de=W.distance<G.threshold,Ie=W.deltaTime>G.time;if(this._input=W,!de||!ne||W.eventType&(Je|at)&&!Ie)this.reset();else if(W.eventType&Be)this.reset(),this._timer=c(function(){this.state=Mi,this.tryEmit()},G.time,this);else if(W.eventType&Je)return Mi;return mi},reset:function(){clearTimeout(this._timer)},emit:function(W){this.state===Mi&&(W&&W.eventType&Je?this.manager.emit(this.options.event+"up",W):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){ni.apply(this,arguments)}S(Yr,ni,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ei]},attrTest:function(W){return this._super.attrTest.call(this,W)&&(Math.abs(W.rotation)>this.options.threshold||this.state&Bn)}});function Kr(){ni.apply(this,arguments)}S(Kr,ni,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ve|we,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(W){var G=this.options.direction,ne;return G&(Ve|we)?ne=W.overallVelocity:G&Ve?ne=W.overallVelocityX:G&we&&(ne=W.overallVelocityY),this._super.attrTest.call(this,W)&&G&W.offsetDirection&&W.distance>this.options.threshold&&W.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&W.eventType&Je},emit:function(W){var G=uf(W.offsetDirection);G&&this.manager.emit(this.options.event+G,W),this.manager.emit(this.options.event,W)}});function wo(){Di.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Di,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ms]},process:function(W){var G=this.options,ne=W.pointers.length===G.pointers,de=W.distance<G.threshold,Ie=W.deltaTime<G.time;if(this.reset(),W.eventType&Be&&this.count===0)return this.failTimeout();if(de&&Ie&&ne){if(W.eventType!=Je)return this.failTimeout();var Ye=this.pTime?W.timeStamp-this.pTime<G.interval:!0,mt=!this.pCenter||gt(this.pCenter,W.center)<G.posThreshold;this.pTime=W.timeStamp,this.pCenter=W.center,!mt||!Ye?this.count=1:this.count+=1,this._input=W;var an=this.count%G.taps;if(an===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Mi,this.tryEmit()},G.interval,this),Bn):Mi}return mi},failTimeout:function(){return this._timer=c(function(){this.state=mi},this.options.interval,this),mi},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Mi&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ui(W,G){return G=G||{},G.recognizers=E(G.recognizers,Ui.defaults.preset),new Jr(W,G)}Ui.VERSION="2.0.7",Ui.defaults={domEvents:!1,touchAction:Fl,enable:!0,inputTarget:null,inputClass:null,preset:[[Yr,{enable:!1}],[Br,{enable:!1},["rotate"]],[Kr,{direction:Ve}],[vo,{direction:Ve},["swipe"]],[wo],[wo,{event:"doubletap",taps:2},["tap"]],[Wr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ck=1,ff=2;function Jr(W,G){this.options=g({},Ui.defaults,G||{}),this.options.inputTarget=this.options.inputTarget||W,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=W,this.input=qt(this),this.touchAction=new hs(this,this.options.touchAction),cf(this,!0),m(this.options.recognizers,function(ne){var de=this.add(new ne[0](ne[1]));ne[2]&&de.recognizeWith(ne[2]),ne[3]&&de.requireFailure(ne[3])},this)}Jr.prototype={set:function(W){return g(this.options,W),W.touchAction&&this.touchAction.update(),W.inputTarget&&(this.input.destroy(),this.input.target=W.inputTarget,this.input.init()),this},stop:function(W){this.session.stopped=W?ff:ck},recognize:function(W){var G=this.session;if(!G.stopped){this.touchAction.preventDefaults(W);var ne,de=this.recognizers,Ie=G.curRecognizer;(!Ie||Ie&&Ie.state&Mi)&&(Ie=G.curRecognizer=null);for(var Ye=0;Ye<de.length;)ne=de[Ye],G.stopped!==ff&&(!Ie||ne==Ie||ne.canRecognizeWith(Ie))?ne.recognize(W):ne.reset(),!Ie&&ne.state&(Bn|Hl|zi)&&(Ie=G.curRecognizer=ne),Ye++}},get:function(W){if(W instanceof Di)return W;for(var G=this.recognizers,ne=0;ne<G.length;ne++)if(G[ne].options.event==W)return G[ne];return null},add:function(W){if(d(W,"add",this))return this;var G=this.get(W.options.event);return G&&this.remove(G),this.recognizers.push(W),W.manager=this,this.touchAction.update(),W},remove:function(W){if(d(W,"remove",this))return this;if(W=this.get(W),W){var G=this.recognizers,ne=R(G,W);ne!==-1&&(G.splice(ne,1),this.touchAction.update())}return this},on:function(W,G){if(W!==l&&G!==l){var ne=this.handlers;return m(P(W),function(de){ne[de]=ne[de]||[],ne[de].push(G)}),this}},off:function(W,G){if(W!==l){var ne=this.handlers;return m(P(W),function(de){G?ne[de]&&ne[de].splice(R(ne[de],G),1):delete ne[de]}),this}},emit:function(W,G){this.options.domEvents&&dk(W,G);var ne=this.handlers[W]&&this.handlers[W].slice();if(!(!ne||!ne.length)){G.type=W,G.preventDefault=function(){G.srcEvent.preventDefault()};for(var de=0;de<ne.length;)ne[de](G),de++}},destroy:function(){this.element&&cf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function cf(W,G){var ne=W.element;if(ne.style){var de;m(W.options.cssProps,function(Ie,Ye){de=j(ne.style,Ye),G?(W.oldCssProps[de]=ne.style[de],ne.style[de]=Ie):ne.style[de]=W.oldCssProps[de]||""}),G||(W.oldCssProps={})}}function dk(W,G){var ne=t.createEvent("Event");ne.initEvent(W,!0,!0),ne.gesture=G,G.target.dispatchEvent(ne)}g(Ui,{INPUT_START:Be,INPUT_MOVE:rt,INPUT_END:Je,INPUT_CANCEL:at,STATE_POSSIBLE:yo,STATE_BEGAN:Bn,STATE_CHANGED:Hl,STATE_ENDED:zi,STATE_RECOGNIZED:Mi,STATE_CANCELLED:_s,STATE_FAILED:mi,DIRECTION_NONE:Ht,DIRECTION_LEFT:Te,DIRECTION_RIGHT:Ze,DIRECTION_UP:ot,DIRECTION_DOWN:Le,DIRECTION_HORIZONTAL:Ve,DIRECTION_VERTICAL:we,DIRECTION_ALL:Oe,Manager:Jr,Input:xe,TouchAction:hs,TouchInput:Re,MouseInput:Hi,PointerEventInput:cl,TouchMouseInput:ft,SingleTouchInput:he,Recognizer:Di,AttrRecognizer:ni,Tap:wo,Pan:vo,Swipe:Kr,Pinch:Br,Rotate:Yr,Press:Wr,on:M,off:L,each:m,merge:y,extend:_,assign:g,inherit:S,bindFn:T,prefixed:j});var pk=typeof e<"u"?e:typeof self<"u"?self:{};pk.Hammer=Ui,n.exports?n.exports=Ui:e[i]=Ui})(window,document,"Hammer")})(Uy);var W$=Uy.exports;const Fs=B$(W$);/*!
+`;return function(){var Ie=new Error("get-stack-trace"),Ye=Ie&&Ie.stack?Ie.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",mt=e.console&&(e.console.warn||e.console.log);return mt&&mt.call(e.console,de,Ye),W.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=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<arguments.length;de++){var Ie=arguments[de];if(Ie!==l&&Ie!==null)for(var Ye in Ie)Ie.hasOwnProperty(Ye)&&(ne[Ye]=Ie[Ye])}return ne}:g=Object.assign;var _=h(function(G,ne,de){for(var Ie=Object.keys(ne),Ye=0;Ye<Ie.length;)(!de||de&&G[Ie[Ye]]===l)&&(G[Ie[Ye]]=ne[Ie[Ye]]),Ye++;return G},"extend","Use `assign`."),y=h(function(G,ne){return _(G,ne,!0)},"merge","Use `assign`.");function S(W,G,ne){var de=G.prototype,Ie;Ie=W.prototype=Object.create(de),Ie.constructor=W,Ie._super=de,ne&&g(Ie,ne)}function T(W,G){return function(){return W.apply(G,arguments)}}function $(W,G){return typeof W==r?W.apply(G&&G[0]||l,G):W}function E(W,G){return W===l?G:W}function M(W,G,ne){m(P(G),function(de){W.addEventListener(de,ne,!1)})}function L(W,G,ne){m(P(G),function(de){W.removeEventListener(de,ne,!1)})}function I(W,G){for(;W;){if(W==G)return!0;W=W.parentNode}return!1}function A(W,G){return W.indexOf(G)>-1}function P(W){return W.trim().split(/\s+/g)}function R(W,G,ne){if(W.indexOf&&!ne)return W.indexOf(G);for(var de=0;de<W.length;){if(ne&&W[de][ne]==G||!ne&&W[de]===G)return de;de++}return-1}function N(W){return Array.prototype.slice.call(W,0)}function U(W,G,ne){for(var de=[],Ie=[],Ye=0;Ye<W.length;){var mt=W[Ye][G];R(Ie,mt)<0&&de.push(W[Ye]),Ie[Ye]=mt,Ye++}return de=de.sort(function(dn,Tn){return dn[G]>Tn[G]}),de}function j(W,G){for(var ne,de,Ie=G[0].toUpperCase()+G.slice(1),Ye=0;Ye<s.length;){if(ne=s[Ye],de=ne?ne+Ie:G,de in W)return de;Ye++}return l}var V=1;function K(){return V++}function J(W){var G=W.ownerDocument||W;return G.defaultView||G.parentWindow||e}var ee=/mobile|tablet|ip(ad|hone|od)|android/i,X="ontouchstart"in e,oe=j(e,"PointerEvent")!==l,Se=X&&ee.test(navigator.userAgent),ke="touch",Ce="pen",We="mouse",st="kinect",et=25,Be=1,rt=2,Je=4,at=8,Ht=1,Te=2,Ze=4,ot=8,Le=16,Ve=Te|Ze,we=ot|Le,Oe=Ve|we,ut=["x","y"],Ne=["clientX","clientY"];function xe(W,G){var ne=this;this.manager=W,this.callback=G,this.element=W.element,this.target=W.options.inputTarget,this.domHandler=function(de){$(W.options.enable,[W])&&ne.handler(de)},this.init()}xe.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(J(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(J(this.element),this.evWin,this.domHandler)}};function qt(W){var G,ne=W.options.inputClass;return ne?G=ne:oe?G=cl:Se?G=Re:X?G=ft:G=Hi,new G(W,Zt)}function Zt(W,G,ne){var de=ne.pointers.length,Ie=ne.changedPointers.length,Ye=G&Be&&de-Ie===0,mt=G&(Je|at)&&de-Ie===0;ne.isFirst=!!Ye,ne.isFinal=!!mt,Ye&&(W.session={}),ne.eventType=G,Fe(W,ne),W.emit("hammer.input",ne),W.recognize(ne),W.session.prevInput=ne}function Fe(W,G){var ne=W.session,de=G.pointers,Ie=de.length;ne.firstInput||(ne.firstInput=mn(G)),Ie>1&&!ne.firstMultiple?ne.firstMultiple=mn(G):Ie===1&&(ne.firstMultiple=!1);var Ye=ne.firstInput,mt=ne.firstMultiple,an=mt?mt.center:Ye.center,dn=G.center=hn(de);G.timeStamp=f(),G.deltaTime=G.timeStamp-Ye.timeStamp,G.angle=rn(an,dn),G.distance=bt(an,dn),Dt(ne,G),G.offsetDirection=Ci(G.deltaX,G.deltaY);var Tn=pi(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=mt?rl(mt.pointers,de):1,G.rotation=mt?sn(mt.pointers,de):0,G.maxPointers=ne.prevInput?G.pointers.length>ne.prevInput.maxPointers?G.pointers.length:ne.prevInput.maxPointers:G.pointers.length,Gt(ne,G);var hi=W.element;I(G.srcEvent.target,hi)&&(hi=G.srcEvent.target),G.target=hi}function Dt(W,G){var ne=G.center,de=W.offsetDelta||{},Ie=W.prevDelta||{},Ye=W.prevInput||{};(G.eventType===Be||Ye.eventType===Je)&&(Ie=W.prevDelta={x:Ye.deltaX||0,y:Ye.deltaY||0},de=W.offsetDelta={x:ne.x,y:ne.y}),G.deltaX=Ie.x+(ne.x-de.x),G.deltaY=Ie.y+(ne.y-de.y)}function Gt(W,G){var ne=W.lastInterval||G,de=G.timeStamp-ne.timeStamp,Ie,Ye,mt,an;if(G.eventType!=at&&(de>et||ne.velocity===l)){var dn=G.deltaX-ne.deltaX,Tn=G.deltaY-ne.deltaY,hi=pi(de,dn,Tn);Ye=hi.x,mt=hi.y,Ie=u(hi.x)>u(hi.y)?hi.x:hi.y,an=Ci(dn,Tn),W.lastInterval=G}else Ie=ne.velocity,Ye=ne.velocityX,mt=ne.velocityY,an=ne.direction;G.velocity=Ie,G.velocityX=Ye,G.velocityY=mt,G.direction=an}function mn(W){for(var G=[],ne=0;ne<W.pointers.length;)G[ne]={clientX:a(W.pointers[ne].clientX),clientY:a(W.pointers[ne].clientY)},ne++;return{timeStamp:f(),pointers:G,center:hn(G),deltaX:W.deltaX,deltaY:W.deltaY}}function hn(W){var G=W.length;if(G===1)return{x:a(W[0].clientX),y:a(W[0].clientY)};for(var ne=0,de=0,Ie=0;Ie<G;)ne+=W[Ie].clientX,de+=W[Ie].clientY,Ie++;return{x:a(ne/G),y:a(de/G)}}function pi(W,G,ne){return{x:G/W||0,y:ne/W||0}}function Ci(W,G){return W===G?Ht:u(W)>=u(G)?W<0?Te:Ze:G<0?ot:Le}function bt(W,G,ne){ne||(ne=ut);var de=G[ne[0]]-W[ne[0]],Ie=G[ne[1]]-W[ne[1]];return Math.sqrt(de*de+Ie*Ie)}function rn(W,G,ne){ne||(ne=ut);var de=G[ne[0]]-W[ne[0]],Ie=G[ne[1]]-W[ne[1]];return Math.atan2(Ie,de)*180/Math.PI}function sn(W,G){return rn(G[1],G[0],Ne)+rn(W[1],W[0],Ne)}function rl(W,G){return bt(G[0],G[1],Ne)/bt(W[0],W[1],Ne)}var It={mousedown:Be,mousemove:rt,mouseup:Je},al="mousedown",ul="mousemove mouseup";function Hi(){this.evEl=al,this.evWin=ul,this.pressed=!1,xe.apply(this,arguments)}S(Hi,xe,{handler:function(G){var ne=It[G.type];ne&Be&&G.button===0&&(this.pressed=!0),ne&rt&&G.which!==1&&(ne=Je),this.pressed&&(ne&Je&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[G],changedPointers:[G],pointerType:We,srcEvent:G}))}});var ji={pointerdown:Be,pointermove:rt,pointerup:Je,pointercancel:at,pointerout:at},fl={2:ke,3:Ce,4:We,5:st},Mn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Mn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Mn,this.evWin=Rl,xe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,xe,{handler:function(G){var ne=this.store,de=!1,Ie=G.type.toLowerCase().replace("ms",""),Ye=ji[Ie],mt=fl[G.pointerType]||G.pointerType,an=mt==ke,dn=R(ne,G.pointerId,"pointerId");Ye&Be&&(G.button===0||an)?dn<0&&(ne.push(G),dn=ne.length-1):Ye&(Je|at)&&(de=!0),!(dn<0)&&(ne[dn]=G,this.callback(this.manager,Ye,{pointers:ne,changedPointers:[G],pointerType:mt,srcEvent:G}),de&&ne.splice(dn,1))}});var Z={touchstart:Be,touchmove:rt,touchend:Je,touchcancel:at},Q="touchstart",se="touchstart touchmove touchend touchcancel";function he(){this.evTarget=Q,this.evWin=se,this.started=!1,xe.apply(this,arguments)}S(he,xe,{handler:function(G){var ne=Z[G.type];if(ne===Be&&(this.started=!0),!!this.started){var de=qe.call(this,G,ne);ne&(Je|at)&&de[0].length-de[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:de[0],changedPointers:de[1],pointerType:ke,srcEvent:G})}}});function qe(W,G){var ne=N(W.touches),de=N(W.changedTouches);return G&(Je|at)&&(ne=U(ne.concat(de),"identifier")),[ne,de]}var le={touchstart:Be,touchmove:rt,touchend:Je,touchcancel:at},Ee="touchstart touchmove touchend touchcancel";function Re(){this.evTarget=Ee,this.targetIds={},xe.apply(this,arguments)}S(Re,xe,{handler:function(G){var ne=le[G.type],de=Ke.call(this,G,ne);de&&this.callback(this.manager,ne,{pointers:de[0],changedPointers:de[1],pointerType:ke,srcEvent:G})}});function Ke(W,G){var ne=N(W.touches),de=this.targetIds;if(G&(Be|rt)&&ne.length===1)return de[ne[0].identifier]=!0,[ne,ne];var Ie,Ye,mt=N(W.changedTouches),an=[],dn=this.target;if(Ye=ne.filter(function(Tn){return I(Tn.target,dn)}),G===Be)for(Ie=0;Ie<Ye.length;)de[Ye[Ie].identifier]=!0,Ie++;for(Ie=0;Ie<mt.length;)de[mt[Ie].identifier]&&an.push(mt[Ie]),G&(Je|at)&&delete de[mt[Ie].identifier],Ie++;if(an.length)return[U(Ye.concat(an),"identifier"),an]}var Ae=2500,Ge=25;function ft(){xe.apply(this,arguments);var W=T(this.handler,this);this.touch=new Re(this.manager,W),this.mouse=new Hi(this.manager,W),this.primaryTouch=null,this.lastTouches=[]}S(ft,xe,{handler:function(G,ne,de){var Ie=de.pointerType==ke,Ye=de.pointerType==We;if(!(Ye&&de.sourceCapabilities&&de.sourceCapabilities.firesTouchEvents)){if(Ie)Xt.call(this,ne,de);else if(Ye&&dl.call(this,de))return;this.callback(G,ne,de)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Xt(W,G){W&Be?(this.primaryTouch=G.changedPointers[0].identifier,_n.call(this,G)):W&(Je|at)&&_n.call(this,G)}function _n(W){var G=W.changedPointers[0];if(G.identifier===this.primaryTouch){var ne={x:G.clientX,y:G.clientY};this.lastTouches.push(ne);var de=this.lastTouches,Ie=function(){var Ye=de.indexOf(ne);Ye>-1&&de.splice(Ye,1)};setTimeout(Ie,Ae)}}function dl(W){for(var G=W.srcEvent.clientX,ne=W.srcEvent.clientY,de=0;de<this.lastTouches.length;de++){var Ie=this.lastTouches[de],Ye=Math.abs(G-Ie.x),mt=Math.abs(ne-Ie.y);if(Ye<=Ge&&mt<=Ge)return!0}return!1}var Oi=j(o.style,"touchAction"),go=Oi!==l,Fl="compute",bo="auto",ms="manipulation",Ei="none",pl="pan-x",ml="pan-y",ql=fk();function hs(W,G){this.manager=W,this.set(G)}hs.prototype={set:function(W){W==Fl&&(W=this.compute()),go&&this.manager.element.style&&ql[W]&&(this.manager.element.style[Oi]=W),this.actions=W.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var W=[];return m(this.manager.recognizers,function(G){$(G.options.enable,[G])&&(W=W.concat(G.getTouchAction()))}),Vr(W.join(" "))},preventDefaults:function(W){var G=W.srcEvent,ne=W.offsetDirection;if(this.manager.session.prevented){G.preventDefault();return}var de=this.actions,Ie=A(de,Ei)&&!ql[Ei],Ye=A(de,ml)&&!ql[ml],mt=A(de,pl)&&!ql[pl];if(Ie){var an=W.pointers.length===1,dn=W.distance<2,Tn=W.deltaTime<250;if(an&&dn&&Tn)return}if(!(mt&&Ye)&&(Ie||Ye&&ne&Ve||mt&&ne&we))return this.preventSrc(G)},preventSrc:function(W){this.manager.session.prevented=!0,W.preventDefault()}};function Vr(W){if(A(W,Ei))return Ei;var G=A(W,pl),ne=A(W,ml);return G&&ne?Ei:G||ne?G?pl:ml:A(W,ms)?ms:bo}function fk(){if(!go)return!1;var W={},G=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(ne){W[ne]=G?e.CSS.supports("touch-action",ne):!0}),W}var yo=1,Bn=2,Hl=4,zi=8,Mi=zi,_s=16,mi=32;function Di(W){this.options=g({},this.defaults,W||{}),this.id=K(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=yo,this.simultaneous={},this.requireFail=[]}Di.prototype={defaults:{},set:function(W){return g(this.options,W),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(W){if(d(W,"recognizeWith",this))return this;var G=this.simultaneous;return W=ko(W,this),G[W.id]||(G[W.id]=W,W.recognizeWith(this)),this},dropRecognizeWith:function(W){return d(W,"dropRecognizeWith",this)?this:(W=ko(W,this),delete this.simultaneous[W.id],this)},requireFailure:function(W){if(d(W,"requireFailure",this))return this;var G=this.requireFail;return W=ko(W,this),R(G,W)===-1&&(G.push(W),W.requireFailure(this)),this},dropRequireFailure:function(W){if(d(W,"dropRequireFailure",this))return this;W=ko(W,this);var G=R(this.requireFail,W);return G>-1&&this.requireFail.splice(G,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(W){return!!this.simultaneous[W.id]},emit:function(W){var G=this,ne=this.state;function de(Ie){G.manager.emit(Ie,W)}ne<zi&&de(G.options.event+af(ne)),de(G.options.event),W.additionalEvent&&de(W.additionalEvent),ne>=zi&&de(G.options.event+af(ne))},tryEmit:function(W){if(this.canEmit())return this.emit(W);this.state=mi},canEmit:function(){for(var W=0;W<this.requireFail.length;){if(!(this.requireFail[W].state&(mi|yo)))return!1;W++}return!0},recognize:function(W){var G=g({},W);if(!$(this.options.enable,[this,G])){this.reset(),this.state=mi;return}this.state&(Mi|_s|mi)&&(this.state=yo),this.state=this.process(G),this.state&(Bn|Hl|zi|_s)&&this.tryEmit(G)},process:function(W){},getTouchAction:function(){},reset:function(){}};function af(W){return W&_s?"cancel":W&zi?"end":W&Hl?"move":W&Bn?"start":""}function uf(W){return W==Le?"down":W==ot?"up":W==Te?"left":W==Ze?"right":""}function ko(W,G){var ne=G.manager;return ne?ne.get(W):W}function ni(){Di.apply(this,arguments)}S(ni,Di,{defaults:{pointers:1},attrTest:function(W){var G=this.options.pointers;return G===0||W.pointers.length===G},process:function(W){var G=this.state,ne=W.eventType,de=G&(Bn|Hl),Ie=this.attrTest(W);return de&&(ne&at||!Ie)?G|_s:de||Ie?ne&Je?G|zi:G&Bn?G|Hl:Bn:mi}});function vo(){ni.apply(this,arguments),this.pX=null,this.pY=null}S(vo,ni,{defaults:{event:"pan",threshold:10,pointers:1,direction:Oe},getTouchAction:function(){var W=this.options.direction,G=[];return W&Ve&&G.push(ml),W&we&&G.push(pl),G},directionTest:function(W){var G=this.options,ne=!0,de=W.distance,Ie=W.direction,Ye=W.deltaX,mt=W.deltaY;return Ie&G.direction||(G.direction&Ve?(Ie=Ye===0?Ht:Ye<0?Te:Ze,ne=Ye!=this.pX,de=Math.abs(W.deltaX)):(Ie=mt===0?Ht:mt<0?ot:Le,ne=mt!=this.pY,de=Math.abs(W.deltaY))),W.direction=Ie,ne&&de>G.threshold&&Ie&G.direction},attrTest:function(W){return ni.prototype.attrTest.call(this,W)&&(this.state&Bn||!(this.state&Bn)&&this.directionTest(W))},emit:function(W){this.pX=W.deltaX,this.pY=W.deltaY;var G=uf(W.direction);G&&(W.additionalEvent=this.options.event+G),this._super.emit.call(this,W)}});function Br(){ni.apply(this,arguments)}S(Br,ni,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ei]},attrTest:function(W){return this._super.attrTest.call(this,W)&&(Math.abs(W.scale-1)>this.options.threshold||this.state&Bn)},emit:function(W){if(W.scale!==1){var G=W.scale<1?"in":"out";W.additionalEvent=this.options.event+G}this._super.emit.call(this,W)}});function Wr(){Di.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Di,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(W){var G=this.options,ne=W.pointers.length===G.pointers,de=W.distance<G.threshold,Ie=W.deltaTime>G.time;if(this._input=W,!de||!ne||W.eventType&(Je|at)&&!Ie)this.reset();else if(W.eventType&Be)this.reset(),this._timer=c(function(){this.state=Mi,this.tryEmit()},G.time,this);else if(W.eventType&Je)return Mi;return mi},reset:function(){clearTimeout(this._timer)},emit:function(W){this.state===Mi&&(W&&W.eventType&Je?this.manager.emit(this.options.event+"up",W):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){ni.apply(this,arguments)}S(Yr,ni,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ei]},attrTest:function(W){return this._super.attrTest.call(this,W)&&(Math.abs(W.rotation)>this.options.threshold||this.state&Bn)}});function Kr(){ni.apply(this,arguments)}S(Kr,ni,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ve|we,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(W){var G=this.options.direction,ne;return G&(Ve|we)?ne=W.overallVelocity:G&Ve?ne=W.overallVelocityX:G&we&&(ne=W.overallVelocityY),this._super.attrTest.call(this,W)&&G&W.offsetDirection&&W.distance>this.options.threshold&&W.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&W.eventType&Je},emit:function(W){var G=uf(W.offsetDirection);G&&this.manager.emit(this.options.event+G,W),this.manager.emit(this.options.event,W)}});function wo(){Di.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Di,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ms]},process:function(W){var G=this.options,ne=W.pointers.length===G.pointers,de=W.distance<G.threshold,Ie=W.deltaTime<G.time;if(this.reset(),W.eventType&Be&&this.count===0)return this.failTimeout();if(de&&Ie&&ne){if(W.eventType!=Je)return this.failTimeout();var Ye=this.pTime?W.timeStamp-this.pTime<G.interval:!0,mt=!this.pCenter||bt(this.pCenter,W.center)<G.posThreshold;this.pTime=W.timeStamp,this.pCenter=W.center,!mt||!Ye?this.count=1:this.count+=1,this._input=W;var an=this.count%G.taps;if(an===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Mi,this.tryEmit()},G.interval,this),Bn):Mi}return mi},failTimeout:function(){return this._timer=c(function(){this.state=mi},this.options.interval,this),mi},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Mi&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ui(W,G){return G=G||{},G.recognizers=E(G.recognizers,Ui.defaults.preset),new Jr(W,G)}Ui.VERSION="2.0.7",Ui.defaults={domEvents:!1,touchAction:Fl,enable:!0,inputTarget:null,inputClass:null,preset:[[Yr,{enable:!1}],[Br,{enable:!1},["rotate"]],[Kr,{direction:Ve}],[vo,{direction:Ve},["swipe"]],[wo],[wo,{event:"doubletap",taps:2},["tap"]],[Wr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ck=1,ff=2;function Jr(W,G){this.options=g({},Ui.defaults,G||{}),this.options.inputTarget=this.options.inputTarget||W,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=W,this.input=qt(this),this.touchAction=new hs(this,this.options.touchAction),cf(this,!0),m(this.options.recognizers,function(ne){var de=this.add(new ne[0](ne[1]));ne[2]&&de.recognizeWith(ne[2]),ne[3]&&de.requireFailure(ne[3])},this)}Jr.prototype={set:function(W){return g(this.options,W),W.touchAction&&this.touchAction.update(),W.inputTarget&&(this.input.destroy(),this.input.target=W.inputTarget,this.input.init()),this},stop:function(W){this.session.stopped=W?ff:ck},recognize:function(W){var G=this.session;if(!G.stopped){this.touchAction.preventDefaults(W);var ne,de=this.recognizers,Ie=G.curRecognizer;(!Ie||Ie&&Ie.state&Mi)&&(Ie=G.curRecognizer=null);for(var Ye=0;Ye<de.length;)ne=de[Ye],G.stopped!==ff&&(!Ie||ne==Ie||ne.canRecognizeWith(Ie))?ne.recognize(W):ne.reset(),!Ie&&ne.state&(Bn|Hl|zi)&&(Ie=G.curRecognizer=ne),Ye++}},get:function(W){if(W instanceof Di)return W;for(var G=this.recognizers,ne=0;ne<G.length;ne++)if(G[ne].options.event==W)return G[ne];return null},add:function(W){if(d(W,"add",this))return this;var G=this.get(W.options.event);return G&&this.remove(G),this.recognizers.push(W),W.manager=this,this.touchAction.update(),W},remove:function(W){if(d(W,"remove",this))return this;if(W=this.get(W),W){var G=this.recognizers,ne=R(G,W);ne!==-1&&(G.splice(ne,1),this.touchAction.update())}return this},on:function(W,G){if(W!==l&&G!==l){var ne=this.handlers;return m(P(W),function(de){ne[de]=ne[de]||[],ne[de].push(G)}),this}},off:function(W,G){if(W!==l){var ne=this.handlers;return m(P(W),function(de){G?ne[de]&&ne[de].splice(R(ne[de],G),1):delete ne[de]}),this}},emit:function(W,G){this.options.domEvents&&dk(W,G);var ne=this.handlers[W]&&this.handlers[W].slice();if(!(!ne||!ne.length)){G.type=W,G.preventDefault=function(){G.srcEvent.preventDefault()};for(var de=0;de<ne.length;)ne[de](G),de++}},destroy:function(){this.element&&cf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function cf(W,G){var ne=W.element;if(ne.style){var de;m(W.options.cssProps,function(Ie,Ye){de=j(ne.style,Ye),G?(W.oldCssProps[de]=ne.style[de],ne.style[de]=Ie):ne.style[de]=W.oldCssProps[de]||""}),G||(W.oldCssProps={})}}function dk(W,G){var ne=t.createEvent("Event");ne.initEvent(W,!0,!0),ne.gesture=G,G.target.dispatchEvent(ne)}g(Ui,{INPUT_START:Be,INPUT_MOVE:rt,INPUT_END:Je,INPUT_CANCEL:at,STATE_POSSIBLE:yo,STATE_BEGAN:Bn,STATE_CHANGED:Hl,STATE_ENDED:zi,STATE_RECOGNIZED:Mi,STATE_CANCELLED:_s,STATE_FAILED:mi,DIRECTION_NONE:Ht,DIRECTION_LEFT:Te,DIRECTION_RIGHT:Ze,DIRECTION_UP:ot,DIRECTION_DOWN:Le,DIRECTION_HORIZONTAL:Ve,DIRECTION_VERTICAL:we,DIRECTION_ALL:Oe,Manager:Jr,Input:xe,TouchAction:hs,TouchInput:Re,MouseInput:Hi,PointerEventInput:cl,TouchMouseInput:ft,SingleTouchInput:he,Recognizer:Di,AttrRecognizer:ni,Tap:wo,Pan:vo,Swipe:Kr,Pinch:Br,Rotate:Yr,Press:Wr,on:M,off:L,each:m,merge:y,extend:_,assign:g,inherit:S,bindFn:T,prefixed:j});var pk=typeof e<"u"?e:typeof self<"u"?self:{};pk.Hammer=Ui,n.exports?n.exports=Ui:e[i]=Ui})(window,document,"Hammer")})(Uy);var W$=Uy.exports;const Fs=B$(W$);/*!
 * chartjs-plugin-zoom v2.0.1
 * undefined
  * (c) 2016-2023 chartjs-plugin-zoom Contributors
  * Released under the MIT License
- */const xs=n=>n&&n.enabled&&n.modifierKey,Vy=(n,e)=>n&&e[n+"Key"],Gu=(n,e)=>n&&!e[n+"Key"];function sl(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 ya(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 Y$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function K$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s<l.length;s++){const o=i[l[s]];if(e>=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function By(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=K$(e,t),r=ya(i,t),a=ya(l,t);if(s){const f=ya(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 ht(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 J$(n){iu.delete(n)}function Wy(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=Ct(o.options,o.scale)}return Ct(s,l)}function Z$(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,e<c?(e=c,t=Math.min(c+m,d)):t>d&&(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 G$(n,e,t,i){const l=Wy(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return fs(n,s,i,!0)}function X$(n,e,t,i){fs(n,Z$(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 Q$(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<t&&(n.max+=1)}function x$(n,e,t,i){const l=Wy(n,e,t);n.min===n.max&&e<1&&Q$(n);const s={min:n.min+Qd(l.min),max:n.max-Qd(l.max)};return fs(n,s,i,!0)}function eC(n){return n.isHorizontal()?n.width:n.height}function tC(n,e,t){const l=n.getLabels().length-1;let{min:s,max:o}=n;const r=Math.max(o-s,1),a=Math.round(eC(n)/Math.max(r,10)),u=Math.round(Math.abs(e/a));let f;return e<-a?(o=Math.min(o+u,l),s=r===1?o:o-r,f=o===l):e>a&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),fs(n,{min:s,max:o},t)||f}const nC={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 Yy(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=nC[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)||u<c||f>d?!0:fs(n,{min:u,max:f},t,i)}function xd(n,e,t){return Yy(n,e,t,!0)}const lu={category:x$,default:G$},su={default:X$},ou={category:tC,default:Yy,logarithmic:xd,timeseries:xd};function iC(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){ht(n,(t,i)=>{e[i]||delete n[i]})}function cs(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return ht(t,function(s){iC(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 lC(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=lC(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=By(a,s,n);ht(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 Ky(n,e,t,i="none"){const l=Jt(n),{options:{limits:s,zoom:o}}=l,{mode:r="xy"}=o;cs(n,l);const a=sl(r,"x",n),u=sl(r,"y",n);ht(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 sC(n,e,t,i="none"){cs(n,Jt(n));const l=n.scales[e];fs(l,t,void 0,!0),n.update(i)}function oC(n,e="default"){const t=Jt(n),i=cs(n,t);ht(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 rC(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Ct(l.options,l.scale)-Ct(i.options,i.scale)}function aC(n){const e=Jt(n);let t=1,i=1;return ht(n.scales,function(l){const s=rC(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;il(s)===il(e)&&(e+=s);const o=ou[n.type]||ou.default;dt(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function Jy(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;ht(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 Zy(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 uC(n){const e=Zy(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 Ln(n,e){const{handlers:t}=Jt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function qs(n,e,t,i){const{handlers:l,options:s}=Jt(n),o=l[t];o&&o.target===e||(Ln(n,t),l[t]=r=>i(n,r,s),l[t].target=e,e.addEventListener(t,l[t]))}function fC(n,e){const t=Jt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function cC(n,e){const t=Jt(n);!t.dragStart||e.key!=="Escape"||(Ln(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function Gy(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=ki(e,n);if(dt(i,[{chart:n,event:e,point:s}])===!1)return dt(l,[{chart:n,event:e}]),!1}}function dC(n,e){const t=Jt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||Vy(xs(i),e)||Gu(xs(l.drag),e))return dt(l.onZoomRejected,[{chart:n,event:e}]);Gy(n,e,l)!==!1&&(t.dragStart=e,qs(n,n.canvas,"mousemove",fC),qs(n,window.document,"keydown",cC))}function Xy(n,e,t,i){const l=sl(e,"x",n),s=sl(e,"y",n);let{top:o,left:r,right:a,bottom:u,width:f,height:c}=n.chartArea;const d=ki(t,n),m=ki(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,g=u-o;return{left:r,top:o,right:a,bottom:u,width:h,height:g,zoomX:l&&h?1+(f-h)/f:1,zoomY:s&&g?1+(c-g)/c:1}}function pC(n,e){const t=Jt(n);if(!t.dragStart)return;Ln(n,"mousemove");const{mode:i,onZoomComplete:l,drag:{threshold:s=0}}=t.options.zoom,o=Xy(n,i,t.dragStart,e),r=sl(i,"x",n)?o.width:0,a=sl(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}Ky(n,{x:o.left,y:o.top},{x:o.right,y:o.bottom},"zoom"),setTimeout(()=>t.dragging=!1,500),dt(l,[{chart:n}])}function mC(n,e,t){if(Gu(xs(t.wheel),e)){dt(t.onZoomRejected,[{chart:n,event:e}]);return}if(Gy(n,e,t)!==!1&&(e.cancelable&&e.preventDefault(),e.deltaY!==void 0))return!0}function hC(n,e){const{handlers:{onZoomComplete:t},options:{zoom:i}}=Jt(n);if(!mC(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 _C(n,e,t,i){t&&(Jt(n).handlers[e]=Y$(()=>dt(t,[{chart:n}]),i))}function gC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(qs(n,t,"wheel",hC),_C(n,"onZoomComplete",s,250)):Ln(n,"wheel"),l.enabled?(qs(n,t,"mousedown",dC),qs(n,t.ownerDocument,"mouseup",pC)):(Ln(n,"mousedown"),Ln(n,"mousemove"),Ln(n,"mouseup"),Ln(n,"keydown"))}function bC(n){Ln(n,"mousedown"),Ln(n,"mousemove"),Ln(n,"mouseup"),Ln(n,"wheel"),Ln(n,"click"),Ln(n,"keydown")}function yC(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(xs(l),o)||Vy(xs(s.drag),o))?(dt(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function kC(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 Qy(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=kC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&sl(a,"x",n)?s:1,y:r.y&&sl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Xu(n,u),e.scale=t.scale}}function vC(n,e){e.options.zoom.pinch.enabled&&(e.scale=1)}function wC(n,e,t){e.scale&&(Qy(n,e,t),e.scale=null,dt(e.options.zoom.onZoomComplete,[{chart:n}]))}function xy(n,e,t){const i=e.delta;i&&(e.panning=!0,Jy(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function SC(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=By(e.options.pan,r,n),e.delta={x:0,y:0},clearTimeout(e.panEndTimeout),xy(n,e,t)}function TC(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 $C(n,e){const t=Jt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new Fs.Manager(i);s&&s.pinch.enabled&&(o.add(new Fs.Pinch),o.on("pinchstart",()=>vC(n,t)),o.on("pinch",r=>Qy(n,t,r)),o.on("pinchend",r=>wC(n,t,r))),l&&l.enabled&&(o.add(new Fs.Pan({threshold:l.threshold,enable:yC(n,t)})),o.on("panstart",r=>SC(n,t,r)),o.on("panmove",r=>xy(n,t,r)),o.on("panend",()=>TC(n,t))),ru.set(n,o)}function CC(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 OC="2.0.1";function Yo(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}=Xy(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 EC={id:"zoom",version:OC,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)."),Fs&&$C(n,t),n.pan=(l,s,o)=>Jy(n,l,s,o),n.zoom=(l,s)=>Xu(n,l,s),n.zoomRect=(l,s,o)=>Ky(n,l,s,o),n.zoomScale=(l,s,o)=>sC(n,l,s,o),n.resetZoom=l=>oC(n,l),n.getZoomLevel=()=>aC(n),n.getInitialScaleBounds=()=>Zy(n),n.isZoomedOrPanned=()=>uC(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,gC(n,t)},beforeDatasetsDraw(n,e,t){Yo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Yo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Yo(n,"beforeDraw",t)},afterDraw(n,e,t){Yo(n,"afterDraw",t)},stop:function(n){bC(n),Fs&&CC(n),J$(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){v(l,e,s),i=!0},i(l){i||(l&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=ze(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&k(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){v(l,e,s),t||(i=B(e,"click",n[4]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function MC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&lp(),g=n[3]&&sp(n);return{c(){e=b("div"),t=b("div"),i=Y("Found "),l=Y(n[1]),s=C(),r=Y(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),x(e,"loading",n[2])},m(_,y){v(_,e,y),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),g&&g.m(e,null),d||(m=B(f,"dblclick",n[4]),d=!0)},p(_,[y]){y&2&&ue(l,_[1]),y&2&&o!==(o=_[1]==1?"log":"logs")&&ue(r,o),y&4&&x(t,"hidden",_[2]),_[2]?h?y&4&&O(h,1):(h=lp(),h.c(),O(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,y):(g=sp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y&4&&x(e,"loading",_[2])},i(_){O(h)},o(_){D(h)},d(_){_&&k(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function DC(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 _=[s,z.normalizeLogsFilter(i)].filter(Boolean).join("&&");return me.logs.getStats({filter:_}).then(y=>{m(),y=z.toArray(y);for(let S of y)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(y=>{y!=null&&y.isAbort||(m(),console.warn(y),me.error(y,!_||(y==null?void 0:y.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Yt(()=>(vi.register(Gi,ar,sr,nu,Qs,M$,F$),vi.register(EC),t(9,r=new vi(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:_=>{var y;return(y=_.tick)!=null&&y.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var y;return(y=_.tick)!=null&&y.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:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,l.min=z.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=z.formatToUTCDate(_.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[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,l=_.zoom),"presets"in _&&t(7,s=_.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,g]}class IC extends ye{constructor(e){super(),be(this,e,DC,MC,_e,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function LC(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){v(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&&k(e)}}}function AC(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 ye{constructor(e){super(),be(this,e,AC,LC,_e,{content:2,language:3,class:0})}}function PC(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){v(o,e,r),l||(s=[Me(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&&Rt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&k(e),l=!1,De(s)}}}function NC(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(){i&&(z.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Yt(()=>()=>{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 ai extends ye{constructor(e){super(),be(this,e,NC,PC,_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=z.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function RC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U,j,V,K,J;d=new ai({props:{value:n[1].id}}),S=new iy({props:{level:n[1].level}}),E=new ai({props:{value:n[1].level}}),R=new ny({props:{date:n[1].created}}),j=new ai({props:{value:n[1].created}});let ee=!n[4]&&rp(n),X=pe(n[5](n[1].data)),oe=[];for(let ke=0;ke<X.length;ke+=1)oe[ke]=up(op(n,X,ke));const Se=ke=>D(oe[ke],1,1,()=>{oe[ke]=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=Y(a),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),y=b("td"),H(S.$$.fragment),T=C(),$=b("div"),H(E.$$.fragment),M=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),H(R.$$.fragment),N=C(),U=b("div"),H(j.$$.fragment),V=C(),ee&&ee.c(),K=C();for(let ke=0;ke<oe.length;ke+=1)oe[ke].c();p(l,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(r,"class","txt"),p(c,"class","copy-icon-wrapper svelte-1c23bpt"),p(o,"class","svelte-1c23bpt"),p(i,"class","svelte-1c23bpt"),p(g,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p($,"class","copy-icon-wrapper svelte-1c23bpt"),p(y,"class","svelte-1c23bpt"),p(h,"class","svelte-1c23bpt"),p(I,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(U,"class","copy-icon-wrapper svelte-1c23bpt"),p(P,"class","svelte-1c23bpt"),p(L,"class","svelte-1c23bpt"),p(e,"class","table-border")},m(ke,Ce){v(ke,e,Ce),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),F(d,c,null),w(t,m),w(t,h),w(h,g),w(h,_),w(h,y),F(S,y,null),w(y,T),w(y,$),F(E,$,null),w(t,M),w(t,L),w(L,I),w(L,A),w(L,P),F(R,P,null),w(P,N),w(P,U),F(j,U,null),w(t,V),ee&&ee.m(t,null),w(t,K);for(let We=0;We<oe.length;We+=1)oe[We]&&oe[We].m(t,null);J=!0},p(ke,Ce){(!J||Ce&2)&&a!==(a=ke[1].id+"")&&ue(u,a);const We={};Ce&2&&(We.value=ke[1].id),d.$set(We);const st={};Ce&2&&(st.level=ke[1].level),S.$set(st);const et={};Ce&2&&(et.value=ke[1].level),E.$set(et);const Be={};Ce&2&&(Be.date=ke[1].created),R.$set(Be);const rt={};if(Ce&2&&(rt.value=ke[1].created),j.$set(rt),ke[4]?ee&&(re(),D(ee,1,1,()=>{ee=null}),ae()):ee?(ee.p(ke,Ce),Ce&16&&O(ee,1)):(ee=rp(ke),ee.c(),O(ee,1),ee.m(t,K)),Ce&50){X=pe(ke[5](ke[1].data));let Je;for(Je=0;Je<X.length;Je+=1){const at=op(ke,X,Je);oe[Je]?(oe[Je].p(at,Ce),O(oe[Je],1)):(oe[Je]=up(at),oe[Je].c(),O(oe[Je],1),oe[Je].m(t,null))}for(re(),Je=X.length;Je<oe.length;Je+=1)Se(Je);ae()}},i(ke){if(!J){O(d.$$.fragment,ke),O(S.$$.fragment,ke),O(E.$$.fragment,ke),O(R.$$.fragment,ke),O(j.$$.fragment,ke),O(ee);for(let Ce=0;Ce<X.length;Ce+=1)O(oe[Ce]);J=!0}},o(ke){D(d.$$.fragment,ke),D(S.$$.fragment,ke),D(E.$$.fragment,ke),D(R.$$.fragment,ke),D(j.$$.fragment,ke),D(ee),oe=oe.filter(Boolean);for(let Ce=0;Ce<oe.length;Ce+=1)D(oe[Ce]);J=!1},d(ke){ke&&k(e),q(d),q(S),q(E),q(R),q(j),ee&&ee.d(),pt(oe,ke)}}}function FC(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function rp(n){let e,t,i,l,s,o,r;const a=[HC,qC],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){v(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):(re(),D(u[m],1,1,()=>{u[m]=null}),ae(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),O(o,1),o.m(l,null))},i(c){r||(O(o),r=!0)},o(c){D(o),r=!1},d(c){c&&k(e),u[s].d()}}}function qC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function HC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new ai({props:{value:n[1].message}}),{c(){e=b("span"),i=Y(t),l=C(),s=b("div"),H(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),F(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&ue(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(l),k(s)),q(o)}}}function jC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=Y(t),s=Y(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&ue(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&ue(s,l)},i:te,o:te,d(o){o&&k(e)}}}function zC(n){let e,t;return e=new Qu({props:{content:n[17],language:"html"}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function UC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&ue(i,t)},i:te,o:te,d(l){l&&k(e)}}}function VC(n){let e,t;return e=new Qu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function BC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function ap(n){let e,t,i;return t=new ai({props:{value:n[17]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function up(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[BC,VC,UC,zC,jC],h=[];function g(y,S){return y[18]?0:y[19]?1:y[16]=="error"?2:y[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&ap(n);return{c(){e=b("tr"),t=b("td"),i=Y("data."),s=Y(l),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),x(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(y,S){v(y,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),_&&_.m(r,null),w(e,c),d=!0},p(y,S){(!d||S&2)&&l!==(l=y[16]+"")&&ue(s,l),(!d||S&34)&&x(t,"v-align-top",y[19]);let T=a;a=g(y),a===T?h[a].p(y,S):(re(),D(h[T],1,1,()=>{h[T]=null}),ae(),u=h[a],u?u.p(y,S):(u=h[a]=m[a](y),u.c()),O(u,1),u.m(r,f)),y[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&2&&O(_,1)):(_=ap(y),_.c(),O(_,1),_.m(r,null))},i(y){d||(O(u),O(_),d=!0)},o(y){D(u),D(_),d=!1},d(y){y&&k(e),h[a].d(),_&&_.d()}}}function WC(n){let e,t,i,l;const s=[FC,RC],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=ge()},m(a,u){~e&&o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(re(),D(o[f],1,1,()=>{o[f]=null}),ae()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),~e&&o[e].d(a)}}}function YC(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function KC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',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){v(u,e,f),v(u,t,f),v(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&&(k(e),k(t),k(i)),r=!1,De(a)}}}function JC(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[KC],header:[YC],default:[WC]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}const fp="log_view";function ZC(n,e,t){let i;const l=_t();let s,o={},r=!1;function a(T){return f(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function u(){return me.cancelRequest(fp),s==null?void 0:s.hide()}async function f(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await me.logs.getOne(T,{requestKey:fp})}catch(E){E.isAbort||(u(),console.warn("resolveModel:",E),$i(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let M of c)typeof T[M]<"u"&&$.push(M);const E=Object.keys(T);for(let M of E)$.includes(M)||$.push(M);return $}function m(){z.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function g(){l("hide",o),t(1,o={})}const _=()=>u(),y=()=>m();function S(T){ie[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[u,o,s,r,i,d,m,g,a,_,y,S]}class GC extends ye{constructor(e){super(),be(this,e,ZC,JC,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function XC(n,e,t){const i=n.slice();return i[1]=e[t],i}function QC(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function xC(n){let e,t,i,l=pe(q0),s=[];for(let o=0;o<l.length;o+=1)s[o]=QC(XC(n,l,o));return{c(){e=b("div"),t=Y(`Default log levels:
-    `),i=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(i,"class","inline-flex flex-gap-5"),p(e,"class",n[0])},m(o,r){v(o,e,r),w(e,t),w(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(i,null)},p(o,[r]){r&1&&p(e,"class",o[0])},i:te,o:te,d(o){o&&k(e),pt(s,o)}}}function e5(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class ek extends ye{constructor(e){super(),be(this,e,e5,xC,_e,{class:0})}}function t5(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:[i5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[l5,({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:[s5,({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:[o5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),F(t,e,null),w(e,i),F(l,e,null),w(e,s),F(o,e,null),w(e,r),F(a,e,null),u=!0,f||(c=B(e,"submit",tt(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const y={};m&25165826&&(y.$$scope={dirty:m,ctx:d}),a.$set(y)},i(d){u||(O(t.$$.fragment,d),O(l.$$.fragment,d),O(o.$$.fragment,d),O(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&&k(e),q(t),q(l),q(o),q(a),f=!1,c()}}}function n5(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function i5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to <code>0</code> 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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[1].logs.maxDays),v(c,r,d),v(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&&yt(s.value)!==c[1].logs.maxDays&&ce(s,c[1].logs.maxDays)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function l5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new ek({}),{c(){e=b("label"),t=Y("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(),H(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,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),ce(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),F(f,r,null),c=!0,d||(m=B(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&yt(s.value)!==h[1].logs.minLevel&&ce(s,h[1].logs.minLevel)},i(h){c||(O(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(k(e),k(l),k(s),k(o),k(r)),q(f),d=!1,m()}}}function s5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function o5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function r5(n){let e,t,i,l;const s=[n5,t5],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function a5(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function u5(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],x(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(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&&x(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function f5(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[u5],header:[a5],default:[r5]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),q(e,l)}}}function c5(n,e,t){let i,l;const s=_t(),o="logs_settings_"+z.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Wt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await me.settings.getAll()||{};y(P)}catch(P){me.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await me.settings.update(z.filterRedactedProps(c));y(P),t(3,a=!1),m(),tn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),me.error(P)}}}function y(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=yt(this.value),t(1,c)}function T(){c.logs.minLevel=yt(this.value),t(1,c)}function $(){c.logs.logIP=this.checked,t(1,c)}function E(){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){Pe.call(this,n,P)}function A(P){Pe.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,_,d,f,i,S,T,$,E,M,L,I,A]}class d5 extends ye{constructor(e){super(),be(this,e,c5,f5,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function p5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(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&&(k(e),k(i),k(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 IC({props:s}),ie.push(()=>ve(e,"zoom",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(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 F3({props:r}),ie.push(()=>ve(e,"filter",s)),ie.push(()=>ve(e,"zoom",o)),e.$on("select",n[17]),{c(){H(e.$$.fragment)},m(a,u){F(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],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){l||(O(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){q(e,a)}}}function m5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$=n[4],E,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:[p5,({uniqueId:U})=>({25:U}),({uniqueId:U})=>U?33554432:0]},$$scope:{ctx:n}}}),_=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new ek({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let R=cp(n),N=dp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Y(n[7]),o=C(),r=b("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(h.$$.fragment),g=C(),H(_.$$.fragment),y=C(),H(S.$$.fragment),T=C(),R.c(),E=C(),N.c(),L=ge(),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(U,j){v(U,e,j),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),F(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),F(h,m,null),w(e,g),F(_,e,null),w(e,y),F(S,e,null),w(e,T),R.m(e,null),v(U,E,j),N.m(U,j),v(U,L,j),I=!0,A||(P=[Me(He.call(null,r,{text:"Logs settings",position:"right"})),B(r,"click",n[10])],A=!0)},p(U,j){(!I||j&128)&&ue(s,U[7]);const V={};j&100663300&&(V.$$scope={dirty:j,ctx:U}),h.$set(V);const K={};j&2&&(K.value=U[1]),_.$set(K),j&16&&_e($,$=U[4])?(re(),D(R,1,1,te),ae(),R=cp(U),R.c(),O(R,1),R.m(e,null)):R.p(U,j),j&16&&_e(M,M=U[4])?(re(),D(N,1,1,te),ae(),N=dp(U),N.c(),O(N,1),N.m(L.parentNode,L)):N.p(U,j)},i(U){I||(O(u.$$.fragment,U),O(h.$$.fragment,U),O(_.$$.fragment,U),O(S.$$.fragment,U),O(R),O(N),I=!0)},o(U){D(u.$$.fragment,U),D(h.$$.fragment,U),D(_.$$.fragment,U),D(S.$$.fragment,U),D(R),D(N),I=!1},d(U){U&&(k(e),k(E),k(L)),q(u),q(h),q(_),q(S),R.d(U),N.d(U),A=!1,De(P)}}}function h5(n){let e,t,i,l,s,o;e=new di({props:{$$slots:{default:[m5]},$$scope:{ctx:n}}});let r={};i=new GC({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new d5({props:a}),n[21](s),s.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(u,f){F(e,u,f),v(u,t,f),F(i,u,f),v(u,l,f),F(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||(O(e.$$.fragment,u),O(i.$$.fragment,u),O(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(k(t),k(l)),q(e,u),n[18](null),q(i,u),n[21](null),q(s,u)}}}const Ko="logId",pp="superuserRequests",mp="superuserLogRequests";function _5(n,e,t){var N;let i,l,s;Qe(n,Lu,U=>t(22,l=U)),Qe(n,cn,U=>t(7,s=U)),Nn(cn,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(pp)||((N=window.localStorage)==null?void 0:N.getItem(mp)))<<0,m=d;function h(){t(4,u++,u)}function g(U={}){let j={};j.filter=f||null,j[pp]=d<<0||null,z.replaceHashQueryParams(Object.assign(j,U))}const _=()=>a==null?void 0:a.show(),y=()=>h();function S(){d=this.checked,t(2,d)}const T=U=>t(1,f=U.detail);function $(U){c=U,t(5,c)}function E(U){f=U,t(1,f)}function M(U){c=U,t(5,c)}const L=U=>r==null?void 0:r.show(U==null?void 0:U.detail);function I(U){ie[U?"unshift":"push"](()=>{r=U,t(0,r)})}const A=U=>{var V;let j={};j[Ko]=((V=U.detail)==null?void 0:V.id)||null,z.replaceHashQueryParams(j)},P=()=>{let U={};U[Ko]=null,z.replaceHashQueryParams(U)};function R(U){ie[U?"unshift":"push"](()=>{a=U,t(3,a)})}return n.$$.update=()=>{var U;n.$$.dirty&1&&o.get(Ko)&&r&&r.show(o.get(Ko)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(U=window.localStorage)==null||U.setItem(mp,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,y,S,T,$,E,M,L,I,A,P,R]}class g5 extends ye{constructor(e){super(),be(this,e,_5,h5,_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){v(t,e,i)},d(t){t&&k(e)}}}function yp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,u,f,c=i&&bp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ge(),c&&c.c(),l=C(),s=b("button"),r=Y(o),a=C(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){v(m,t,h),c&&c.m(m,h),v(m,l,h),v(m,s,h),w(s,r),w(s,a),u||(f=B(s,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=bp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&ue(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(k(t),k(l),k(s)),c&&c.d(m),u=!1,f()}}}function kp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:k5,then:y5,catch:b5,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ge(),l.block.c()},m(s,o){v(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)||Lk(l,n,o)},i(s){i||(O(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&&k(e),l.block.d(s),l.token=null,l=null}}}function b5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function y5(n){_p(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(l,s){F(e,l,s),v(l,t,s),i=!0},p(l,s){_p(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(O(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&k(t),q(e,l)}}}function k5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function vp(n,e){let t,i,l,s=e[5]===e[14]&&kp(e);return{key:n,first:null,c(){t=ge(),s&&s.c(),i=ge(),this.first=t},m(o,r){v(o,t,r),s&&s.m(o,r),v(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&O(s,1)):(s=kp(e),s.c(),O(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(O(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(k(t),k(i)),s&&s.d(o)}}}function v5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=g=>g[14];for(let g=0;g<c.length;g+=1){let _=gp(n,c,g),y=d(_);s.set(y,l[g]=yp(y,_))}let m=pe(Object.entries(n[3]));const h=g=>g[14];for(let g=0;g<m.length;g+=1){let _=hp(n,m,g),y=h(_);u.set(y,a[g]=vp(y,_))}return{c(){var g;e=b("div"),t=b("aside"),i=b("nav");for(let _=0;_<l.length;_+=1)l[_].c();o=C(),r=b("div");for(let _=0;_<a.length;_+=1)a[_].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),x(t,"compact",((g=n[2])==null?void 0:g.type)==="auth"),p(r,"class","docs-content"),p(e,"class","docs-content-wrapper")},m(g,_){v(g,e,_),w(e,t),w(t,i);for(let y=0;y<l.length;y+=1)l[y]&&l[y].m(i,null);w(e,o),w(e,r);for(let y=0;y<a.length;y+=1)a[y]&&a[y].m(r,null);f=!0},p(g,_){var y;_&106&&(c=pe(Object.entries(g[3])),l=kt(l,_,d,1,g,c,s,i,ci,yp,null,gp)),(!f||_&4)&&x(t,"compact",((y=g[2])==null?void 0:y.type)==="auth"),_&44&&(m=pe(Object.entries(g[3])),re(),a=kt(a,_,h,1,g,m,u,r,zt,vp,null,hp),ae())},i(g){if(!f){for(let _=0;_<m.length;_+=1)O(a[_]);f=!0}},o(g){for(let _=0;_<a.length;_+=1)D(a[_]);f=!1},d(g){g&&k(e);for(let _=0;_<l.length;_+=1)l[_].d();for(let _=0;_<a.length;_+=1)a[_].d()}}}function w5(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[8]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function S5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[w5],default:[v5]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),q(e,l)}}}function T5(n,e,t){const i={list:{label:"List/Search",component:Ot(()=>import("./ListApiDocs-Cbzk6gf3.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Ot(()=>import("./ViewApiDocs-U3CHHlFs.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Ot(()=>import("./CreateApiDocs-DwenXKXg.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Ot(()=>import("./UpdateApiDocs-DRwwrV0b.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Ot(()=>import("./DeleteApiDocs-vSv-5m5A.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Ot(()=>import("./RealtimeApiDocs-DcZfgmqs.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Ot(()=>import("./AuthMethodsDocs-DeHPt55D.js"),__vite__mapDeps([8,3]),import.meta.url)},refresh:{label:"Auth refresh",component:Ot(()=>import("./AuthRefreshDocs-D0IAoZLo.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Ot(()=>import("./AuthWithPasswordDocs-DY-s5WMs.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Ot(()=>import("./AuthWithOAuth2Docs-bl3paI1E.js"),__vite__mapDeps([11,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Ot(()=>import("./AuthWithOtpDocs-DMGTBbXL.js"),[],import.meta.url)},verification:{label:"Verification",component:Ot(()=>import("./VerificationDocs-C6tW_CBf.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Ot(()=>import("./PasswordResetDocs-kZP8IVQT.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Ot(()=>import("./EmailChangeDocs-BvWiYTd5.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>f(),m=y=>c(y);function h(y){ie[y?"unshift":"push"](()=>{s=y,t(4,s)})}function g(y){Pe.call(this,n,y)}function _(y){Pe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),o.passwordAuth.enabled||delete a["auth-with-password"],o.oauth2.enabled||delete a["auth-with-oauth2"],o.otp.enabled||delete a["auth-with-otp"]):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 $5 extends ye{constructor(e){super(),be(this,e,T5,S5,_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 C5=n=>({active:n&1}),wp=n=>({active:n[0]});function Sp(n){let e,t,i;const l=n[15].default,s=Lt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){v(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Pt(s,l,o,o[14],i?At(l,o[14],r,null):Nt(o[14]),null)},i(o){i||(O(s,o),o&&nt(()=>{i&&(t||(t=ze(e,wt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=ze(e,wt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),s&&s.d(o),o&&t&&t.end()}}}function O5(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(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]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){v(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",tt(n[17])),B(t,"drop",tt(n[18])),B(t,"dragstart",n[19]),B(t,"dragenter",n[20]),B(t,"dragleave",n[21]),B(t,"dragover",tt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Pt(u,a,c,c[14],s?At(a,c[14],d,C5):Nt(c[14]),wp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&O(f,1)):(f=Sp(c),f.c(),O(f,1),f.m(e,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(O(u,c),O(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,De(r)}}}function E5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=_t();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 g(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const R of P)R.click()}}Yt(()=>()=>clearTimeout(r));function T(P){Pe.call(this,n,P)}const $=()=>c&&y(),E=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,y,S,o,m,s,d,h,g,_,r,l,i,T,$,E,M,L,I,A]}class qi extends ye{constructor(e){super(),be(this,e,E5,O5,_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;s<i.length;s+=1)l[s]=Op($p(n,i,s));return{c(){e=b("div"),t=Y(`Available placeholder parameters:
+ */const xs=n=>n&&n.enabled&&n.modifierKey,Vy=(n,e)=>n&&e[n+"Key"],Gu=(n,e)=>n&&!e[n+"Key"];function sl(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 ya(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 Y$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function K$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s<l.length;s++){const o=i[l[s]];if(e>=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function By(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=K$(e,t),r=ya(i,t),a=ya(l,t);if(s){const f=ya(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 ht(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 J$(n){iu.delete(n)}function Wy(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=Ct(o.options,o.scale)}return Ct(s,l)}function Z$(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,e<c?(e=c,t=Math.min(c+m,d)):t>d&&(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 G$(n,e,t,i){const l=Wy(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return fs(n,s,i,!0)}function X$(n,e,t,i){fs(n,Z$(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 Q$(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<t&&(n.max+=1)}function x$(n,e,t,i){const l=Wy(n,e,t);n.min===n.max&&e<1&&Q$(n);const s={min:n.min+Qd(l.min),max:n.max-Qd(l.max)};return fs(n,s,i,!0)}function eC(n){return n.isHorizontal()?n.width:n.height}function tC(n,e,t){const l=n.getLabels().length-1;let{min:s,max:o}=n;const r=Math.max(o-s,1),a=Math.round(eC(n)/Math.max(r,10)),u=Math.round(Math.abs(e/a));let f;return e<-a?(o=Math.min(o+u,l),s=r===1?o:o-r,f=o===l):e>a&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),fs(n,{min:s,max:o},t)||f}const nC={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 Yy(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=nC[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)||u<c||f>d?!0:fs(n,{min:u,max:f},t,i)}function xd(n,e,t){return Yy(n,e,t,!0)}const lu={category:x$,default:G$},su={default:X$},ou={category:tC,default:Yy,logarithmic:xd,timeseries:xd};function iC(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){ht(n,(t,i)=>{e[i]||delete n[i]})}function cs(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return ht(t,function(s){iC(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 lC(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=lC(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=By(a,s,n);ht(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 Ky(n,e,t,i="none"){const l=Jt(n),{options:{limits:s,zoom:o}}=l,{mode:r="xy"}=o;cs(n,l);const a=sl(r,"x",n),u=sl(r,"y",n);ht(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 sC(n,e,t,i="none"){cs(n,Jt(n));const l=n.scales[e];fs(l,t,void 0,!0),n.update(i)}function oC(n,e="default"){const t=Jt(n),i=cs(n,t);ht(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 rC(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Ct(l.options,l.scale)-Ct(i.options,i.scale)}function aC(n){const e=Jt(n);let t=1,i=1;return ht(n.scales,function(l){const s=rC(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;il(s)===il(e)&&(e+=s);const o=ou[n.type]||ou.default;dt(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function Jy(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;ht(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 Zy(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 uC(n){const e=Zy(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 Ln(n,e){const{handlers:t}=Jt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function qs(n,e,t,i){const{handlers:l,options:s}=Jt(n),o=l[t];o&&o.target===e||(Ln(n,t),l[t]=r=>i(n,r,s),l[t].target=e,e.addEventListener(t,l[t]))}function fC(n,e){const t=Jt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function cC(n,e){const t=Jt(n);!t.dragStart||e.key!=="Escape"||(Ln(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function Gy(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=ki(e,n);if(dt(i,[{chart:n,event:e,point:s}])===!1)return dt(l,[{chart:n,event:e}]),!1}}function dC(n,e){const t=Jt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||Vy(xs(i),e)||Gu(xs(l.drag),e))return dt(l.onZoomRejected,[{chart:n,event:e}]);Gy(n,e,l)!==!1&&(t.dragStart=e,qs(n,n.canvas,"mousemove",fC),qs(n,window.document,"keydown",cC))}function Xy(n,e,t,i){const l=sl(e,"x",n),s=sl(e,"y",n);let{top:o,left:r,right:a,bottom:u,width:f,height:c}=n.chartArea;const d=ki(t,n),m=ki(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,g=u-o;return{left:r,top:o,right:a,bottom:u,width:h,height:g,zoomX:l&&h?1+(f-h)/f:1,zoomY:s&&g?1+(c-g)/c:1}}function pC(n,e){const t=Jt(n);if(!t.dragStart)return;Ln(n,"mousemove");const{mode:i,onZoomComplete:l,drag:{threshold:s=0}}=t.options.zoom,o=Xy(n,i,t.dragStart,e),r=sl(i,"x",n)?o.width:0,a=sl(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}Ky(n,{x:o.left,y:o.top},{x:o.right,y:o.bottom},"zoom"),setTimeout(()=>t.dragging=!1,500),dt(l,[{chart:n}])}function mC(n,e,t){if(Gu(xs(t.wheel),e)){dt(t.onZoomRejected,[{chart:n,event:e}]);return}if(Gy(n,e,t)!==!1&&(e.cancelable&&e.preventDefault(),e.deltaY!==void 0))return!0}function hC(n,e){const{handlers:{onZoomComplete:t},options:{zoom:i}}=Jt(n);if(!mC(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 _C(n,e,t,i){t&&(Jt(n).handlers[e]=Y$(()=>dt(t,[{chart:n}]),i))}function gC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(qs(n,t,"wheel",hC),_C(n,"onZoomComplete",s,250)):Ln(n,"wheel"),l.enabled?(qs(n,t,"mousedown",dC),qs(n,t.ownerDocument,"mouseup",pC)):(Ln(n,"mousedown"),Ln(n,"mousemove"),Ln(n,"mouseup"),Ln(n,"keydown"))}function bC(n){Ln(n,"mousedown"),Ln(n,"mousemove"),Ln(n,"mouseup"),Ln(n,"wheel"),Ln(n,"click"),Ln(n,"keydown")}function yC(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(xs(l),o)||Vy(xs(s.drag),o))?(dt(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function kC(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 Qy(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=kC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&sl(a,"x",n)?s:1,y:r.y&&sl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Xu(n,u),e.scale=t.scale}}function vC(n,e){e.options.zoom.pinch.enabled&&(e.scale=1)}function wC(n,e,t){e.scale&&(Qy(n,e,t),e.scale=null,dt(e.options.zoom.onZoomComplete,[{chart:n}]))}function xy(n,e,t){const i=e.delta;i&&(e.panning=!0,Jy(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function SC(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=By(e.options.pan,r,n),e.delta={x:0,y:0},clearTimeout(e.panEndTimeout),xy(n,e,t)}function TC(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 $C(n,e){const t=Jt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new Fs.Manager(i);s&&s.pinch.enabled&&(o.add(new Fs.Pinch),o.on("pinchstart",()=>vC(n,t)),o.on("pinch",r=>Qy(n,t,r)),o.on("pinchend",r=>wC(n,t,r))),l&&l.enabled&&(o.add(new Fs.Pan({threshold:l.threshold,enable:yC(n,t)})),o.on("panstart",r=>SC(n,t,r)),o.on("panmove",r=>xy(n,t,r)),o.on("panend",()=>TC(n,t))),ru.set(n,o)}function CC(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 OC="2.0.1";function Yo(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}=Xy(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 EC={id:"zoom",version:OC,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)."),Fs&&$C(n,t),n.pan=(l,s,o)=>Jy(n,l,s,o),n.zoom=(l,s)=>Xu(n,l,s),n.zoomRect=(l,s,o)=>Ky(n,l,s,o),n.zoomScale=(l,s,o)=>sC(n,l,s,o),n.resetZoom=l=>oC(n,l),n.getZoomLevel=()=>aC(n),n.getInitialScaleBounds=()=>Zy(n),n.isZoomedOrPanned=()=>uC(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,gC(n,t)},beforeDatasetsDraw(n,e,t){Yo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Yo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Yo(n,"beforeDraw",t)},afterDraw(n,e,t){Yo(n,"afterDraw",t)},stop:function(n){bC(n),Fs&&CC(n),J$(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){v(l,e,s),i=!0},i(l){i||(l&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=ze(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&k(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){v(l,e,s),t||(i=B(e,"click",n[4]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function MC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&lp(),g=n[3]&&sp(n);return{c(){e=b("div"),t=b("div"),i=Y("Found "),l=Y(n[1]),s=C(),r=Y(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),x(e,"loading",n[2])},m(_,y){v(_,e,y),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),g&&g.m(e,null),d||(m=B(f,"dblclick",n[4]),d=!0)},p(_,[y]){y&2&&ue(l,_[1]),y&2&&o!==(o=_[1]==1?"log":"logs")&&ue(r,o),y&4&&x(t,"hidden",_[2]),_[2]?h?y&4&&O(h,1):(h=lp(),h.c(),O(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,y):(g=sp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y&4&&x(e,"loading",_[2])},i(_){O(h)},o(_){D(h)},d(_){_&&k(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function DC(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 _=[s,z.normalizeLogsFilter(i)].filter(Boolean).join("&&");return me.logs.getStats({filter:_}).then(y=>{m(),y=z.toArray(y);for(let S of y)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(y=>{y!=null&&y.isAbort||(m(),console.warn(y),me.error(y,!_||(y==null?void 0:y.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Yt(()=>(vi.register(Gi,ar,sr,nu,Qs,M$,F$),vi.register(EC),t(9,r=new vi(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:_=>{var y;return(y=_.tick)!=null&&y.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var y;return(y=_.tick)!=null&&y.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:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,l.min=z.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=z.formatToUTCDate(_.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[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,l=_.zoom),"presets"in _&&t(7,s=_.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,g]}class IC extends ye{constructor(e){super(),be(this,e,DC,MC,_e,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function LC(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){v(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&&k(e)}}}function AC(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 ye{constructor(e){super(),be(this,e,AC,LC,_e,{content:2,language:3,class:0})}}function PC(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){v(o,e,r),l||(s=[Me(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&&Rt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&k(e),l=!1,De(s)}}}function NC(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(){i&&(z.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Yt(()=>()=>{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 ai extends ye{constructor(e){super(),be(this,e,NC,PC,_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=z.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function RC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U,j,V,K,J;d=new ai({props:{value:n[1].id}}),S=new iy({props:{level:n[1].level}}),E=new ai({props:{value:n[1].level}}),R=new ny({props:{date:n[1].created}}),j=new ai({props:{value:n[1].created}});let ee=!n[4]&&rp(n),X=pe(n[5](n[1].data)),oe=[];for(let ke=0;ke<X.length;ke+=1)oe[ke]=up(op(n,X,ke));const Se=ke=>D(oe[ke],1,1,()=>{oe[ke]=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=Y(a),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),y=b("td"),H(S.$$.fragment),T=C(),$=b("div"),H(E.$$.fragment),M=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),H(R.$$.fragment),N=C(),U=b("div"),H(j.$$.fragment),V=C(),ee&&ee.c(),K=C();for(let ke=0;ke<oe.length;ke+=1)oe[ke].c();p(l,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(r,"class","txt"),p(c,"class","copy-icon-wrapper svelte-1c23bpt"),p(o,"class","svelte-1c23bpt"),p(i,"class","svelte-1c23bpt"),p(g,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p($,"class","copy-icon-wrapper svelte-1c23bpt"),p(y,"class","svelte-1c23bpt"),p(h,"class","svelte-1c23bpt"),p(I,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(U,"class","copy-icon-wrapper svelte-1c23bpt"),p(P,"class","svelte-1c23bpt"),p(L,"class","svelte-1c23bpt"),p(e,"class","table-border")},m(ke,Ce){v(ke,e,Ce),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),F(d,c,null),w(t,m),w(t,h),w(h,g),w(h,_),w(h,y),F(S,y,null),w(y,T),w(y,$),F(E,$,null),w(t,M),w(t,L),w(L,I),w(L,A),w(L,P),F(R,P,null),w(P,N),w(P,U),F(j,U,null),w(t,V),ee&&ee.m(t,null),w(t,K);for(let We=0;We<oe.length;We+=1)oe[We]&&oe[We].m(t,null);J=!0},p(ke,Ce){(!J||Ce&2)&&a!==(a=ke[1].id+"")&&ue(u,a);const We={};Ce&2&&(We.value=ke[1].id),d.$set(We);const st={};Ce&2&&(st.level=ke[1].level),S.$set(st);const et={};Ce&2&&(et.value=ke[1].level),E.$set(et);const Be={};Ce&2&&(Be.date=ke[1].created),R.$set(Be);const rt={};if(Ce&2&&(rt.value=ke[1].created),j.$set(rt),ke[4]?ee&&(re(),D(ee,1,1,()=>{ee=null}),ae()):ee?(ee.p(ke,Ce),Ce&16&&O(ee,1)):(ee=rp(ke),ee.c(),O(ee,1),ee.m(t,K)),Ce&50){X=pe(ke[5](ke[1].data));let Je;for(Je=0;Je<X.length;Je+=1){const at=op(ke,X,Je);oe[Je]?(oe[Je].p(at,Ce),O(oe[Je],1)):(oe[Je]=up(at),oe[Je].c(),O(oe[Je],1),oe[Je].m(t,null))}for(re(),Je=X.length;Je<oe.length;Je+=1)Se(Je);ae()}},i(ke){if(!J){O(d.$$.fragment,ke),O(S.$$.fragment,ke),O(E.$$.fragment,ke),O(R.$$.fragment,ke),O(j.$$.fragment,ke),O(ee);for(let Ce=0;Ce<X.length;Ce+=1)O(oe[Ce]);J=!0}},o(ke){D(d.$$.fragment,ke),D(S.$$.fragment,ke),D(E.$$.fragment,ke),D(R.$$.fragment,ke),D(j.$$.fragment,ke),D(ee),oe=oe.filter(Boolean);for(let Ce=0;Ce<oe.length;Ce+=1)D(oe[Ce]);J=!1},d(ke){ke&&k(e),q(d),q(S),q(E),q(R),q(j),ee&&ee.d(),pt(oe,ke)}}}function FC(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function rp(n){let e,t,i,l,s,o,r;const a=[HC,qC],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){v(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):(re(),D(u[m],1,1,()=>{u[m]=null}),ae(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),O(o,1),o.m(l,null))},i(c){r||(O(o),r=!0)},o(c){D(o),r=!1},d(c){c&&k(e),u[s].d()}}}function qC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function HC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new ai({props:{value:n[1].message}}),{c(){e=b("span"),i=Y(t),l=C(),s=b("div"),H(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),F(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&ue(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(l),k(s)),q(o)}}}function jC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=Y(t),s=Y(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&ue(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&ue(s,l)},i:te,o:te,d(o){o&&k(e)}}}function zC(n){let e,t;return e=new Qu({props:{content:n[17],language:"html"}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function UC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&ue(i,t)},i:te,o:te,d(l){l&&k(e)}}}function VC(n){let e,t;return e=new Qu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function BC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function ap(n){let e,t,i;return t=new ai({props:{value:n[17]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function up(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[BC,VC,UC,zC,jC],h=[];function g(y,S){return y[18]?0:y[19]?1:y[16]=="error"?2:y[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&ap(n);return{c(){e=b("tr"),t=b("td"),i=Y("data."),s=Y(l),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),x(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(y,S){v(y,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),_&&_.m(r,null),w(e,c),d=!0},p(y,S){(!d||S&2)&&l!==(l=y[16]+"")&&ue(s,l),(!d||S&34)&&x(t,"v-align-top",y[19]);let T=a;a=g(y),a===T?h[a].p(y,S):(re(),D(h[T],1,1,()=>{h[T]=null}),ae(),u=h[a],u?u.p(y,S):(u=h[a]=m[a](y),u.c()),O(u,1),u.m(r,f)),y[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&2&&O(_,1)):(_=ap(y),_.c(),O(_,1),_.m(r,null))},i(y){d||(O(u),O(_),d=!0)},o(y){D(u),D(_),d=!1},d(y){y&&k(e),h[a].d(),_&&_.d()}}}function WC(n){let e,t,i,l;const s=[FC,RC],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=ge()},m(a,u){~e&&o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(re(),D(o[f],1,1,()=>{o[f]=null}),ae()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),~e&&o[e].d(a)}}}function YC(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function KC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',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){v(u,e,f),v(u,t,f),v(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&&(k(e),k(t),k(i)),r=!1,De(a)}}}function JC(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[KC],header:[YC],default:[WC]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}const fp="log_view";function ZC(n,e,t){let i;const l=gt();let s,o={},r=!1;function a(T){return f(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function u(){return me.cancelRequest(fp),s==null?void 0:s.hide()}async function f(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await me.logs.getOne(T,{requestKey:fp})}catch(E){E.isAbort||(u(),console.warn("resolveModel:",E),$i(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let M of c)typeof T[M]<"u"&&$.push(M);const E=Object.keys(T);for(let M of E)$.includes(M)||$.push(M);return $}function m(){z.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function g(){l("hide",o),t(1,o={})}const _=()=>u(),y=()=>m();function S(T){ie[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[u,o,s,r,i,d,m,g,a,_,y,S]}class GC extends ye{constructor(e){super(),be(this,e,ZC,JC,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function XC(n,e,t){const i=n.slice();return i[1]=e[t],i}function QC(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function xC(n){let e,t,i,l=pe(q0),s=[];for(let o=0;o<l.length;o+=1)s[o]=QC(XC(n,l,o));return{c(){e=b("div"),t=Y(`Default log levels:
+    `),i=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(i,"class","inline-flex flex-gap-5"),p(e,"class",n[0])},m(o,r){v(o,e,r),w(e,t),w(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(i,null)},p(o,[r]){r&1&&p(e,"class",o[0])},i:te,o:te,d(o){o&&k(e),pt(s,o)}}}function e5(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class ek extends ye{constructor(e){super(),be(this,e,e5,xC,_e,{class:0})}}function t5(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:[i5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[l5,({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:[s5,({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:[o5,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),F(t,e,null),w(e,i),F(l,e,null),w(e,s),F(o,e,null),w(e,r),F(a,e,null),u=!0,f||(c=B(e,"submit",tt(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const y={};m&25165826&&(y.$$scope={dirty:m,ctx:d}),a.$set(y)},i(d){u||(O(t.$$.fragment,d),O(l.$$.fragment,d),O(o.$$.fragment,d),O(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&&k(e),q(t),q(l),q(o),q(a),f=!1,c()}}}function n5(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function i5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to <code>0</code> 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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[1].logs.maxDays),v(c,r,d),v(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&&_t(s.value)!==c[1].logs.maxDays&&ce(s,c[1].logs.maxDays)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function l5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new ek({}),{c(){e=b("label"),t=Y("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(),H(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,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),ce(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),F(f,r,null),c=!0,d||(m=B(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&_t(s.value)!==h[1].logs.minLevel&&ce(s,h[1].logs.minLevel)},i(h){c||(O(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(k(e),k(l),k(s),k(o),k(r)),q(f),d=!1,m()}}}function s5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function o5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function r5(n){let e,t,i,l;const s=[n5,t5],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function a5(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function u5(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],x(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(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&&x(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function f5(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[u5],header:[a5],default:[r5]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),q(e,l)}}}function c5(n,e,t){let i,l;const s=gt(),o="logs_settings_"+z.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Wt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await me.settings.getAll()||{};y(P)}catch(P){me.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await me.settings.update(z.filterRedactedProps(c));y(P),t(3,a=!1),m(),tn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),me.error(P)}}}function y(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=_t(this.value),t(1,c)}function T(){c.logs.minLevel=_t(this.value),t(1,c)}function $(){c.logs.logIP=this.checked,t(1,c)}function E(){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){Pe.call(this,n,P)}function A(P){Pe.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,_,d,f,i,S,T,$,E,M,L,I,A]}class d5 extends ye{constructor(e){super(),be(this,e,c5,f5,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function p5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(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&&(k(e),k(i),k(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 IC({props:s}),ie.push(()=>ve(e,"zoom",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(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 F3({props:r}),ie.push(()=>ve(e,"filter",s)),ie.push(()=>ve(e,"zoom",o)),e.$on("select",n[17]),{c(){H(e.$$.fragment)},m(a,u){F(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],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){l||(O(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){q(e,a)}}}function m5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$=n[4],E,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:[p5,({uniqueId:U})=>({25:U}),({uniqueId:U})=>U?33554432:0]},$$scope:{ctx:n}}}),_=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new ek({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let R=cp(n),N=dp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Y(n[7]),o=C(),r=b("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(h.$$.fragment),g=C(),H(_.$$.fragment),y=C(),H(S.$$.fragment),T=C(),R.c(),E=C(),N.c(),L=ge(),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(U,j){v(U,e,j),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),F(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),F(h,m,null),w(e,g),F(_,e,null),w(e,y),F(S,e,null),w(e,T),R.m(e,null),v(U,E,j),N.m(U,j),v(U,L,j),I=!0,A||(P=[Me(He.call(null,r,{text:"Logs settings",position:"right"})),B(r,"click",n[10])],A=!0)},p(U,j){(!I||j&128)&&ue(s,U[7]);const V={};j&100663300&&(V.$$scope={dirty:j,ctx:U}),h.$set(V);const K={};j&2&&(K.value=U[1]),_.$set(K),j&16&&_e($,$=U[4])?(re(),D(R,1,1,te),ae(),R=cp(U),R.c(),O(R,1),R.m(e,null)):R.p(U,j),j&16&&_e(M,M=U[4])?(re(),D(N,1,1,te),ae(),N=dp(U),N.c(),O(N,1),N.m(L.parentNode,L)):N.p(U,j)},i(U){I||(O(u.$$.fragment,U),O(h.$$.fragment,U),O(_.$$.fragment,U),O(S.$$.fragment,U),O(R),O(N),I=!0)},o(U){D(u.$$.fragment,U),D(h.$$.fragment,U),D(_.$$.fragment,U),D(S.$$.fragment,U),D(R),D(N),I=!1},d(U){U&&(k(e),k(E),k(L)),q(u),q(h),q(_),q(S),R.d(U),N.d(U),A=!1,De(P)}}}function h5(n){let e,t,i,l,s,o;e=new di({props:{$$slots:{default:[m5]},$$scope:{ctx:n}}});let r={};i=new GC({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new d5({props:a}),n[21](s),s.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(u,f){F(e,u,f),v(u,t,f),F(i,u,f),v(u,l,f),F(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||(O(e.$$.fragment,u),O(i.$$.fragment,u),O(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(k(t),k(l)),q(e,u),n[18](null),q(i,u),n[21](null),q(s,u)}}}const Ko="logId",pp="superuserRequests",mp="superuserLogRequests";function _5(n,e,t){var N;let i,l,s;Qe(n,Lu,U=>t(22,l=U)),Qe(n,cn,U=>t(7,s=U)),Nn(cn,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(pp)||((N=window.localStorage)==null?void 0:N.getItem(mp)))<<0,m=d;function h(){t(4,u++,u)}function g(U={}){let j={};j.filter=f||null,j[pp]=d<<0||null,z.replaceHashQueryParams(Object.assign(j,U))}const _=()=>a==null?void 0:a.show(),y=()=>h();function S(){d=this.checked,t(2,d)}const T=U=>t(1,f=U.detail);function $(U){c=U,t(5,c)}function E(U){f=U,t(1,f)}function M(U){c=U,t(5,c)}const L=U=>r==null?void 0:r.show(U==null?void 0:U.detail);function I(U){ie[U?"unshift":"push"](()=>{r=U,t(0,r)})}const A=U=>{var V;let j={};j[Ko]=((V=U.detail)==null?void 0:V.id)||null,z.replaceHashQueryParams(j)},P=()=>{let U={};U[Ko]=null,z.replaceHashQueryParams(U)};function R(U){ie[U?"unshift":"push"](()=>{a=U,t(3,a)})}return n.$$.update=()=>{var U;n.$$.dirty&1&&o.get(Ko)&&r&&r.show(o.get(Ko)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(U=window.localStorage)==null||U.setItem(mp,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,y,S,T,$,E,M,L,I,A,P,R]}class g5 extends ye{constructor(e){super(),be(this,e,_5,h5,_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){v(t,e,i)},d(t){t&&k(e)}}}function yp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,u,f,c=i&&bp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ge(),c&&c.c(),l=C(),s=b("button"),r=Y(o),a=C(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){v(m,t,h),c&&c.m(m,h),v(m,l,h),v(m,s,h),w(s,r),w(s,a),u||(f=B(s,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=bp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&ue(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(k(t),k(l),k(s)),c&&c.d(m),u=!1,f()}}}function kp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:k5,then:y5,catch:b5,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ge(),l.block.c()},m(s,o){v(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)||Lk(l,n,o)},i(s){i||(O(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&&k(e),l.block.d(s),l.token=null,l=null}}}function b5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function y5(n){_p(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(l,s){F(e,l,s),v(l,t,s),i=!0},p(l,s){_p(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(O(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&k(t),q(e,l)}}}function k5(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function vp(n,e){let t,i,l,s=e[5]===e[14]&&kp(e);return{key:n,first:null,c(){t=ge(),s&&s.c(),i=ge(),this.first=t},m(o,r){v(o,t,r),s&&s.m(o,r),v(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&O(s,1)):(s=kp(e),s.c(),O(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(O(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(k(t),k(i)),s&&s.d(o)}}}function v5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=g=>g[14];for(let g=0;g<c.length;g+=1){let _=gp(n,c,g),y=d(_);s.set(y,l[g]=yp(y,_))}let m=pe(Object.entries(n[3]));const h=g=>g[14];for(let g=0;g<m.length;g+=1){let _=hp(n,m,g),y=h(_);u.set(y,a[g]=vp(y,_))}return{c(){var g;e=b("div"),t=b("aside"),i=b("nav");for(let _=0;_<l.length;_+=1)l[_].c();o=C(),r=b("div");for(let _=0;_<a.length;_+=1)a[_].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),x(t,"compact",((g=n[2])==null?void 0:g.type)==="auth"),p(r,"class","docs-content"),p(e,"class","docs-content-wrapper")},m(g,_){v(g,e,_),w(e,t),w(t,i);for(let y=0;y<l.length;y+=1)l[y]&&l[y].m(i,null);w(e,o),w(e,r);for(let y=0;y<a.length;y+=1)a[y]&&a[y].m(r,null);f=!0},p(g,_){var y;_&106&&(c=pe(Object.entries(g[3])),l=kt(l,_,d,1,g,c,s,i,ci,yp,null,gp)),(!f||_&4)&&x(t,"compact",((y=g[2])==null?void 0:y.type)==="auth"),_&44&&(m=pe(Object.entries(g[3])),re(),a=kt(a,_,h,1,g,m,u,r,zt,vp,null,hp),ae())},i(g){if(!f){for(let _=0;_<m.length;_+=1)O(a[_]);f=!0}},o(g){for(let _=0;_<a.length;_+=1)D(a[_]);f=!1},d(g){g&&k(e);for(let _=0;_<l.length;_+=1)l[_].d();for(let _=0;_<a.length;_+=1)a[_].d()}}}function w5(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[8]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function S5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[w5],default:[v5]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),q(e,l)}}}function T5(n,e,t){const i={list:{label:"List/Search",component:Ot(()=>import("./ListApiDocs-B7pwTvY7.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Ot(()=>import("./ViewApiDocs-BhiZdWr9.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Ot(()=>import("./CreateApiDocs-CikqNBE1.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Ot(()=>import("./UpdateApiDocs-D8XSOeHG.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Ot(()=>import("./DeleteApiDocs-CznS-igD.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Ot(()=>import("./RealtimeApiDocs-DviwWQmF.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Ot(()=>import("./AuthMethodsDocs-BtaDoWWO.js"),__vite__mapDeps([8,3]),import.meta.url)},refresh:{label:"Auth refresh",component:Ot(()=>import("./AuthRefreshDocs-CgORCLzq.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Ot(()=>import("./AuthWithPasswordDocs-BEqreZjJ.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Ot(()=>import("./AuthWithOAuth2Docs-DcbkfNMl.js"),__vite__mapDeps([11,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Ot(()=>import("./AuthWithOtpDocs-DeZu5Cq6.js"),[],import.meta.url)},verification:{label:"Verification",component:Ot(()=>import("./VerificationDocs-DcqlnWXO.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Ot(()=>import("./PasswordResetDocs-Blc8Xe1F.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Ot(()=>import("./EmailChangeDocs-Bof9qVRL.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>f(),m=y=>c(y);function h(y){ie[y?"unshift":"push"](()=>{s=y,t(4,s)})}function g(y){Pe.call(this,n,y)}function _(y){Pe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),o.passwordAuth.enabled||delete a["auth-with-password"],o.oauth2.enabled||delete a["auth-with-oauth2"],o.otp.enabled||delete a["auth-with-otp"]):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 $5 extends ye{constructor(e){super(),be(this,e,T5,S5,_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 C5=n=>({active:n&1}),wp=n=>({active:n[0]});function Sp(n){let e,t,i;const l=n[15].default,s=Lt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){v(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Pt(s,l,o,o[14],i?At(l,o[14],r,null):Nt(o[14]),null)},i(o){i||(O(s,o),o&&nt(()=>{i&&(t||(t=ze(e,wt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=ze(e,wt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),s&&s.d(o),o&&t&&t.end()}}}function O5(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(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]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){v(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",tt(n[17])),B(t,"drop",tt(n[18])),B(t,"dragstart",n[19]),B(t,"dragenter",n[20]),B(t,"dragleave",n[21]),B(t,"dragover",tt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Pt(u,a,c,c[14],s?At(a,c[14],d,C5):Nt(c[14]),wp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&O(f,1)):(f=Sp(c),f.c(),O(f,1),f.m(e,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(O(u,c),O(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,De(r)}}}function E5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=gt();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 g(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const R of P)R.click()}}Yt(()=>()=>clearTimeout(r));function T(P){Pe.call(this,n,P)}const $=()=>c&&y(),E=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,y,S,o,m,s,d,h,g,_,r,l,i,T,$,E,M,L,I,A]}class qi extends ye{constructor(e){super(),be(this,e,E5,O5,_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;s<i.length;s+=1)l[s]=Op($p(n,i,s));return{c(){e=b("div"),t=Y(`Available placeholder parameters:
                 `);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=$p(s,i,r);l[r]?l[r].p(a,o):(l[r]=Op(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&k(e),pt(l,s)}}}function Op(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[15](n[25])}return{c(){e=b("button"),i=Y(t),l=Y(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&ue(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function M5(n){var d;let e,t,i,l,s,o,r,a,u,f,c=((d=n[3])==null?void 0:d.length)>0&&Cp(n);return{c(){e=b("label"),t=Y("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ge(),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){v(m,e,h),w(e,t),v(m,l,h),v(m,s,h),ce(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=B(s,"input",n[14]),u=!0)},p(m,h){var g;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),((g=m[3])==null?void 0:g.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&&(k(e),k(l),k(s),k(r),k(a)),c&&c.d(m),u=!1,f()}}}function D5(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){v(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&&k(e),i=!1,l()}}}function I5(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(()=>ve(e,"value",s))),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{q(f,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),H(e.$$.fragment),O(e.$$.fragment,1),F(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,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function Ep(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Mp(Tp(n,i,s));return{c(){e=b("div"),t=Y(`Available placeholder parameters:
-                `);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Tp(s,i,r);l[r]?l[r].p(a,o):(l[r]=Mp(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&k(e),pt(l,s)}}}function Mp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[18](n[25])}return{c(){e=b("button"),i=Y(t),l=Y(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&ue(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function L5(n){var h;let e,t,i,l,s,o,r,a,u;const f=[I5,D5],c=[];function d(g,_){return g[5]&&!g[6]?0:1}s=d(n),o=c[s]=f[s](n);let m=((h=n[3])==null?void 0:h.length)>0&&Ep(n);return{c(){e=b("label"),t=Y("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ge(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let y=s;s=d(g),s===y?c[s].p(g,_):(re(),D(c[y],1,1,()=>{c[y]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),O(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Ep(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(O(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(k(e),k(l),k(r),k(a)),c[s].d(g),m&&m.d(g)}}}function A5(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[M5,({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:[L5,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(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||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function P5(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=Y(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ge(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&ue(s,c[2]),c[7]?f?d&128&&O(f,1):(f=Dp(),f.c(),O(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function N5(n){let e,t;const i=[n[9]];let l={$$slots:{header:[P5],default:[A5]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new qi({props:l}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){H(e.$$.fragment)},m(s,o){F(e,s,o),t=!0},p(s,[o]){const r=o&512?vt(i,[Ft(s[9])]):{};o&1073742063&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(O(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),q(e,s)}}}let Ip;function R5(n,e,t){let i;const l=["key","title","config","placeholders","expand","collapse","collapseSiblings"];let s=lt(e,l),o;Qe(n,Sn,N=>t(13,o=N));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 g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function y(){d||m||(t(6,m=!0),t(5,d=(await Ot(async()=>{const{default:N}=await import("./CodeEditor-C_5qTJii.js");return{default:N}},__vite__mapDeps([12,1]),import.meta.url)).default),Ip=d,t(6,m=!1))}function S(N){N=N.replace("*",""),z.copyToClipboard(N),Ys(`Copied ${N} to clipboard`,2e3)}y();function T(){u.subject=this.value,t(0,u)}const $=N=>S("{"+N+"}");function E(N){n.$$.not_equal(u.body,N)&&(u.body=N,t(0,u))}function M(){u.body=this.value,t(0,u)}const L=N=>S("{"+N+"}");function I(N){ie[N?"unshift":"push"](()=>{c=N,t(4,c)})}function A(N){Pe.call(this,n,N)}function P(N){Pe.call(this,n,N)}function R(N){Pe.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Ut(N)),t(9,s=lt(e,l)),"key"in N&&t(1,r=N.key),"title"in N&&t(2,a=N.title),"config"in N&&t(0,u=N.config),"placeholders"in N&&t(3,f=N.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||fi(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,T,$,E,M,L,I,A,P,R]}class F5 extends ye{constructor(e){super(),be(this,e,R5,N5,_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 q5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=Y(n[3]),i=Y(" 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"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){v(m,e,h),w(e,t),w(e,i),v(m,s,h),v(m,o,h),ce(o,n[0]),v(m,a,h),v(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&&ue(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&&yt(o.value)!==m[0]&&ce(o,m[0]),h&2&&x(f,"txt-success",!!m[1])},d(m){m&&(k(e),k(s),k(o),k(a),k(u)),c=!1,De(d)}}}function H5(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[q5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function j5(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=yt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=z.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 ye{constructor(e){super(),be(this,e,j5,H5,_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(()=>ve(i,"duration",a)),ie.push(()=>ve(i,"secret",u)),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),F(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,$e(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,$e(()=>s=!1)),i.$set(m)},i(c){r||(O(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&k(t),q(i)}}}function U5(n){let e,t=[],i=new Map,l,s=pe(n[1]);const o=r=>r[8].key;for(let r=0;r<s.length;r+=1){let a=Lp(n,s,r),u=o(a);i.set(u,t[r]=Ap(u,a))}return{c(){e=b("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","grid")},m(r,a){v(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);l=!0},p(r,a){a&3&&(s=pe(r[1]),re(),t=kt(t,a,o,1,r,s,i,e,zt,Ap,null,Lp),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(t[a]);l=!0}},o(r){for(let a=0;a<t.length;a+=1)D(t[a]);l=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Pp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function V5(n){let e,t,i,l,s,o=n[2]&&Pp();return{c(){e=b("div"),e.innerHTML='<i class="ri-key-2-line"></i> <span class="txt">Tokens options (invalidate, duration)</span>',t=C(),i=b("div"),l=C(),o&&o.c(),s=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),o&&o.m(r,a),v(r,s,a)},p(r,a){r[2]?o?a&4&&O(o,1):(o=Pp(),o.c(),O(o,1),o.m(s.parentNode,s)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},d(r){r&&(k(e),k(t),k(i),k(l),k(s)),o&&o.d(r)}}}function B5(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[V5],default:[U5]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function W5(n,e,t){let i,l,s;Qe(n,Sn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(z.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 Y5 extends ye{constructor(e){super(),be(this,e,W5,B5,_e,{collection:0})}}const K5=n=>({isSuperuserOnly:n&2048}),Np=n=>({isSuperuserOnly:n[11]}),J5=n=>({isSuperuserOnly:n&2048}),Rp=n=>({isSuperuserOnly:n[11]}),Z5=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]});function G5(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:[Q5,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function X5(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(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){v(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&&k(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='<i class="ri-lock-unlock-line svelte-dnx4io"></i>',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){v(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&&nt(()=>{s&&(l||(l=ze(e,Mt,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=ze(e,Mt,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&k(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){v(t,e,i)},d(t){t&&k(e)}}}function Q5(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,y,S,T,$,E;const M=n[15].beforeLabel,L=Lt(M,n,n[18],Fp),I=n[15].afterLabel,A=Lt(I,n,n[18],Rp);let P=n[5]&&!n[11]&&qp(n);function R(J){n[17](J)}var N=n[8];function U(J,ee){let X={id:J[21],baseCollection:J[1],disabled:J[10],placeholder:J[11]?"":J[6]};return J[0]!==void 0&&(X.value=J[0]),{props:X}}N&&(m=jt(N,U(n)),n[16](m),ie.push(()=>ve(m,"value",R)));let j=n[5]&&n[11]&&Hp(n);const V=n[15].default,K=Lt(V,n,n[18],Np);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=Y(n[2]),o=C(),a=Y(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&H(m.$$.fragment),g=C(),j&&j.c(),y=C(),S=b("div"),K&&K.c(),p(l,"class","txt"),x(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(J,ee){v(J,e,ee),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&&F(m,e,null),w(e,g),j&&j.m(e,null),v(J,y,ee),v(J,S,ee),K&&K.m(S,null),T=!0,$||(E=Me(_=He.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),$=!0)},p(J,ee){if(L&&L.p&&(!T||ee&264192)&&Pt(L,M,J,J[18],T?At(M,J[18],ee,Z5):Nt(J[18]),Fp),(!T||ee&4)&&ue(s,J[2]),(!T||ee&2048)&&r!==(r=J[11]?"- Superusers only":"")&&ue(a,r),(!T||ee&2048)&&x(l,"txt-hint",J[11]),A&&A.p&&(!T||ee&264192)&&Pt(A,I,J,J[18],T?At(I,J[18],ee,J5):Nt(J[18]),Rp),J[5]&&!J[11]?P?P.p(J,ee):(P=qp(J),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!T||ee&2097152&&c!==(c=J[21]))&&p(t,"for",c),ee&256&&N!==(N=J[8])){if(m){re();const X=m;D(X.$$.fragment,1,0,()=>{q(X,1)}),ae()}N?(m=jt(N,U(J)),J[16](m),ie.push(()=>ve(m,"value",R)),H(m.$$.fragment),O(m.$$.fragment,1),F(m,e,g)):m=null}else if(N){const X={};ee&2097152&&(X.id=J[21]),ee&2&&(X.baseCollection=J[1]),ee&1024&&(X.disabled=J[10]),ee&2112&&(X.placeholder=J[11]?"":J[6]),!h&&ee&1&&(h=!0,X.value=J[0],$e(()=>h=!1)),m.$set(X)}J[5]&&J[11]?j?(j.p(J,ee),ee&2080&&O(j,1)):(j=Hp(J),j.c(),O(j,1),j.m(e,null)):j&&(re(),D(j,1,1,()=>{j=null}),ae()),_&&Rt(_.update)&&ee&2&&_.update.call(null,J[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),K&&K.p&&(!T||ee&264192)&&Pt(K,V,J,J[18],T?At(V,J[18],ee,K5):Nt(J[18]),Np)},i(J){T||(O(L,J),O(A,J),m&&O(m.$$.fragment,J),O(j),O(K,J),T=!0)},o(J){D(L,J),D(A,J),m&&D(m.$$.fragment,J),D(j),D(K,J),T=!1},d(J){J&&(k(e),k(y),k(S)),L&&L.d(J),A&&A.d(J),P&&P.d(),n[16](null),m&&q(m),j&&j.d(),K&&K.d(J),$=!1,E()}}}function x5(n){let e,t,i,l;const s=[X5,G5],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}let zp;function e6(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,g=null,_=null,y=zp,S=!1;T();async function T(){y||S||(t(9,S=!0),t(8,y=(await Ot(async()=>{const{default:I}=await import("./FilterAutocompleteInput-HCvPk0wu.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),zp=y,t(9,S=!1))}async function $(){t(0,a=_||""),await fn(),g==null||g.focus()}async function E(){_=a,t(0,a=null)}function M(I){ie[I?"unshift":"push"](()=>{g=I,t(7,g)})}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,g,y,S,l,i,$,E,d,s,M,L,o]}class tl extends ye{constructor(e){super(),be(this,e,e6,x5,_e,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function t6(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){v(u,e,f),e.checked=n[0].mfa.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function n6(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
+                `);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Tp(s,i,r);l[r]?l[r].p(a,o):(l[r]=Mp(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&k(e),pt(l,s)}}}function Mp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[18](n[25])}return{c(){e=b("button"),i=Y(t),l=Y(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&ue(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function L5(n){var h;let e,t,i,l,s,o,r,a,u;const f=[I5,D5],c=[];function d(g,_){return g[5]&&!g[6]?0:1}s=d(n),o=c[s]=f[s](n);let m=((h=n[3])==null?void 0:h.length)>0&&Ep(n);return{c(){e=b("label"),t=Y("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ge(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let y=s;s=d(g),s===y?c[s].p(g,_):(re(),D(c[y],1,1,()=>{c[y]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),O(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Ep(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(O(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(k(e),k(l),k(r),k(a)),c[s].d(g),m&&m.d(g)}}}function A5(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[M5,({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:[L5,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(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||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function P5(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=Y(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ge(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&ue(s,c[2]),c[7]?f?d&128&&O(f,1):(f=Dp(),f.c(),O(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function N5(n){let e,t;const i=[n[9]];let l={$$slots:{header:[P5],default:[A5]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new qi({props:l}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){H(e.$$.fragment)},m(s,o){F(e,s,o),t=!0},p(s,[o]){const r=o&512?vt(i,[Ft(s[9])]):{};o&1073742063&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(O(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),q(e,s)}}}let Ip;function R5(n,e,t){let i;const l=["key","title","config","placeholders","expand","collapse","collapseSiblings"];let s=lt(e,l),o;Qe(n,Sn,N=>t(13,o=N));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 g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function y(){d||m||(t(6,m=!0),t(5,d=(await Ot(async()=>{const{default:N}=await import("./CodeEditor-BMLITRTv.js");return{default:N}},__vite__mapDeps([12,1]),import.meta.url)).default),Ip=d,t(6,m=!1))}function S(N){N=N.replace("*",""),z.copyToClipboard(N),Ys(`Copied ${N} to clipboard`,2e3)}y();function T(){u.subject=this.value,t(0,u)}const $=N=>S("{"+N+"}");function E(N){n.$$.not_equal(u.body,N)&&(u.body=N,t(0,u))}function M(){u.body=this.value,t(0,u)}const L=N=>S("{"+N+"}");function I(N){ie[N?"unshift":"push"](()=>{c=N,t(4,c)})}function A(N){Pe.call(this,n,N)}function P(N){Pe.call(this,n,N)}function R(N){Pe.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Ut(N)),t(9,s=lt(e,l)),"key"in N&&t(1,r=N.key),"title"in N&&t(2,a=N.title),"config"in N&&t(0,u=N.config),"placeholders"in N&&t(3,f=N.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||fi(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,T,$,E,M,L,I,A,P,R]}class F5 extends ye{constructor(e){super(),be(this,e,R5,N5,_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 q5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=Y(n[3]),i=Y(" 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"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){v(m,e,h),w(e,t),w(e,i),v(m,s,h),v(m,o,h),ce(o,n[0]),v(m,a,h),v(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&&ue(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&&_t(o.value)!==m[0]&&ce(o,m[0]),h&2&&x(f,"txt-success",!!m[1])},d(m){m&&(k(e),k(s),k(o),k(a),k(u)),c=!1,De(d)}}}function H5(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[q5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function j5(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=_t(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=z.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 ye{constructor(e){super(),be(this,e,j5,H5,_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(()=>ve(i,"duration",a)),ie.push(()=>ve(i,"secret",u)),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),F(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,$e(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,$e(()=>s=!1)),i.$set(m)},i(c){r||(O(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&k(t),q(i)}}}function U5(n){let e,t=[],i=new Map,l,s=pe(n[1]);const o=r=>r[8].key;for(let r=0;r<s.length;r+=1){let a=Lp(n,s,r),u=o(a);i.set(u,t[r]=Ap(u,a))}return{c(){e=b("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","grid")},m(r,a){v(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);l=!0},p(r,a){a&3&&(s=pe(r[1]),re(),t=kt(t,a,o,1,r,s,i,e,zt,Ap,null,Lp),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(t[a]);l=!0}},o(r){for(let a=0;a<t.length;a+=1)D(t[a]);l=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Pp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function V5(n){let e,t,i,l,s,o=n[2]&&Pp();return{c(){e=b("div"),e.innerHTML='<i class="ri-key-2-line"></i> <span class="txt">Tokens options (invalidate, duration)</span>',t=C(),i=b("div"),l=C(),o&&o.c(),s=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),o&&o.m(r,a),v(r,s,a)},p(r,a){r[2]?o?a&4&&O(o,1):(o=Pp(),o.c(),O(o,1),o.m(s.parentNode,s)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},d(r){r&&(k(e),k(t),k(i),k(l),k(s)),o&&o.d(r)}}}function B5(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[V5],default:[U5]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function W5(n,e,t){let i,l,s;Qe(n,Sn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(z.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 Y5 extends ye{constructor(e){super(),be(this,e,W5,B5,_e,{collection:0})}}const K5=n=>({isSuperuserOnly:n&2048}),Np=n=>({isSuperuserOnly:n[11]}),J5=n=>({isSuperuserOnly:n&2048}),Rp=n=>({isSuperuserOnly:n[11]}),Z5=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]});function G5(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:[Q5,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function X5(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(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){v(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&&k(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='<i class="ri-lock-unlock-line svelte-dnx4io"></i>',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){v(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&&nt(()=>{s&&(l||(l=ze(e,Mt,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=ze(e,Mt,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&k(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){v(t,e,i)},d(t){t&&k(e)}}}function Q5(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,y,S,T,$,E;const M=n[15].beforeLabel,L=Lt(M,n,n[18],Fp),I=n[15].afterLabel,A=Lt(I,n,n[18],Rp);let P=n[5]&&!n[11]&&qp(n);function R(J){n[17](J)}var N=n[8];function U(J,ee){let X={id:J[21],baseCollection:J[1],disabled:J[10],placeholder:J[11]?"":J[6]};return J[0]!==void 0&&(X.value=J[0]),{props:X}}N&&(m=jt(N,U(n)),n[16](m),ie.push(()=>ve(m,"value",R)));let j=n[5]&&n[11]&&Hp(n);const V=n[15].default,K=Lt(V,n,n[18],Np);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=Y(n[2]),o=C(),a=Y(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&H(m.$$.fragment),g=C(),j&&j.c(),y=C(),S=b("div"),K&&K.c(),p(l,"class","txt"),x(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(J,ee){v(J,e,ee),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&&F(m,e,null),w(e,g),j&&j.m(e,null),v(J,y,ee),v(J,S,ee),K&&K.m(S,null),T=!0,$||(E=Me(_=He.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),$=!0)},p(J,ee){if(L&&L.p&&(!T||ee&264192)&&Pt(L,M,J,J[18],T?At(M,J[18],ee,Z5):Nt(J[18]),Fp),(!T||ee&4)&&ue(s,J[2]),(!T||ee&2048)&&r!==(r=J[11]?"- Superusers only":"")&&ue(a,r),(!T||ee&2048)&&x(l,"txt-hint",J[11]),A&&A.p&&(!T||ee&264192)&&Pt(A,I,J,J[18],T?At(I,J[18],ee,J5):Nt(J[18]),Rp),J[5]&&!J[11]?P?P.p(J,ee):(P=qp(J),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!T||ee&2097152&&c!==(c=J[21]))&&p(t,"for",c),ee&256&&N!==(N=J[8])){if(m){re();const X=m;D(X.$$.fragment,1,0,()=>{q(X,1)}),ae()}N?(m=jt(N,U(J)),J[16](m),ie.push(()=>ve(m,"value",R)),H(m.$$.fragment),O(m.$$.fragment,1),F(m,e,g)):m=null}else if(N){const X={};ee&2097152&&(X.id=J[21]),ee&2&&(X.baseCollection=J[1]),ee&1024&&(X.disabled=J[10]),ee&2112&&(X.placeholder=J[11]?"":J[6]),!h&&ee&1&&(h=!0,X.value=J[0],$e(()=>h=!1)),m.$set(X)}J[5]&&J[11]?j?(j.p(J,ee),ee&2080&&O(j,1)):(j=Hp(J),j.c(),O(j,1),j.m(e,null)):j&&(re(),D(j,1,1,()=>{j=null}),ae()),_&&Rt(_.update)&&ee&2&&_.update.call(null,J[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),K&&K.p&&(!T||ee&264192)&&Pt(K,V,J,J[18],T?At(V,J[18],ee,K5):Nt(J[18]),Np)},i(J){T||(O(L,J),O(A,J),m&&O(m.$$.fragment,J),O(j),O(K,J),T=!0)},o(J){D(L,J),D(A,J),m&&D(m.$$.fragment,J),D(j),D(K,J),T=!1},d(J){J&&(k(e),k(y),k(S)),L&&L.d(J),A&&A.d(J),P&&P.d(),n[16](null),m&&q(m),j&&j.d(),K&&K.d(J),$=!1,E()}}}function x5(n){let e,t,i,l;const s=[X5,G5],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}let zp;function e6(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,g=null,_=null,y=zp,S=!1;T();async function T(){y||S||(t(9,S=!0),t(8,y=(await Ot(async()=>{const{default:I}=await import("./FilterAutocompleteInput-D8GkPlZA.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),zp=y,t(9,S=!1))}async function $(){t(0,a=_||""),await fn(),g==null||g.focus()}async function E(){_=a,t(0,a=null)}function M(I){ie[I?"unshift":"push"](()=>{g=I,t(7,g)})}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,g,y,S,l,i,$,E,d,s,M,L,o]}class tl extends ye{constructor(e){super(),be(this,e,e6,x5,_e,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function t6(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){v(u,e,f),e.checked=n[0].mfa.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function n6(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
                         <code>email != &#39;&#39;</code>.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p:te,d(o){o&&(k(e),k(t),k(i),k(l),k(s))}}}function i6(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:[t6,({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:[n6]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new tl({props:c}),ie.push(()=>ve(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`<p class="txt-bold">This feature is experimental and may change in the future.</p> <p>Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth
             methods (otp, identity/password, oauth2) before issuing an auth token.
-            <a href="https://pocketbase.io/docs/@todo" target="_blank" rel="noopener noreferrer" class="txt-sm link-hint" title="Learn more"><em>(Learn more)</em> </a>.</p>`,t=C(),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),F(l,i,null),w(i,s),w(i,o),F(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(O(l.$$.fragment,d),O(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(k(e),k(t),k(i)),q(l),q(r)}}}function l6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function s6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function o6(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?s6:l6}let a=r(n),u=a(n),f=n[1]&&Up();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-check-line"></i> <span class="txt">Multi-factor authentication (MFA)</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=Up(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function r6(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[o6],default:[i6]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function a6(n,e,t){let i,l;Qe(n,Sn,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=!z.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class u6 extends ye{constructor(e){super(),be(this,e,a6,r6,_e,{collection:0})}}const f6=n=>({}),Vp=n=>({});function Bp(n,e,t){const i=n.slice();return i[50]=e[t],i}const c6=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=Y(n[2]),i=C(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&ue(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&k(e)}}}function d6(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&ue(i,t)},i:te,o:te,d(l){l&&k(e)}}}function p6(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<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a[0]&2049&&(u=je(u,vt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]))),{props:u}}return s&&(e=jt(s,o(n))),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a[0]&1024&&s!==(s=r[10])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?vt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Jp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(s,o){v(s,e,o),t||(i=[Me(He.call(null,e,"Clear")),B(e,"click",On(tt(l)))],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,De(i)}}}function Zp(n){let e,t,i,l,s,o;const r=[p6,d6],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){v(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):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),O(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||(O(i),o=!0)},o(c){D(i),o=!1},d(c){c&&k(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:[_6]},$$scope:{ctx:n}};return e=new Hn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),q(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='<i class="ri-search-line"></i>',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){v(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&&k(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='<i class="ri-close-line"></i>',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){v(s,e,o),w(e,t),i||(l=B(t,"click",On(tt(n[23]))),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function xp(n){let e,t=n[1]&&em(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(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&&k(e),t&&t.d(i)}}}function em(n){let e,t;return{c(){e=b("div"),t=Y(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function m6(n){let e=n[50]+"",t;return{c(){t=Y(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&ue(t,e)},i:te,o:te,d(i){i&&k(t)}}}function h6(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<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a[0]&4202496&&(u=je(u,vt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Ft(r[13])]))),{props:u}}return s&&(e=jt(s,o(n))),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a[0]&4096&&s!==(s=r[12])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?vt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Ft(r[13])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function tm(n){let e,t,i,l,s,o,r;const a=[h6,m6],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"),x(e,"closable",n[9]),x(e,"selected",n[21](n[50]))},m(m,h){v(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 g=t;t=f(n),t===g?u[t].p(n,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),O(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[50]))},i(m){s||(O(i),s=!0)},o(m){D(i),s=!1},d(m){m&&k(e),u[t].d(),o=!1,De(r)}}}function _6(n){let e,t,i,l,s,o=n[14]&&Xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Wp);let u=pe(n[22]),f=[];for(let g=0;g<u.length;g+=1)f[g]=tm(Bp(n,u,g));const c=g=>D(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=xp(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Vp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),l=C(),h&&h.c(),p(i,"class","options-list")},m(g,_){o&&o.m(g,_),v(g,e,_),a&&a.m(g,_),v(g,t,_),v(g,i,_);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(i,null);d&&d.m(i,null),v(g,l,_),h&&h.m(g,_),s=!0},p(g,_){if(g[14]?o?o.p(g,_):(o=Xp(g),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!s||_[1]&16384)&&Pt(a,r,g,g[45],s?At(r,g[45],_,c6):Nt(g[45]),Wp),_[0]&56635906){u=pe(g[22]);let y;for(y=0;y<u.length;y+=1){const S=Bp(g,u,y);f[y]?(f[y].p(S,_),O(f[y],1)):(f[y]=tm(S),f[y].c(),O(f[y],1),f[y].m(i,null))}for(re(),y=u.length;y<f.length;y+=1)c(y);ae(),!u.length&&d?d.p(g,_):u.length?d&&(d.d(1),d=null):(d=xp(g),d.c(),d.m(i,null))}h&&h.p&&(!s||_[1]&16384)&&Pt(h,m,g,g[45],s?At(m,g[45],_,f6):Nt(g[45]),Vp)},i(g){if(!s){O(a,g);for(let _=0;_<u.length;_+=1)O(f[_]);O(h,g),s=!0}},o(g){D(a,g),f=f.filter(Boolean);for(let _=0;_<f.length;_+=1)D(f[_]);D(h,g),s=!1},d(g){g&&(k(e),k(t),k(i),k(l)),o&&o.d(g),a&&a.d(g),pt(f,g),d&&d.d(),h&&h.d(g)}}}function g6(n){let e,t,i,l,s,o,r=pe(z.toArray(n[0])),a=[];for(let d=0;d<r.length;d+=1)a[d]=Zp(Yp(n,r,d));const u=d=>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<a.length;d+=1)a[d].c();f&&f.c(),l=C(),c&&c.c(),p(t,"tabindex",i=n[5]||n[6]?"-1":"0"),p(t,"class","selected-container"),p(t,"role","button"),x(t,"disabled",n[5]),x(t,"readonly",n[6]),p(e,"class",s="select "+n[15]),x(e,"upside",n[7]),x(e,"multiple",n[4]),x(e,"disabled",n[5]),x(e,"readonly",n[6])},m(d,m){v(d,e,m),w(e,t);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(t,null);f&&f.m(t,null),n[38](t),w(e,l),c&&c.m(e,null),n[44](e),o=!0},p(d,m){if(m[0]&68981){r=pe(z.toArray(d[0]));let h;for(h=0;h<r.length;h+=1){const g=Yp(d,r,h);a[h]?(a[h].p(g,m),O(a[h],1)):(a[h]=Zp(g),a[h].c(),O(a[h],1),a[h].m(t,null))}for(re(),h=r.length;h<a.length;h+=1)u(h);ae(),!r.length&&f?f.p(d,m):r.length?f&&(f.d(1),f=null):(f=Kp(d),f.c(),f.m(t,null))}(!o||m[0]&96&&i!==(i=d[5]||d[6]?"-1":"0"))&&p(t,"tabindex",i),(!o||m[0]&32)&&x(t,"disabled",d[5]),(!o||m[0]&64)&&x(t,"readonly",d[6]),!d[5]&&!d[6]?c?(c.p(d,m),m[0]&96&&O(c,1)):(c=Gp(d),c.c(),O(c,1),c.m(e,null)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;m<r.length;m+=1)O(a[m]);O(c),o=!0}},o(d){a=a.filter(Boolean);for(let m=0;m<a.length;m+=1)D(a[m]);D(c),o=!1},d(d){d&&k(e),pt(a,d),f&&f.d(),n[38](null),c&&c.d(),n[44](null)}}}function b6(n,e){let t=(""+e).replace(/\s+/g,"").toLowerCase(),i=n;try{typeof n=="object"&&n!==null&&(i=JSON.stringify(n))}catch{}return(""+i).replace(/\s+/g,"").toLowerCase().includes(t)}function y6(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:m=!1}=e,{readonly:h=!1}=e,{upside:g=!1}=e,{zeroFunc:_=()=>d?[]:void 0}=e,{selected:y=_()}=e,{toggle:S=d}=e,{closable:T=!0}=e,{labelComponent:$=void 0}=e,{labelComponentProps:E={}}=e,{optionComponent:M=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=_t();let{class:R=""}=e,N,U="",j,V;function K(we){if(z.isEmpty(y))return;let Oe=z.toArray(y);z.inArray(Oe,we)&&(z.removeByValue(Oe,we),t(0,y=d?Oe:(Oe==null?void 0:Oe[0])||_())),P("change",{selected:y}),j==null||j.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function J(we){if(d){let Oe=z.toArray(y);z.inArray(Oe,we)||t(0,y=[...Oe,we])}else t(0,y=we);P("change",{selected:y}),j==null||j.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function ee(we){return l(we)?K(we):J(we)}function X(){t(0,y=_()),P("change",{selected:y}),j==null||j.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function oe(){N!=null&&N.show&&(N==null||N.show())}function Se(){N!=null&&N.hide&&(N==null||N.hide())}function ke(){if(z.isEmpty(y)||z.isEmpty(c))return;let we=z.toArray(y),Oe=[];for(const ut of we)z.inArray(c,ut)||Oe.push(ut);if(Oe.length){for(const ut of Oe)z.removeByValue(we,ut);t(0,y=d?we:we[0])}}function Ce(){t(17,U="")}function We(we,Oe){we=we||[];const ut=A||b6;return we.filter(Ne=>ut(Ne,Oe))||[]}function st(we,Oe){we.preventDefault(),S&&d?ee(Oe):J(Oe)}function et(we,Oe){(we.code==="Enter"||we.code==="Space")&&(st(we,Oe),T&&Se())}function Be(){Ce(),setTimeout(()=>{const we=j==null?void 0:j.querySelector(".dropdown-item.option.selected");we&&(we.focus(),we.scrollIntoView({block:"nearest"}))},0)}function rt(we){we.stopPropagation(),!h&&!m&&(N==null||N.toggle())}Yt(()=>{const we=document.querySelectorAll(`label[for="${r}"]`);for(const Oe of we)Oe.addEventListener("click",rt);return()=>{for(const Oe of we)Oe.removeEventListener("click",rt)}});const Je=we=>K(we);function at(we){ie[we?"unshift":"push"](()=>{V=we,t(20,V)})}function Ht(){U=this.value,t(17,U)}const Te=(we,Oe)=>st(Oe,we),Ze=(we,Oe)=>et(Oe,we);function ot(we){ie[we?"unshift":"push"](()=>{N=we,t(18,N)})}function Le(we){Pe.call(this,n,we)}function Ve(we){ie[we?"unshift":"push"](()=>{j=we,t(19,j)})}return n.$$set=we=>{"id"in we&&t(27,r=we.id),"noOptionsText"in we&&t(1,a=we.noOptionsText),"selectPlaceholder"in we&&t(2,u=we.selectPlaceholder),"searchPlaceholder"in we&&t(3,f=we.searchPlaceholder),"items"in we&&t(28,c=we.items),"multiple"in we&&t(4,d=we.multiple),"disabled"in we&&t(5,m=we.disabled),"readonly"in we&&t(6,h=we.readonly),"upside"in we&&t(7,g=we.upside),"zeroFunc"in we&&t(29,_=we.zeroFunc),"selected"in we&&t(0,y=we.selected),"toggle"in we&&t(8,S=we.toggle),"closable"in we&&t(9,T=we.closable),"labelComponent"in we&&t(10,$=we.labelComponent),"labelComponentProps"in we&&t(11,E=we.labelComponentProps),"optionComponent"in we&&t(12,M=we.optionComponent),"optionComponentProps"in we&&t(13,L=we.optionComponentProps),"searchable"in we&&t(14,I=we.searchable),"searchFunc"in we&&t(30,A=we.searchFunc),"class"in we&&t(15,R=we.class),"$$scope"in we&&t(45,o=we.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ke(),Ce()),n.$$.dirty[0]&268566528&&t(22,i=We(c,U)),n.$$.dirty[0]&1&&t(21,l=function(we){const Oe=z.toArray(y);return z.inArray(Oe,we)})},[y,a,u,f,d,m,h,g,S,T,$,E,M,L,I,R,K,U,N,j,V,l,i,Ce,st,et,Be,r,c,_,A,J,ee,X,oe,Se,s,Je,at,Ht,Te,Ze,ot,Le,Ve,o]}class ds extends ye{constructor(e){super(),be(this,e,y6,g6,_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 k6(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o<l.length;o+=1)s=je(s,l[o]);return{c(){e=b("input"),Xn(e,s)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),ce(e,n[1]),t||(i=B(e,"input",n[6]),t=!0)},p(o,r){Xn(e,s=vt(l,[{type:"password"},{autocomplete:"new-password"},r&16&&o[4]])),r&2&&e.value!==o[1]&&ce(e,o[1])},d(o){o&&k(e),n[5](null),t=!1,i()}}}function v6(n){let e,t,i,l,s,o,r=[{readOnly:!0},{type:"text"},{placeholder:"******"},n[4]],a={};for(let u=0;u<r.length;u+=1)a=je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',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){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),l.autofocus&&l.focus(),s||(o=[Me(He.call(null,t,{position:"left",text:"Set new value"})),B(t,"click",tt(n[3]))],s=!0)},p(u,f){Xn(l,a=vt(r,[{readOnly:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(k(e),k(i),k(l)),s=!1,De(o)}}}function w6(n){let e;function t(s,o){return s[0]?v6:k6}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function S6(n,e,t){const i=["mask","value"];let l=lt(e,i),{mask:s=!1}=e,{value:o=""}=e,r;async function a(){t(1,o=""),t(0,s=!1),await fn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){o=this.value,t(1,o)}return n.$$set=c=>{e=je(je({},e),Ut(c)),t(4,l=lt(e,i)),"mask"in c&&t(0,s=c.mask),"value"in c&&t(1,o=c.value)},[s,o,r,a,l,u,f]}class xu extends ye{constructor(e){super(),be(this,e,S6,w6,_e,{mask:0,value:1})}}function T6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function $6(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(()=>ve(s,"mask",u)),ie.push(()=>ve(s,"value",f)),{c(){e=b("label"),t=Y("Client secret"),l=C(),H(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(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;d<s.length;d+=1)c=je(c,s[d]);return f!==void 0&&f&72&&(c=je(c,vt(s,[f&64&&{key:u[6]},f&8&&Ft(u[3].optionsComponentProps||{})]))),u[1]!==void 0&&(c.config=u[1]),{props:c}}return r&&(t=jt(r,a(n)),ie.push(()=>ve(t,"config",o))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&F(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;D(c.$$.fragment,1,0,()=>{q(c,1)}),ae()}r?(t=jt(r,a(u,f)),ie.push(()=>ve(t,"config",o)),H(t.$$.fragment),O(t.$$.fragment,1),F(t,e,null)):t=null}else if(r){const c=f&72?vt(s,[f&64&&{key:u[6]},f&8&&Ft(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){l||(t&&O(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&k(e),t&&q(t)}}}function C6(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[T6,({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:[$6,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&nm(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),F(t,e,null),w(e,i),F(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=B(e,"submit",tt(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&&O(u,1)):(u=nm(f),u.c(),O(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(O(t.$$.fragment,f),O(l.$$.fragment,f),O(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&k(e),q(t),q(l),u&&u.d(),r=!1,a()}}}function O6(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function E6(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!vn(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&&k(e)}}}function M6(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?E6:O6}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=Y(l),o=C(),r=b("small"),a=Y("("),f=Y(u),c=Y(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){v(g,e,_),h.m(e,null),v(g,t,_),v(g,i,_),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&l!==(l=g[3].title+"")&&ue(s,l),_&8&&u!==(u=g[3].key+"")&&ue(f,u)},d(g){g&&(k(e),k(t),k(i)),h.d()}}}function im(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i>',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){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Me(He.call(null,e,{text:"Remove provider",position:"right"})),B(e,"click",n[10])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,De(s)}}}function D6(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),v(f,e,c),v(f,t,c),v(f,i,c),v(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&&(k(e),k(t),k(i),k(l)),u&&u.d(f),r=!1,a()}}}function I6(n){let e,t,i={btnClose:!1,$$slots:{footer:[D6],header:[M6],default:[C6]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),q(e,l)}}}function L6(n,e,t){let i,l;const s=_t(),o="provider_popup_"+z.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,R,N){t(13,m=N||0),t(4,f=z.isEmpty(R)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},R)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){fi(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function y(){pn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function T(P){d=P,t(5,d)}function $(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function E(P){u=P,t(1,u)}const M=()=>_();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.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)},[g,u,r,a,f,d,l,i,o,_,y,h,c,m,S,T,$,E,M,L,I,A]}class A6 extends ye{constructor(e){super(),be(this,e,L6,I6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function P6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function N6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function R6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function F6(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","text"),p(r,"id",a=n[23]),p(r,"max",ur),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),ce(r,n[6]),u||(f=[Me(He.call(null,l,{text:`Max ${ur} seconds (~${ur/(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&&(k(e),k(o),k(r)),u=!1,De(f)}}}function q6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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-----
+            <a href="https://pocketbase.io/docs/@todo" target="_blank" rel="noopener noreferrer" class="txt-sm link-hint" title="Learn more"><em>(Learn more)</em> </a>.</p>`,t=C(),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),F(l,i,null),w(i,s),w(i,o),F(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(O(l.$$.fragment,d),O(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(k(e),k(t),k(i)),q(l),q(r)}}}function l6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function s6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function o6(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?s6:l6}let a=r(n),u=a(n),f=n[1]&&Up();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-check-line"></i> <span class="txt">Multi-factor authentication (MFA)</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=Up(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function r6(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[o6],default:[i6]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function a6(n,e,t){let i,l;Qe(n,Sn,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=!z.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class u6 extends ye{constructor(e){super(),be(this,e,a6,r6,_e,{collection:0})}}const f6=n=>({}),Vp=n=>({});function Bp(n,e,t){const i=n.slice();return i[50]=e[t],i}const c6=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=Y(n[2]),i=C(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&ue(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&k(e)}}}function d6(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&ue(i,t)},i:te,o:te,d(l){l&&k(e)}}}function p6(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<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a[0]&2049&&(u=je(u,vt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]))),{props:u}}return s&&(e=jt(s,o(n))),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a[0]&1024&&s!==(s=r[10])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?vt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Jp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(s,o){v(s,e,o),t||(i=[Me(He.call(null,e,"Clear")),B(e,"click",On(tt(l)))],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,De(i)}}}function Zp(n){let e,t,i,l,s,o;const r=[p6,d6],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){v(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):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),O(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||(O(i),o=!0)},o(c){D(i),o=!1},d(c){c&&k(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:[_6]},$$scope:{ctx:n}};return e=new Hn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),q(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='<i class="ri-search-line"></i>',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){v(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&&k(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='<i class="ri-close-line"></i>',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){v(s,e,o),w(e,t),i||(l=B(t,"click",On(tt(n[23]))),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function xp(n){let e,t=n[1]&&em(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(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&&k(e),t&&t.d(i)}}}function em(n){let e,t;return{c(){e=b("div"),t=Y(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function m6(n){let e=n[50]+"",t;return{c(){t=Y(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&ue(t,e)},i:te,o:te,d(i){i&&k(t)}}}function h6(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<l.length;f+=1)u=je(u,l[f]);return a!==void 0&&a[0]&4202496&&(u=je(u,vt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Ft(r[13])]))),{props:u}}return s&&(e=jt(s,o(n))),{c(){e&&H(e.$$.fragment),t=ge()},m(r,a){e&&F(e,r,a),v(r,t,a),i=!0},p(r,a){if(a[0]&4096&&s!==(s=r[12])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{q(u,1)}),ae()}s?(e=jt(s,o(r,a)),H(e.$$.fragment),O(e.$$.fragment,1),F(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?vt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Ft(r[13])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function tm(n){let e,t,i,l,s,o,r;const a=[h6,m6],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"),x(e,"closable",n[9]),x(e,"selected",n[21](n[50]))},m(m,h){v(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 g=t;t=f(n),t===g?u[t].p(n,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),O(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[50]))},i(m){s||(O(i),s=!0)},o(m){D(i),s=!1},d(m){m&&k(e),u[t].d(),o=!1,De(r)}}}function _6(n){let e,t,i,l,s,o=n[14]&&Xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Wp);let u=pe(n[22]),f=[];for(let g=0;g<u.length;g+=1)f[g]=tm(Bp(n,u,g));const c=g=>D(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=xp(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Vp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),l=C(),h&&h.c(),p(i,"class","options-list")},m(g,_){o&&o.m(g,_),v(g,e,_),a&&a.m(g,_),v(g,t,_),v(g,i,_);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(i,null);d&&d.m(i,null),v(g,l,_),h&&h.m(g,_),s=!0},p(g,_){if(g[14]?o?o.p(g,_):(o=Xp(g),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!s||_[1]&16384)&&Pt(a,r,g,g[45],s?At(r,g[45],_,c6):Nt(g[45]),Wp),_[0]&56635906){u=pe(g[22]);let y;for(y=0;y<u.length;y+=1){const S=Bp(g,u,y);f[y]?(f[y].p(S,_),O(f[y],1)):(f[y]=tm(S),f[y].c(),O(f[y],1),f[y].m(i,null))}for(re(),y=u.length;y<f.length;y+=1)c(y);ae(),!u.length&&d?d.p(g,_):u.length?d&&(d.d(1),d=null):(d=xp(g),d.c(),d.m(i,null))}h&&h.p&&(!s||_[1]&16384)&&Pt(h,m,g,g[45],s?At(m,g[45],_,f6):Nt(g[45]),Vp)},i(g){if(!s){O(a,g);for(let _=0;_<u.length;_+=1)O(f[_]);O(h,g),s=!0}},o(g){D(a,g),f=f.filter(Boolean);for(let _=0;_<f.length;_+=1)D(f[_]);D(h,g),s=!1},d(g){g&&(k(e),k(t),k(i),k(l)),o&&o.d(g),a&&a.d(g),pt(f,g),d&&d.d(),h&&h.d(g)}}}function g6(n){let e,t,i,l,s,o,r=pe(z.toArray(n[0])),a=[];for(let d=0;d<r.length;d+=1)a[d]=Zp(Yp(n,r,d));const u=d=>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<a.length;d+=1)a[d].c();f&&f.c(),l=C(),c&&c.c(),p(t,"tabindex",i=n[5]||n[6]?"-1":"0"),p(t,"class","selected-container"),p(t,"role","button"),x(t,"disabled",n[5]),x(t,"readonly",n[6]),p(e,"class",s="select "+n[15]),x(e,"upside",n[7]),x(e,"multiple",n[4]),x(e,"disabled",n[5]),x(e,"readonly",n[6])},m(d,m){v(d,e,m),w(e,t);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(t,null);f&&f.m(t,null),n[38](t),w(e,l),c&&c.m(e,null),n[44](e),o=!0},p(d,m){if(m[0]&68981){r=pe(z.toArray(d[0]));let h;for(h=0;h<r.length;h+=1){const g=Yp(d,r,h);a[h]?(a[h].p(g,m),O(a[h],1)):(a[h]=Zp(g),a[h].c(),O(a[h],1),a[h].m(t,null))}for(re(),h=r.length;h<a.length;h+=1)u(h);ae(),!r.length&&f?f.p(d,m):r.length?f&&(f.d(1),f=null):(f=Kp(d),f.c(),f.m(t,null))}(!o||m[0]&96&&i!==(i=d[5]||d[6]?"-1":"0"))&&p(t,"tabindex",i),(!o||m[0]&32)&&x(t,"disabled",d[5]),(!o||m[0]&64)&&x(t,"readonly",d[6]),!d[5]&&!d[6]?c?(c.p(d,m),m[0]&96&&O(c,1)):(c=Gp(d),c.c(),O(c,1),c.m(e,null)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;m<r.length;m+=1)O(a[m]);O(c),o=!0}},o(d){a=a.filter(Boolean);for(let m=0;m<a.length;m+=1)D(a[m]);D(c),o=!1},d(d){d&&k(e),pt(a,d),f&&f.d(),n[38](null),c&&c.d(),n[44](null)}}}function b6(n,e){let t=(""+e).replace(/\s+/g,"").toLowerCase(),i=n;try{typeof n=="object"&&n!==null&&(i=JSON.stringify(n))}catch{}return(""+i).replace(/\s+/g,"").toLowerCase().includes(t)}function y6(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:m=!1}=e,{readonly:h=!1}=e,{upside:g=!1}=e,{zeroFunc:_=()=>d?[]:void 0}=e,{selected:y=_()}=e,{toggle:S=d}=e,{closable:T=!0}=e,{labelComponent:$=void 0}=e,{labelComponentProps:E={}}=e,{optionComponent:M=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=gt();let{class:R=""}=e,N,U="",j,V;function K(we){if(z.isEmpty(y))return;let Oe=z.toArray(y);z.inArray(Oe,we)&&(z.removeByValue(Oe,we),t(0,y=d?Oe:(Oe==null?void 0:Oe[0])||_())),P("change",{selected:y}),j==null||j.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function J(we){if(d){let Oe=z.toArray(y);z.inArray(Oe,we)||t(0,y=[...Oe,we])}else t(0,y=we);P("change",{selected:y}),j==null||j.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function ee(we){return l(we)?K(we):J(we)}function X(){t(0,y=_()),P("change",{selected:y}),j==null||j.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function oe(){N!=null&&N.show&&(N==null||N.show())}function Se(){N!=null&&N.hide&&(N==null||N.hide())}function ke(){if(z.isEmpty(y)||z.isEmpty(c))return;let we=z.toArray(y),Oe=[];for(const ut of we)z.inArray(c,ut)||Oe.push(ut);if(Oe.length){for(const ut of Oe)z.removeByValue(we,ut);t(0,y=d?we:we[0])}}function Ce(){t(17,U="")}function We(we,Oe){we=we||[];const ut=A||b6;return we.filter(Ne=>ut(Ne,Oe))||[]}function st(we,Oe){we.preventDefault(),S&&d?ee(Oe):J(Oe)}function et(we,Oe){(we.code==="Enter"||we.code==="Space")&&(st(we,Oe),T&&Se())}function Be(){Ce(),setTimeout(()=>{const we=j==null?void 0:j.querySelector(".dropdown-item.option.selected");we&&(we.focus(),we.scrollIntoView({block:"nearest"}))},0)}function rt(we){we.stopPropagation(),!h&&!m&&(N==null||N.toggle())}Yt(()=>{const we=document.querySelectorAll(`label[for="${r}"]`);for(const Oe of we)Oe.addEventListener("click",rt);return()=>{for(const Oe of we)Oe.removeEventListener("click",rt)}});const Je=we=>K(we);function at(we){ie[we?"unshift":"push"](()=>{V=we,t(20,V)})}function Ht(){U=this.value,t(17,U)}const Te=(we,Oe)=>st(Oe,we),Ze=(we,Oe)=>et(Oe,we);function ot(we){ie[we?"unshift":"push"](()=>{N=we,t(18,N)})}function Le(we){Pe.call(this,n,we)}function Ve(we){ie[we?"unshift":"push"](()=>{j=we,t(19,j)})}return n.$$set=we=>{"id"in we&&t(27,r=we.id),"noOptionsText"in we&&t(1,a=we.noOptionsText),"selectPlaceholder"in we&&t(2,u=we.selectPlaceholder),"searchPlaceholder"in we&&t(3,f=we.searchPlaceholder),"items"in we&&t(28,c=we.items),"multiple"in we&&t(4,d=we.multiple),"disabled"in we&&t(5,m=we.disabled),"readonly"in we&&t(6,h=we.readonly),"upside"in we&&t(7,g=we.upside),"zeroFunc"in we&&t(29,_=we.zeroFunc),"selected"in we&&t(0,y=we.selected),"toggle"in we&&t(8,S=we.toggle),"closable"in we&&t(9,T=we.closable),"labelComponent"in we&&t(10,$=we.labelComponent),"labelComponentProps"in we&&t(11,E=we.labelComponentProps),"optionComponent"in we&&t(12,M=we.optionComponent),"optionComponentProps"in we&&t(13,L=we.optionComponentProps),"searchable"in we&&t(14,I=we.searchable),"searchFunc"in we&&t(30,A=we.searchFunc),"class"in we&&t(15,R=we.class),"$$scope"in we&&t(45,o=we.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ke(),Ce()),n.$$.dirty[0]&268566528&&t(22,i=We(c,U)),n.$$.dirty[0]&1&&t(21,l=function(we){const Oe=z.toArray(y);return z.inArray(Oe,we)})},[y,a,u,f,d,m,h,g,S,T,$,E,M,L,I,R,K,U,N,j,V,l,i,Ce,st,et,Be,r,c,_,A,J,ee,X,oe,Se,s,Je,at,Ht,Te,Ze,ot,Le,Ve,o]}class ds extends ye{constructor(e){super(),be(this,e,y6,g6,_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 k6(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o<l.length;o+=1)s=je(s,l[o]);return{c(){e=b("input"),Xn(e,s)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),ce(e,n[1]),t||(i=B(e,"input",n[6]),t=!0)},p(o,r){Xn(e,s=vt(l,[{type:"password"},{autocomplete:"new-password"},r&16&&o[4]])),r&2&&e.value!==o[1]&&ce(e,o[1])},d(o){o&&k(e),n[5](null),t=!1,i()}}}function v6(n){let e,t,i,l,s,o,r=[{readOnly:!0},{type:"text"},{placeholder:"******"},n[4]],a={};for(let u=0;u<r.length;u+=1)a=je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',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){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),l.autofocus&&l.focus(),s||(o=[Me(He.call(null,t,{position:"left",text:"Set new value"})),B(t,"click",tt(n[3]))],s=!0)},p(u,f){Xn(l,a=vt(r,[{readOnly:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(k(e),k(i),k(l)),s=!1,De(o)}}}function w6(n){let e;function t(s,o){return s[0]?v6:k6}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function S6(n,e,t){const i=["mask","value"];let l=lt(e,i),{mask:s=!1}=e,{value:o=""}=e,r;async function a(){t(1,o=""),t(0,s=!1),await fn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){o=this.value,t(1,o)}return n.$$set=c=>{e=je(je({},e),Ut(c)),t(4,l=lt(e,i)),"mask"in c&&t(0,s=c.mask),"value"in c&&t(1,o=c.value)},[s,o,r,a,l,u,f]}class xu extends ye{constructor(e){super(),be(this,e,S6,w6,_e,{mask:0,value:1})}}function T6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function $6(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(()=>ve(s,"mask",u)),ie.push(()=>ve(s,"value",f)),{c(){e=b("label"),t=Y("Client secret"),l=C(),H(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(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;d<s.length;d+=1)c=je(c,s[d]);return f!==void 0&&f&72&&(c=je(c,vt(s,[f&64&&{key:u[6]},f&8&&Ft(u[3].optionsComponentProps||{})]))),u[1]!==void 0&&(c.config=u[1]),{props:c}}return r&&(t=jt(r,a(n)),ie.push(()=>ve(t,"config",o))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&F(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;D(c.$$.fragment,1,0,()=>{q(c,1)}),ae()}r?(t=jt(r,a(u,f)),ie.push(()=>ve(t,"config",o)),H(t.$$.fragment),O(t.$$.fragment,1),F(t,e,null)):t=null}else if(r){const c=f&72?vt(s,[f&64&&{key:u[6]},f&8&&Ft(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){l||(t&&O(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&k(e),t&&q(t)}}}function C6(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[T6,({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:[$6,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&nm(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),F(t,e,null),w(e,i),F(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=B(e,"submit",tt(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&&O(u,1)):(u=nm(f),u.c(),O(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(O(t.$$.fragment,f),O(l.$$.fragment,f),O(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&k(e),q(t),q(l),u&&u.d(),r=!1,a()}}}function O6(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function E6(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!vn(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&&k(e)}}}function M6(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?E6:O6}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=Y(l),o=C(),r=b("small"),a=Y("("),f=Y(u),c=Y(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){v(g,e,_),h.m(e,null),v(g,t,_),v(g,i,_),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&l!==(l=g[3].title+"")&&ue(s,l),_&8&&u!==(u=g[3].key+"")&&ue(f,u)},d(g){g&&(k(e),k(t),k(i)),h.d()}}}function im(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i>',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){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Me(He.call(null,e,{text:"Remove provider",position:"right"})),B(e,"click",n[10])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,De(s)}}}function D6(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),v(f,e,c),v(f,t,c),v(f,i,c),v(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&&(k(e),k(t),k(i),k(l)),u&&u.d(f),r=!1,a()}}}function I6(n){let e,t,i={btnClose:!1,$$slots:{footer:[D6],header:[M6],default:[C6]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),q(e,l)}}}function L6(n,e,t){let i,l;const s=gt(),o="provider_popup_"+z.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,R,N){t(13,m=N||0),t(4,f=z.isEmpty(R)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},R)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){fi(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function y(){pn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function T(P){d=P,t(5,d)}function $(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function E(P){u=P,t(1,u)}const M=()=>_();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.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)},[g,u,r,a,f,d,l,i,o,_,y,h,c,m,S,T,$,E,M,L,I,A]}class A6 extends ye{constructor(e){super(),be(this,e,L6,I6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function P6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function N6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function R6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function F6(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",ur),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),ce(r,n[6]),u||(f=[Me(He.call(null,l,{text:`Max ${ur} seconds (~${ur/(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&&_t(r.value)!==c[6]&&ce(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,De(f)}}}function q6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[5]),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function H6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S;return l=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[P6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[N6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[R6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[F6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[q6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),H(g.$$.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,$){v(T,e,$),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(r,o,null),w(t,a),w(t,u),F(f,u,null),w(t,c),w(t,d),F(m,d,null),w(t,h),F(g,t,null),_=!0,y||(S=B(e,"submit",tt(n[17])),y=!0)},p(T,$){const E={};$&25165828&&(E.$$scope={dirty:$,ctx:T}),l.$set(E);const M={};$&25165832&&(M.$$scope={dirty:$,ctx:T}),r.$set(M);const L={};$&25165840&&(L.$$scope={dirty:$,ctx:T}),f.$set(L);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const A={};$&25165856&&(A.$$scope={dirty:$,ctx:T}),g.$set(A)},i(T){_||(O(l.$$.fragment,T),O(r.$$.fragment,T),O(f.$$.fragment,T),O(m.$$.fragment,T),O(g.$$.fragment,T),_=!0)},o(T){D(l.$$.fragment,T),D(r.$$.fragment,T),D(f.$$.fragment,T),D(m.$$.fragment,T),D(g.$$.fragment,T),_=!1},d(T){T&&k(e),q(l),q(r),q(f),q(m),q(g),y=!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){v(t,e,i)},p:te,d(t){t&&k(e)}}}function z6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("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],x(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(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&&x(l,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(l)),u=!1,f()}}}function U6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[z6],header:[j6],default:[H6]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),q(e,l)}}}const ur=15777e3;function V6(n,e,t){let i;const l=_t(),s="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||ur),Wt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){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 _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function T(){c=this.value,t(6,c)}function $(){f=this.value,t(5,f)}const E=()=>g(),M=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,g,m,_,y,S,T,$,E,M,L,I,A]}class B6 extends ye{constructor(e){super(),be(this,e,V6,U6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function W6(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new B6({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(),H(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){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),F(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||(O(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),q(r,d),u=!1,f()}}}function Y6(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 K6 extends ye{constructor(e){super(),be(this,e,Y6,W6,_e,{key:1,config:0})}}function J6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[0].authURL),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function Z6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[0].tokenURL),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function G6(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[J6,({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:[Z6,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),F(i,r,a),v(r,l,a),F(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||(O(i.$$.fragment,r),O(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l)),q(i,r),q(s,r)}}}function X6(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 Q6 extends ye{constructor(e){super(),be(this,e,X6,G6,_e,{key:1,config:0})}}function x6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Display name"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","text"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].displayName),r||(a=B(s,"input",n[2]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&ce(s,u[0].displayName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function e8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].authURL),r||(a=B(s,"input",n[3]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&ce(s,u[0].authURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function t8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].tokenURL),r||(a=B(s,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&ce(s,u[0].tokenURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function n8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].userInfoURL),r||(a=B(s,"input",n[5]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&ce(s,u[0].userInfoURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function i8(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[7]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[7])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[6]),Me(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&128&&t!==(t=c[7])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&128&&a!==(a=c[7])&&p(l,"for",a)},d(c){c&&(k(e),k(i),k(l)),u=!1,De(f)}}}function l8(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[x6,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[e8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[t8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[n8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[i8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),H(s.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),H(c.$$.fragment),p(i,"class","section-title")},m(m,h){F(e,m,h),v(m,t,h),v(m,i,h),v(m,l,h),F(s,m,h),v(m,o,h),F(r,m,h),v(m,a,h),F(u,m,h),v(m,f,h),F(c,m,h),d=!0},p(m,[h]){const g={};h&2&&(g.name=m[1]+".displayName"),h&385&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.name=m[1]+".authURL"),h&385&&(_.$$scope={dirty:h,ctx:m}),s.$set(_);const y={};h&2&&(y.name=m[1]+".tokenURL"),h&385&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&2&&(S.name=m[1]+".userInfoURL"),h&385&&(S.$$scope={dirty:h,ctx:m}),u.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&385&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(O(e.$$.fragment,m),O(s.$$.fragment,m),O(r.$$.fragment,m),O(u.$$.fragment,m),O(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(r.$$.fragment,m),D(u.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(k(t),k(i),k(l),k(o),k(a),k(f)),q(e,m),q(s,m),q(r,m),q(u,m),q(c,m)}}}function s8(n,e,t){let{key:i=""}=e,{config:l={}}=e;z.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC");function s(){l.displayName=this.value,t(0,l)}function o(){l.authURL=this.value,t(0,l)}function r(){l.tokenURL=this.value,t(0,l)}function a(){l.userInfoURL=this.value,t(0,l)}function u(){l.pkce=this.checked,t(0,l)}return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a,u]}class ka extends ye{constructor(e){super(),be(this,e,s8,l8,_e,{key:1,config:0})}}function o8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function r8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function a8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function u8(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:[r8,({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:[a8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=Y(n[2]),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),F(l,f,c),v(f,s,c),F(o,f,c),v(f,r,c),F(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&ue(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||(O(l.$$.fragment,f),O(o.$$.fragment,f),O(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(e),k(i),k(s),k(r)),q(l,f),q(o,f),q(a,f)}}}function f8(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 va extends ye{constructor(e){super(),be(this,e,f8,u8,_e,{key:1,config:0,required:4,title:2})}}const ef=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:K6},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:Q6},{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:va,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:va,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:"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:va,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:ka},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:ka},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:ka}];function lm(n,e,t){const i=n.slice();return i[16]=e[t],i}function sm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',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){v(o,e,r),i=!0,l||(s=B(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function c8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&sm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ge(),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){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),ce(s,n[1]),v(d,r,m),c&&c.m(d,m),v(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&&O(c,1)):(c=sm(d),c.c(),O(c,1),c.m(a.parentNode,a)):c&&(re(),D(c,1,1,()=>{c=null}),ae())},d(d){d&&(k(e),k(l),k(s),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function om(n){let e,t,i,l,s=n[1]!=""&&rm(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){v(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=rm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function rm(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){v(l,e,s),t||(i=B(e,"click",n[5]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function am(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!vn(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&&k(e)}}}function um(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,y=e[16].logo&&am(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),y&&y.c(),s=C(),o=b("div"),r=b("div"),u=Y(a),f=C(),c=b("em"),m=Y(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,$){v(T,t,$),w(t,i),w(i,l),y&&y.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),g=!0)},p(T,$){e=T,e[16].logo?y?y.p(e,$):(y=am(e),y.c(),y.m(l,null)):y&&(y.d(1),y=null),$&8&&a!==(a=e[16].title+"")&&ue(u,a),$&8&&d!==(d=e[16].key+"")&&ue(m,d)},d(T){T&&k(t),y&&y.d(),g=!1,_()}}}function d8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[c8,({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<r.length;f+=1){let c=lm(n,r,f),d=a(c);s.set(d,l[f]=um(d,c))}let u=null;return r.length||(u=om(n)),{c(){H(e.$$.fragment),t=C(),i=b("div");for(let f=0;f<l.length;f+=1)l[f].c();u&&u.c(),p(i,"class","grid grid-sm")},m(f,c){F(e,f,c),v(f,t,c),v(f,i,c);for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(i,null);u&&u.m(i,null),o=!0},p(f,c){const d={};c&1572866&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),c&58&&(r=pe(f[3]),l=kt(l,c,a,1,f,r,s,i,ci,um,null,lm),!r.length&&u?u.p(f,c):r.length?u&&(u.d(1),u=null):(u=om(f),u.c(),u.m(i,null)))},i(f){o||(O(e.$$.fragment,f),o=!0)},o(f){D(e.$$.fragment,f),o=!1},d(f){f&&(k(t),k(i)),q(e,f);for(let c=0;c<l.length;c+=1)l[c].d();u&&u.d()}}}function p8(n){let e;return{c(){e=b("h4"),e.textContent="Add OAuth2 provider",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function m8(n){let e,t,i;return{c(){e=b("button"),e.textContent="Cancel",p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[0]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function h8(n){let e,t,i={btnClose:!1,$$slots:{footer:[m8],header:[p8],default:[d8]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&1048586&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}function _8(n,e,t){const i=_t();let{disabled:l=[]}=e,s,o="",r=[];function a(){s==null||s.show()}function u(){return s==null?void 0:s.hide()}function f(T){i("select",T),u()}function c(){const T=(o||"").toLowerCase();return ef.filter($=>!l.includes($.key)&&(T==""||$.key.toLowerCase().includes(T)||$.title.toLowerCase().includes(T)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=T=>f(T);function _(T){ie[T?"unshift":"push"](()=>{s=T,t(2,s)})}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}return n.$$set=T=>{"disabled"in T&&t(6,l=T.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,_,y,S]}class g8 extends ye{constructor(e){super(),be(this,e,_8,h8,_e,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function fm(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 b8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function y8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function k8(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s[0]&1&&!vn(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&&k(e)}}}function cm(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){v(s,e,o),t||(i=[Me(He.call(null,e,{text:"Edit config",position:"left"})),B(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,De(i)}}}function dm(n,e){var T;let t,i,l,s,o,r,a=(e[28].displayName||((T=e[29])==null?void 0:T.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g($,E){var M;return(M=$[29])!=null&&M.logo?k8:y8}let _=g(e),y=_(e),S=e[29]&&cm(e);return{key:n,first:null,c(){var $,E,M;t=b("div"),i=b("div"),l=b("figure"),y.c(),s=C(),o=b("div"),r=b("div"),u=Y(a),f=C(),c=b("em"),m=Y(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"),x(i,"error",!z.isEmpty((M=(E=($=e[1])==null?void 0:$.oauth2)==null?void 0:E.providers)==null?void 0:M[e[31]])),p(t,"class","col-lg-6"),this.first=t},m($,E){v($,t,E),w(t,i),w(i,l),y.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($,E){var M,L,I,A;e=$,_===(_=g(e))&&y?y.p(e,E):(y.d(1),y=_(e),y&&(y.c(),y.m(l,null))),E[0]&1&&a!==(a=(e[28].displayName||((M=e[29])==null?void 0:M.title)||"Custom")+"")&&ue(u,a),E[0]&1&&d!==(d=e[28].name+"")&&ue(m,d),e[29]?S?S.p(e,E):(S=cm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),E[0]&3&&x(i,"error",!z.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d($){$&&k(t),y.d(),S&&S.d()}}}function v8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function w8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function pm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[S8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[T8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[$8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[C8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(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(_,y){v(_,e,y),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(r,o,null),w(t,a),w(t,u),F(f,u,null),w(t,c),w(t,d),F(m,d,null),g=!0},p(_,y){const S={};y[0]&134217761|y[1]&2&&(S.$$scope={dirty:y,ctx:_}),l.$set(S);const T={};y[0]&134217793|y[1]&2&&(T.$$scope={dirty:y,ctx:_}),r.$set(T);const $={};y[0]&134217761|y[1]&2&&($.$$scope={dirty:y,ctx:_}),f.$set($);const E={};y[0]&134217761|y[1]&2&&(E.$$scope={dirty:y,ctx:_}),m.$set(E)},i(_){g||(O(l.$$.fragment,_),O(r.$$.fragment,_),O(f.$$.fragment,_),O(m.$$.fragment,_),_&&nt(()=>{g&&(h||(h=ze(e,wt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=ze(e,wt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&k(e),q(l),q(r),q(f),q(m),_&&h&&h.end()}}}function S8(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:L8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 full name"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function T8(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:A8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 avatar"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function $8(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:P8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 id"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function C8(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:N8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 username"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function O8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,y,S,T,$,E,M;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[b8,({uniqueId:U})=>({27:U}),({uniqueId:U})=>[U?134217728:0]]},$$scope:{ctx:n}}});let L=pe(n[0].oauth2.providers);const I=U=>U[28].name;for(let U=0;U<L.length;U+=1){let j=fm(n,L,U),V=I(j);s.set(V,l[U]=dm(V,j))}function A(U,j){return U[4]?w8:v8}let P=A(n),R=P(n),N=n[4]&&pm(n);return{c(){H(e.$$.fragment),t=C(),i=b("div");for(let U=0;U<l.length;U+=1)l[U].c();o=C(),r=b("div"),a=b("button"),a.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add provider</span>',u=C(),f=b("button"),c=b("strong"),d=Y("Optional "),h=Y(m),g=Y(" create fields map"),_=C(),R.c(),S=C(),N&&N.c(),T=ge(),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",y="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(U,j){F(e,U,j),v(U,t,j),v(U,i,j);for(let V=0;V<l.length;V+=1)l[V]&&l[V].m(i,null);w(i,o),w(i,r),w(r,a),v(U,u,j),v(U,f,j),w(f,c),w(c,d),w(c,h),w(c,g),w(f,_),R.m(f,null),v(U,S,j),N&&N.m(U,j),v(U,T,j),$=!0,E||(M=[B(a,"click",n[12]),B(f,"click",n[13])],E=!0)},p(U,j){const V={};j[0]&134217729|j[1]&2&&(V.$$scope={dirty:j,ctx:U}),e.$set(V),j[0]&523&&(L=pe(U[0].oauth2.providers),l=kt(l,j,I,1,U,L,s,i,ci,dm,o,fm)),(!$||j[0]&1)&&m!==(m=U[0].name+"")&&ue(h,m),P!==(P=A(U))&&(R.d(1),R=P(U),R&&(R.c(),R.m(f,null))),(!$||j[0]&16&&y!==(y="m-t-25 btn btn-sm "+(U[4]?"btn-secondary":"btn-hint btn-transparent")))&&p(f,"class",y),U[4]?N?(N.p(U,j),j[0]&16&&O(N,1)):(N=pm(U),N.c(),O(N,1),N.m(T.parentNode,T)):N&&(re(),D(N,1,1,()=>{N=null}),ae())},i(U){$||(O(e.$$.fragment,U),O(N),$=!0)},o(U){D(e.$$.fragment,U),D(N),$=!1},d(U){U&&(k(t),k(i),k(u),k(f),k(S),k(T)),q(e,U);for(let j=0;j<l.length;j+=1)l[j].d();R.d(),N&&N.d(U),E=!1,De(M)}}}function E8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function M8(n){let e,t,i,l=n[7]==1?"provider":"providers",s,o,r;return{c(){e=b("span"),t=Y(n[7]),i=C(),s=Y(l),o=C(),r=b("span"),r.textContent="Enabled",p(e,"class","label"),x(e,"label-warning",!n[7]),x(e,"label-info",n[7]>0),p(r,"class","label label-success")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,s),v(a,o,u),v(a,r,u)},p(a,u){u[0]&128&&ue(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&ue(s,l),u[0]&128&&x(e,"label-warning",!a[7]),u[0]&128&&x(e,"label-info",a[7]>0)},d(a){a&&(k(e),k(o),k(r))}}}function mm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function D8(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?M8:E8}let a=r(n),u=a(n),f=n[8]&&mm();return{c(){e=b("div"),e.innerHTML='<i class="ri-pass-expired-line"></i> <span class="txt">OAuth2</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=mm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function I8(n){var u,f;let e,t,i,l,s,o;e=new qi({props:{single:!0,$$slots:{header:[D8],default:[O8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(hm))||[]};i=new g8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new A6({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(c,d){F(e,c,d),v(c,t,d),F(i,c,d),v(c,l,d),F(s,c,d),o=!0},p(c,d){var _,y;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((y=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:y.map(hm))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(O(e.$$.fragment,c),O(i.$$.fragment,c),O(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(k(t),k(l)),q(e,c),n[18](null),q(i,c),n[20](null),q(s,c)}}}const L8=()=>"",A8=()=>"",P8=()=>"",N8=()=>"",hm=n=>n.name;function R8(n,e,t){let i,l,s;Qe(n,Sn,j=>t(1,s=j));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 g(j=[]){var V,K;t(5,m=((V=j==null?void 0:j.filter(J=>a.includes(J.type)&&!r.includes(J.name)))==null?void 0:V.map(J=>J.name))||[]),t(6,h=((K=j==null?void 0:j.filter(J=>u.includes(J.type)&&!r.includes(J.name)))==null?void 0:K.map(J=>J.name))||[])}function _(j){for(let V of ef)if(V.key==j)return V;return null}function y(){o.oauth2.enabled=this.checked,t(0,o)}const S=(j,V,K)=>{c==null||c.show(j,V,K)},T=()=>f==null?void 0:f.show(),$=()=>t(4,d=!d);function E(j){n.$$.not_equal(o.oauth2.mappedFields.name,j)&&(o.oauth2.mappedFields.name=j,t(0,o))}function M(j){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,j)&&(o.oauth2.mappedFields.avatarURL=j,t(0,o))}function L(j){n.$$.not_equal(o.oauth2.mappedFields.id,j)&&(o.oauth2.mappedFields.id=j,t(0,o))}function I(j){n.$$.not_equal(o.oauth2.mappedFields.username,j)&&(o.oauth2.mappedFields.username=j,t(0,o))}function A(j){ie[j?"unshift":"push"](()=>{f=j,t(2,f)})}const P=j=>{var V,K;c.show(j.detail,{},((K=(V=o.oauth2)==null?void 0:V.providers)==null?void 0:K.length)||0)};function R(j){ie[j?"unshift":"push"](()=>{c=j,t(3,c)})}const N=j=>{const V=j.detail.uiOptions;z.removeByKey(o.oauth2.providers,"name",V.key),t(0,o)},U=j=>{const V=j.detail.uiOptions,K=j.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),z.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:V.key},K),"name"),t(0,o)};return n.$$set=j=>{"collection"in j&&t(0,o=j.collection)},n.$$.update=()=>{var j,V;n.$$.dirty[0]&1&&z.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!z.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((V=(j=o.oauth2)==null?void 0:j.providers)==null?void 0:V.length)||0)},[o,s,f,c,d,m,h,l,i,_,y,S,T,$,E,M,L,I,A,P,R,N,U]}class F8 extends ye{constructor(e){super(),be(this,e,R8,I8,_e,{collection:0},null,[-1,-1])}}function _m(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Me(He.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&k(e),t=!1,i()}}}function q8(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&_m();return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),r=C(),c&&c.c(),a=ge(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].otp.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(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=_m(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(i),k(l),k(r),k(a)),c&&c.d(d),u=!1,De(f)}}}function H8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].otp.duration&&ce(s,u[0].otp.duration)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function j8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].otp.length&&ce(s,u[0].otp.length)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function z8(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:[q8,({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:[H8,({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:[j8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div"),H(s.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){F(e,f,c),v(f,t,c),v(f,i,c),w(i,l),F(s,l,null),w(i,o),w(i,r),F(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||(O(e.$$.fragment,f),O(s.$$.fragment,f),O(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(t),k(i)),q(e,f),q(s),q(a)}}}function U8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function V8(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function B8(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?V8:U8}let a=r(n),u=a(n),f=n[1]&&gm();return{c(){e=b("div"),e.innerHTML='<i class="ri-time-line"></i> <span class="txt">One-time password (OTP)</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=gm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function W8(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[B8],default:[z8]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Y8(n,e,t){let i,l,s;Qe(n,Sn,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=yt(this.value),t(0,o)}function f(){o.otp.length=yt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&z.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=!z.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class K8 extends ye{constructor(e){super(),be(this,e,Y8,W8,_e,{collection:0})}}function bm(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function J8(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&&bm(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=Y(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),v(o,e,r),v(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=bm(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)+"")&&ue(l,i)},i:te,o:te,d(o){o&&(k(e),k(t)),s&&s.d(o)}}}function Z8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class ym extends ye{constructor(e){super(),be(this,e,Z8,J8,_e,{item:0})}}const G8=n=>({}),km=n=>({});function X8(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[12],km);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&Pt(i,t,l,l[12],e?At(t,l[12],s,G8):Nt(l[12]),km)},i(l){e||(O(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function Q8(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:[X8]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new ds({props:o}),ie.push(()=>ve(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&62?vt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ft(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function x8(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=ym}=e,{optionComponent:c=ym}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=z.toArray(T,!0);let $=[];for(let E of T){const M=z.findByKey(r,d,E);M&&$.push(M)}T.length&&!$.length||t(0,u=a?$:$[0])}async function g(T){let $=z.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?$:$[0])}function _(T){u=T,t(0,u)}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Ut(T)),t(5,l=lt(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,l,m,d,s,_,y,S,o]}class xn extends ye{constructor(e){super(),be(this,e,x8,Q8,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Me(He.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&k(e),t=!1,i()}}}function eO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&vm();return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),r=C(),c&&c.c(),a=ge(),p(e,"type","checkbox"),p(e,"id",t=n[8]),e.disabled=n[3],p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].passwordAuth.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=B(e,"change",n[5]),u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[3]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(i),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function tO(n){let e,t,i,l,s,o,r;function a(f){n[6](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new xn({props:u}),ie.push(()=>ve(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),H(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[8])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(s,f,c),r=!0},p(f,c){(!r||c&256&&i!==(i=f[8]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function nO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[eO,({uniqueId:s})=>({8:s}),({uniqueId:s})=>s?256:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[tO,({uniqueId:s})=>({8:s}),({uniqueId:s})=>s?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,o){const r={};o&777&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&771&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function iO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function lO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function sO(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?lO:iO}let a=r(n),u=a(n),f=n[2]&&wm();return{c(){e=b("div"),e.innerHTML='<i class="ri-lock-password-line"></i> <span class="txt">Identity/Password</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=wm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function oO(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[sO],default:[nO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function rO(n,e,t){let i,l,s;Qe(n,Sn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){const d=[{value:"email"}],m=(c==null?void 0:c.fields)||[],h=(c==null?void 0:c.indexes)||[];for(let g of h){const _=z.parseIndex(g);if(!_.unique||_.columns.length!=1||_.columns[0].name=="email")continue;const y=m.find(S=>!S.hidden&&S.name.toLowerCase()==_.columns[0].name.toLowerCase());y&&d.push({value:y.name})}return d}Yt(()=>{t(1,r=a(o))});function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(c){n.$$.not_equal(o.passwordAuth.identityFields,c)&&(o.passwordAuth.identityFields=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&z.isEmpty(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&16&&t(2,l=!z.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,s,u,f]}class aO extends ye{constructor(e){super(),be(this,e,rO,oO,_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=vk(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=Y(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,g){v(h,t,g),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,g){e=h,g&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&k(t),c.r(),d=!1,m()}}}function uO(n){let e=[],t=new Map,i,l=pe(n[7]);const s=o=>o[22].value;for(let o=0;o<l.length;o+=1){let r=Sm(n,l,o),a=s(r);t.set(a,e[o]=Tm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r&2097284&&(l=pe(o[7]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,Tm,i,Sm))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function fO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("To email address"),l=C(),s=b("input"),p(e,"for",i=n[21]),p(s,"type","email"),p(s,"id",o=n[21]),s.autofocus=!0,s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[1]),s.focus(),r||(a=B(s,"input",n[12]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(s,"id",o),f&2&&s.value!==u[1]&&ce(s,u[1])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function cO(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"template",$$slots:{default:[uO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[fO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),F(t,e,null),w(e,i),F(l,e,null),s=!0,o||(r=B(e,"submit",tt(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||(O(t.$$.fragment,a),O(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(t),q(l),o=!1,r()}}}function dO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function pO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("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],x(l,"btn-loading",n[4])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(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&&x(l,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(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:[pO],header:[dO],default:[cO]},$$scope:{ctx:n}};return e=new ln({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),q(e,l)}}}const wa="last_email_test",$m="email_test_request";function hO(n,e,t){let i;const l=_t(),s="email_test_"+z.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),Wt({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(wa,u),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest($m),$i("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 fn(),h()}catch(I){t(4,c=!1),me.error(I)}clearTimeout(d)}}const _=[[]];function y(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const T=()=>g(),$=()=>!c;function E(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function M(I){Pe.call(this,n,I)}function L(I){Pe.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,g,m,y,_,S,T,$,E,M,L]}class tk extends ye{constructor(e){super(),be(this,e,hO,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 _O(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("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){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(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&&(k(e),k(i),k(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 F8({props:s}),ie.push(()=>ve(e,"collection",l)),{c(){H(e.$$.fragment)},m(o,r){F(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(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 F5({props:r}),ie.push(()=>ve(i,"config",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),F(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,$e(()=>l=!1)),i.$set(c)},i(u){s||(O(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&k(t),q(i,u)}}}function gO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P=[],R=new Map,N,U,j,V,K,J,ee,X,oe,Se,ke;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[_O,({uniqueId:Le})=>({21:Le}),({uniqueId:Le})=>Le?2097152:0]},$$scope:{ctx:n}}});function Ce(Le){n[10](Le)}let We={};n[0]!==void 0&&(We.collection=n[0]),u=new K8({props:We}),ie.push(()=>ve(u,"collection",Ce));function st(Le){n[11](Le)}let et={};n[0]!==void 0&&(et.collection=n[0]),d=new aO({props:et}),ie.push(()=>ve(d,"collection",st));let Be=!n[1]&&Om(n);function rt(Le){n[13](Le)}let Je={};n[0]!==void 0&&(Je.collection=n[0]),_=new u6({props:Je}),ie.push(()=>ve(_,"collection",rt));let at=pe(n[2]);const Ht=Le=>Le[18].key;for(let Le=0;Le<at.length;Le+=1){let Ve=Cm(n,at,Le),we=Ht(Ve);R.set(we,P[Le]=Em(we,Ve))}function Te(Le){n[16](Le)}let Ze={};n[0]!==void 0&&(Ze.collection=n[0]),K=new Y5({props:Ze}),ie.push(()=>ve(K,"collection",Te));let ot={};return X=new tk({props:ot}),n[17](X),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),c=C(),H(d.$$.fragment),h=C(),Be&&Be.c(),g=C(),H(_.$$.fragment),S=C(),T=b("h4"),$=b("span"),$.textContent="Mail templates",E=C(),M=b("button"),M.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let Le=0;Le<P.length;Le+=1)P[Le].c();N=C(),U=b("h4"),U.textContent="Other",j=C(),V=b("div"),H(K.$$.fragment),ee=C(),H(X.$$.fragment),p(i,"class","txt"),p(s,"class","m-l-auto handle"),p(t,"class","flex"),p(e,"class","section-title"),p(a,"class","accordions m-b-35"),p($,"class","txt"),p(M,"type","button"),p(M,"class","btn btn-xs m-l-auto btn-secondary"),p(T,"class","section-title"),p(A,"class","accordions"),p(I,"class","accordions m-b-35"),p(U,"class","section-title"),p(V,"class","accordions m-b-base")},m(Le,Ve){v(Le,e,Ve),w(e,t),w(t,i),w(t,l),w(t,s),F(o,s,null),v(Le,r,Ve),v(Le,a,Ve),F(u,a,null),w(a,c),F(d,a,null),w(a,h),Be&&Be.m(a,null),w(a,g),F(_,a,null),v(Le,S,Ve),v(Le,T,Ve),w(T,$),w(T,E),w(T,M),v(Le,L,Ve),v(Le,I,Ve),w(I,A);for(let we=0;we<P.length;we+=1)P[we]&&P[we].m(A,null);v(Le,N,Ve),v(Le,U,Ve),v(Le,j,Ve),v(Le,V,Ve),F(K,V,null),v(Le,ee,Ve),F(X,Le,Ve),oe=!0,Se||(ke=B(M,"click",n[14]),Se=!0)},p(Le,[Ve]){const we={};Ve&6291457&&(we.$$scope={dirty:Ve,ctx:Le}),o.$set(we);const Oe={};!f&&Ve&1&&(f=!0,Oe.collection=Le[0],$e(()=>f=!1)),u.$set(Oe);const ut={};!m&&Ve&1&&(m=!0,ut.collection=Le[0],$e(()=>m=!1)),d.$set(ut),Le[1]?Be&&(re(),D(Be,1,1,()=>{Be=null}),ae()):Be?(Be.p(Le,Ve),Ve&2&&O(Be,1)):(Be=Om(Le),Be.c(),O(Be,1),Be.m(a,g));const Ne={};!y&&Ve&1&&(y=!0,Ne.collection=Le[0],$e(()=>y=!1)),_.$set(Ne),Ve&4&&(at=pe(Le[2]),re(),P=kt(P,Ve,Ht,1,Le,at,R,A,zt,Em,null,Cm),ae());const xe={};!J&&Ve&1&&(J=!0,xe.collection=Le[0],$e(()=>J=!1)),K.$set(xe);const qt={};X.$set(qt)},i(Le){if(!oe){O(o.$$.fragment,Le),O(u.$$.fragment,Le),O(d.$$.fragment,Le),O(Be),O(_.$$.fragment,Le);for(let Ve=0;Ve<at.length;Ve+=1)O(P[Ve]);O(K.$$.fragment,Le),O(X.$$.fragment,Le),oe=!0}},o(Le){D(o.$$.fragment,Le),D(u.$$.fragment,Le),D(d.$$.fragment,Le),D(Be),D(_.$$.fragment,Le);for(let Ve=0;Ve<P.length;Ve+=1)D(P[Ve]);D(K.$$.fragment,Le),D(X.$$.fragment,Le),oe=!1},d(Le){Le&&(k(e),k(r),k(a),k(S),k(T),k(L),k(I),k(N),k(U),k(j),k(V),k(ee)),q(o),q(u),q(d),Be&&Be.d(),q(_);for(let Ve=0;Ve<P.length;Ve+=1)P[Ve].d();q(K),n[17](null),q(X,Le),Se=!1,ke()}}}function bO(n,e,t){let i,l,s,o,r,a,{collection:u}=e,f=[],c;function d(){u.authAlert.enabled=this.checked,t(0,u)}function m(E){u=E,t(0,u)}function h(E){u=E,t(0,u)}function g(E){u=E,t(0,u)}function _(E){u=E,t(0,u)}const y=()=>c==null?void 0:c.show(u.id);function S(E,M){n.$$.not_equal(M.config,E)&&(M.config=E,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 T(E){u=E,t(0,u)}function $(E){ie[E?"unshift":"push"](()=>{c=E,t(3,c)})}return n.$$set=E=>{"collection"in E&&t(0,u=E.collection)},n.$$.update=()=>{var E,M;n.$$.dirty&1&&typeof((E=u.otp)==null?void 0:E.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,_,y,S,T,$]}class yO extends ye{constructor(e){super(),be(this,e,bO,gO,_e,{collection:0})}}const kO=n=>({dragging:n&4,dragover:n&8}),Mm=n=>({dragging:n[2],dragover:n[3]});function vO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(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"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[B(e,"dragover",tt(n[11])),B(e,"dragleave",tt(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)&&Pt(r,o,a,a[9],i?At(o,a[9],u,kO):Nt(a[9]),Mm),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(O(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,De(s)}}}function wO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=_t();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m($,E){if(!(!$||u)){if(f&&!$.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:E,group:a})),s("drag",$)}}function h($,E){if(t(3,d=!1),t(2,c=!1),!$||u)return;$.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const L=M.index<<0;L<E?(r.splice(E+1,0,r[L]),r.splice(L,1)):(r.splice(E,0,r[L]),r.splice(L+1,1)),t(6,r),s("sort",{oldIndex:L,newIndex:E,list:r})}const g=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,u=$.disabled),"dragHandleClass"in $&&t(8,f=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,y,S,T]}class ho extends ye{constructor(e){super(),be(this,e,wO,vO,_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 SO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=Y("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){v(f,e,c),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function TO(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(()=>ve(e,"value",s))),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;D(c.$$.fragment,1,0,()=>{q(c,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),H(e.$$.fragment),O(e.$$.fragment,1),F(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],$e(()=>t=!1)),e.$set(c)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function $O(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function CO(n){let e,t,i,l;const s=[$O,TO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function Im(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Lm(Dm(n,l,o));return{c(){e=b("div"),t=b("span"),t.textContent="Presets",i=C();for(let o=0;o<s.length;o+=1)s[o].c();p(t,"class","txt txt-hint"),p(e,"class","inline-flex gap-10")},m(o,r){v(o,e,r),w(e,t),w(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null)},p(o,r){if(r[0]&9728){l=pe(o[10]);let a;for(a=0;a<l.length;a+=1){const u=Dm(o,l,a);s[a]?s[a].p(u,r):(s[a]=Lm(u),s[a].c(),s[a].m(e,null))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&k(e),pt(s,o)}}}function Lm(n){let e,t=n[27]+"",i,l,s,o;function r(){return n[21](n[27])}return{c(){e=b("button"),i=Y(t),l=C(),p(e,"type","button"),p(e,"class","label link-primary"),x(e,"label-info",n[9].includes(n[27]))},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&ue(i,t),u[0]&1536&&x(e,"label-info",n[9].includes(n[27]))},d(a){a&&k(e),s=!1,o()}}}function OO(n){let e,t,i,l,s,o;e=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[SO,({uniqueId:a})=>({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:[CO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Im(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),r&&r.c(),s=ge()},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),v(a,l,u),r&&r.m(a,u),v(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||(O(e.$$.fragment,a),O(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l),k(s)),q(e,a),q(i,a),r&&r.d(a)}}}function EO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&ue(i,t)},d(s){s&&k(e)}}}function Am(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-delete-bin-7-line"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){v(l,e,s),t||(i=[Me(He.call(null,e,{text:"Delete",position:"top"})),B(e,"click",n[16])],t=!0)},p:te,d(l){l&&k(e),t=!1,De(i)}}}function MO(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='<span class="txt">Cancel</span>',i=C(),l=b("button"),l.innerHTML='<span class="txt">Set index</span>',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),v(a,e,u),v(a,t,u),v(a,i,u),v(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&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(l)),r&&r.d(a),s=!1,De(o)}}}function DO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[MO],header:[EO],default:[OO]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new ln({props:l}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){H(e.$$.fragment)},m(s,o){F(e,s,o),t=!0},p(s,o){const r=o[0]&16384?vt(i,[i[0],Ft(s[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(O(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[22](null),q(e,s)}}}function IO(n,e,t){let i,l,s;const o=["collection","show","hide"];let r=lt(e,o);const a=_t();let{collection:u}=e,f,c="",d="",m="",h,g=!1;function _(V,K){return t(6,m=z.isEmpty(K)?"":K),t(5,c=V||S()),t(2,d=c),f==null?void 0:f.show()}function y(){return f==null?void 0:f.hide()}function S(){const V=z.parseIndex("");return V.tableName=(u==null?void 0:u.name)||"",z.buildIndex(V)}function T(){a("remove",c),y()}function $(){s.length&&(a("submit",{old:c,new:d}),y())}function E(V){const K=z.clone(l),J=K.columns.find(ee=>ee.name==V);J?z.removeByValue(K.columns,J):z.pushUnique(K.columns,{name:V}),t(2,d=z.buildIndex(K))}Yt(async()=>{t(8,g=!0);try{t(7,h=(await Ot(async()=>{const{default:V}=await import("./CodeEditor-C_5qTJii.js");return{default:V}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(V){console.warn(V)}t(8,g=!1)});const M=()=>T(),L=()=>y(),I=()=>$(),A=V=>{t(3,l.unique=V.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=z.buildIndex(l))};function P(V){d=V,t(2,d)}const R=V=>E(V);function N(V){ie[V?"unshift":"push"](()=>{f=V,t(4,f)})}function U(V){Pe.call(this,n,V)}function j(V){Pe.call(this,n,V)}return n.$$set=V=>{e=je(je({},e),Ut(V)),t(14,r=lt(e,o)),"collection"in V&&t(0,u=V.collection)},n.$$.update=()=>{var V,K,J;n.$$.dirty[0]&1&&t(10,i=((K=(V=u==null?void 0:u.fields)==null?void 0:V.filter(ee=>!ee.toDelete&&ee.name!="id"))==null?void 0:K.map(ee=>ee.name))||[]),n.$$.dirty[0]&4&&t(3,l=z.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((J=l.columns)==null?void 0:J.map(ee=>ee.name))||[])},[u,y,d,l,f,c,m,h,g,s,i,T,$,E,r,_,M,L,I,A,P,R,N,U,j]}class LO extends ye{constructor(e){super(),be(this,e,IO,DO,_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=z.parseIndex(i[10]);return i[11]=l,i}function Nm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&k(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=Y(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,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Me(r=He.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),B(e,"click",c)],a=!0)},p(m,h){var g,_,y,S,T;n=m,n[11].unique?f||(f=Nm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((g=n[11].columns)==null?void 0:g.map(Fm).join(", "))+"")&&ue(s,l),h&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Rt(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&k(e),f&&f.d(),a=!1,De(u)}}}function AO(n){var $,E,M;let e,t,i=(((E=($=n[0])==null?void 0:$.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=pe(((M=n[0])==null?void 0:M.indexes)||[]),y=[];for(let L=0;L<_.length;L+=1)y[L]=Rm(Pm(n,_,L));function S(L){n[7](L)}let T={};return n[0]!==void 0&&(T.collection=n[0]),c=new LO({props:T}),n[6](c),ie.push(()=>ve(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=Y("Unique constraints and indexes ("),l=Y(i),s=Y(")"),o=C(),r=b("div");for(let L=0;L<y.length;L+=1)y[L].c();a=C(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=C(),H(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){v(L,e,I),w(e,t),w(e,l),w(e,s),v(L,o,I),v(L,r,I);for(let A=0;A<y.length;A+=1)y[A]&&y[A].m(r,null);w(r,a),w(r,u),v(L,f,I),F(c,L,I),m=!0,h||(g=B(u,"click",n[5]),h=!0)},p(L,[I]){var P,R,N;if((!m||I&1)&&i!==(i=(((R=(P=L[0])==null?void 0:P.indexes)==null?void 0:R.length)||0)+"")&&ue(l,i),I&7){_=pe(((N=L[0])==null?void 0:N.indexes)||[]);let U;for(U=0;U<_.length;U+=1){const j=Pm(L,_,U);y[U]?y[U].p(j,I):(y[U]=Rm(j),y[U].c(),y[U].m(r,a))}for(;U<y.length;U+=1)y[U].d(1);y.length=_.length}const A={};!d&&I&1&&(d=!0,A.collection=L[0],$e(()=>d=!1)),c.$set(A)},i(L){m||(O(c.$$.fragment,L),m=!0)},o(L){D(c.$$.fragment,L),m=!1},d(L){L&&(k(e),k(o),k(r),k(f)),pt(y,L),n[6](null),q(c,L),h=!1,g()}}}const Fm=n=>n.name;function PO(n,e,t){let i;Qe(n,Sn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;g<l.indexes.length;g++)if(l.indexes[g]==m){t(0,l.indexes[g]=h,l),fi("indexes."+g);return}l.indexes.push(h),t(0,l)}const r=(m,h)=>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<l.indexes.length;h++)if(l.indexes[h]==m.detail){l.indexes.splice(h,1),fi("indexes."+h);break}t(0,l)},d=m=>{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 NO extends ye{constructor(e){super(),be(this,e,PO,AO,_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){v(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&&k(e),o=!1,r()}}}function RO(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Hm(qm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&6){t=pe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=qm(l,t,o);i[o]?i[o].p(r,s):(i[o]=Hm(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function FO(n){let e,t,i,l,s,o,r,a;return o=new Hn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[RO]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=C(),l=b("div"),l.textContent="New field",s=C(),H(o.$$.fragment),p(t,"class","ri-add-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),F(o,e,null),a=!0},p(u,[f]){const c={};f&256&&(c.$$scope={dirty:f,ctx:u}),o.$set(c),(!a||f&1&&r!==(r="field-types-btn "+u[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(u){a||(O(o.$$.fragment,u),a=!0)},o(u){D(o.$$.fragment,u),a=!1},d(u){u&&k(e),q(o)}}}function qO(n,e,t){let{class:i=""}=e;const l=_t(),s=[{label:"Plain text",value:"text",icon:z.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:z.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:z.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:z.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:z.getFieldTypeIcon("email")},{label:"URL",value:"url",icon:z.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:z.getFieldTypeIcon("date")},{label:"Autodate",value:"autodate",icon:z.getFieldTypeIcon("autodate")},{label:"Select",value:"select",icon:z.getFieldTypeIcon("select")},{label:"File",value:"file",icon:z.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:z.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:z.getFieldTypeIcon("json")}];function o(a){l("select",a)}const r=a=>o(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class HO extends ye{constructor(e){super(),be(this,e,qO,FO,_e,{class:0})}}const jO=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),jm=n=>({interactive:n[7],hasErrors:n[6]}),zO=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),zm=n=>({interactive:n[7],hasErrors:n[6]}),UO=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='<span class="drag-handle"></span>',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function Bm(n){let e,t;return{c(){e=b("span"),t=Y(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&ue(t,i[5])},d(i){i&&k(e)}}}function Wm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function VO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Bm(n),g=n[0].hidden&&Wm();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=z.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),x(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(_,y){v(_,e,y),h&&h.m(e,null),w(e,t),g&&g.m(e,null),v(_,i,y),v(_,l,y),w(l,s),v(_,a,y),v(_,u,y),n[22](u),d||(m=[Me(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(_,y){_[0].required?h?h.p(_,y):(h=Bm(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Wm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y[0]&1&&o!==(o=z.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&Rt(r.update)&&y[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),y[0]&129&&x(l,"txt-disabled",!_[7]||_[0].system),y[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),y[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(k(e),k(i),k(l),k(a),k(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,De(m)}}}function BO(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function WO(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]),x(e,"btn-hint",!n[4]&&!n[6]),x(e,"btn-danger",n[6])},m(r,a){v(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&&x(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&x(e,"btn-danger",r[6])},d(r){r&&k(e),s=!1,o()}}}function YO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-restart-line"></i>',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){v(l,e,s),t||(i=[Me(He.call(null,e,"Restore")),B(e,"click",n[14])],t=!0)},p:te,d(l){l&&k(e),t=!1,De(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,g=Lt(h,n,n[28],zm);let _=s&&Km(n),y=r&&Jm(n),S=u&&Zm(n);const T=n[20].optionsFooter,$=Lt(T,n,n[28],jm);let E=!n[0]._toDelete&&!n[0].primaryKey&&Gm(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),l=b("div"),_&&_.c(),o=C(),y&&y.c(),a=C(),S&&S.c(),f=C(),$&&$.c(),c=C(),E&&E.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){v(M,e,L),w(e,t),g&&g.m(t,null),w(e,i),w(e,l),_&&_.m(l,null),w(l,o),y&&y.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),$&&$.m(l,null),w(l,c),E&&E.m(l,null),m=!0},p(M,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,M,M[28],m?At(h,M[28],L,zO):Nt(M[28]),zm),L[0]&257&&(s=!M[0].primaryKey&&M[0].type!="autodate"&&(!M[8]||!M[10].includes(M[0].name))),s?_?(_.p(M,L),L[0]&257&&O(_,1)):(_=Km(M),_.c(),O(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!M[0].primaryKey&&(!M[8]||!M[11].includes(M[0].name))),r?y?(y.p(M,L),L[0]&257&&O(y,1)):(y=Jm(M),y.c(),O(y,1),y.m(l,a)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),L[0]&257&&(u=!M[8]||!M[12].includes(M[0].name)),u?S?(S.p(M,L),L[0]&257&&O(S,1)):(S=Zm(M),S.c(),O(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),$&&$.p&&(!m||L[0]&268435648)&&Pt($,T,M,M[28],m?At(T,M[28],L,jO):Nt(M[28]),jm),!M[0]._toDelete&&!M[0].primaryKey?E?(E.p(M,L),L[0]&1&&O(E,1)):(E=Gm(M),E.c(),O(E,1),E.m(l,null)):E&&(re(),D(E,1,1,()=>{E=null}),ae())},i(M){m||(O(g,M),O(_),O(y),O(S),O($,M),O(E),M&&nt(()=>{m&&(d||(d=ze(e,wt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(M){D(g,M),D(_),D(y),D(S),D($,M),D(E),M&&(d||(d=ze(e,wt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(M){M&&k(e),g&&g.d(M),_&&_.d(),y&&y.d(),S&&S.d(),$&&$.d(M),E&&E.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:[KO,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function KO(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=Y(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){v(m,e,h),e.checked=n[0].required,v(m,i,h),v(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[B(e,"change",n[24]),Me(u=He.call(null,a,{text:`Requires the field value NOT to be ${z.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&&ue(o,m[5]),u&&Rt(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${z.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(k(e),k(i),k(l)),c=!1,De(d)}}}function Jm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[JO,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function JO(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){v(c,e,d),e.checked=n[0].hidden,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[25]),B(e,"change",n[26]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function Zm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[ZO,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function ZO(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){v(m,e,h),e.checked=n[0].presentable,v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[B(e,"change",n[27]),Me(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&&(k(e),k(l),k(s)),c=!1,De(d)}}}function Gm(n){let e,t,i,l,s,o,r;return o=new Hn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[GO]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),H(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){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),F(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||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(o)}}}function Xm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",tt(n[13])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function GO(n){let e,t,i,l,s,o=!n[0].system&&Xm(n);return{c(){e=b("button"),e.innerHTML='<span class="txt">Duplicate</span>',t=C(),o&&o.c(),i=ge(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){v(r,e,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l||(s=B(e,"click",tt(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&&(k(e),k(t),k(i)),o&&o.d(r),l=!1,s()}}}function XO(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:[VO]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Um),m=d||BO();function h(S,T){if(S[0]._toDelete)return YO;if(S[7])return WO}let g=h(n),_=g&&g(n),y=n[7]&&n[4]&&Ym(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),H(l.$$.fragment),s=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[7]&&n[4]),x(e,"deleted",n[0]._toDelete)},m(S,T){v(S,e,T),w(e,t),f&&f.m(t,null),w(t,i),F(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),y&&y.m(e,null),u=!0},p(S,T){S[7]&&S[2]?f||(f=Vm(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const $={};T[0]&128&&($.class="form-field required m-0 "+(S[7]?"":"disabled")),T[0]&2&&($.name="fields."+S[1]+".name"),T[0]&268435625&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!u||T[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],T,UO):Nt(S[28]),Um),g===(g=h(S))&&_?_.p(S,T):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?y?(y.p(S,T),T[0]&144&&O(y,1)):(y=Ym(S),y.c(),O(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),(!u||T[0]&1)&&x(e,"required",S[0].required),(!u||T[0]&144)&&x(e,"expanded",S[7]&&S[4]),(!u||T[0]&1)&&x(e,"deleted",S[0]._toDelete)},i(S){u||(O(l.$$.fragment,S),O(m,S),O(y),S&&nt(()=>{u&&(a||(a=ze(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(y),S&&(a||(a=ze(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),q(l),m&&m.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Sa=[];function QO(n,e,t){let i,l,s,o,r;Qe(n,Sn,Se=>t(19,r=Se));let{$$slots:a={},$$scope:u}=e;const f="f_"+z.randomString(8),c=_t(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:y=z.initSchemaField()}=e,{draggable:S=!0}=e,{collection:T={}}=e,$,E=!1;function M(){y.id?t(0,y._toDelete=!0,y):(R(),c("remove"))}function L(){t(0,y._toDelete=!1,y),Wt({})}function I(){y._toDelete||(R(),c("duplicate"))}function A(Se){return z.slugify(Se)}function P(){t(4,E=!0),U()}function R(){t(4,E=!1)}function N(){E?R():P()}function U(){for(let Se of Sa)Se.id!=f&&Se.collapse()}Yt(()=>(Sa.push({id:f,collapse:R}),y.onMountSelect&&(t(0,y.onMountSelect=!1,y),$==null||$.select()),()=>{z.removeByKey(Sa,"id",f)}));const j=()=>$==null?void 0:$.focus();function V(Se){ie[Se?"unshift":"push"](()=>{$=Se,t(3,$)})}const K=Se=>{const ke=y.name;t(0,y.name=A(Se.target.value),y),Se.target.value=y.name,c("rename",{oldName:ke,newName:y.name})};function J(){y.required=this.checked,t(0,y)}function ee(){y.hidden=this.checked,t(0,y)}const X=Se=>{Se.target.checked&&t(0,y.presentable=!1,y)};function oe(){y.presentable=this.checked,t(0,y)}return n.$$set=Se=>{"key"in Se&&t(1,_=Se.key),"field"in Se&&t(0,y=Se.field),"draggable"in Se&&t(2,S=Se.draggable),"collection"in Se&&t(18,T=Se.collection),"$$scope"in Se&&t(28,u=Se.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=(T==null?void 0:T.type)=="auth"),n.$$.dirty[0]&1&&y._toDelete&&y._originalName&&y.name!==y._originalName&&t(0,y.name=y._originalName,y),n.$$.dirty[0]&1&&!y._originalName&&y.name&&t(0,y._originalName=y.name,y),n.$$.dirty[0]&1&&typeof y._toDelete>"u"&&t(0,y._toDelete=!1,y),n.$$.dirty[0]&1&&y.required&&t(0,y.nullable=!1,y),n.$$.dirty[0]&1&&t(7,l=!y._toDelete),n.$$.dirty[0]&524290&&t(6,s=!z.isEmpty(z.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[y==null?void 0:y.type]||"Nonempty")},[y,_,S,$,E,o,s,l,i,c,m,h,g,M,L,I,A,N,T,r,a,j,V,K,J,ee,X,oe,u]}class ei extends ye{constructor(e){super(),be(this,e,QO,XO,_e,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function xO(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 xn({props:a}),ie.push(()=>ve(t,"keyOfSelected",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){v(u,e,f),F(t,e,null),l=!0,s||(o=Me(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],$e(()=>i=!1)),t.$set(c)},i(u){l||(O(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),q(t),s=!1,o()}}}function eE(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:[xO,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),F(i,r,a),v(r,l,a),v(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||(O(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),q(i,r)}}}function tE(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[eE,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(l,[a&2&&{key:r[1]},a&16&&Ft(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}const Ta=1,$a=2,Ca=3;function nE(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(_){switch(_){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(_){a=_,t(2,a)}function d(_){o=_,t(0,o)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Ut(_)),t(4,l=lt(e,i)),"field"in _&&t(0,o=_.field),"key"in _&&t(1,r=_.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,g]}class iE extends ye{constructor(e){super(),be(this,e,nE,tE,_e,{field:0,key:1})}}function lE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function sE(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){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},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 oE extends ye{constructor(e){super(),be(this,e,sE,lE,_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},eo={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},In=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Kn=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 Jo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function nk(n,e){if(e(n))return n;if(n.parentNode)return nk(n.parentNode,e)}function Zo(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 jn(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]},rE={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*Kn(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})"},Hs={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[Hs.w(n,e,t)]},F:function(n,e,t){return Cr(Hs.n(n,e,t)-1,!1,e)},G:function(n,e,t){return In(Hs.h(n,e,t))},H:function(n){return In(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[Kn(n.getHours()>11)]},M:function(n,e){return Cr(n.getMonth(),!0,e)},S:function(n){return In(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return In(n.getFullYear(),4)},d:function(n){return In(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return In(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return In(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)}},ik=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?eo: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 Hs[c]&&m[d-1]!=="\\"?Hs[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?eo: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,y=0,S="";_<d.length;_++){var T=d[_],$=T==="\\",E=d[_-1]==="\\"||$;if(Sl[T]&&!E){S+=Sl[T];var M=new RegExp(S).exec(s);M&&(h=!0)&&g[T!=="Y"?"push":"unshift"]({fn:rE[T],val:M[++y]})}else $||(S+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),g.forEach(function(L){var I=L.fn,A=L.val;return f=I(f,A,u)||f}),f=h?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function zn(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var aE=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Da=function(n,e,t){return n*3600+e*60+t},uE=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},fE={DAY:864e5};function Ia(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var l=n.minDate.getHours(),s=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<l&&(e=l),e===l&&t<s&&(t=s),e===l&&t===s&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},l=0,s=e;l<s.length;l++){var o=s[l];i(o)}return n});var bn=function(){return bn=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(n[l]=e[l])}return n},bn.apply(this,arguments)},xm=function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),l=0,e=0;e<t;e++)for(var s=arguments[e],o=0,r=s.length;o<r;o++,l++)i[l]=s[o];return i},cE=300;function dE(n,e){var t={config:bn(bn({},es),en.defaultConfig),l10n:eo};t.parseDate=au({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=ut,t.changeMonth=Se,t.changeYear=Be,t.clear=ke,t.close=Ce,t.onMouseOver=Te,t._createElement=$t,t.createDay=M,t.destroy=We,t.isEnabled=rt,t.jumpToDate=S,t.updateValue=Mn,t.open=ot,t.redraw=qt,t.set=Gt,t.setDate=hn,t.toggle=rl;function i(){t.utils={getDaysInMonth:function(Z,Q){return Z===void 0&&(Z=t.currentMonth),Q===void 0&&(Q=t.currentYear),Z===1&&(Q%4===0&&Q%100!==0||Q%400===0)?29:t.l10n.daysInMonth[Z]}}}function l(){t.element=t.input=n,t.isOpen=!1,Ve(),Oe(),gt(),Ci(),i(),t.isMobile||E(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Mn(!1)),r();var Z=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&Z&&ut(),It("onReady")}function s(){var Z;return((Z=t.calendarContainer)===null||Z===void 0?void 0:Z.getRootNode()).activeElement||document.activeElement}function o(Z){return Z.bind(t)}function r(){var Z=t.config;Z.weekNumbers===!1&&Z.showMonths===1||Z.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var Q=(t.days.offsetWidth+1)*Z.showMonths;t.daysContainer.style.width=Q+"px",t.calendarContainer.style.width=Q+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(Z){if(t.selectedDates.length===0){var Q=t.config.minDate===void 0||zn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),se=Ia(t.config);Q.setHours(se.hours,se.minutes,se.seconds,Q.getMilliseconds()),t.selectedDates=[Q],t.latestSelectedDateObj=Q}Z!==void 0&&Z.type!=="blur"&&cl(Z);var he=t._input.value;c(),Mn(),t._input.value!==he&&t._debouncedChange()}function u(Z,Q){return Z%12+12*Kn(Q===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,Q=(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&&zn(t.latestSelectedDateObj,t.config.minDate,!0)===0,qe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&zn(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()),Ee=Da(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Re=Da(Z,Q,se);if(Re>Ee&&Re<le){var Ke=uE(le);Z=Ke[0],Q=Ke[1],se=Ke[2]}}else{if(qe){var Ae=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;Z=Math.min(Z,Ae.getHours()),Z===Ae.getHours()&&(Q=Math.min(Q,Ae.getMinutes())),Q===Ae.getMinutes()&&(se=Math.min(se,Ae.getSeconds()))}if(he){var Ge=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;Z=Math.max(Z,Ge.getHours()),Z===Ge.getHours()&&Q<Ge.getMinutes()&&(Q=Ge.getMinutes()),Q===Ge.getMinutes()&&(se=Math.max(se,Ge.getSeconds()))}}m(Z,Q,se)}}function d(Z){var Q=Z||t.latestSelectedDateObj;Q&&Q instanceof Date&&m(Q.getHours(),Q.getMinutes(),Q.getSeconds())}function m(Z,Q,se){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(Z%24,Q,se||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=In(t.config.time_24hr?Z:(12+Z)%12+12*Kn(Z%12===0)),t.minuteElement.value=In(Q),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Kn(Z>=12)]),t.secondElement!==void 0&&(t.secondElement.value=In(se)))}function h(Z){var Q=jn(Z),se=parseInt(Q.value)+(Z.delta||0);(se/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(se.toString()))&&Be(se)}function g(Z,Q,se,he){if(Q instanceof Array)return Q.forEach(function(qe){return g(Z,qe,se,he)});if(Z instanceof Array)return Z.forEach(function(qe){return g(qe,Q,se,he)});Z.addEventListener(Q,se,he),t._handlers.push({remove:function(){return Z.removeEventListener(Q,se,he)}})}function _(){It("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(se){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+se+"]"),function(he){return g(he,"click",t[se])})}),t.isMobile){sn();return}var Z=Qm(Ze,50);if(t._debouncedChange=Qm(_,cE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(se){t.config.mode==="range"&&Te(jn(se))}),g(t._input,"keydown",Ht),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Ht),!t.config.inline&&!t.config.static&&g(window,"resize",Z),window.ontouchstart!==void 0?g(window.document,"touchstart",et):g(window.document,"mousedown",et),g(window.document,"focus",et,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Rl),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",Fe)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Q=function(se){return jn(se).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],Q),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(se){a(se)})}t.config.allowInput&&g(t._input,"blur",at)}function S(Z,Q){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.maxDate<t.now?t.config.maxDate:t.now),he=t.currentYear,qe=t.currentMonth;try{se!==void 0&&(t.currentYear=se.getFullYear(),t.currentMonth=se.getMonth())}catch(le){le.message="Invalid date supplied: "+se,t.config.errorHandler(le)}Q&&t.currentYear!==he&&(It("onYearChange"),U()),Q&&(t.currentYear!==he||t.currentMonth!==qe)&&It("onMonthChange"),t.redraw()}function T(Z){var Q=jn(Z);~Q.className.indexOf("arrow")&&$(Z,Q.classList.contains("arrowUp")?1:-1)}function $(Z,Q,se){var he=Z&&jn(Z),qe=se||he&&he.parentNode&&he.parentNode.firstChild,le=al("increment");le.delta=Q,qe&&qe.dispatchEvent(le)}function E(){var Z=window.document.createDocumentFragment();if(t.calendarContainer=$t("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(Z.appendChild(K()),t.innerContainer=$t("div","flatpickr-innerContainer"),t.config.weekNumbers){var Q=oe(),se=Q.weekWrapper,he=Q.weekNumbers;t.innerContainer.appendChild(se),t.weekNumbers=he,t.weekWrapper=se}t.rContainer=$t("div","flatpickr-rContainer"),t.rContainer.appendChild(ee()),t.daysContainer||(t.daysContainer=$t("div","flatpickr-days"),t.daysContainer.tabIndex=-1),N(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),Z.appendChild(t.innerContainer)}t.config.enableTime&&Z.appendChild(J()),$n(t.calendarContainer,"rangeMode",t.config.mode==="range"),$n(t.calendarContainer,"animate",t.config.animate===!0),$n(t.calendarContainer,"multiMonth",t.config.showMonths>1),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,Q,se,he){var qe=rt(Q,!0),le=$t("span",Z,Q.getDate().toString());return le.dateObj=Q,le.$i=he,le.setAttribute("aria-label",t.formatDate(Q,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&zn(Q,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),qe?(le.tabIndex=-1,ul(Q)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&($n(le,"startRange",t.selectedDates[0]&&zn(Q,t.selectedDates[0],!0)===0),$n(le,"endRange",t.selectedDates[1]&&zn(Q,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Hi(Q)&&!ul(Q)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&he%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(Q)+"</span>"),It("onDayCreate",le),le}function L(Z){Z.focus(),t.config.mode==="range"&&Te(Z)}function I(Z){for(var Q=Z>0?0:t.config.showMonths-1,se=Z>0?t.config.showMonths:-1,he=Q;he!=se;he+=Z)for(var qe=t.daysContainer.children[he],le=Z>0?0:qe.children.length-1,Ee=Z>0?qe.children.length:-1,Re=le;Re!=Ee;Re+=Z){var Ke=qe.children[Re];if(Ke.className.indexOf("hidden")===-1&&rt(Ke.dateObj))return Ke}}function A(Z,Q){for(var se=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,he=Q>0?t.config.showMonths:-1,qe=Q>0?1:-1,le=se-t.currentMonth;le!=he;le+=qe)for(var Ee=t.daysContainer.children[le],Re=se-t.currentMonth===le?Z.$i+Q:Q<0?Ee.children.length-1:0,Ke=Ee.children.length,Ae=Re;Ae>=0&&Ae<Ke&&Ae!=(Q>0?Ke:-1);Ae+=qe){var Ge=Ee.children[Ae];if(Ge.className.indexOf("hidden")===-1&&rt(Ge.dateObj)&&Math.abs(Z.$i-Ae)>=Math.abs(Q))return L(Ge)}t.changeMonth(qe),P(I(qe),0)}function P(Z,Q){var se=s(),he=Je(se||document.body),qe=Z!==void 0?Z:he?se:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:I(Q>0?1:-1);qe===void 0?t._input.focus():he?A(qe,Q):L(qe)}function R(Z,Q){for(var se=(new Date(Z,Q,1).getDay()-t.l10n.firstDayOfWeek+7)%7,he=t.utils.getDaysInMonth((Q-1+12)%12,Z),qe=t.utils.getDaysInMonth(Q,Z),le=window.document.createDocumentFragment(),Ee=t.config.showMonths>1,Re=Ee?"prevMonthDay hidden":"prevMonthDay",Ke=Ee?"nextMonthDay hidden":"nextMonthDay",Ae=he+1-se,Ge=0;Ae<=he;Ae++,Ge++)le.appendChild(M("flatpickr-day "+Re,new Date(Z,Q-1,Ae),Ae,Ge));for(Ae=1;Ae<=qe;Ae++,Ge++)le.appendChild(M("flatpickr-day",new Date(Z,Q,Ae),Ae,Ge));for(var ft=qe+1;ft<=42-se&&(t.config.showMonths===1||Ge%7!==0);ft++,Ge++)le.appendChild(M("flatpickr-day "+Ke,new Date(Z,Q+1,ft%qe),ft,Ge));var Xt=$t("div","dayContainer");return Xt.appendChild(le),Xt}function N(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var Z=document.createDocumentFragment(),Q=0;Q<t.config.showMonths;Q++){var se=new Date(t.currentYear,t.currentMonth,1);se.setMonth(t.currentMonth+Q),Z.appendChild(R(se.getFullYear(),se.getMonth()))}t.daysContainer.appendChild(Z),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Te()}}function U(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var Z=function(he){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&he<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&he>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var Q=0;Q<12;Q++)if(Z(Q)){var se=$t("option","flatpickr-monthDropdown-month");se.value=new Date(t.currentYear,Q).getMonth().toString(),se.textContent=Cr(Q,t.config.shorthandCurrentMonth,t.l10n),se.tabIndex=-1,t.currentMonth===Q&&(se.selected=!0),t.monthsDropdownContainer.appendChild(se)}}}function j(){var Z=$t("div","flatpickr-month"),Q=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),g(t.monthsDropdownContainer,"change",function(Ee){var Re=jn(Ee),Ke=parseInt(Re.value,10);t.changeMonth(Ke-t.currentMonth),It("onMonthChange")}),U(),se=t.monthsDropdownContainer);var he=Zo("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),Q.appendChild(le),Z.appendChild(Q),{container:Z,yearElement:qe,monthElement:se}}function V(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var Q=j();t.yearElements.push(Q.yearElement),t.monthElements.push(Q.monthElement),t.monthNav.appendChild(Q.container)}t.monthNav.appendChild(t.nextMonthNav)}function K(){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,V(),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],ji(),t.monthNav}function J(){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 Q=$t("span","flatpickr-time-separator",":"),se=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=se.getElementsByTagName("input")[0];var he=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=he.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=In(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=In(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(Q),t.timeContainer.appendChild(he),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var qe=Zo("flatpickr-second");t.secondElement=qe.getElementsByTagName("input")[0],t.secondElement.value=In(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[Kn((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 ee(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=$t("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var Q=$t("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Q)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,Q=xm(t.l10n.weekdays.shorthand);Z>0&&Z<Q.length&&(Q=xm(Q.splice(Z,Q.length),Q.splice(0,Z)));for(var se=t.config.showMonths;se--;)t.weekdayContainer.children[se].innerHTML=`
+-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[5]),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function H6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S;return l=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[P6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[N6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[R6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[F6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[q6,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),H(g.$$.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,$){v(T,e,$),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(r,o,null),w(t,a),w(t,u),F(f,u,null),w(t,c),w(t,d),F(m,d,null),w(t,h),F(g,t,null),_=!0,y||(S=B(e,"submit",tt(n[17])),y=!0)},p(T,$){const E={};$&25165828&&(E.$$scope={dirty:$,ctx:T}),l.$set(E);const M={};$&25165832&&(M.$$scope={dirty:$,ctx:T}),r.$set(M);const L={};$&25165840&&(L.$$scope={dirty:$,ctx:T}),f.$set(L);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const A={};$&25165856&&(A.$$scope={dirty:$,ctx:T}),g.$set(A)},i(T){_||(O(l.$$.fragment,T),O(r.$$.fragment,T),O(f.$$.fragment,T),O(m.$$.fragment,T),O(g.$$.fragment,T),_=!0)},o(T){D(l.$$.fragment,T),D(r.$$.fragment,T),D(f.$$.fragment,T),D(m.$$.fragment,T),D(g.$$.fragment,T),_=!1},d(T){T&&k(e),q(l),q(r),q(f),q(m),q(g),y=!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){v(t,e,i)},p:te,d(t){t&&k(e)}}}function z6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("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],x(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(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&&x(l,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(l)),u=!1,f()}}}function U6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[z6],header:[j6],default:[H6]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),q(e,l)}}}const ur=15777e3;function V6(n,e,t){let i;const l=gt(),s="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||ur),Wt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){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 _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function T(){c=_t(this.value),t(6,c)}function $(){f=this.value,t(5,f)}const E=()=>g(),M=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,g,m,_,y,S,T,$,E,M,L,I,A]}class B6 extends ye{constructor(e){super(),be(this,e,V6,U6,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function W6(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new B6({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(),H(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){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),F(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||(O(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),q(r,d),u=!1,f()}}}function Y6(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 K6 extends ye{constructor(e){super(),be(this,e,Y6,W6,_e,{key:1,config:0})}}function J6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[0].authURL),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function Z6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[0].tokenURL),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function G6(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[J6,({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:[Z6,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),F(i,r,a),v(r,l,a),F(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||(O(i.$$.fragment,r),O(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l)),q(i,r),q(s,r)}}}function X6(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 Q6 extends ye{constructor(e){super(),be(this,e,X6,G6,_e,{key:1,config:0})}}function x6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Display name"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","text"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].displayName),r||(a=B(s,"input",n[2]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&ce(s,u[0].displayName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function e8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].authURL),r||(a=B(s,"input",n[3]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&ce(s,u[0].authURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function t8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].tokenURL),r||(a=B(s,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&ce(s,u[0].tokenURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function n8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[0].userInfoURL),r||(a=B(s,"input",n[5]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&ce(s,u[0].userInfoURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function i8(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[7]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[7])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[6]),Me(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&128&&t!==(t=c[7])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&128&&a!==(a=c[7])&&p(l,"for",a)},d(c){c&&(k(e),k(i),k(l)),u=!1,De(f)}}}function l8(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[x6,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[e8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[t8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[n8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[i8,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),H(s.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),H(c.$$.fragment),p(i,"class","section-title")},m(m,h){F(e,m,h),v(m,t,h),v(m,i,h),v(m,l,h),F(s,m,h),v(m,o,h),F(r,m,h),v(m,a,h),F(u,m,h),v(m,f,h),F(c,m,h),d=!0},p(m,[h]){const g={};h&2&&(g.name=m[1]+".displayName"),h&385&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.name=m[1]+".authURL"),h&385&&(_.$$scope={dirty:h,ctx:m}),s.$set(_);const y={};h&2&&(y.name=m[1]+".tokenURL"),h&385&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&2&&(S.name=m[1]+".userInfoURL"),h&385&&(S.$$scope={dirty:h,ctx:m}),u.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&385&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(O(e.$$.fragment,m),O(s.$$.fragment,m),O(r.$$.fragment,m),O(u.$$.fragment,m),O(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(r.$$.fragment,m),D(u.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(k(t),k(i),k(l),k(o),k(a),k(f)),q(e,m),q(s,m),q(r,m),q(u,m),q(c,m)}}}function s8(n,e,t){let{key:i=""}=e,{config:l={}}=e;z.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC");function s(){l.displayName=this.value,t(0,l)}function o(){l.authURL=this.value,t(0,l)}function r(){l.tokenURL=this.value,t(0,l)}function a(){l.userInfoURL=this.value,t(0,l)}function u(){l.pkce=this.checked,t(0,l)}return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a,u]}class ka extends ye{constructor(e){super(),be(this,e,s8,l8,_e,{key:1,config:0})}}function o8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function r8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function a8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function u8(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:[r8,({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:[a8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=Y(n[2]),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),F(l,f,c),v(f,s,c),F(o,f,c),v(f,r,c),F(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&ue(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||(O(l.$$.fragment,f),O(o.$$.fragment,f),O(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(e),k(i),k(s),k(r)),q(l,f),q(o,f),q(a,f)}}}function f8(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 va extends ye{constructor(e){super(),be(this,e,f8,u8,_e,{key:1,config:0,required:4,title:2})}}const ef=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:K6},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:Q6},{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:va,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:va,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:"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:va,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:ka},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:ka},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:ka}];function lm(n,e,t){const i=n.slice();return i[16]=e[t],i}function sm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',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){v(o,e,r),i=!0,l||(s=B(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function c8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&sm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ge(),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){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),ce(s,n[1]),v(d,r,m),c&&c.m(d,m),v(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&&O(c,1)):(c=sm(d),c.c(),O(c,1),c.m(a.parentNode,a)):c&&(re(),D(c,1,1,()=>{c=null}),ae())},d(d){d&&(k(e),k(l),k(s),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function om(n){let e,t,i,l,s=n[1]!=""&&rm(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){v(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=rm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function rm(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){v(l,e,s),t||(i=B(e,"click",n[5]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function am(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!vn(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&&k(e)}}}function um(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,y=e[16].logo&&am(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),y&&y.c(),s=C(),o=b("div"),r=b("div"),u=Y(a),f=C(),c=b("em"),m=Y(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,$){v(T,t,$),w(t,i),w(i,l),y&&y.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),g=!0)},p(T,$){e=T,e[16].logo?y?y.p(e,$):(y=am(e),y.c(),y.m(l,null)):y&&(y.d(1),y=null),$&8&&a!==(a=e[16].title+"")&&ue(u,a),$&8&&d!==(d=e[16].key+"")&&ue(m,d)},d(T){T&&k(t),y&&y.d(),g=!1,_()}}}function d8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[c8,({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<r.length;f+=1){let c=lm(n,r,f),d=a(c);s.set(d,l[f]=um(d,c))}let u=null;return r.length||(u=om(n)),{c(){H(e.$$.fragment),t=C(),i=b("div");for(let f=0;f<l.length;f+=1)l[f].c();u&&u.c(),p(i,"class","grid grid-sm")},m(f,c){F(e,f,c),v(f,t,c),v(f,i,c);for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(i,null);u&&u.m(i,null),o=!0},p(f,c){const d={};c&1572866&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),c&58&&(r=pe(f[3]),l=kt(l,c,a,1,f,r,s,i,ci,um,null,lm),!r.length&&u?u.p(f,c):r.length?u&&(u.d(1),u=null):(u=om(f),u.c(),u.m(i,null)))},i(f){o||(O(e.$$.fragment,f),o=!0)},o(f){D(e.$$.fragment,f),o=!1},d(f){f&&(k(t),k(i)),q(e,f);for(let c=0;c<l.length;c+=1)l[c].d();u&&u.d()}}}function p8(n){let e;return{c(){e=b("h4"),e.textContent="Add OAuth2 provider",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function m8(n){let e,t,i;return{c(){e=b("button"),e.textContent="Cancel",p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[0]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function h8(n){let e,t,i={btnClose:!1,$$slots:{footer:[m8],header:[p8],default:[d8]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&1048586&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}function _8(n,e,t){const i=gt();let{disabled:l=[]}=e,s,o="",r=[];function a(){s==null||s.show()}function u(){return s==null?void 0:s.hide()}function f(T){i("select",T),u()}function c(){const T=(o||"").toLowerCase();return ef.filter($=>!l.includes($.key)&&(T==""||$.key.toLowerCase().includes(T)||$.title.toLowerCase().includes(T)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=T=>f(T);function _(T){ie[T?"unshift":"push"](()=>{s=T,t(2,s)})}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}return n.$$set=T=>{"disabled"in T&&t(6,l=T.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,_,y,S]}class g8 extends ye{constructor(e){super(),be(this,e,_8,h8,_e,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function fm(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 b8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function y8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function k8(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s[0]&1&&!vn(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&&k(e)}}}function cm(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){v(s,e,o),t||(i=[Me(He.call(null,e,{text:"Edit config",position:"left"})),B(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,De(i)}}}function dm(n,e){var T;let t,i,l,s,o,r,a=(e[28].displayName||((T=e[29])==null?void 0:T.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g($,E){var M;return(M=$[29])!=null&&M.logo?k8:y8}let _=g(e),y=_(e),S=e[29]&&cm(e);return{key:n,first:null,c(){var $,E,M;t=b("div"),i=b("div"),l=b("figure"),y.c(),s=C(),o=b("div"),r=b("div"),u=Y(a),f=C(),c=b("em"),m=Y(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"),x(i,"error",!z.isEmpty((M=(E=($=e[1])==null?void 0:$.oauth2)==null?void 0:E.providers)==null?void 0:M[e[31]])),p(t,"class","col-lg-6"),this.first=t},m($,E){v($,t,E),w(t,i),w(i,l),y.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($,E){var M,L,I,A;e=$,_===(_=g(e))&&y?y.p(e,E):(y.d(1),y=_(e),y&&(y.c(),y.m(l,null))),E[0]&1&&a!==(a=(e[28].displayName||((M=e[29])==null?void 0:M.title)||"Custom")+"")&&ue(u,a),E[0]&1&&d!==(d=e[28].name+"")&&ue(m,d),e[29]?S?S.p(e,E):(S=cm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),E[0]&3&&x(i,"error",!z.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d($){$&&k(t),y.d(),S&&S.d()}}}function v8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function w8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function pm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[S8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[T8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[$8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[C8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(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(_,y){v(_,e,y),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(r,o,null),w(t,a),w(t,u),F(f,u,null),w(t,c),w(t,d),F(m,d,null),g=!0},p(_,y){const S={};y[0]&134217761|y[1]&2&&(S.$$scope={dirty:y,ctx:_}),l.$set(S);const T={};y[0]&134217793|y[1]&2&&(T.$$scope={dirty:y,ctx:_}),r.$set(T);const $={};y[0]&134217761|y[1]&2&&($.$$scope={dirty:y,ctx:_}),f.$set($);const E={};y[0]&134217761|y[1]&2&&(E.$$scope={dirty:y,ctx:_}),m.$set(E)},i(_){g||(O(l.$$.fragment,_),O(r.$$.fragment,_),O(f.$$.fragment,_),O(m.$$.fragment,_),_&&nt(()=>{g&&(h||(h=ze(e,wt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=ze(e,wt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&k(e),q(l),q(r),q(f),q(m),_&&h&&h.end()}}}function S8(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:L8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 full name"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function T8(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:A8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 avatar"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function $8(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:P8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 id"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function C8(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:N8,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(()=>ve(s,"selected",a)),{c(){e=b("label"),t=Y("OAuth2 username"),l=C(),H(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function O8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,y,S,T,$,E,M;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[b8,({uniqueId:U})=>({27:U}),({uniqueId:U})=>[U?134217728:0]]},$$scope:{ctx:n}}});let L=pe(n[0].oauth2.providers);const I=U=>U[28].name;for(let U=0;U<L.length;U+=1){let j=fm(n,L,U),V=I(j);s.set(V,l[U]=dm(V,j))}function A(U,j){return U[4]?w8:v8}let P=A(n),R=P(n),N=n[4]&&pm(n);return{c(){H(e.$$.fragment),t=C(),i=b("div");for(let U=0;U<l.length;U+=1)l[U].c();o=C(),r=b("div"),a=b("button"),a.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add provider</span>',u=C(),f=b("button"),c=b("strong"),d=Y("Optional "),h=Y(m),g=Y(" create fields map"),_=C(),R.c(),S=C(),N&&N.c(),T=ge(),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",y="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(U,j){F(e,U,j),v(U,t,j),v(U,i,j);for(let V=0;V<l.length;V+=1)l[V]&&l[V].m(i,null);w(i,o),w(i,r),w(r,a),v(U,u,j),v(U,f,j),w(f,c),w(c,d),w(c,h),w(c,g),w(f,_),R.m(f,null),v(U,S,j),N&&N.m(U,j),v(U,T,j),$=!0,E||(M=[B(a,"click",n[12]),B(f,"click",n[13])],E=!0)},p(U,j){const V={};j[0]&134217729|j[1]&2&&(V.$$scope={dirty:j,ctx:U}),e.$set(V),j[0]&523&&(L=pe(U[0].oauth2.providers),l=kt(l,j,I,1,U,L,s,i,ci,dm,o,fm)),(!$||j[0]&1)&&m!==(m=U[0].name+"")&&ue(h,m),P!==(P=A(U))&&(R.d(1),R=P(U),R&&(R.c(),R.m(f,null))),(!$||j[0]&16&&y!==(y="m-t-25 btn btn-sm "+(U[4]?"btn-secondary":"btn-hint btn-transparent")))&&p(f,"class",y),U[4]?N?(N.p(U,j),j[0]&16&&O(N,1)):(N=pm(U),N.c(),O(N,1),N.m(T.parentNode,T)):N&&(re(),D(N,1,1,()=>{N=null}),ae())},i(U){$||(O(e.$$.fragment,U),O(N),$=!0)},o(U){D(e.$$.fragment,U),D(N),$=!1},d(U){U&&(k(t),k(i),k(u),k(f),k(S),k(T)),q(e,U);for(let j=0;j<l.length;j+=1)l[j].d();R.d(),N&&N.d(U),E=!1,De(M)}}}function E8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function M8(n){let e,t,i,l=n[7]==1?"provider":"providers",s,o,r;return{c(){e=b("span"),t=Y(n[7]),i=C(),s=Y(l),o=C(),r=b("span"),r.textContent="Enabled",p(e,"class","label"),x(e,"label-warning",!n[7]),x(e,"label-info",n[7]>0),p(r,"class","label label-success")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,s),v(a,o,u),v(a,r,u)},p(a,u){u[0]&128&&ue(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&ue(s,l),u[0]&128&&x(e,"label-warning",!a[7]),u[0]&128&&x(e,"label-info",a[7]>0)},d(a){a&&(k(e),k(o),k(r))}}}function mm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function D8(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?M8:E8}let a=r(n),u=a(n),f=n[8]&&mm();return{c(){e=b("div"),e.innerHTML='<i class="ri-pass-expired-line"></i> <span class="txt">OAuth2</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=mm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function I8(n){var u,f;let e,t,i,l,s,o;e=new qi({props:{single:!0,$$slots:{header:[D8],default:[O8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(hm))||[]};i=new g8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new A6({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(c,d){F(e,c,d),v(c,t,d),F(i,c,d),v(c,l,d),F(s,c,d),o=!0},p(c,d){var _,y;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((y=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:y.map(hm))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(O(e.$$.fragment,c),O(i.$$.fragment,c),O(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(k(t),k(l)),q(e,c),n[18](null),q(i,c),n[20](null),q(s,c)}}}const L8=()=>"",A8=()=>"",P8=()=>"",N8=()=>"",hm=n=>n.name;function R8(n,e,t){let i,l,s;Qe(n,Sn,j=>t(1,s=j));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 g(j=[]){var V,K;t(5,m=((V=j==null?void 0:j.filter(J=>a.includes(J.type)&&!r.includes(J.name)))==null?void 0:V.map(J=>J.name))||[]),t(6,h=((K=j==null?void 0:j.filter(J=>u.includes(J.type)&&!r.includes(J.name)))==null?void 0:K.map(J=>J.name))||[])}function _(j){for(let V of ef)if(V.key==j)return V;return null}function y(){o.oauth2.enabled=this.checked,t(0,o)}const S=(j,V,K)=>{c==null||c.show(j,V,K)},T=()=>f==null?void 0:f.show(),$=()=>t(4,d=!d);function E(j){n.$$.not_equal(o.oauth2.mappedFields.name,j)&&(o.oauth2.mappedFields.name=j,t(0,o))}function M(j){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,j)&&(o.oauth2.mappedFields.avatarURL=j,t(0,o))}function L(j){n.$$.not_equal(o.oauth2.mappedFields.id,j)&&(o.oauth2.mappedFields.id=j,t(0,o))}function I(j){n.$$.not_equal(o.oauth2.mappedFields.username,j)&&(o.oauth2.mappedFields.username=j,t(0,o))}function A(j){ie[j?"unshift":"push"](()=>{f=j,t(2,f)})}const P=j=>{var V,K;c.show(j.detail,{},((K=(V=o.oauth2)==null?void 0:V.providers)==null?void 0:K.length)||0)};function R(j){ie[j?"unshift":"push"](()=>{c=j,t(3,c)})}const N=j=>{const V=j.detail.uiOptions;z.removeByKey(o.oauth2.providers,"name",V.key),t(0,o)},U=j=>{const V=j.detail.uiOptions,K=j.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),z.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:V.key},K),"name"),t(0,o)};return n.$$set=j=>{"collection"in j&&t(0,o=j.collection)},n.$$.update=()=>{var j,V;n.$$.dirty[0]&1&&z.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!z.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((V=(j=o.oauth2)==null?void 0:j.providers)==null?void 0:V.length)||0)},[o,s,f,c,d,m,h,l,i,_,y,S,T,$,E,M,L,I,A,P,R,N,U]}class F8 extends ye{constructor(e){super(),be(this,e,R8,I8,_e,{collection:0},null,[-1,-1])}}function _m(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Me(He.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&k(e),t=!1,i()}}}function q8(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&_m();return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),r=C(),c&&c.c(),a=ge(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].otp.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(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=_m(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(i),k(l),k(r),k(a)),c&&c.d(d),u=!1,De(f)}}}function H8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].otp.duration&&ce(s,u[0].otp.duration)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function j8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].otp.length&&ce(s,u[0].otp.length)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function z8(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:[q8,({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:[H8,({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:[j8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div"),H(s.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){F(e,f,c),v(f,t,c),v(f,i,c),w(i,l),F(s,l,null),w(i,o),w(i,r),F(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||(O(e.$$.fragment,f),O(s.$$.fragment,f),O(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(t),k(i)),q(e,f),q(s),q(a)}}}function U8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function V8(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function B8(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?V8:U8}let a=r(n),u=a(n),f=n[1]&&gm();return{c(){e=b("div"),e.innerHTML='<i class="ri-time-line"></i> <span class="txt">One-time password (OTP)</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=gm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function W8(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[B8],default:[z8]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Y8(n,e,t){let i,l,s;Qe(n,Sn,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=_t(this.value),t(0,o)}function f(){o.otp.length=_t(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&z.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=!z.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class K8 extends ye{constructor(e){super(),be(this,e,Y8,W8,_e,{collection:0})}}function bm(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function J8(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&&bm(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=Y(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),v(o,e,r),v(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=bm(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)+"")&&ue(l,i)},i:te,o:te,d(o){o&&(k(e),k(t)),s&&s.d(o)}}}function Z8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class ym extends ye{constructor(e){super(),be(this,e,Z8,J8,_e,{item:0})}}const G8=n=>({}),km=n=>({});function X8(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[12],km);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&Pt(i,t,l,l[12],e?At(t,l[12],s,G8):Nt(l[12]),km)},i(l){e||(O(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function Q8(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:[X8]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new ds({props:o}),ie.push(()=>ve(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&62?vt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ft(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function x8(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=ym}=e,{optionComponent:c=ym}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=z.toArray(T,!0);let $=[];for(let E of T){const M=z.findByKey(r,d,E);M&&$.push(M)}T.length&&!$.length||t(0,u=a?$:$[0])}async function g(T){let $=z.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?$:$[0])}function _(T){u=T,t(0,u)}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Ut(T)),t(5,l=lt(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,l,m,d,s,_,y,S,o]}class xn extends ye{constructor(e){super(),be(this,e,x8,Q8,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Me(He.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&k(e),t=!1,i()}}}function eO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&vm();return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),r=C(),c&&c.c(),a=ge(),p(e,"type","checkbox"),p(e,"id",t=n[8]),e.disabled=n[3],p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].passwordAuth.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=B(e,"change",n[5]),u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[3]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(i),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function tO(n){let e,t,i,l,s,o,r;function a(f){n[6](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new xn({props:u}),ie.push(()=>ve(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),H(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[8])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(s,f,c),r=!0},p(f,c){(!r||c&256&&i!==(i=f[8]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function nO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[eO,({uniqueId:s})=>({8:s}),({uniqueId:s})=>s?256:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[tO,({uniqueId:s})=>({8:s}),({uniqueId:s})=>s?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,o){const r={};o&777&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&771&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function iO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function lO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(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){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function sO(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?lO:iO}let a=r(n),u=a(n),f=n[2]&&wm();return{c(){e=b("div"),e.innerHTML='<i class="ri-lock-password-line"></i> <span class="txt">Identity/Password</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=wm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function oO(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[sO],default:[nO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function rO(n,e,t){let i,l,s;Qe(n,Sn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){const d=[{value:"email"}],m=(c==null?void 0:c.fields)||[],h=(c==null?void 0:c.indexes)||[];for(let g of h){const _=z.parseIndex(g);if(!_.unique||_.columns.length!=1||_.columns[0].name=="email")continue;const y=m.find(S=>!S.hidden&&S.name.toLowerCase()==_.columns[0].name.toLowerCase());y&&d.push({value:y.name})}return d}Yt(()=>{t(1,r=a(o))});function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(c){n.$$.not_equal(o.passwordAuth.identityFields,c)&&(o.passwordAuth.identityFields=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&z.isEmpty(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&16&&t(2,l=!z.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,s,u,f]}class aO extends ye{constructor(e){super(),be(this,e,rO,oO,_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=vk(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=Y(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,g){v(h,t,g),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,g){e=h,g&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&k(t),c.r(),d=!1,m()}}}function uO(n){let e=[],t=new Map,i,l=pe(n[7]);const s=o=>o[22].value;for(let o=0;o<l.length;o+=1){let r=Sm(n,l,o),a=s(r);t.set(a,e[o]=Tm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r&2097284&&(l=pe(o[7]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,Tm,i,Sm))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function fO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("To email address"),l=C(),s=b("input"),p(e,"for",i=n[21]),p(s,"type","email"),p(s,"id",o=n[21]),s.autofocus=!0,s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),ce(s,n[1]),s.focus(),r||(a=B(s,"input",n[12]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(s,"id",o),f&2&&s.value!==u[1]&&ce(s,u[1])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function cO(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"template",$$slots:{default:[uO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[fO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),F(t,e,null),w(e,i),F(l,e,null),s=!0,o||(r=B(e,"submit",tt(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||(O(t.$$.fragment,a),O(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(t),q(l),o=!1,r()}}}function dO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function pO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("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],x(l,"btn-loading",n[4])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(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&&x(l,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(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:[pO],header:[dO],default:[cO]},$$scope:{ctx:n}};return e=new ln({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),q(e,l)}}}const wa="last_email_test",$m="email_test_request";function hO(n,e,t){let i;const l=gt(),s="email_test_"+z.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),Wt({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(wa,u),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest($m),$i("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 fn(),h()}catch(I){t(4,c=!1),me.error(I)}clearTimeout(d)}}const _=[[]];function y(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const T=()=>g(),$=()=>!c;function E(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function M(I){Pe.call(this,n,I)}function L(I){Pe.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,g,m,y,_,S,T,$,E,M,L]}class tk extends ye{constructor(e){super(),be(this,e,hO,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 _O(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("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){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(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&&(k(e),k(i),k(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 F8({props:s}),ie.push(()=>ve(e,"collection",l)),{c(){H(e.$$.fragment)},m(o,r){F(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(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 F5({props:r}),ie.push(()=>ve(i,"config",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),F(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,$e(()=>l=!1)),i.$set(c)},i(u){s||(O(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&k(t),q(i,u)}}}function gO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P=[],R=new Map,N,U,j,V,K,J,ee,X,oe,Se,ke;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[_O,({uniqueId:Le})=>({21:Le}),({uniqueId:Le})=>Le?2097152:0]},$$scope:{ctx:n}}});function Ce(Le){n[10](Le)}let We={};n[0]!==void 0&&(We.collection=n[0]),u=new K8({props:We}),ie.push(()=>ve(u,"collection",Ce));function st(Le){n[11](Le)}let et={};n[0]!==void 0&&(et.collection=n[0]),d=new aO({props:et}),ie.push(()=>ve(d,"collection",st));let Be=!n[1]&&Om(n);function rt(Le){n[13](Le)}let Je={};n[0]!==void 0&&(Je.collection=n[0]),_=new u6({props:Je}),ie.push(()=>ve(_,"collection",rt));let at=pe(n[2]);const Ht=Le=>Le[18].key;for(let Le=0;Le<at.length;Le+=1){let Ve=Cm(n,at,Le),we=Ht(Ve);R.set(we,P[Le]=Em(we,Ve))}function Te(Le){n[16](Le)}let Ze={};n[0]!==void 0&&(Ze.collection=n[0]),K=new Y5({props:Ze}),ie.push(()=>ve(K,"collection",Te));let ot={};return X=new tk({props:ot}),n[17](X),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),c=C(),H(d.$$.fragment),h=C(),Be&&Be.c(),g=C(),H(_.$$.fragment),S=C(),T=b("h4"),$=b("span"),$.textContent="Mail templates",E=C(),M=b("button"),M.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let Le=0;Le<P.length;Le+=1)P[Le].c();N=C(),U=b("h4"),U.textContent="Other",j=C(),V=b("div"),H(K.$$.fragment),ee=C(),H(X.$$.fragment),p(i,"class","txt"),p(s,"class","m-l-auto handle"),p(t,"class","flex"),p(e,"class","section-title"),p(a,"class","accordions m-b-35"),p($,"class","txt"),p(M,"type","button"),p(M,"class","btn btn-xs m-l-auto btn-secondary"),p(T,"class","section-title"),p(A,"class","accordions"),p(I,"class","accordions m-b-35"),p(U,"class","section-title"),p(V,"class","accordions m-b-base")},m(Le,Ve){v(Le,e,Ve),w(e,t),w(t,i),w(t,l),w(t,s),F(o,s,null),v(Le,r,Ve),v(Le,a,Ve),F(u,a,null),w(a,c),F(d,a,null),w(a,h),Be&&Be.m(a,null),w(a,g),F(_,a,null),v(Le,S,Ve),v(Le,T,Ve),w(T,$),w(T,E),w(T,M),v(Le,L,Ve),v(Le,I,Ve),w(I,A);for(let we=0;we<P.length;we+=1)P[we]&&P[we].m(A,null);v(Le,N,Ve),v(Le,U,Ve),v(Le,j,Ve),v(Le,V,Ve),F(K,V,null),v(Le,ee,Ve),F(X,Le,Ve),oe=!0,Se||(ke=B(M,"click",n[14]),Se=!0)},p(Le,[Ve]){const we={};Ve&6291457&&(we.$$scope={dirty:Ve,ctx:Le}),o.$set(we);const Oe={};!f&&Ve&1&&(f=!0,Oe.collection=Le[0],$e(()=>f=!1)),u.$set(Oe);const ut={};!m&&Ve&1&&(m=!0,ut.collection=Le[0],$e(()=>m=!1)),d.$set(ut),Le[1]?Be&&(re(),D(Be,1,1,()=>{Be=null}),ae()):Be?(Be.p(Le,Ve),Ve&2&&O(Be,1)):(Be=Om(Le),Be.c(),O(Be,1),Be.m(a,g));const Ne={};!y&&Ve&1&&(y=!0,Ne.collection=Le[0],$e(()=>y=!1)),_.$set(Ne),Ve&4&&(at=pe(Le[2]),re(),P=kt(P,Ve,Ht,1,Le,at,R,A,zt,Em,null,Cm),ae());const xe={};!J&&Ve&1&&(J=!0,xe.collection=Le[0],$e(()=>J=!1)),K.$set(xe);const qt={};X.$set(qt)},i(Le){if(!oe){O(o.$$.fragment,Le),O(u.$$.fragment,Le),O(d.$$.fragment,Le),O(Be),O(_.$$.fragment,Le);for(let Ve=0;Ve<at.length;Ve+=1)O(P[Ve]);O(K.$$.fragment,Le),O(X.$$.fragment,Le),oe=!0}},o(Le){D(o.$$.fragment,Le),D(u.$$.fragment,Le),D(d.$$.fragment,Le),D(Be),D(_.$$.fragment,Le);for(let Ve=0;Ve<P.length;Ve+=1)D(P[Ve]);D(K.$$.fragment,Le),D(X.$$.fragment,Le),oe=!1},d(Le){Le&&(k(e),k(r),k(a),k(S),k(T),k(L),k(I),k(N),k(U),k(j),k(V),k(ee)),q(o),q(u),q(d),Be&&Be.d(),q(_);for(let Ve=0;Ve<P.length;Ve+=1)P[Ve].d();q(K),n[17](null),q(X,Le),Se=!1,ke()}}}function bO(n,e,t){let i,l,s,o,r,a,{collection:u}=e,f=[],c;function d(){u.authAlert.enabled=this.checked,t(0,u)}function m(E){u=E,t(0,u)}function h(E){u=E,t(0,u)}function g(E){u=E,t(0,u)}function _(E){u=E,t(0,u)}const y=()=>c==null?void 0:c.show(u.id);function S(E,M){n.$$.not_equal(M.config,E)&&(M.config=E,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 T(E){u=E,t(0,u)}function $(E){ie[E?"unshift":"push"](()=>{c=E,t(3,c)})}return n.$$set=E=>{"collection"in E&&t(0,u=E.collection)},n.$$.update=()=>{var E,M;n.$$.dirty&1&&typeof((E=u.otp)==null?void 0:E.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,_,y,S,T,$]}class yO extends ye{constructor(e){super(),be(this,e,bO,gO,_e,{collection:0})}}const kO=n=>({dragging:n&4,dragover:n&8}),Mm=n=>({dragging:n[2],dragover:n[3]});function vO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(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"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[B(e,"dragover",tt(n[11])),B(e,"dragleave",tt(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)&&Pt(r,o,a,a[9],i?At(o,a[9],u,kO):Nt(a[9]),Mm),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(O(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,De(s)}}}function wO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=gt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m($,E){if(!(!$||u)){if(f&&!$.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:E,group:a})),s("drag",$)}}function h($,E){if(t(3,d=!1),t(2,c=!1),!$||u)return;$.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const L=M.index<<0;L<E?(r.splice(E+1,0,r[L]),r.splice(L,1)):(r.splice(E,0,r[L]),r.splice(L+1,1)),t(6,r),s("sort",{oldIndex:L,newIndex:E,list:r})}const g=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,u=$.disabled),"dragHandleClass"in $&&t(8,f=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,y,S,T]}class ho extends ye{constructor(e){super(),be(this,e,wO,vO,_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 SO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=Y("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){v(f,e,c),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function TO(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(()=>ve(e,"value",s))),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;D(c.$$.fragment,1,0,()=>{q(c,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),H(e.$$.fragment),O(e.$$.fragment,1),F(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],$e(()=>t=!1)),e.$set(c)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function $O(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function CO(n){let e,t,i,l;const s=[$O,TO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function Im(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Lm(Dm(n,l,o));return{c(){e=b("div"),t=b("span"),t.textContent="Presets",i=C();for(let o=0;o<s.length;o+=1)s[o].c();p(t,"class","txt txt-hint"),p(e,"class","inline-flex gap-10")},m(o,r){v(o,e,r),w(e,t),w(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null)},p(o,r){if(r[0]&9728){l=pe(o[10]);let a;for(a=0;a<l.length;a+=1){const u=Dm(o,l,a);s[a]?s[a].p(u,r):(s[a]=Lm(u),s[a].c(),s[a].m(e,null))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&k(e),pt(s,o)}}}function Lm(n){let e,t=n[27]+"",i,l,s,o;function r(){return n[21](n[27])}return{c(){e=b("button"),i=Y(t),l=C(),p(e,"type","button"),p(e,"class","label link-primary"),x(e,"label-info",n[9].includes(n[27]))},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&ue(i,t),u[0]&1536&&x(e,"label-info",n[9].includes(n[27]))},d(a){a&&k(e),s=!1,o()}}}function OO(n){let e,t,i,l,s,o;e=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[SO,({uniqueId:a})=>({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:[CO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Im(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),r&&r.c(),s=ge()},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),v(a,l,u),r&&r.m(a,u),v(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||(O(e.$$.fragment,a),O(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l),k(s)),q(e,a),q(i,a),r&&r.d(a)}}}function EO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&ue(i,t)},d(s){s&&k(e)}}}function Am(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-delete-bin-7-line"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){v(l,e,s),t||(i=[Me(He.call(null,e,{text:"Delete",position:"top"})),B(e,"click",n[16])],t=!0)},p:te,d(l){l&&k(e),t=!1,De(i)}}}function MO(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='<span class="txt">Cancel</span>',i=C(),l=b("button"),l.innerHTML='<span class="txt">Set index</span>',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),v(a,e,u),v(a,t,u),v(a,i,u),v(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&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(l)),r&&r.d(a),s=!1,De(o)}}}function DO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[MO],header:[EO],default:[OO]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new ln({props:l}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){H(e.$$.fragment)},m(s,o){F(e,s,o),t=!0},p(s,o){const r=o[0]&16384?vt(i,[i[0],Ft(s[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(O(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[22](null),q(e,s)}}}function IO(n,e,t){let i,l,s;const o=["collection","show","hide"];let r=lt(e,o);const a=gt();let{collection:u}=e,f,c="",d="",m="",h,g=!1;function _(V,K){return t(6,m=z.isEmpty(K)?"":K),t(5,c=V||S()),t(2,d=c),f==null?void 0:f.show()}function y(){return f==null?void 0:f.hide()}function S(){const V=z.parseIndex("");return V.tableName=(u==null?void 0:u.name)||"",z.buildIndex(V)}function T(){a("remove",c),y()}function $(){s.length&&(a("submit",{old:c,new:d}),y())}function E(V){const K=z.clone(l),J=K.columns.find(ee=>ee.name==V);J?z.removeByValue(K.columns,J):z.pushUnique(K.columns,{name:V}),t(2,d=z.buildIndex(K))}Yt(async()=>{t(8,g=!0);try{t(7,h=(await Ot(async()=>{const{default:V}=await import("./CodeEditor-BMLITRTv.js");return{default:V}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(V){console.warn(V)}t(8,g=!1)});const M=()=>T(),L=()=>y(),I=()=>$(),A=V=>{t(3,l.unique=V.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=z.buildIndex(l))};function P(V){d=V,t(2,d)}const R=V=>E(V);function N(V){ie[V?"unshift":"push"](()=>{f=V,t(4,f)})}function U(V){Pe.call(this,n,V)}function j(V){Pe.call(this,n,V)}return n.$$set=V=>{e=je(je({},e),Ut(V)),t(14,r=lt(e,o)),"collection"in V&&t(0,u=V.collection)},n.$$.update=()=>{var V,K,J;n.$$.dirty[0]&1&&t(10,i=((K=(V=u==null?void 0:u.fields)==null?void 0:V.filter(ee=>!ee.toDelete&&ee.name!="id"))==null?void 0:K.map(ee=>ee.name))||[]),n.$$.dirty[0]&4&&t(3,l=z.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((J=l.columns)==null?void 0:J.map(ee=>ee.name))||[])},[u,y,d,l,f,c,m,h,g,s,i,T,$,E,r,_,M,L,I,A,P,R,N,U,j]}class LO extends ye{constructor(e){super(),be(this,e,IO,DO,_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=z.parseIndex(i[10]);return i[11]=l,i}function Nm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&k(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=Y(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,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Me(r=He.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),B(e,"click",c)],a=!0)},p(m,h){var g,_,y,S,T;n=m,n[11].unique?f||(f=Nm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((g=n[11].columns)==null?void 0:g.map(Fm).join(", "))+"")&&ue(s,l),h&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Rt(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&k(e),f&&f.d(),a=!1,De(u)}}}function AO(n){var $,E,M;let e,t,i=(((E=($=n[0])==null?void 0:$.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=pe(((M=n[0])==null?void 0:M.indexes)||[]),y=[];for(let L=0;L<_.length;L+=1)y[L]=Rm(Pm(n,_,L));function S(L){n[7](L)}let T={};return n[0]!==void 0&&(T.collection=n[0]),c=new LO({props:T}),n[6](c),ie.push(()=>ve(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=Y("Unique constraints and indexes ("),l=Y(i),s=Y(")"),o=C(),r=b("div");for(let L=0;L<y.length;L+=1)y[L].c();a=C(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=C(),H(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){v(L,e,I),w(e,t),w(e,l),w(e,s),v(L,o,I),v(L,r,I);for(let A=0;A<y.length;A+=1)y[A]&&y[A].m(r,null);w(r,a),w(r,u),v(L,f,I),F(c,L,I),m=!0,h||(g=B(u,"click",n[5]),h=!0)},p(L,[I]){var P,R,N;if((!m||I&1)&&i!==(i=(((R=(P=L[0])==null?void 0:P.indexes)==null?void 0:R.length)||0)+"")&&ue(l,i),I&7){_=pe(((N=L[0])==null?void 0:N.indexes)||[]);let U;for(U=0;U<_.length;U+=1){const j=Pm(L,_,U);y[U]?y[U].p(j,I):(y[U]=Rm(j),y[U].c(),y[U].m(r,a))}for(;U<y.length;U+=1)y[U].d(1);y.length=_.length}const A={};!d&&I&1&&(d=!0,A.collection=L[0],$e(()=>d=!1)),c.$set(A)},i(L){m||(O(c.$$.fragment,L),m=!0)},o(L){D(c.$$.fragment,L),m=!1},d(L){L&&(k(e),k(o),k(r),k(f)),pt(y,L),n[6](null),q(c,L),h=!1,g()}}}const Fm=n=>n.name;function PO(n,e,t){let i;Qe(n,Sn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;g<l.indexes.length;g++)if(l.indexes[g]==m){t(0,l.indexes[g]=h,l),fi("indexes."+g);return}l.indexes.push(h),t(0,l)}const r=(m,h)=>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<l.indexes.length;h++)if(l.indexes[h]==m.detail){l.indexes.splice(h,1),fi("indexes."+h);break}t(0,l)},d=m=>{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 NO extends ye{constructor(e){super(),be(this,e,PO,AO,_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){v(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&&k(e),o=!1,r()}}}function RO(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Hm(qm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&6){t=pe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=qm(l,t,o);i[o]?i[o].p(r,s):(i[o]=Hm(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function FO(n){let e,t,i,l,s,o,r,a;return o=new Hn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[RO]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=C(),l=b("div"),l.textContent="New field",s=C(),H(o.$$.fragment),p(t,"class","ri-add-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),F(o,e,null),a=!0},p(u,[f]){const c={};f&256&&(c.$$scope={dirty:f,ctx:u}),o.$set(c),(!a||f&1&&r!==(r="field-types-btn "+u[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(u){a||(O(o.$$.fragment,u),a=!0)},o(u){D(o.$$.fragment,u),a=!1},d(u){u&&k(e),q(o)}}}function qO(n,e,t){let{class:i=""}=e;const l=gt(),s=[{label:"Plain text",value:"text",icon:z.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:z.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:z.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:z.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:z.getFieldTypeIcon("email")},{label:"URL",value:"url",icon:z.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:z.getFieldTypeIcon("date")},{label:"Autodate",value:"autodate",icon:z.getFieldTypeIcon("autodate")},{label:"Select",value:"select",icon:z.getFieldTypeIcon("select")},{label:"File",value:"file",icon:z.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:z.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:z.getFieldTypeIcon("json")}];function o(a){l("select",a)}const r=a=>o(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class HO extends ye{constructor(e){super(),be(this,e,qO,FO,_e,{class:0})}}const jO=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),jm=n=>({interactive:n[7],hasErrors:n[6]}),zO=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),zm=n=>({interactive:n[7],hasErrors:n[6]}),UO=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='<span class="drag-handle"></span>',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function Bm(n){let e,t;return{c(){e=b("span"),t=Y(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&ue(t,i[5])},d(i){i&&k(e)}}}function Wm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function VO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Bm(n),g=n[0].hidden&&Wm();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=z.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),x(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(_,y){v(_,e,y),h&&h.m(e,null),w(e,t),g&&g.m(e,null),v(_,i,y),v(_,l,y),w(l,s),v(_,a,y),v(_,u,y),n[22](u),d||(m=[Me(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(_,y){_[0].required?h?h.p(_,y):(h=Bm(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Wm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y[0]&1&&o!==(o=z.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&Rt(r.update)&&y[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),y[0]&129&&x(l,"txt-disabled",!_[7]||_[0].system),y[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),y[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(k(e),k(i),k(l),k(a),k(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,De(m)}}}function BO(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function WO(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]),x(e,"btn-hint",!n[4]&&!n[6]),x(e,"btn-danger",n[6])},m(r,a){v(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&&x(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&x(e,"btn-danger",r[6])},d(r){r&&k(e),s=!1,o()}}}function YO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-restart-line"></i>',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){v(l,e,s),t||(i=[Me(He.call(null,e,"Restore")),B(e,"click",n[14])],t=!0)},p:te,d(l){l&&k(e),t=!1,De(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,g=Lt(h,n,n[28],zm);let _=s&&Km(n),y=r&&Jm(n),S=u&&Zm(n);const T=n[20].optionsFooter,$=Lt(T,n,n[28],jm);let E=!n[0]._toDelete&&!n[0].primaryKey&&Gm(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),l=b("div"),_&&_.c(),o=C(),y&&y.c(),a=C(),S&&S.c(),f=C(),$&&$.c(),c=C(),E&&E.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){v(M,e,L),w(e,t),g&&g.m(t,null),w(e,i),w(e,l),_&&_.m(l,null),w(l,o),y&&y.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),$&&$.m(l,null),w(l,c),E&&E.m(l,null),m=!0},p(M,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,M,M[28],m?At(h,M[28],L,zO):Nt(M[28]),zm),L[0]&257&&(s=!M[0].primaryKey&&M[0].type!="autodate"&&(!M[8]||!M[10].includes(M[0].name))),s?_?(_.p(M,L),L[0]&257&&O(_,1)):(_=Km(M),_.c(),O(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!M[0].primaryKey&&(!M[8]||!M[11].includes(M[0].name))),r?y?(y.p(M,L),L[0]&257&&O(y,1)):(y=Jm(M),y.c(),O(y,1),y.m(l,a)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),L[0]&257&&(u=!M[8]||!M[12].includes(M[0].name)),u?S?(S.p(M,L),L[0]&257&&O(S,1)):(S=Zm(M),S.c(),O(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),$&&$.p&&(!m||L[0]&268435648)&&Pt($,T,M,M[28],m?At(T,M[28],L,jO):Nt(M[28]),jm),!M[0]._toDelete&&!M[0].primaryKey?E?(E.p(M,L),L[0]&1&&O(E,1)):(E=Gm(M),E.c(),O(E,1),E.m(l,null)):E&&(re(),D(E,1,1,()=>{E=null}),ae())},i(M){m||(O(g,M),O(_),O(y),O(S),O($,M),O(E),M&&nt(()=>{m&&(d||(d=ze(e,wt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(M){D(g,M),D(_),D(y),D(S),D($,M),D(E),M&&(d||(d=ze(e,wt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(M){M&&k(e),g&&g.d(M),_&&_.d(),y&&y.d(),S&&S.d(),$&&$.d(M),E&&E.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:[KO,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function KO(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=Y(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){v(m,e,h),e.checked=n[0].required,v(m,i,h),v(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[B(e,"change",n[24]),Me(u=He.call(null,a,{text:`Requires the field value NOT to be ${z.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&&ue(o,m[5]),u&&Rt(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${z.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(k(e),k(i),k(l)),c=!1,De(d)}}}function Jm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[JO,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function JO(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){v(c,e,d),e.checked=n[0].hidden,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[25]),B(e,"change",n[26]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function Zm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[ZO,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function ZO(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){v(m,e,h),e.checked=n[0].presentable,v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[B(e,"change",n[27]),Me(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&&(k(e),k(l),k(s)),c=!1,De(d)}}}function Gm(n){let e,t,i,l,s,o,r;return o=new Hn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[GO]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),H(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){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),F(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||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(o)}}}function Xm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",tt(n[13])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function GO(n){let e,t,i,l,s,o=!n[0].system&&Xm(n);return{c(){e=b("button"),e.innerHTML='<span class="txt">Duplicate</span>',t=C(),o&&o.c(),i=ge(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){v(r,e,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l||(s=B(e,"click",tt(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&&(k(e),k(t),k(i)),o&&o.d(r),l=!1,s()}}}function XO(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:[VO]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Um),m=d||BO();function h(S,T){if(S[0]._toDelete)return YO;if(S[7])return WO}let g=h(n),_=g&&g(n),y=n[7]&&n[4]&&Ym(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),H(l.$$.fragment),s=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[7]&&n[4]),x(e,"deleted",n[0]._toDelete)},m(S,T){v(S,e,T),w(e,t),f&&f.m(t,null),w(t,i),F(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),y&&y.m(e,null),u=!0},p(S,T){S[7]&&S[2]?f||(f=Vm(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const $={};T[0]&128&&($.class="form-field required m-0 "+(S[7]?"":"disabled")),T[0]&2&&($.name="fields."+S[1]+".name"),T[0]&268435625&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!u||T[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],T,UO):Nt(S[28]),Um),g===(g=h(S))&&_?_.p(S,T):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?y?(y.p(S,T),T[0]&144&&O(y,1)):(y=Ym(S),y.c(),O(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),(!u||T[0]&1)&&x(e,"required",S[0].required),(!u||T[0]&144)&&x(e,"expanded",S[7]&&S[4]),(!u||T[0]&1)&&x(e,"deleted",S[0]._toDelete)},i(S){u||(O(l.$$.fragment,S),O(m,S),O(y),S&&nt(()=>{u&&(a||(a=ze(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(y),S&&(a||(a=ze(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),q(l),m&&m.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Sa=[];function QO(n,e,t){let i,l,s,o,r;Qe(n,Sn,Se=>t(19,r=Se));let{$$slots:a={},$$scope:u}=e;const f="f_"+z.randomString(8),c=gt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:y=z.initSchemaField()}=e,{draggable:S=!0}=e,{collection:T={}}=e,$,E=!1;function M(){y.id?t(0,y._toDelete=!0,y):(R(),c("remove"))}function L(){t(0,y._toDelete=!1,y),Wt({})}function I(){y._toDelete||(R(),c("duplicate"))}function A(Se){return z.slugify(Se)}function P(){t(4,E=!0),U()}function R(){t(4,E=!1)}function N(){E?R():P()}function U(){for(let Se of Sa)Se.id!=f&&Se.collapse()}Yt(()=>(Sa.push({id:f,collapse:R}),y.onMountSelect&&(t(0,y.onMountSelect=!1,y),$==null||$.select()),()=>{z.removeByKey(Sa,"id",f)}));const j=()=>$==null?void 0:$.focus();function V(Se){ie[Se?"unshift":"push"](()=>{$=Se,t(3,$)})}const K=Se=>{const ke=y.name;t(0,y.name=A(Se.target.value),y),Se.target.value=y.name,c("rename",{oldName:ke,newName:y.name})};function J(){y.required=this.checked,t(0,y)}function ee(){y.hidden=this.checked,t(0,y)}const X=Se=>{Se.target.checked&&t(0,y.presentable=!1,y)};function oe(){y.presentable=this.checked,t(0,y)}return n.$$set=Se=>{"key"in Se&&t(1,_=Se.key),"field"in Se&&t(0,y=Se.field),"draggable"in Se&&t(2,S=Se.draggable),"collection"in Se&&t(18,T=Se.collection),"$$scope"in Se&&t(28,u=Se.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=(T==null?void 0:T.type)=="auth"),n.$$.dirty[0]&1&&y._toDelete&&y._originalName&&y.name!==y._originalName&&t(0,y.name=y._originalName,y),n.$$.dirty[0]&1&&!y._originalName&&y.name&&t(0,y._originalName=y.name,y),n.$$.dirty[0]&1&&typeof y._toDelete>"u"&&t(0,y._toDelete=!1,y),n.$$.dirty[0]&1&&y.required&&t(0,y.nullable=!1,y),n.$$.dirty[0]&1&&t(7,l=!y._toDelete),n.$$.dirty[0]&524290&&t(6,s=!z.isEmpty(z.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[y==null?void 0:y.type]||"Nonempty")},[y,_,S,$,E,o,s,l,i,c,m,h,g,M,L,I,A,N,T,r,a,j,V,K,J,ee,X,oe,u]}class ei extends ye{constructor(e){super(),be(this,e,QO,XO,_e,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function xO(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 xn({props:a}),ie.push(()=>ve(t,"keyOfSelected",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){v(u,e,f),F(t,e,null),l=!0,s||(o=Me(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],$e(()=>i=!1)),t.$set(c)},i(u){l||(O(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),q(t),s=!1,o()}}}function eE(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:[xO,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),F(i,r,a),v(r,l,a),v(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||(O(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),q(i,r)}}}function tE(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[eE,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(l,[a&2&&{key:r[1]},a&16&&Ft(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}const Ta=1,$a=2,Ca=3;function nE(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(_){switch(_){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(_){a=_,t(2,a)}function d(_){o=_,t(0,o)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Ut(_)),t(4,l=lt(e,i)),"field"in _&&t(0,o=_.field),"key"in _&&t(1,r=_.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,g]}class iE extends ye{constructor(e){super(),be(this,e,nE,tE,_e,{field:0,key:1})}}function lE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function sE(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){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},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 oE extends ye{constructor(e){super(),be(this,e,sE,lE,_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},eo={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},In=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Kn=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 Jo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function nk(n,e){if(e(n))return n;if(n.parentNode)return nk(n.parentNode,e)}function Zo(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 jn(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]},rE={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*Kn(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})"},Hs={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[Hs.w(n,e,t)]},F:function(n,e,t){return Cr(Hs.n(n,e,t)-1,!1,e)},G:function(n,e,t){return In(Hs.h(n,e,t))},H:function(n){return In(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[Kn(n.getHours()>11)]},M:function(n,e){return Cr(n.getMonth(),!0,e)},S:function(n){return In(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return In(n.getFullYear(),4)},d:function(n){return In(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return In(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return In(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)}},ik=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?eo: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 Hs[c]&&m[d-1]!=="\\"?Hs[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?eo: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,y=0,S="";_<d.length;_++){var T=d[_],$=T==="\\",E=d[_-1]==="\\"||$;if(Sl[T]&&!E){S+=Sl[T];var M=new RegExp(S).exec(s);M&&(h=!0)&&g[T!=="Y"?"push":"unshift"]({fn:rE[T],val:M[++y]})}else $||(S+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),g.forEach(function(L){var I=L.fn,A=L.val;return f=I(f,A,u)||f}),f=h?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function zn(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var aE=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Da=function(n,e,t){return n*3600+e*60+t},uE=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},fE={DAY:864e5};function Ia(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var l=n.minDate.getHours(),s=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<l&&(e=l),e===l&&t<s&&(t=s),e===l&&t===s&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},l=0,s=e;l<s.length;l++){var o=s[l];i(o)}return n});var bn=function(){return bn=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(n[l]=e[l])}return n},bn.apply(this,arguments)},xm=function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),l=0,e=0;e<t;e++)for(var s=arguments[e],o=0,r=s.length;o<r;o++,l++)i[l]=s[o];return i},cE=300;function dE(n,e){var t={config:bn(bn({},es),en.defaultConfig),l10n:eo};t.parseDate=au({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=ut,t.changeMonth=Se,t.changeYear=Be,t.clear=ke,t.close=Ce,t.onMouseOver=Te,t._createElement=$t,t.createDay=M,t.destroy=We,t.isEnabled=rt,t.jumpToDate=S,t.updateValue=Mn,t.open=ot,t.redraw=qt,t.set=Gt,t.setDate=hn,t.toggle=rl;function i(){t.utils={getDaysInMonth:function(Z,Q){return Z===void 0&&(Z=t.currentMonth),Q===void 0&&(Q=t.currentYear),Z===1&&(Q%4===0&&Q%100!==0||Q%400===0)?29:t.l10n.daysInMonth[Z]}}}function l(){t.element=t.input=n,t.isOpen=!1,Ve(),Oe(),bt(),Ci(),i(),t.isMobile||E(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Mn(!1)),r();var Z=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&Z&&ut(),It("onReady")}function s(){var Z;return((Z=t.calendarContainer)===null||Z===void 0?void 0:Z.getRootNode()).activeElement||document.activeElement}function o(Z){return Z.bind(t)}function r(){var Z=t.config;Z.weekNumbers===!1&&Z.showMonths===1||Z.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var Q=(t.days.offsetWidth+1)*Z.showMonths;t.daysContainer.style.width=Q+"px",t.calendarContainer.style.width=Q+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(Z){if(t.selectedDates.length===0){var Q=t.config.minDate===void 0||zn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),se=Ia(t.config);Q.setHours(se.hours,se.minutes,se.seconds,Q.getMilliseconds()),t.selectedDates=[Q],t.latestSelectedDateObj=Q}Z!==void 0&&Z.type!=="blur"&&cl(Z);var he=t._input.value;c(),Mn(),t._input.value!==he&&t._debouncedChange()}function u(Z,Q){return Z%12+12*Kn(Q===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,Q=(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&&zn(t.latestSelectedDateObj,t.config.minDate,!0)===0,qe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&zn(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()),Ee=Da(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Re=Da(Z,Q,se);if(Re>Ee&&Re<le){var Ke=uE(le);Z=Ke[0],Q=Ke[1],se=Ke[2]}}else{if(qe){var Ae=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;Z=Math.min(Z,Ae.getHours()),Z===Ae.getHours()&&(Q=Math.min(Q,Ae.getMinutes())),Q===Ae.getMinutes()&&(se=Math.min(se,Ae.getSeconds()))}if(he){var Ge=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;Z=Math.max(Z,Ge.getHours()),Z===Ge.getHours()&&Q<Ge.getMinutes()&&(Q=Ge.getMinutes()),Q===Ge.getMinutes()&&(se=Math.max(se,Ge.getSeconds()))}}m(Z,Q,se)}}function d(Z){var Q=Z||t.latestSelectedDateObj;Q&&Q instanceof Date&&m(Q.getHours(),Q.getMinutes(),Q.getSeconds())}function m(Z,Q,se){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(Z%24,Q,se||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=In(t.config.time_24hr?Z:(12+Z)%12+12*Kn(Z%12===0)),t.minuteElement.value=In(Q),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Kn(Z>=12)]),t.secondElement!==void 0&&(t.secondElement.value=In(se)))}function h(Z){var Q=jn(Z),se=parseInt(Q.value)+(Z.delta||0);(se/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(se.toString()))&&Be(se)}function g(Z,Q,se,he){if(Q instanceof Array)return Q.forEach(function(qe){return g(Z,qe,se,he)});if(Z instanceof Array)return Z.forEach(function(qe){return g(qe,Q,se,he)});Z.addEventListener(Q,se,he),t._handlers.push({remove:function(){return Z.removeEventListener(Q,se,he)}})}function _(){It("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(se){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+se+"]"),function(he){return g(he,"click",t[se])})}),t.isMobile){sn();return}var Z=Qm(Ze,50);if(t._debouncedChange=Qm(_,cE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(se){t.config.mode==="range"&&Te(jn(se))}),g(t._input,"keydown",Ht),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Ht),!t.config.inline&&!t.config.static&&g(window,"resize",Z),window.ontouchstart!==void 0?g(window.document,"touchstart",et):g(window.document,"mousedown",et),g(window.document,"focus",et,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Rl),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",Fe)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Q=function(se){return jn(se).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],Q),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(se){a(se)})}t.config.allowInput&&g(t._input,"blur",at)}function S(Z,Q){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.maxDate<t.now?t.config.maxDate:t.now),he=t.currentYear,qe=t.currentMonth;try{se!==void 0&&(t.currentYear=se.getFullYear(),t.currentMonth=se.getMonth())}catch(le){le.message="Invalid date supplied: "+se,t.config.errorHandler(le)}Q&&t.currentYear!==he&&(It("onYearChange"),U()),Q&&(t.currentYear!==he||t.currentMonth!==qe)&&It("onMonthChange"),t.redraw()}function T(Z){var Q=jn(Z);~Q.className.indexOf("arrow")&&$(Z,Q.classList.contains("arrowUp")?1:-1)}function $(Z,Q,se){var he=Z&&jn(Z),qe=se||he&&he.parentNode&&he.parentNode.firstChild,le=al("increment");le.delta=Q,qe&&qe.dispatchEvent(le)}function E(){var Z=window.document.createDocumentFragment();if(t.calendarContainer=$t("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(Z.appendChild(K()),t.innerContainer=$t("div","flatpickr-innerContainer"),t.config.weekNumbers){var Q=oe(),se=Q.weekWrapper,he=Q.weekNumbers;t.innerContainer.appendChild(se),t.weekNumbers=he,t.weekWrapper=se}t.rContainer=$t("div","flatpickr-rContainer"),t.rContainer.appendChild(ee()),t.daysContainer||(t.daysContainer=$t("div","flatpickr-days"),t.daysContainer.tabIndex=-1),N(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),Z.appendChild(t.innerContainer)}t.config.enableTime&&Z.appendChild(J()),$n(t.calendarContainer,"rangeMode",t.config.mode==="range"),$n(t.calendarContainer,"animate",t.config.animate===!0),$n(t.calendarContainer,"multiMonth",t.config.showMonths>1),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,Q,se,he){var qe=rt(Q,!0),le=$t("span",Z,Q.getDate().toString());return le.dateObj=Q,le.$i=he,le.setAttribute("aria-label",t.formatDate(Q,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&zn(Q,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),qe?(le.tabIndex=-1,ul(Q)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&($n(le,"startRange",t.selectedDates[0]&&zn(Q,t.selectedDates[0],!0)===0),$n(le,"endRange",t.selectedDates[1]&&zn(Q,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Hi(Q)&&!ul(Q)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&he%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(Q)+"</span>"),It("onDayCreate",le),le}function L(Z){Z.focus(),t.config.mode==="range"&&Te(Z)}function I(Z){for(var Q=Z>0?0:t.config.showMonths-1,se=Z>0?t.config.showMonths:-1,he=Q;he!=se;he+=Z)for(var qe=t.daysContainer.children[he],le=Z>0?0:qe.children.length-1,Ee=Z>0?qe.children.length:-1,Re=le;Re!=Ee;Re+=Z){var Ke=qe.children[Re];if(Ke.className.indexOf("hidden")===-1&&rt(Ke.dateObj))return Ke}}function A(Z,Q){for(var se=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,he=Q>0?t.config.showMonths:-1,qe=Q>0?1:-1,le=se-t.currentMonth;le!=he;le+=qe)for(var Ee=t.daysContainer.children[le],Re=se-t.currentMonth===le?Z.$i+Q:Q<0?Ee.children.length-1:0,Ke=Ee.children.length,Ae=Re;Ae>=0&&Ae<Ke&&Ae!=(Q>0?Ke:-1);Ae+=qe){var Ge=Ee.children[Ae];if(Ge.className.indexOf("hidden")===-1&&rt(Ge.dateObj)&&Math.abs(Z.$i-Ae)>=Math.abs(Q))return L(Ge)}t.changeMonth(qe),P(I(qe),0)}function P(Z,Q){var se=s(),he=Je(se||document.body),qe=Z!==void 0?Z:he?se:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:I(Q>0?1:-1);qe===void 0?t._input.focus():he?A(qe,Q):L(qe)}function R(Z,Q){for(var se=(new Date(Z,Q,1).getDay()-t.l10n.firstDayOfWeek+7)%7,he=t.utils.getDaysInMonth((Q-1+12)%12,Z),qe=t.utils.getDaysInMonth(Q,Z),le=window.document.createDocumentFragment(),Ee=t.config.showMonths>1,Re=Ee?"prevMonthDay hidden":"prevMonthDay",Ke=Ee?"nextMonthDay hidden":"nextMonthDay",Ae=he+1-se,Ge=0;Ae<=he;Ae++,Ge++)le.appendChild(M("flatpickr-day "+Re,new Date(Z,Q-1,Ae),Ae,Ge));for(Ae=1;Ae<=qe;Ae++,Ge++)le.appendChild(M("flatpickr-day",new Date(Z,Q,Ae),Ae,Ge));for(var ft=qe+1;ft<=42-se&&(t.config.showMonths===1||Ge%7!==0);ft++,Ge++)le.appendChild(M("flatpickr-day "+Ke,new Date(Z,Q+1,ft%qe),ft,Ge));var Xt=$t("div","dayContainer");return Xt.appendChild(le),Xt}function N(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var Z=document.createDocumentFragment(),Q=0;Q<t.config.showMonths;Q++){var se=new Date(t.currentYear,t.currentMonth,1);se.setMonth(t.currentMonth+Q),Z.appendChild(R(se.getFullYear(),se.getMonth()))}t.daysContainer.appendChild(Z),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Te()}}function U(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var Z=function(he){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&he<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&he>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var Q=0;Q<12;Q++)if(Z(Q)){var se=$t("option","flatpickr-monthDropdown-month");se.value=new Date(t.currentYear,Q).getMonth().toString(),se.textContent=Cr(Q,t.config.shorthandCurrentMonth,t.l10n),se.tabIndex=-1,t.currentMonth===Q&&(se.selected=!0),t.monthsDropdownContainer.appendChild(se)}}}function j(){var Z=$t("div","flatpickr-month"),Q=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),g(t.monthsDropdownContainer,"change",function(Ee){var Re=jn(Ee),Ke=parseInt(Re.value,10);t.changeMonth(Ke-t.currentMonth),It("onMonthChange")}),U(),se=t.monthsDropdownContainer);var he=Zo("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),Q.appendChild(le),Z.appendChild(Q),{container:Z,yearElement:qe,monthElement:se}}function V(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var Q=j();t.yearElements.push(Q.yearElement),t.monthElements.push(Q.monthElement),t.monthNav.appendChild(Q.container)}t.monthNav.appendChild(t.nextMonthNav)}function K(){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,V(),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],ji(),t.monthNav}function J(){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 Q=$t("span","flatpickr-time-separator",":"),se=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=se.getElementsByTagName("input")[0];var he=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=he.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=In(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=In(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(Q),t.timeContainer.appendChild(he),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var qe=Zo("flatpickr-second");t.secondElement=qe.getElementsByTagName("input")[0],t.secondElement.value=In(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[Kn((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 ee(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=$t("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var Q=$t("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Q)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,Q=xm(t.l10n.weekdays.shorthand);Z>0&&Z<Q.length&&(Q=xm(Q.splice(Z,Q.length),Q.splice(0,Z)));for(var se=t.config.showMonths;se--;)t.weekdayContainer.children[se].innerHTML=`
       <span class='flatpickr-weekday'>
         `+Q.join("</span><span class='flatpickr-weekday'>")+`
       </span>
-      `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var Z=$t("div","flatpickr-weekwrapper");Z.appendChild($t("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Q=$t("div","flatpickr-weeks");return Z.appendChild(Q),{weekWrapper:Z,weekNumbers:Q}}function Se(Z,Q){Q===void 0&&(Q=!0);var se=Q?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,It("onYearChange"),U()),N(),It("onMonthChange"),ji())}function ke(Z,Q){if(Z===void 0&&(Z=!0),Q===void 0&&(Q=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Q===!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&&It("onChange")}function Ce(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),It("onClose")}function We(){t.config!==void 0&&It("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 Q=t.calendarContainer.parentNode;if(Q.lastChild&&Q.removeChild(Q.lastChild),Q.parentNode){for(;Q.firstChild;)Q.parentNode.insertBefore(Q.firstChild,Q);Q.parentNode.removeChild(Q)}}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 st(Z){return t.calendarContainer.contains(Z)}function et(Z){if(t.isOpen&&!t.config.inline){var Q=jn(Z),se=st(Q),he=Q===t.input||Q===t.altInput||t.element.contains(Q)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),qe=!he&&!se&&!st(Z.relatedTarget),le=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(Q)});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 Be(Z){if(!(!Z||t.config.minDate&&Z<t.config.minDate.getFullYear()||t.config.maxDate&&Z>t.config.maxDate.getFullYear())){var Q=Z,se=t.currentYear!==Q;t.currentYear=Q||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(),It("onYearChange"),U())}}function rt(Z,Q){var se;Q===void 0&&(Q=!0);var he=t.parseDate(Z,void 0,Q);if(t.config.minDate&&he&&zn(he,t.config.minDate,Q!==void 0?Q:!t.minDateHasTime)<0||t.config.maxDate&&he&&zn(he,t.config.maxDate,Q!==void 0?Q:!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,Ee=0,Re=void 0;Ee<le.length;Ee++){if(Re=le[Ee],typeof Re=="function"&&Re(he))return qe;if(Re instanceof Date&&he!==void 0&&Re.getTime()===he.getTime())return qe;if(typeof Re=="string"){var Ke=t.parseDate(Re,void 0,!0);return Ke&&Ke.getTime()===he.getTime()?qe:!qe}else if(typeof Re=="object"&&he!==void 0&&Re.from&&Re.to&&he.getTime()>=Re.from.getTime()&&he.getTime()<=Re.to.getTime())return qe}return!qe}function Je(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 Q=Z.target===t._input,se=t._input.value.trimEnd()!==fl();Q&&se&&!(Z.relatedTarget&&st(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ht(Z){var Q=jn(Z),se=t.config.wrap?n.contains(Q):Q===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,Q===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Q.blur();t.open()}else if(st(Q)||qe||le){var Ee=!!t.timeContainer&&t.timeContainer.contains(Q);switch(Z.keyCode){case 13:Ee?(Z.preventDefault(),a(),Zt()):Fe(Z);break;case 27:Z.preventDefault(),Zt();break;case 8:case 46:se&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Ee&&!se){Z.preventDefault();var Re=s();if(t.daysContainer!==void 0&&(he===!1||Re&&Je(Re))){var Ke=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),Se(Ke),P(I(1),0)):P(void 0,Ke)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Ae=Z.keyCode===40?1:-1;t.daysContainer&&Q.$i!==void 0||Q===t.input||Q===t.altInput?Z.ctrlKey?(Z.stopPropagation(),Be(t.currentYear-Ae),P(I(1),0)):Ee||P(void 0,Ae*7):Q===t.currentYearElement?Be(t.currentYear-Ae):t.config.enableTime&&(!Ee&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Ee){var Ge=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(_n){return _n}),ft=Ge.indexOf(Q);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(Q)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Q===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(),Mn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Mn();break}(se||st(Q))&&It("onKeyDown",Z)}function Te(Z,Q){if(Q===void 0&&(Q="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(Q)||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()),Ee=!1,Re=0,Ke=0,Ae=qe;Ae<le;Ae+=fE.DAY)rt(new Date(Ae),!0)||(Ee=Ee||Ae>qe&&Ae<le,Ae<he&&(!Re||Ae>Re)?Re=Ae:Ae>he&&(!Ke||Ae<Ke)&&(Ke=Ae));var Ge=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+Q));Ge.forEach(function(ft){var Xt=ft.dateObj,_n=Xt.getTime(),dl=Re>0&&_n<Re||Ke>0&&_n>Ke;if(dl){ft.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Oi){ft.classList.remove(Oi)});return}else if(Ee&&!dl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Oi){ft.classList.remove(Oi)}),Z!==void 0&&(Z.classList.add(se<=t.selectedDates[0].getTime()?"startRange":"endRange"),he<se&&_n===he?ft.classList.add("startRange"):he>se&&_n===he&&ft.classList.add("endRange"),_n>=Re&&(Ke===0||_n<=Ke)&&aE(_n,he,se)&&ft.classList.add("inRange"))})}}function Ze(){t.isOpen&&!t.config.static&&!t.config.inline&&ut()}function ot(Z,Q){if(Q===void 0&&(Q=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var se=jn(Z);se&&se.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),It("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"),It("onOpen"),ut(Q)),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 Le(Z){return function(Q){var se=t.config["_"+Z+"Date"]=t.parseDate(Q,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),Mn()),t.daysContainer&&(qt(),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 Ve(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Q=bn(bn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),se={};t.config.parseDate=Q.parseDate,t.config.formatDate=Q.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ge){t.config._enable=pi(Ge)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ge){t.config._disable=pi(Ge)}});var he=Q.mode==="time";if(!Q.dateFormat&&(Q.enableTime||he)){var qe=en.defaultConfig.dateFormat||es.dateFormat;se.dateFormat=Q.noCalendar||he?"H:i"+(Q.enableSeconds?":S":""):qe+" H:i"+(Q.enableSeconds?":S":"")}if(Q.altInput&&(Q.enableTime||he)&&!Q.altFormat){var le=en.defaultConfig.altFormat||es.altFormat;se.altFormat=Q.noCalendar||he?"h:i"+(Q.enableSeconds?":S K":" K"):le+(" h:i"+(Q.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Le("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Le("max")});var Ee=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:Ee("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ee("max")}),Q.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,se,Q);for(var Re=0;Re<Z.length;Re++)t.config[Z[Re]]=t.config[Z[Re]]===!0||t.config[Z[Re]]==="true";Oa.filter(function(Ge){return t.config[Ge]!==void 0}).forEach(function(Ge){t.config[Ge]=Ea(t.config[Ge]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Re=0;Re<t.config.plugins.length;Re++){var Ke=t.config.plugins[Re](t)||{};for(var Ae in Ke)Oa.indexOf(Ae)>-1?t.config[Ae]=Ea(Ke[Ae]).map(o).concat(t.config[Ae]):typeof Q[Ae]>"u"&&(t.config[Ae]=Ke[Ae])}Q.altInputClass||(t.config.altInputClass=we().className+" "+t.config.altInputClass),It("onParseConfig")}function we(){return t.config.wrap?n.querySelector("[data-input]"):n}function Oe(){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=bn(bn({},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=bn(bn({},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=ik(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){It("onPreCalendarPosition");var Q=Z||t._positionElement,se=Array.prototype.reduce.call(t.calendarContainer.children,function(hs,Vr){return hs+Vr.offsetHeight},0),he=t.calendarContainer.offsetWidth,qe=t.config.position.split(" "),le=qe[0],Ee=qe.length>1?qe[1]:null,Re=Q.getBoundingClientRect(),Ke=window.innerHeight-Re.bottom,Ae=le==="above"||le!=="below"&&Ke<se&&Re.top>se,Ge=window.pageYOffset+Re.top+(Ae?-se-2:Q.offsetHeight+2);if($n(t.calendarContainer,"arrowTop",!Ae),$n(t.calendarContainer,"arrowBottom",Ae),!t.config.inline){var ft=window.pageXOffset+Re.left,Xt=!1,_n=!1;Ee==="center"?(ft-=(he-Re.width)/2,Xt=!0):Ee==="right"&&(ft-=he-Re.width,_n=!0),$n(t.calendarContainer,"arrowLeft",!Xt&&!_n),$n(t.calendarContainer,"arrowCenter",Xt),$n(t.calendarContainer,"arrowRight",_n);var dl=window.document.body.offsetWidth-(window.pageXOffset+Re.right),Oi=ft+he>window.document.body.offsetWidth,go=dl+he>window.document.body.offsetWidth;if($n(t.calendarContainer,"rightMost",Oi),!t.config.static)if(t.calendarContainer.style.top=Ge+"px",!Oi)t.calendarContainer.style.left=ft+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=dl+"px";else{var Fl=Ne();if(Fl===void 0)return;var bo=window.document.body.offsetWidth,ms=Math.max(0,bo/2-he/2),Ei=".flatpickr-calendar.centerMost:before",pl=".flatpickr-calendar.centerMost:after",ml=Fl.cssRules.length,ql="{left:"+Re.left+"px;right:auto;}";$n(t.calendarContainer,"rightMost",!1),$n(t.calendarContainer,"centerMost",!0),Fl.insertRule(Ei+","+pl+ql,ml),t.calendarContainer.style.left=ms+"px",t.calendarContainer.style.right="auto"}}}}function Ne(){for(var Z=null,Q=0;Q<document.styleSheets.length;Q++){var se=document.styleSheets[Q];if(se.cssRules){try{se.cssRules}catch{continue}Z=se;break}}return Z??xe()}function xe(){var Z=document.createElement("style");return document.head.appendChild(Z),Z.sheet}function qt(){t.config.noCalendar||t.isMobile||(U(),ji(),N())}function Zt(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function Fe(Z){Z.preventDefault(),Z.stopPropagation();var Q=function(Ge){return Ge.classList&&Ge.classList.contains("flatpickr-day")&&!Ge.classList.contains("flatpickr-disabled")&&!Ge.classList.contains("notAllowed")},se=nk(jn(Z),Q);if(se!==void 0){var he=se,qe=t.latestSelectedDateObj=new Date(he.dateObj.getTime()),le=(qe.getMonth()<t.currentMonth||qe.getMonth()>t.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 Ee=ul(qe);Ee?t.selectedDates.splice(parseInt(Ee),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),zn(qe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ge,ft){return Ge.getTime()-ft.getTime()}));if(c(),le){var Re=t.currentYear!==qe.getFullYear();t.currentYear=qe.getFullYear(),t.currentMonth=qe.getMonth(),Re&&(It("onYearChange"),U()),It("onMonthChange")}if(ji(),N(),Mn(),!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 Ke=t.config.mode==="single"&&!t.config.enableTime,Ae=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ke||Ae)&&Zt()}_()}}var Dt={locale:[Oe,X],showMonths:[V,r,ee],minDate:[S],maxDate:[S],positionElement:[rn],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Gt(Z,Q){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var se in Z)Dt[se]!==void 0&&Dt[se].forEach(function(he){return he()})}else t.config[Z]=Q,Dt[Z]!==void 0?Dt[Z].forEach(function(he){return he()}):Oa.indexOf(Z)>-1&&(t.config[Z]=Ea(Q));t.redraw(),Mn(!0)}function mn(Z,Q){var se=[];if(Z instanceof Array)se=Z.map(function(he){return t.parseDate(he,Q)});else if(Z instanceof Date||typeof Z=="number")se=[t.parseDate(Z,Q)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":se=[t.parseDate(Z,Q)];break;case"multiple":se=Z.split(t.config.conjunction).map(function(he){return t.parseDate(he,Q)});break;case"range":se=Z.split(t.l10n.rangeSeparator).map(function(he){return t.parseDate(he,Q)});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 hn(Z,Q,se){if(Q===void 0&&(Q=!1),se===void 0&&(se=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(Q);mn(Z,se),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,Q),d(),t.selectedDates.length===0&&t.clear(!1),Mn(Q),Q&&It("onChange")}function pi(Z){return Z.slice().map(function(Q){return typeof Q=="string"||typeof Q=="number"||Q instanceof Date?t.parseDate(Q,void 0,!0):Q&&typeof Q=="object"&&Q.from&&Q.to?{from:t.parseDate(Q.from,void 0),to:t.parseDate(Q.to,void 0)}:Q}).filter(function(Q){return Q})}function Ci(){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&&mn(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()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>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 gt(){if(t.input=we(),!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"),rn()}function rn(){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{}g(t.mobileInput,"change",function(Q){t.setDate(jn(Q).value,!1,t.mobileFormatStr),It("onChange"),It("onClose")})}function rl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function It(Z,Q){if(t.config!==void 0){var se=t.config[Z];if(se!==void 0&&se.length>0)for(var he=0;se[he]&&he<se.length;he++)se[he](t.selectedDates,t.input.value,t,Q);Z==="onChange"&&(t.input.dispatchEvent(al("change")),t.input.dispatchEvent(al("input")))}}function al(Z){var Q=document.createEvent("Event");return Q.initEvent(Z,!0,!0),Q}function ul(Z){for(var Q=0;Q<t.selectedDates.length;Q++){var se=t.selectedDates[Q];if(se instanceof Date&&zn(se,Z)===0)return""+Q}return!1}function Hi(Z){return t.config.mode!=="range"||t.selectedDates.length<2?!1:zn(Z,t.selectedDates[0])>=0&&zn(Z,t.selectedDates[1])<=0}function ji(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,Q){var se=new Date(t.currentYear,t.currentMonth,1);se.setMonth(t.currentMonth+Q),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Q].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.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function fl(Z){var Q=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(se){return t.formatDate(se,Q)}).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 Mn(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&&It("onValueUpdate")}function Rl(Z){var Q=jn(Z),se=t.prevMonthNav.contains(Q),he=t.nextMonthNav.contains(Q);se||he?Se(se?-1:1):t.yearElements.indexOf(Q)>=0?Q.select():Q.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Q.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(Z){Z.preventDefault();var Q=Z.type==="keydown",se=jn(Z),he=se;t.amPM!==void 0&&se===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Kn(t.amPM.textContent===t.l10n.amPM[0])]);var qe=parseFloat(he.getAttribute("min")),le=parseFloat(he.getAttribute("max")),Ee=parseFloat(he.getAttribute("step")),Re=parseInt(he.value,10),Ke=Z.delta||(Q?Z.which===38?1:-1:0),Ae=Re+Ee*Ke;if(typeof he.value<"u"&&he.value.length===2){var Ge=he===t.hourElement,ft=he===t.minuteElement;Ae<qe?(Ae=le+Ae+Kn(!Ge)+(Kn(Ge)&&Kn(!t.amPM)),ft&&$(void 0,-1,t.hourElement)):Ae>le&&(Ae=he===t.hourElement?Ae-le-Kn(!t.amPM):qe,ft&&$(void 0,1,t.hourElement)),t.amPM&&Ge&&(Ee===1?Ae+Re===23:Math.abs(Ae-Re)>Ee)&&(t.amPM.textContent=t.l10n.amPM[Kn(t.amPM.textContent===t.l10n.amPM[0])]),he.value=In(Ae)}}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;l<t.length;l++){var s=t[l];try{if(s.getAttribute("data-fp-omit")!==null)continue;s._flatpickr!==void 0&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=dE(s,e||{}),i.push(s._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return ts(this,n)},HTMLElement.prototype.flatpickr=function(n){return ts([this],n)});var en=function(n,e){return typeof n=="string"?ts(window.document.querySelectorAll(n),e):n instanceof Node?ts([n],e):ts(n,e)};en.defaultConfig={};en.l10ns={en:bn({},eo),default:bn({},eo)};en.localize=function(n){en.l10ns.default=bn(bn({},en.l10ns.default),n)};en.setDefaults=function(n){en.defaultConfig=bn(bn({},en.defaultConfig),n)};en.parseDate=au({});en.formatDate=ik({});en.compareDates=zn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ts(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=en);function pE(n){let e,t=[n[1]],i={};for(let l=0;l<t.length;l+=1)i=je(i,t[l]);return{c(){e=b("input"),Xn(e,i)},m(l,s){v(l,e,s),e.autofocus&&e.focus(),n[11](e)},p(l,s){Xn(e,i=vt(t,[s&2&&l[1]]))},d(l){l&&k(e),n[11](null)}}}function mE(n){let e;const t=n[10].default,i=Lt(t,n,n[9],null),l=i||pE(n);return{c(){l&&l.c()},m(s,o){l&&l.m(s,o),e=!0},p(s,[o]){i?i.p&&(!e||o&512)&&Pt(i,t,s,s[9],e?At(t,s[9],o,null):Nt(s[9]),null):l&&l.p&&(!e||o&3)&&l.p(s,e?o:-1)},i(s){e||(O(l,s),e=!0)},o(s){D(l,s),e=!1},d(s){l&&l.d(s)}}}function hE(n){return n.charAt(2).toLowerCase()+n.substring(3)}function eh(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function th(n,e){return!!(n==e||n instanceof Date&&e instanceof Date&&n.valueOf()===e.valueOf()||Array.isArray(n)&&Array.isArray(e)&&n.length===e.length&&n.every((t,i)=>t===e[i]))}function _E(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:g=void 0}=e;Yt(()=>{const $=f??h,E=y(d);return E.onReady.push((M,L,I)=>{a===void 0&&S(M,L,I),fn().then(()=>{t(8,m=!0)})}),t(3,g=en($,Object.assign(E,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=_t();function y($={}){$=Object.assign({},$);for(const E of r){const M=(L,I,A)=>{_(hE(E),[L,I,A])};E in $?(Array.isArray($[E])||($[E]=[$[E]]),$[E].push(M)):$[E]=[M]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,E,M){const L=eh(M,$);!th(a,L)&&(a||L)&&t(2,a=L),t(4,u=E)}function T($){ie[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=je(je({},e),Ut($)),t(1,l=lt(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,g=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(th(a,eh(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[$,E]of Object.entries(y(d)))g.set($,E)},[h,l,a,g,u,f,c,d,m,o,s,T]}class tf extends ye{constructor(e){super(),be(this,e,_E,mE,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function gE(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:z.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(()=>ve(s,"value",u)),ie.push(()=>ve(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=Y("Min date (UTC)"),l=C(),H(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function bE(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:z.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(()=>ve(s,"value",u)),ie.push(()=>ve(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=Y("Max date (UTC)"),l=C(),H(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function yE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[gE,({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:[bE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),F(i,t,null),w(e,l),w(e,s),F(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||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function kE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[yE]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(l,[a&2&&{key:r[1]},a&32&&Ft(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function vE(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($,E){$.detail&&$.detail.length==3&&t(0,s[E]=$.detail[1],s)}function f($){r=$,t(2,r),t(0,s)}function c($){n.$$.not_equal(s.min,$)&&(s.min=$,t(0,s))}const d=$=>u($,"min");function m($){a=$,t(3,a),t(0,s)}function h($){n.$$.not_equal(s.max,$)&&(s.max=$,t(0,s))}const g=$=>u($,"max");function _($){s=$,t(0,s)}function y($){Pe.call(this,n,$)}function S($){Pe.call(this,n,$)}function T($){Pe.call(this,n,$)}return n.$$set=$=>{e=je(je({},e),Ut($)),t(5,l=lt(e,i)),"field"in $&&t(0,s=$.field),"key"in $&&t(1,o=$.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,_,y,S,T]}class wE extends ye{constructor(e){super(),be(this,e,vE,kE,_e,{field:0,key:1})}}function SE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(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&&(k(e),k(s),k(o)),u=!1,f()}}}function TE(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){v(c,e,d),e.checked=n[0].convertURLs,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[4]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function $E(n){let e,t,i,l;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[SE,({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:[TE,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(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||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function CE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[$E]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function OE(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){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},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 EE extends ye{constructor(e){super(),be(this,e,OE,CE,_e,{field:0,key:1})}}function ME(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<s.length;r+=1)o=je(o,s[r]);return{c(){e=b("input"),Xn(e,o)},m(r,a){v(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(l=B(e,"input",n[6]),i=!0)},p(r,[a]){Xn(e,o=vt(s,[a&32&&t!==(t=r[5].type||"text")&&{type:t},a&16&&e.value!==r[4]&&{value:r[4]},a&8&&{disabled:r[3]},a&4&&{readOnly:r[2]},a&32&&r[5]])),"value"in o&&(e.value=o.value)},i:te,o:te,d(r){r&&k(e),i=!1,l()}}}function DE(n,e,t){let i;const l=["value","separator","readonly","disabled"];let s=lt(e,l),{value:o=[]}=e,{separator:r=","}=e,{readonly:a=null}=e,{disabled:u=null}=e;const f=c=>{t(0,o=z.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},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=z.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class _o extends ye{constructor(e){super(),be(this,e,DE,ME,_e,{value:0,separator:1,readonly:2,disabled:3})}}function IE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[3](_)}let g={id:n[9],disabled:!z.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new _o({props:g}),ie.push(()=>ve(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),l=b("i"),o=C(),H(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(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),F(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(He.call(null,l,{text:`List of domains that are NOT allowed. 
+      `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var Z=$t("div","flatpickr-weekwrapper");Z.appendChild($t("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Q=$t("div","flatpickr-weeks");return Z.appendChild(Q),{weekWrapper:Z,weekNumbers:Q}}function Se(Z,Q){Q===void 0&&(Q=!0);var se=Q?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,It("onYearChange"),U()),N(),It("onMonthChange"),ji())}function ke(Z,Q){if(Z===void 0&&(Z=!0),Q===void 0&&(Q=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Q===!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&&It("onChange")}function Ce(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),It("onClose")}function We(){t.config!==void 0&&It("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 Q=t.calendarContainer.parentNode;if(Q.lastChild&&Q.removeChild(Q.lastChild),Q.parentNode){for(;Q.firstChild;)Q.parentNode.insertBefore(Q.firstChild,Q);Q.parentNode.removeChild(Q)}}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 st(Z){return t.calendarContainer.contains(Z)}function et(Z){if(t.isOpen&&!t.config.inline){var Q=jn(Z),se=st(Q),he=Q===t.input||Q===t.altInput||t.element.contains(Q)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),qe=!he&&!se&&!st(Z.relatedTarget),le=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(Q)});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 Be(Z){if(!(!Z||t.config.minDate&&Z<t.config.minDate.getFullYear()||t.config.maxDate&&Z>t.config.maxDate.getFullYear())){var Q=Z,se=t.currentYear!==Q;t.currentYear=Q||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(),It("onYearChange"),U())}}function rt(Z,Q){var se;Q===void 0&&(Q=!0);var he=t.parseDate(Z,void 0,Q);if(t.config.minDate&&he&&zn(he,t.config.minDate,Q!==void 0?Q:!t.minDateHasTime)<0||t.config.maxDate&&he&&zn(he,t.config.maxDate,Q!==void 0?Q:!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,Ee=0,Re=void 0;Ee<le.length;Ee++){if(Re=le[Ee],typeof Re=="function"&&Re(he))return qe;if(Re instanceof Date&&he!==void 0&&Re.getTime()===he.getTime())return qe;if(typeof Re=="string"){var Ke=t.parseDate(Re,void 0,!0);return Ke&&Ke.getTime()===he.getTime()?qe:!qe}else if(typeof Re=="object"&&he!==void 0&&Re.from&&Re.to&&he.getTime()>=Re.from.getTime()&&he.getTime()<=Re.to.getTime())return qe}return!qe}function Je(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 Q=Z.target===t._input,se=t._input.value.trimEnd()!==fl();Q&&se&&!(Z.relatedTarget&&st(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ht(Z){var Q=jn(Z),se=t.config.wrap?n.contains(Q):Q===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,Q===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Q.blur();t.open()}else if(st(Q)||qe||le){var Ee=!!t.timeContainer&&t.timeContainer.contains(Q);switch(Z.keyCode){case 13:Ee?(Z.preventDefault(),a(),Zt()):Fe(Z);break;case 27:Z.preventDefault(),Zt();break;case 8:case 46:se&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Ee&&!se){Z.preventDefault();var Re=s();if(t.daysContainer!==void 0&&(he===!1||Re&&Je(Re))){var Ke=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),Se(Ke),P(I(1),0)):P(void 0,Ke)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Ae=Z.keyCode===40?1:-1;t.daysContainer&&Q.$i!==void 0||Q===t.input||Q===t.altInput?Z.ctrlKey?(Z.stopPropagation(),Be(t.currentYear-Ae),P(I(1),0)):Ee||P(void 0,Ae*7):Q===t.currentYearElement?Be(t.currentYear-Ae):t.config.enableTime&&(!Ee&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Ee){var Ge=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(_n){return _n}),ft=Ge.indexOf(Q);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(Q)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Q===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(),Mn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Mn();break}(se||st(Q))&&It("onKeyDown",Z)}function Te(Z,Q){if(Q===void 0&&(Q="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(Q)||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()),Ee=!1,Re=0,Ke=0,Ae=qe;Ae<le;Ae+=fE.DAY)rt(new Date(Ae),!0)||(Ee=Ee||Ae>qe&&Ae<le,Ae<he&&(!Re||Ae>Re)?Re=Ae:Ae>he&&(!Ke||Ae<Ke)&&(Ke=Ae));var Ge=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+Q));Ge.forEach(function(ft){var Xt=ft.dateObj,_n=Xt.getTime(),dl=Re>0&&_n<Re||Ke>0&&_n>Ke;if(dl){ft.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Oi){ft.classList.remove(Oi)});return}else if(Ee&&!dl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Oi){ft.classList.remove(Oi)}),Z!==void 0&&(Z.classList.add(se<=t.selectedDates[0].getTime()?"startRange":"endRange"),he<se&&_n===he?ft.classList.add("startRange"):he>se&&_n===he&&ft.classList.add("endRange"),_n>=Re&&(Ke===0||_n<=Ke)&&aE(_n,he,se)&&ft.classList.add("inRange"))})}}function Ze(){t.isOpen&&!t.config.static&&!t.config.inline&&ut()}function ot(Z,Q){if(Q===void 0&&(Q=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var se=jn(Z);se&&se.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),It("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"),It("onOpen"),ut(Q)),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 Le(Z){return function(Q){var se=t.config["_"+Z+"Date"]=t.parseDate(Q,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),Mn()),t.daysContainer&&(qt(),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 Ve(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Q=bn(bn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),se={};t.config.parseDate=Q.parseDate,t.config.formatDate=Q.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ge){t.config._enable=pi(Ge)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ge){t.config._disable=pi(Ge)}});var he=Q.mode==="time";if(!Q.dateFormat&&(Q.enableTime||he)){var qe=en.defaultConfig.dateFormat||es.dateFormat;se.dateFormat=Q.noCalendar||he?"H:i"+(Q.enableSeconds?":S":""):qe+" H:i"+(Q.enableSeconds?":S":"")}if(Q.altInput&&(Q.enableTime||he)&&!Q.altFormat){var le=en.defaultConfig.altFormat||es.altFormat;se.altFormat=Q.noCalendar||he?"h:i"+(Q.enableSeconds?":S K":" K"):le+(" h:i"+(Q.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Le("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Le("max")});var Ee=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:Ee("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ee("max")}),Q.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,se,Q);for(var Re=0;Re<Z.length;Re++)t.config[Z[Re]]=t.config[Z[Re]]===!0||t.config[Z[Re]]==="true";Oa.filter(function(Ge){return t.config[Ge]!==void 0}).forEach(function(Ge){t.config[Ge]=Ea(t.config[Ge]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Re=0;Re<t.config.plugins.length;Re++){var Ke=t.config.plugins[Re](t)||{};for(var Ae in Ke)Oa.indexOf(Ae)>-1?t.config[Ae]=Ea(Ke[Ae]).map(o).concat(t.config[Ae]):typeof Q[Ae]>"u"&&(t.config[Ae]=Ke[Ae])}Q.altInputClass||(t.config.altInputClass=we().className+" "+t.config.altInputClass),It("onParseConfig")}function we(){return t.config.wrap?n.querySelector("[data-input]"):n}function Oe(){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=bn(bn({},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=bn(bn({},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=ik(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){It("onPreCalendarPosition");var Q=Z||t._positionElement,se=Array.prototype.reduce.call(t.calendarContainer.children,function(hs,Vr){return hs+Vr.offsetHeight},0),he=t.calendarContainer.offsetWidth,qe=t.config.position.split(" "),le=qe[0],Ee=qe.length>1?qe[1]:null,Re=Q.getBoundingClientRect(),Ke=window.innerHeight-Re.bottom,Ae=le==="above"||le!=="below"&&Ke<se&&Re.top>se,Ge=window.pageYOffset+Re.top+(Ae?-se-2:Q.offsetHeight+2);if($n(t.calendarContainer,"arrowTop",!Ae),$n(t.calendarContainer,"arrowBottom",Ae),!t.config.inline){var ft=window.pageXOffset+Re.left,Xt=!1,_n=!1;Ee==="center"?(ft-=(he-Re.width)/2,Xt=!0):Ee==="right"&&(ft-=he-Re.width,_n=!0),$n(t.calendarContainer,"arrowLeft",!Xt&&!_n),$n(t.calendarContainer,"arrowCenter",Xt),$n(t.calendarContainer,"arrowRight",_n);var dl=window.document.body.offsetWidth-(window.pageXOffset+Re.right),Oi=ft+he>window.document.body.offsetWidth,go=dl+he>window.document.body.offsetWidth;if($n(t.calendarContainer,"rightMost",Oi),!t.config.static)if(t.calendarContainer.style.top=Ge+"px",!Oi)t.calendarContainer.style.left=ft+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=dl+"px";else{var Fl=Ne();if(Fl===void 0)return;var bo=window.document.body.offsetWidth,ms=Math.max(0,bo/2-he/2),Ei=".flatpickr-calendar.centerMost:before",pl=".flatpickr-calendar.centerMost:after",ml=Fl.cssRules.length,ql="{left:"+Re.left+"px;right:auto;}";$n(t.calendarContainer,"rightMost",!1),$n(t.calendarContainer,"centerMost",!0),Fl.insertRule(Ei+","+pl+ql,ml),t.calendarContainer.style.left=ms+"px",t.calendarContainer.style.right="auto"}}}}function Ne(){for(var Z=null,Q=0;Q<document.styleSheets.length;Q++){var se=document.styleSheets[Q];if(se.cssRules){try{se.cssRules}catch{continue}Z=se;break}}return Z??xe()}function xe(){var Z=document.createElement("style");return document.head.appendChild(Z),Z.sheet}function qt(){t.config.noCalendar||t.isMobile||(U(),ji(),N())}function Zt(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function Fe(Z){Z.preventDefault(),Z.stopPropagation();var Q=function(Ge){return Ge.classList&&Ge.classList.contains("flatpickr-day")&&!Ge.classList.contains("flatpickr-disabled")&&!Ge.classList.contains("notAllowed")},se=nk(jn(Z),Q);if(se!==void 0){var he=se,qe=t.latestSelectedDateObj=new Date(he.dateObj.getTime()),le=(qe.getMonth()<t.currentMonth||qe.getMonth()>t.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 Ee=ul(qe);Ee?t.selectedDates.splice(parseInt(Ee),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),zn(qe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ge,ft){return Ge.getTime()-ft.getTime()}));if(c(),le){var Re=t.currentYear!==qe.getFullYear();t.currentYear=qe.getFullYear(),t.currentMonth=qe.getMonth(),Re&&(It("onYearChange"),U()),It("onMonthChange")}if(ji(),N(),Mn(),!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 Ke=t.config.mode==="single"&&!t.config.enableTime,Ae=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ke||Ae)&&Zt()}_()}}var Dt={locale:[Oe,X],showMonths:[V,r,ee],minDate:[S],maxDate:[S],positionElement:[rn],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Gt(Z,Q){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var se in Z)Dt[se]!==void 0&&Dt[se].forEach(function(he){return he()})}else t.config[Z]=Q,Dt[Z]!==void 0?Dt[Z].forEach(function(he){return he()}):Oa.indexOf(Z)>-1&&(t.config[Z]=Ea(Q));t.redraw(),Mn(!0)}function mn(Z,Q){var se=[];if(Z instanceof Array)se=Z.map(function(he){return t.parseDate(he,Q)});else if(Z instanceof Date||typeof Z=="number")se=[t.parseDate(Z,Q)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":se=[t.parseDate(Z,Q)];break;case"multiple":se=Z.split(t.config.conjunction).map(function(he){return t.parseDate(he,Q)});break;case"range":se=Z.split(t.l10n.rangeSeparator).map(function(he){return t.parseDate(he,Q)});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 hn(Z,Q,se){if(Q===void 0&&(Q=!1),se===void 0&&(se=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(Q);mn(Z,se),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,Q),d(),t.selectedDates.length===0&&t.clear(!1),Mn(Q),Q&&It("onChange")}function pi(Z){return Z.slice().map(function(Q){return typeof Q=="string"||typeof Q=="number"||Q instanceof Date?t.parseDate(Q,void 0,!0):Q&&typeof Q=="object"&&Q.from&&Q.to?{from:t.parseDate(Q.from,void 0),to:t.parseDate(Q.to,void 0)}:Q}).filter(function(Q){return Q})}function Ci(){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&&mn(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()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>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 bt(){if(t.input=we(),!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"),rn()}function rn(){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{}g(t.mobileInput,"change",function(Q){t.setDate(jn(Q).value,!1,t.mobileFormatStr),It("onChange"),It("onClose")})}function rl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function It(Z,Q){if(t.config!==void 0){var se=t.config[Z];if(se!==void 0&&se.length>0)for(var he=0;se[he]&&he<se.length;he++)se[he](t.selectedDates,t.input.value,t,Q);Z==="onChange"&&(t.input.dispatchEvent(al("change")),t.input.dispatchEvent(al("input")))}}function al(Z){var Q=document.createEvent("Event");return Q.initEvent(Z,!0,!0),Q}function ul(Z){for(var Q=0;Q<t.selectedDates.length;Q++){var se=t.selectedDates[Q];if(se instanceof Date&&zn(se,Z)===0)return""+Q}return!1}function Hi(Z){return t.config.mode!=="range"||t.selectedDates.length<2?!1:zn(Z,t.selectedDates[0])>=0&&zn(Z,t.selectedDates[1])<=0}function ji(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,Q){var se=new Date(t.currentYear,t.currentMonth,1);se.setMonth(t.currentMonth+Q),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Q].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.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function fl(Z){var Q=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(se){return t.formatDate(se,Q)}).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 Mn(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&&It("onValueUpdate")}function Rl(Z){var Q=jn(Z),se=t.prevMonthNav.contains(Q),he=t.nextMonthNav.contains(Q);se||he?Se(se?-1:1):t.yearElements.indexOf(Q)>=0?Q.select():Q.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Q.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(Z){Z.preventDefault();var Q=Z.type==="keydown",se=jn(Z),he=se;t.amPM!==void 0&&se===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Kn(t.amPM.textContent===t.l10n.amPM[0])]);var qe=parseFloat(he.getAttribute("min")),le=parseFloat(he.getAttribute("max")),Ee=parseFloat(he.getAttribute("step")),Re=parseInt(he.value,10),Ke=Z.delta||(Q?Z.which===38?1:-1:0),Ae=Re+Ee*Ke;if(typeof he.value<"u"&&he.value.length===2){var Ge=he===t.hourElement,ft=he===t.minuteElement;Ae<qe?(Ae=le+Ae+Kn(!Ge)+(Kn(Ge)&&Kn(!t.amPM)),ft&&$(void 0,-1,t.hourElement)):Ae>le&&(Ae=he===t.hourElement?Ae-le-Kn(!t.amPM):qe,ft&&$(void 0,1,t.hourElement)),t.amPM&&Ge&&(Ee===1?Ae+Re===23:Math.abs(Ae-Re)>Ee)&&(t.amPM.textContent=t.l10n.amPM[Kn(t.amPM.textContent===t.l10n.amPM[0])]),he.value=In(Ae)}}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;l<t.length;l++){var s=t[l];try{if(s.getAttribute("data-fp-omit")!==null)continue;s._flatpickr!==void 0&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=dE(s,e||{}),i.push(s._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return ts(this,n)},HTMLElement.prototype.flatpickr=function(n){return ts([this],n)});var en=function(n,e){return typeof n=="string"?ts(window.document.querySelectorAll(n),e):n instanceof Node?ts([n],e):ts(n,e)};en.defaultConfig={};en.l10ns={en:bn({},eo),default:bn({},eo)};en.localize=function(n){en.l10ns.default=bn(bn({},en.l10ns.default),n)};en.setDefaults=function(n){en.defaultConfig=bn(bn({},en.defaultConfig),n)};en.parseDate=au({});en.formatDate=ik({});en.compareDates=zn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ts(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=en);function pE(n){let e,t=[n[1]],i={};for(let l=0;l<t.length;l+=1)i=je(i,t[l]);return{c(){e=b("input"),Xn(e,i)},m(l,s){v(l,e,s),e.autofocus&&e.focus(),n[11](e)},p(l,s){Xn(e,i=vt(t,[s&2&&l[1]]))},d(l){l&&k(e),n[11](null)}}}function mE(n){let e;const t=n[10].default,i=Lt(t,n,n[9],null),l=i||pE(n);return{c(){l&&l.c()},m(s,o){l&&l.m(s,o),e=!0},p(s,[o]){i?i.p&&(!e||o&512)&&Pt(i,t,s,s[9],e?At(t,s[9],o,null):Nt(s[9]),null):l&&l.p&&(!e||o&3)&&l.p(s,e?o:-1)},i(s){e||(O(l,s),e=!0)},o(s){D(l,s),e=!1},d(s){l&&l.d(s)}}}function hE(n){return n.charAt(2).toLowerCase()+n.substring(3)}function eh(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function th(n,e){return!!(n==e||n instanceof Date&&e instanceof Date&&n.valueOf()===e.valueOf()||Array.isArray(n)&&Array.isArray(e)&&n.length===e.length&&n.every((t,i)=>t===e[i]))}function _E(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:g=void 0}=e;Yt(()=>{const $=f??h,E=y(d);return E.onReady.push((M,L,I)=>{a===void 0&&S(M,L,I),fn().then(()=>{t(8,m=!0)})}),t(3,g=en($,Object.assign(E,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=gt();function y($={}){$=Object.assign({},$);for(const E of r){const M=(L,I,A)=>{_(hE(E),[L,I,A])};E in $?(Array.isArray($[E])||($[E]=[$[E]]),$[E].push(M)):$[E]=[M]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,E,M){const L=eh(M,$);!th(a,L)&&(a||L)&&t(2,a=L),t(4,u=E)}function T($){ie[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=je(je({},e),Ut($)),t(1,l=lt(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,g=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(th(a,eh(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[$,E]of Object.entries(y(d)))g.set($,E)},[h,l,a,g,u,f,c,d,m,o,s,T]}class tf extends ye{constructor(e){super(),be(this,e,_E,mE,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function gE(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:z.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(()=>ve(s,"value",u)),ie.push(()=>ve(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=Y("Min date (UTC)"),l=C(),H(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function bE(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:z.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(()=>ve(s,"value",u)),ie.push(()=>ve(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=Y("Max date (UTC)"),l=C(),H(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function yE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[gE,({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:[bE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),F(i,t,null),w(e,l),w(e,s),F(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||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function kE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[yE]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(l,[a&2&&{key:r[1]},a&32&&Ft(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function vE(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($,E){$.detail&&$.detail.length==3&&t(0,s[E]=$.detail[1],s)}function f($){r=$,t(2,r),t(0,s)}function c($){n.$$.not_equal(s.min,$)&&(s.min=$,t(0,s))}const d=$=>u($,"min");function m($){a=$,t(3,a),t(0,s)}function h($){n.$$.not_equal(s.max,$)&&(s.max=$,t(0,s))}const g=$=>u($,"max");function _($){s=$,t(0,s)}function y($){Pe.call(this,n,$)}function S($){Pe.call(this,n,$)}function T($){Pe.call(this,n,$)}return n.$$set=$=>{e=je(je({},e),Ut($)),t(5,l=lt(e,i)),"field"in $&&t(0,s=$.field),"key"in $&&t(1,o=$.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,_,y,S,T]}class wE extends ye{constructor(e){super(),be(this,e,vE,kE,_e,{field:0,key:1})}}function SE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(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&&(k(e),k(s),k(o)),u=!1,f()}}}function TE(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){v(c,e,d),e.checked=n[0].convertURLs,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[4]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function $E(n){let e,t,i,l;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[SE,({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:[TE,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(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||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function CE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[$E]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function OE(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){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},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 EE extends ye{constructor(e){super(),be(this,e,OE,CE,_e,{field:0,key:1})}}function ME(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<s.length;r+=1)o=je(o,s[r]);return{c(){e=b("input"),Xn(e,o)},m(r,a){v(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(l=B(e,"input",n[6]),i=!0)},p(r,[a]){Xn(e,o=vt(s,[a&32&&t!==(t=r[5].type||"text")&&{type:t},a&16&&e.value!==r[4]&&{value:r[4]},a&8&&{disabled:r[3]},a&4&&{readOnly:r[2]},a&32&&r[5]])),"value"in o&&(e.value=o.value)},i:te,o:te,d(r){r&&k(e),i=!1,l()}}}function DE(n,e,t){let i;const l=["value","separator","readonly","disabled"];let s=lt(e,l),{value:o=[]}=e,{separator:r=","}=e,{readonly:a=null}=e,{disabled:u=null}=e;const f=c=>{t(0,o=z.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},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=z.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class _o extends ye{constructor(e){super(),be(this,e,DE,ME,_e,{value:0,separator:1,readonly:2,disabled:3})}}function IE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[3](_)}let g={id:n[9],disabled:!z.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new _o({props:g}),ie.push(()=>ve(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),l=b("i"),o=C(),H(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(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),F(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(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(_,y){(!c||y&512&&s!==(s=_[9]))&&p(e,"for",s);const S={};y&512&&(S.id=_[9]),y&1&&(S.disabled=!z.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(O(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),q(r,_),d=!1,m()}}}function LE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[4](_)}let g={id:n[9]+".onlyDomains",disabled:!z.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new _o({props:g}),ie.push(()=>ve(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),l=b("i"),o=C(),H(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(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),F(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(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(_,y){(!c||y&512&&s!==(s=_[9]+".onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=_[9]+".onlyDomains"),y&1&&(S.disabled=!z.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(O(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),q(r,_),d=!1,m()}}}function AE(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[IE,({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:[LE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),F(i,t,null),w(e,l),w(e,s),F(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||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function PE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[AE]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function NE(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){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},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 lk extends ye{constructor(e){super(),be(this,e,NE,PE,_e,{field:0,key:1})}}function RE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=Y(t),l=C(),s=b("small"),r=Y(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),w(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&ue(i,t),u&1&&o!==(o=a[0].mimeType+"")&&ue(r,o)},i:te,o:te,d(a){a&&(k(e),k(l),k(s))}}}function FE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class nh extends ye{constructor(e){super(),be(this,e,FE,RE,_e,{item:0})}}const qE=[{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 HE(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function jE(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:[HE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),F(i,r,a),v(r,l,a),v(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||(O(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),q(i,r)}}}function zE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',l=C(),s=b("button"),s.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=C(),r=b("button"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',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){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(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&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r)),a=!1,De(u)}}}function UE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T;function $(M){n[7](M)}let E={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&&(E.keyOfSelected=n[0].mimeTypes),r=new xn({props:E}),ie.push(()=>ve(r,"keyOfSelected",$)),_=new Hn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[zE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),l=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),g=C(),H(_.$$.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){v(M,e,L),w(e,t),w(e,i),w(e,l),v(M,o,L),F(r,M,L),v(M,u,L),v(M,f,L),w(f,c),w(c,d),w(c,m),w(c,h),w(c,g),F(_,c,null),y=!0,S||(T=Me(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){(!y||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,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:M}),_.$set(A)},i(M){y||(O(r.$$.fragment,M),O(_.$$.fragment,M),y=!0)},o(M){D(r.$$.fragment,M),D(_.$$.fragment,M),y=!1},d(M){M&&(k(e),k(o),k(u),k(f)),q(r,M),q(_),S=!1,T()}}}function VE(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
@@ -68,23 +68,24 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
                                         (e.g. 100x50b) - crop to WxH viewbox (from bottom)</li> <li><strong>WxHf</strong>
                                         (e.g. 100x50f) - fit inside a WxH viewbox (without cropping)</li> <li><strong>0xH</strong>
                                         (e.g. 0x50) - resize to H height preserving the aspect ratio</li> <li><strong>Wx0</strong>
-                                        (e.g. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function BE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E;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 _o({props:L}),ie.push(()=>ve(r,"value",M)),S=new Hn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[VE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),H(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",g=C(),_=b("i"),y=C(),H(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(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(e,l),v(I,o,A),F(r,I,A),v(I,u,A),v(I,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,g),w(m,_),w(m,y),F(S,m,null),T=!0,$||(E=Me(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"})),$=!0)},p(I,A){(!T||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,$e(()=>a=!1)),r.$set(P);const R={};A&33554432&&(R.$$scope={dirty:A,ctx:I}),S.$set(R)},i(I){T||(O(r.$$.fragment,I),O(S.$$.fragment,I),T=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),T=!1},d(I){I&&(k(e),k(o),k(u),k(f)),q(r,I),q(S),$=!1,E()}}}function WE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("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){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),v(d,a,m),v(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&&(k(e),k(l),k(s),k(a),k(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:[YE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),F(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||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function YE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].maxSelect&&ce(s,u[0].maxSelect)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function KE(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
-                    <a href="https://pocketbase.io/docs/files-handling/#protected-files" class="toggle-info" target="_blank" rel="noopener">(Learn more)</a>`,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){v(c,e,d),e.checked=n[0].protected,v(c,i,d),v(c,l,d),w(l,s),v(c,r,d),v(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&&(k(e),k(i),k(l),k(r),k(a)),u=!1,f()}}}function JE(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:"fields."+n[1]+".mimeTypes",$$slots:{default:[UE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[BE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[WE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&ih(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[KE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),d=C(),_&&_.c(),m=C(),H(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(y,S){v(y,e,S),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,a),w(e,u),F(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),F(h,e,null),g=!0},p(y,S){const T={};S&2&&(T.name="fields."+y[1]+".mimeTypes"),S&41943049&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.name="fields."+y[1]+".thumbs"),S&41943041&&($.$$scope={dirty:S,ctx:y}),o.$set($),(!g||S&4&&r!==(r=y[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const E={};S&2&&(E.name="fields."+y[1]+".maxSize"),S&41943041&&(E.$$scope={dirty:S,ctx:y}),f.$set(E),(!g||S&4&&c!==(c=y[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),y[2]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&4&&O(_,1)):(_=ih(y),_.c(),O(_,1),_.m(e,m));const M={};S&2&&(M.name="fields."+y[1]+".protected"),S&41943041&&(M.$$scope={dirty:S,ctx:y}),h.$set(M)},i(y){g||(O(i.$$.fragment,y),O(o.$$.fragment,y),O(f.$$.fragment,y),O(_),O(h.$$.fragment,y),g=!0)},o(y){D(i.$$.fragment,y),D(o.$$.fragment,y),D(f.$$.fragment,y),D(_),D(h.$$.fragment,y),g=!1},d(y){y&&k(e),q(i),q(o),q(f),_&&_.d(),q(h)}}}function ZE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[JE],default:[jE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(l,[a&2&&{key:r[1]},a&32&&Ft(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function GE(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=qE.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(z.isEmpty(s.mimeTypes))return;const R=[];for(const N of s.mimeTypes)a.find(U=>U.mimeType===N)||R.push({mimeType:N});R.length&&t(3,a=a.concat(R))}function m(R){n.$$.not_equal(s.mimeTypes,R)&&(s.mimeTypes=R,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)},g=()=>{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)},_=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},y=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function S(R){n.$$.not_equal(s.thumbs,R)&&(s.thumbs=R,t(0,s),t(6,f),t(2,u))}const T=R=>t(0,s.maxSize=R.target.value<<0,s);function $(){s.maxSelect=yt(this.value),t(0,s),t(6,f),t(2,u)}function E(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function M(R){u=R,t(2,u)}function L(R){s=R,t(0,s),t(6,f),t(2,u)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Ut(R)),t(5,l=lt(e,i)),"field"in R&&t(0,s=R.field),"key"in R&&t(1,o=R.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,_,y,S,T,$,E,M,L,I,A,P]}class XE extends ye{constructor(e){super(),be(this,e,GE,ZE,_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=Y("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){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(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&&(k(e),k(s),k(o)),u=!1,f()}}}function xE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function eM(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function lh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L='"{"a":1,"b":2}"',I,A,P,R,N,U,j,V,K,J,ee,X,oe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=Y("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=Y(` and
+                                        (e.g. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function BE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E;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 _o({props:L}),ie.push(()=>ve(r,"value",M)),S=new Hn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[VE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),H(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",g=C(),_=b("i"),y=C(),H(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(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(e,l),v(I,o,A),F(r,I,A),v(I,u,A),v(I,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,g),w(m,_),w(m,y),F(S,m,null),T=!0,$||(E=Me(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"})),$=!0)},p(I,A){(!T||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,$e(()=>a=!1)),r.$set(P);const R={};A&33554432&&(R.$$scope={dirty:A,ctx:I}),S.$set(R)},i(I){T||(O(r.$$.fragment,I),O(S.$$.fragment,I),T=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),T=!1},d(I){I&&(k(e),k(o),k(u),k(f)),q(r,I),q(S),$=!1,E()}}}function WE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("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){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),v(d,a,m),v(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&&(k(e),k(l),k(s),k(a),k(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:[YE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),F(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||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function YE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].maxSelect&&ce(s,u[0].maxSelect)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function KE(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
+                    <a href="https://pocketbase.io/docs/files-handling/#protected-files" class="toggle-info" target="_blank" rel="noopener">(Learn more)</a>`,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){v(c,e,d),e.checked=n[0].protected,v(c,i,d),v(c,l,d),w(l,s),v(c,r,d),v(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&&(k(e),k(i),k(l),k(r),k(a)),u=!1,f()}}}function JE(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:"fields."+n[1]+".mimeTypes",$$slots:{default:[UE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[BE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[WE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&ih(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[KE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),d=C(),_&&_.c(),m=C(),H(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(y,S){v(y,e,S),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,a),w(e,u),F(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),F(h,e,null),g=!0},p(y,S){const T={};S&2&&(T.name="fields."+y[1]+".mimeTypes"),S&41943049&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.name="fields."+y[1]+".thumbs"),S&41943041&&($.$$scope={dirty:S,ctx:y}),o.$set($),(!g||S&4&&r!==(r=y[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const E={};S&2&&(E.name="fields."+y[1]+".maxSize"),S&41943041&&(E.$$scope={dirty:S,ctx:y}),f.$set(E),(!g||S&4&&c!==(c=y[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),y[2]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&4&&O(_,1)):(_=ih(y),_.c(),O(_,1),_.m(e,m));const M={};S&2&&(M.name="fields."+y[1]+".protected"),S&41943041&&(M.$$scope={dirty:S,ctx:y}),h.$set(M)},i(y){g||(O(i.$$.fragment,y),O(o.$$.fragment,y),O(f.$$.fragment,y),O(_),O(h.$$.fragment,y),g=!0)},o(y){D(i.$$.fragment,y),D(o.$$.fragment,y),D(f.$$.fragment,y),D(_),D(h.$$.fragment,y),g=!1},d(y){y&&k(e),q(i),q(o),q(f),_&&_.d(),q(h)}}}function ZE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[JE],default:[jE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(l,[a&2&&{key:r[1]},a&32&&Ft(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function GE(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=qE.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(z.isEmpty(s.mimeTypes))return;const R=[];for(const N of s.mimeTypes)a.find(U=>U.mimeType===N)||R.push({mimeType:N});R.length&&t(3,a=a.concat(R))}function m(R){n.$$.not_equal(s.mimeTypes,R)&&(s.mimeTypes=R,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)},g=()=>{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)},_=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},y=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function S(R){n.$$.not_equal(s.thumbs,R)&&(s.thumbs=R,t(0,s),t(6,f),t(2,u))}const T=R=>t(0,s.maxSize=R.target.value<<0,s);function $(){s.maxSelect=_t(this.value),t(0,s),t(6,f),t(2,u)}function E(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function M(R){u=R,t(2,u)}function L(R){s=R,t(0,s),t(6,f),t(2,u)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Ut(R)),t(5,l=lt(e,i)),"field"in R&&t(0,s=R.field),"key"in R&&t(1,o=R.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,_,y,S,T,$,E,M,L,I,A,P]}class XE extends ye{constructor(e){super(),be(this,e,GE,ZE,_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=Y("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){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(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&&(k(e),k(s),k(o)),u=!1,f()}}}function xE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function eM(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function lh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L='"{"a":1,"b":2}"',I,A,P,R,N,U,j,V,K,J,ee,X,oe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=Y("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=Y(` and
                         `),r=b("code"),r.textContent="multipart/form-data",a=Y(`
                         requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=Y(` field
                         is a
                         `),c=b("strong"),c.textContent="plain string",d=Y(`:
                         `),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=C(),_=b("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=C(),S=b("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=C(),$=b("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",E=C(),M=b("li"),I=Y(L),A=Y(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',R=C(),N=b("li"),N.textContent="numeric strings are converted to json number",U=C(),j=b("li"),j.textContent="double quoted strings are left as they are (aka. without normalizations)",V=C(),K=b("li"),K.textContent="any other string (empty string too) is double quoted",J=Y(`
                         Alternatively, if you want to avoid the string value normalizations, you can wrap your
-                        data inside an object, eg.`),ee=b("code"),ee.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,ke){v(Se,e,ke),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,g),w(m,_),w(m,y),w(m,S),w(m,T),w(m,$),w(m,E),w(m,M),w(M,I),w(M,A),w(M,P),w(m,R),w(m,N),w(m,U),w(m,j),w(m,V),w(m,K),w(i,J),w(i,ee),oe=!0},i(Se){oe||(Se&&nt(()=>{oe&&(X||(X=ze(e,wt,{duration:150},!0)),X.run(1))}),oe=!0)},o(Se){Se&&(X||(X=ze(e,wt,{duration:150},!1)),X.run(0)),oe=!1},d(Se){Se&&k(e),Se&&X&&X.end()}}}function tM(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:[QE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,y){return _[2]?eM:xE}let m=d(n),h=m(n),g=n[2]&&lh();return{c(){H(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),g&&g.c(),a=ge(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,y){F(e,_,y),v(_,t,y),v(_,i,y),w(i,l),w(i,s),h.m(i,null),v(_,r,y),g&&g.m(_,y),v(_,a,y),u=!0,f||(c=B(i,"click",n[5]),f=!0)},p(_,y){const S={};y&2&&(S.name="fields."+_[1]+".maxSize"),y&3073&&(S.$$scope={dirty:y,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||y&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?y&4&&O(g,1):(g=lh(),g.c(),O(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(O(e.$$.fragment,_),O(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(k(t),k(i),k(r),k(a)),q(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function nM(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[tM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&10?vt(l,[a&2&&{key:r[1]},a&8&&Ft(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function iM(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){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},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 lM extends ye{constructor(e){super(),be(this,e,iM,nM,_e,{field:0,key:1})}}function sM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].min&&ce(s,u[0].min)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function oM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&yt(s.value)!==f[0].max&&ce(s,f[0].max)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function rM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[sM,({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:[oM,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),F(i,t,null),w(e,l),w(e,s),F(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||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function aM(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){v(c,e,d),e.checked=n[0].onlyInt,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[3]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function uM(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[aM,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function fM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[uM],options:[rM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function cM(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=yt(this.value),t(0,s)}function u(){s.max=yt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},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 dM extends ye{constructor(e){super(),be(this,e,cM,fM,_e,{field:0,key:1})}}function pM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function mM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(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&&(k(e),k(l),k(s)),u=!1,f()}}}function hM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function _M(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function gM(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:[pM,({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:[mM,({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:[hM,({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:[_M,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(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,g){v(h,e,g),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),F(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&12289&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g&2&&(y.name="fields."+h[1]+".max"),g&12289&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const S={};g&2&&(S.name="fields."+h[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const T={};g&2&&(T.name="fields."+h[1]+".pattern"),g&12289&&(T.$$scope={dirty:g,ctx:h}),d.$set(T)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),O(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&&k(e),q(i),q(o),q(u),q(d)}}}function bM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[gM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function yM(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=_=>t(0,s.min=_.target.value<<0,s),u=_=>t(0,s.max=_.target.value<<0,s),f=_=>t(0,s.cost=_.target.value<<0,s);function c(){s.pattern=this.value,t(0,s)}function d(_){s=_,t(0,s)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Ut(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&z.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,g]}class kM extends ye{constructor(e){super(),be(this,e,yM,bM,_e,{field:0,key:1})}}function vM(n){let e,t,i,l,s;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML='<i class="ri-add-line"></i> <span class="txt">New collection</span>',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=B(i,"click",n[14]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function wM(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:[vM]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function TM(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:[wM,({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:[SM,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),F(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),F(r,c,d),v(c,a,d),v(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||(O(i.$$.fragment,c),O(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),q(i,c),q(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:[$M,({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:[CM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),l=b("div"),H(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){v(r,e,a),F(t,e,null),v(r,i,a),v(r,l,a),F(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||(O(t.$$.fragment,r),O(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(l)),q(t),q(s)}}}function $M(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function CM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&yt(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function OM(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(g){n[13](g)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new xn({props:h}),ie.push(()=>ve(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),l=b("i"),r=C(),H(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,_){var y,S;v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,r,_),F(a,g,_),f=!0,c||(d=Me(s=He.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
+                        data inside an object, eg.`),ee=b("code"),ee.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,ke){v(Se,e,ke),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,g),w(m,_),w(m,y),w(m,S),w(m,T),w(m,$),w(m,E),w(m,M),w(M,I),w(M,A),w(M,P),w(m,R),w(m,N),w(m,U),w(m,j),w(m,V),w(m,K),w(i,J),w(i,ee),oe=!0},i(Se){oe||(Se&&nt(()=>{oe&&(X||(X=ze(e,wt,{duration:150},!0)),X.run(1))}),oe=!0)},o(Se){Se&&(X||(X=ze(e,wt,{duration:150},!1)),X.run(0)),oe=!1},d(Se){Se&&k(e),Se&&X&&X.end()}}}function tM(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:[QE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,y){return _[2]?eM:xE}let m=d(n),h=m(n),g=n[2]&&lh();return{c(){H(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),g&&g.c(),a=ge(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,y){F(e,_,y),v(_,t,y),v(_,i,y),w(i,l),w(i,s),h.m(i,null),v(_,r,y),g&&g.m(_,y),v(_,a,y),u=!0,f||(c=B(i,"click",n[5]),f=!0)},p(_,y){const S={};y&2&&(S.name="fields."+_[1]+".maxSize"),y&3073&&(S.$$scope={dirty:y,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||y&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?y&4&&O(g,1):(g=lh(),g.c(),O(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(O(e.$$.fragment,_),O(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(k(t),k(i),k(r),k(a)),q(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function nM(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[tM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&10?vt(l,[a&2&&{key:r[1]},a&8&&Ft(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function iM(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){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},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 lM extends ye{constructor(e){super(),be(this,e,iM,nM,_e,{field:0,key:1})}}function sM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].min&&ce(s,u[0].min)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function oM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&_t(s.value)!==f[0].max&&ce(s,f[0].max)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function rM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[sM,({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:[oM,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),F(i,t,null),w(e,l),w(e,s),F(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||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function aM(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){v(c,e,d),e.checked=n[0].onlyInt,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[3]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function uM(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[aM,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function fM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[uM],options:[rM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function cM(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=_t(this.value),t(0,s)}function u(){s.max=_t(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},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 dM extends ye{constructor(e){super(),be(this,e,cM,fM,_e,{field:0,key:1})}}function pM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function mM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(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&&(k(e),k(l),k(s)),u=!1,f()}}}function hM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function _M(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function gM(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:[pM,({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:[mM,({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:[hM,({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:[_M,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(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,g){v(h,e,g),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),F(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&12289&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g&2&&(y.name="fields."+h[1]+".max"),g&12289&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const S={};g&2&&(S.name="fields."+h[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const T={};g&2&&(T.name="fields."+h[1]+".pattern"),g&12289&&(T.$$scope={dirty:g,ctx:h}),d.$set(T)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),O(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&&k(e),q(i),q(o),q(u),q(d)}}}function bM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[gM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function yM(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=_=>t(0,s.min=_.target.value<<0,s),u=_=>t(0,s.max=_.target.value<<0,s),f=_=>t(0,s.cost=_.target.value<<0,s);function c(){s.pattern=this.value,t(0,s)}function d(_){s=_,t(0,s)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Ut(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&z.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,g]}class kM extends ye{constructor(e){super(),be(this,e,yM,bM,_e,{field:0,key:1})}}function vM(n){let e,t,i,l,s;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML='<i class="ri-add-line"></i> <span class="txt">New collection</span>',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=B(i,"click",n[14]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function wM(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:[vM]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function TM(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:[wM,({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:[SM,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),F(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),F(r,c,d),v(c,a,d),v(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||(O(i.$$.fragment,c),O(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),q(i,c),q(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:[$M,({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:[CM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),l=b("div"),H(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){v(r,e,a),F(t,e,null),v(r,i,a),v(r,l,a),F(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||(O(t.$$.fragment,r),O(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(l)),q(t),q(s)}}}function $M(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function CM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&_t(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function OM(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(g){n[13](g)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new xn({props:h}),ie.push(()=>ve(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),l=b("i"),r=C(),H(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,_){var y,S;v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,r,_),F(a,g,_),f=!0,c||(d=Me(s=He.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
 
 `),position:"top"})),c=!0)},p(g,_){var S,T;s&&Rt(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=g[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,g[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=g[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
 
-`),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const y={};_&16777216&&(y.id=g[24]),!u&&_&1&&(u=!0,y.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(y)},i(g){f||(O(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(k(e),k(r)),q(a,g),c=!1,d()}}}function EM(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:[OM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),H(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){v(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),F(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),D(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&O(o,1)):(o=sh(r),o.c(),O(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||(O(o),O(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&k(e),o&&o.d(),q(l)}}}function MM(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[EM],default:[TM,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=je(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new ei({props:a}),ie.push(()=>ve(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(){H(e.$$.fragment),i=C(),H(l.$$.fragment)},m(f,c){F(e,f,c),v(f,i,c),F(l,f,c),s=!0},p(f,[c]){const d=c&258?vt(o,[c&2&&{key:f[1]},c&256&&Ft(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(O(e.$$.fragment,f),O(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&k(i),q(e,f),n[21](null),q(l,f)}}}function DM(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,En,N=>t(10,r=N));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 g(){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 _=N=>t(0,a.minSelect=N.target.value<<0,a);function y(){a.maxSelect=yt(this.value),t(0,a),t(9,h),t(2,m)}function S(N){n.$$.not_equal(a.cascadeDelete,N)&&(a.cascadeDelete=N,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(N){n.$$.not_equal(a.collectionId,N)&&(a.collectionId=N,t(0,a),t(9,h),t(2,m))}function E(N){m=N,t(2,m)}function M(N){a=N,t(0,a),t(9,h),t(2,m)}function L(N){Pe.call(this,n,N)}function I(N){Pe.call(this,n,N)}function A(N){Pe.call(this,n,N)}function P(N){ie[N?"unshift":"push"](()=>{d=N,t(3,d)})}const R=N=>{var U,j;(j=(U=N==null?void 0:N.detail)==null?void 0:U.collection)!=null&&j.id&&N.detail.collection.type!="view"&&t(0,a.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=je(je({},e),Ut(N)),t(8,o=lt(e,s)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>!N.system&&N.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"&&g(),n.$$.dirty&1025&&t(4,l=r.find(N=>N.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,y,S,T,$,E,M,L,I,A,P,R]}class IM extends ye{constructor(e){super(),be(this,e,DM,MM,_e,{field:0,key:1})}}function LM(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 _o({props:a}),ie.push(()=>ve(t,"value",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){v(u,e,f),F(t,e,null),l=!0,s||(o=Me(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,$e(()=>i=!1)),t.$set(c)},i(u){l||(O(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),q(t),s=!1,o()}}}function AM(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function PM(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:[LM,({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:[AM,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),F(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),F(r,c,d),v(c,a,d),v(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||(O(i.$$.fragment,c),O(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),q(i,c),q(r,c)}}}function oh(n){let e,t;return e=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[NM,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function NM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&yt(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function RM(n){let e,t,i=!n[2]&&oh(n);return{c(){i&&i.c(),e=ge()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),D(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&O(i,1)):(i=oh(l),i.c(),O(i,1),i.m(e.parentNode,e))},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function FM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[RM],default:[PM,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(l,[a&2&&{key:r[1]},a&16&&Ft(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function qM(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=yt(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 g(S){Pe.call(this,n,S)}function _(S){Pe.call(this,n,S)}function y(S){Pe.call(this,n,S)}return n.$$set=S=>{e=je(je({},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,_,y]}class HM extends ye{constructor(e){super(),be(this,e,qM,FM,_e,{field:0,key:1})}}function jM(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){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),v(d,r,m),f||(c=[Me(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&&(k(e),k(o),k(r)),f=!1,De(c)}}}function zM(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){v(m,e,h),w(e,t),w(e,i),w(e,l),v(m,o,h),v(m,r,h),c||(d=[Me(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&&(k(e),k(o),k(r)),c=!1,De(d)}}}function UM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=Y("Validation pattern"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("p"),f=Y("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,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),ce(s,n[0].pattern),v(h,r,g),v(h,a,g),w(a,u),w(u,f),w(u,c),d||(m=B(s,"input",n[5]),d=!0)},p(h,g){g&2048&&i!==(i=h[11])&&p(e,"for",i),g&2048&&o!==(o=h[11])&&p(s,"id",o),g&1&&s.value!==h[0].pattern&&ce(s,h[0].pattern)},d(h){h&&(k(e),k(l),k(s),k(r),k(a)),d=!1,m()}}}function VM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;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=Y("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(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),v(_,r,y),ce(r,n[0].autogeneratePattern),v(_,u,y),v(_,f,y),w(f,c),w(c,d),w(c,m),h||(g=[Me(He.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),B(r,"input",n[6])],h=!0)},p(_,y){y&2048&&s!==(s=_[11])&&p(e,"for",s),y&2048&&a!==(a=_[11])&&p(r,"id",a),y&1&&r.value!==_[0].autogeneratePattern&&ce(r,_[0].autogeneratePattern)},d(_){_&&(k(e),k(o),k(r),k(u),k(f)),h=!1,De(g)}}}function BM(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:[jM,({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:[zM,({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:[UM,({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:[VM,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(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,g){v(h,e,g),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),F(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&6145&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g&2&&(y.name="fields."+h[1]+".max"),g&6145&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const S={};g&2&&(S.name="fields."+h[1]+".pattern"),g&6145&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const T={};g&2&&(T.name="fields."+h[1]+".pattern"),g&6145&&(T.$$scope={dirty:g,ctx:h}),d.$set(T)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),O(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&&k(e),q(i),q(o),q(u),q(d)}}}function WM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[BM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function YM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=g=>t(0,s.min=g.target.value<<0,s),a=g=>t(0,s.max=g.target.value<<0,s);function u(){s.pattern=this.value,t(0,s)}function f(){s.autogeneratePattern=this.value,t(0,s)}function c(g){s=g,t(0,s)}function d(g){Pe.call(this,n,g)}function m(g){Pe.call(this,n,g)}function h(g){Pe.call(this,n,g)}return n.$$set=g=>{e=je(je({},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)},[s,o,l,r,a,u,f,c,d,m,h]}class KM extends ye{constructor(e){super(),be(this,e,YM,WM,_e,{field:0,key:1})}}function JM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new lk({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function ZM(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){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},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 GM extends ye{constructor(e){super(),be(this,e,ZM,JM,_e,{field:0,key:1})}}function rh(n,e,t){const i=n.slice();return i[22]=e[t],i[23]=e,i[24]=t,i}function XM(n){let e,t,i,l;function s(f){n[8](f,n[22],n[23],n[24])}function o(){return n[9](n[24])}function r(){return n[10](n[24])}var a=n[1][n[22].type];function u(f,c){let d={key:f[5](f[22]),collection:f[0]};return f[22]!==void 0&&(d.field=f[22]),{props:d}}return a&&(e=jt(a,u(n)),ie.push(()=>ve(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&H(e.$$.fragment),i=C()},m(f,c){e&&F(e,f,c),v(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[22].type])){if(e){re();const d=e;D(d.$$.fragment,1,0,()=>{q(d,1)}),ae()}a?(e=jt(a,u(n)),ie.push(()=>ve(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),H(e.$$.fragment),O(e.$$.fragment,1),F(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[22])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[22],$e(()=>t=!1)),e.$set(d)}},i(f){l||(e&&O(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&k(i),e&&q(e,f)}}}function ah(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[24],disabled:e[22]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[XM]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new ho({props:r}),ie.push(()=>ve(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[24]),u&1&&(f.disabled=e[22]._toDelete),u&33554433&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function QM(n){let e,t=[],i=new Map,l,s,o,r,a,u,f,c,d,m=pe(n[0].fields);const h=y=>y[22];for(let y=0;y<m.length;y+=1){let S=rh(n,m,y),T=h(S);i.set(T,t[y]=ah(T,S))}o=new HO({props:{class:"btn btn-block btn-outline"}}),o.$on("select",n[15]);function g(y){n[16](y)}let _={};return n[0]!==void 0&&(_.collection=n[0]),f=new NO({props:_}),ie.push(()=>ve(f,"collection",g)),{c(){e=b("div");for(let y=0;y<t.length;y+=1)t[y].c();s=C(),H(o.$$.fragment),r=C(),a=b("hr"),u=C(),H(f.$$.fragment),p(e,"class",l="schema-fields total-"+n[0].fields.length)},m(y,S){v(y,e,S);for(let T=0;T<t.length;T+=1)t[T]&&t[T].m(e,null);v(y,s,S),F(o,y,S),v(y,r,S),v(y,a,S),v(y,u,S),F(f,y,S),d=!0},p(y,[S]){S&111&&(m=pe(y[0].fields),re(),t=kt(t,S,h,1,y,m,i,e,zt,ah,null,rh),ae()),(!d||S&1&&l!==(l="schema-fields total-"+y[0].fields.length))&&p(e,"class",l);const T={};!c&&S&1&&(c=!0,T.collection=y[0],$e(()=>c=!1)),f.$set(T)},i(y){if(!d){for(let S=0;S<m.length;S+=1)O(t[S]);O(o.$$.fragment,y),O(f.$$.fragment,y),d=!0}},o(y){for(let S=0;S<t.length;S+=1)D(t[S]);D(o.$$.fragment,y),D(f.$$.fragment,y),d=!1},d(y){y&&(k(e),k(s),k(r),k(a),k(u));for(let S=0;S<t.length;S+=1)t[S].d();q(o,y),q(f,y)}}}function xM(n,e,t){let i,l;Qe(n,Mu,A=>t(18,l=A));let{collection:s}=e,o;const r={text:KM,number:dM,bool:oE,email:lk,url:GM,editor:EE,date:wE,select:HM,json:lM,file:XE,relation:IM,password:kM,autodate:iE};function a(A){s.fields[A]&&(s.fields.splice(A,1),t(0,s))}function u(A){const P=s.fields[A];if(!P)return;P.onMountSelect=!1;const R=structuredClone(P);R.id="",R.system=!1,R.name=c(R.name+"_copy"),R.onMountSelect=!0,s.fields.splice(A+1,0,R),t(0,s)}function f(A="text"){const P=z.initSchemaField({name:c(),type:A});P.onMountSelect=!0;const R=s.fields.findLastIndex(N=>N.type!="autodate");P.type!="autodate"&&R>=0?s.fields.splice(R+1,0,P):s.fields.push(P),t(0,s)}function c(A="field"){var j;let P=A,R=2,N=((j=A.match(/\d+$/))==null?void 0:j[0])||"",U=N?A.substring(0,A.length-N.length):A;for(;d(P);)P=U+((N<<0)+R),R++;return P}function d(A){var P;return!!((P=s==null?void 0:s.fields)!=null&&P.find(R=>R.name===A))}function m(A){return i.findIndex(P=>P===A)}function h(A,P){var R,N;!((R=s==null?void 0:s.fields)!=null&&R.length)||A===P||!P||(N=s==null?void 0:s.fields)!=null&&N.find(U=>U.name==A&&!U._toDelete)||t(0,s.indexes=s.indexes.map(U=>z.replaceIndexColumn(U,A,P)),s)}function g(){const A=s.fields||[],P=A.filter(N=>!N.system),R=structuredClone(l[s.type]);t(0,s.fields=R.fields,s);for(let N of A){if(!N.system)continue;const U=s.fields.findIndex(j=>j.name==N.name);U<0||t(0,s.fields[U]=Object.assign(s.fields[U],N),s)}for(let N of P)s.fields.push(N)}function _(A,P,R,N){R[N]=A,t(0,s)}const y=A=>a(A),S=A=>u(A),T=A=>h(A.detail.oldName,A.detail.newName);function $(A){n.$$.not_equal(s.fields,A)&&(s.fields=A,t(0,s))}const E=A=>{if(!A.detail)return;const P=A.detail.target;P.style.opacity=0,setTimeout(()=>{var R;(R=P==null?void 0:P.style)==null||R.removeProperty("opacity")},0),A.detail.dataTransfer.setDragImage(P,0,0)},M=()=>{Wt({})},L=A=>f(A.detail);function I(A){s=A,t(0,s)}return n.$$set=A=>{"collection"in A&&t(0,s=A.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),g()),n.$$.dirty&1&&(i=s.fields.filter(A=>!A._toDelete))},[s,r,a,u,f,m,h,o,_,y,S,T,$,E,M,L,I]}class eD extends ye{constructor(e){super(),be(this,e,xM,QM,_e,{collection:0})}}function uh(n,e,t){const i=n.slice();return i[9]=e[t],i}function tD(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(()=>ve(e,"value",s)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{q(f,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),e.$on("change",a[6]),H(e.$$.fragment),O(e.$$.fragment,1),F(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,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function nD(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function fh(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=ch(uh(n,i,s));return{c(){e=b("div"),t=b("div");for(let s=0;s<l.length;s+=1)l[s].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(t,null)},p(s,o){if(o&8){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=uh(s,i,r);l[r]?l[r].p(a,o):(l[r]=ch(a),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&k(e),pt(l,s)}}}function ch(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=Y(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&ue(i,t)},d(l){l&&k(e)}}}function iD(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[nD,tD],m=[];function h(_,y){return _[2]?0:1}s=h(n),o=m[s]=d[s](n);let g=n[3].length&&fh(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=C(),o.c(),r=C(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li> <li>The query must have a unique <code>id</code> column.
+`),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const y={};_&16777216&&(y.id=g[24]),!u&&_&1&&(u=!0,y.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(y)},i(g){f||(O(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(k(e),k(r)),q(a,g),c=!1,d()}}}function EM(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:[OM,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),H(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){v(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),F(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),D(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&O(o,1)):(o=sh(r),o.c(),O(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||(O(o),O(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&k(e),o&&o.d(),q(l)}}}function MM(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[EM],default:[TM,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=je(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new ei({props:a}),ie.push(()=>ve(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(){H(e.$$.fragment),i=C(),H(l.$$.fragment)},m(f,c){F(e,f,c),v(f,i,c),F(l,f,c),s=!0},p(f,[c]){const d=c&258?vt(o,[c&2&&{key:f[1]},c&256&&Ft(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(O(e.$$.fragment,f),O(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&k(i),q(e,f),n[21](null),q(l,f)}}}function DM(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,En,N=>t(10,r=N));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 g(){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 _=N=>t(0,a.minSelect=N.target.value<<0,a);function y(){a.maxSelect=_t(this.value),t(0,a),t(9,h),t(2,m)}function S(N){n.$$.not_equal(a.cascadeDelete,N)&&(a.cascadeDelete=N,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(N){n.$$.not_equal(a.collectionId,N)&&(a.collectionId=N,t(0,a),t(9,h),t(2,m))}function E(N){m=N,t(2,m)}function M(N){a=N,t(0,a),t(9,h),t(2,m)}function L(N){Pe.call(this,n,N)}function I(N){Pe.call(this,n,N)}function A(N){Pe.call(this,n,N)}function P(N){ie[N?"unshift":"push"](()=>{d=N,t(3,d)})}const R=N=>{var U,j;(j=(U=N==null?void 0:N.detail)==null?void 0:U.collection)!=null&&j.id&&N.detail.collection.type!="view"&&t(0,a.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=je(je({},e),Ut(N)),t(8,o=lt(e,s)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>!N.system&&N.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"&&g(),n.$$.dirty&1025&&t(4,l=r.find(N=>N.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,y,S,T,$,E,M,L,I,A,P,R]}class IM extends ye{constructor(e){super(),be(this,e,DM,MM,_e,{field:0,key:1})}}function LM(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 _o({props:a}),ie.push(()=>ve(t,"value",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){v(u,e,f),F(t,e,null),l=!0,s||(o=Me(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,$e(()=>i=!1)),t.$set(c)},i(u){l||(O(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),q(t),s=!1,o()}}}function AM(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function PM(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:[LM,({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:[AM,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),l=C(),s=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),F(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),F(r,c,d),v(c,a,d),v(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||(O(i.$$.fragment,c),O(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),q(i,c),q(r,c)}}}function oh(n){let e,t;return e=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[NM,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function NM(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&_t(s.value)!==f[0].maxSelect&&ce(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function RM(n){let e,t,i=!n[2]&&oh(n);return{c(){i&&i.c(),e=ge()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),D(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&O(i,1)):(i=oh(l),i.c(),O(i,1),i.m(e.parentNode,e))},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function FM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[RM],default:[PM,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(l,[a&2&&{key:r[1]},a&16&&Ft(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function qM(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=_t(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 g(S){Pe.call(this,n,S)}function _(S){Pe.call(this,n,S)}function y(S){Pe.call(this,n,S)}return n.$$set=S=>{e=je(je({},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,_,y]}class HM extends ye{constructor(e){super(),be(this,e,qM,FM,_e,{field:0,key:1})}}function jM(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){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),v(d,r,m),f||(c=[Me(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&&(k(e),k(o),k(r)),f=!1,De(c)}}}function zM(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){v(m,e,h),w(e,t),w(e,i),w(e,l),v(m,o,h),v(m,r,h),c||(d=[Me(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&&(k(e),k(o),k(r)),c=!1,De(d)}}}function UM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=Y("Validation pattern"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("p"),f=Y("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,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),ce(s,n[0].pattern),v(h,r,g),v(h,a,g),w(a,u),w(u,f),w(u,c),d||(m=B(s,"input",n[5]),d=!0)},p(h,g){g&2048&&i!==(i=h[11])&&p(e,"for",i),g&2048&&o!==(o=h[11])&&p(s,"id",o),g&1&&s.value!==h[0].pattern&&ce(s,h[0].pattern)},d(h){h&&(k(e),k(l),k(s),k(r),k(a)),d=!1,m()}}}function VM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;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=Y("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(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),v(_,r,y),ce(r,n[0].autogeneratePattern),v(_,u,y),v(_,f,y),w(f,c),w(c,d),w(c,m),h||(g=[Me(He.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),B(r,"input",n[6])],h=!0)},p(_,y){y&2048&&s!==(s=_[11])&&p(e,"for",s),y&2048&&a!==(a=_[11])&&p(r,"id",a),y&1&&r.value!==_[0].autogeneratePattern&&ce(r,_[0].autogeneratePattern)},d(_){_&&(k(e),k(o),k(r),k(u),k(f)),h=!1,De(g)}}}function BM(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:[jM,({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:[zM,({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:[UM,({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:[VM,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(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,g){v(h,e,g),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),F(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&6145&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g&2&&(y.name="fields."+h[1]+".max"),g&6145&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const S={};g&2&&(S.name="fields."+h[1]+".pattern"),g&6145&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const T={};g&2&&(T.name="fields."+h[1]+".pattern"),g&6145&&(T.$$scope={dirty:g,ctx:h}),d.$set(T)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),O(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&&k(e),q(i),q(o),q(u),q(d)}}}function WM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[BM]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ei({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function YM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=g=>t(0,s.min=g.target.value<<0,s),a=g=>t(0,s.max=g.target.value<<0,s);function u(){s.pattern=this.value,t(0,s)}function f(){s.autogeneratePattern=this.value,t(0,s)}function c(g){s=g,t(0,s)}function d(g){Pe.call(this,n,g)}function m(g){Pe.call(this,n,g)}function h(g){Pe.call(this,n,g)}return n.$$set=g=>{e=je(je({},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)},[s,o,l,r,a,u,f,c,d,m,h]}class KM extends ye{constructor(e){super(),be(this,e,YM,WM,_e,{field:0,key:1})}}function JM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new lk({props:o}),ie.push(()=>ve(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){F(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function ZM(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){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},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 GM extends ye{constructor(e){super(),be(this,e,ZM,JM,_e,{field:0,key:1})}}function rh(n,e,t){const i=n.slice();return i[22]=e[t],i[23]=e,i[24]=t,i}function XM(n){let e,t,i,l;function s(f){n[8](f,n[22],n[23],n[24])}function o(){return n[9](n[24])}function r(){return n[10](n[24])}var a=n[1][n[22].type];function u(f,c){let d={key:f[5](f[22]),collection:f[0]};return f[22]!==void 0&&(d.field=f[22]),{props:d}}return a&&(e=jt(a,u(n)),ie.push(()=>ve(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&H(e.$$.fragment),i=C()},m(f,c){e&&F(e,f,c),v(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[22].type])){if(e){re();const d=e;D(d.$$.fragment,1,0,()=>{q(d,1)}),ae()}a?(e=jt(a,u(n)),ie.push(()=>ve(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),H(e.$$.fragment),O(e.$$.fragment,1),F(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[22])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[22],$e(()=>t=!1)),e.$set(d)}},i(f){l||(e&&O(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&k(i),e&&q(e,f)}}}function ah(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[24],disabled:e[22]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[XM]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new ho({props:r}),ie.push(()=>ve(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[24]),u&1&&(f.disabled=e[22]._toDelete),u&33554433&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function QM(n){let e,t=[],i=new Map,l,s,o,r,a,u,f,c,d,m=pe(n[0].fields);const h=y=>y[22];for(let y=0;y<m.length;y+=1){let S=rh(n,m,y),T=h(S);i.set(T,t[y]=ah(T,S))}o=new HO({props:{class:"btn btn-block btn-outline"}}),o.$on("select",n[15]);function g(y){n[16](y)}let _={};return n[0]!==void 0&&(_.collection=n[0]),f=new NO({props:_}),ie.push(()=>ve(f,"collection",g)),{c(){e=b("div");for(let y=0;y<t.length;y+=1)t[y].c();s=C(),H(o.$$.fragment),r=C(),a=b("hr"),u=C(),H(f.$$.fragment),p(e,"class",l="schema-fields total-"+n[0].fields.length)},m(y,S){v(y,e,S);for(let T=0;T<t.length;T+=1)t[T]&&t[T].m(e,null);v(y,s,S),F(o,y,S),v(y,r,S),v(y,a,S),v(y,u,S),F(f,y,S),d=!0},p(y,[S]){S&111&&(m=pe(y[0].fields),re(),t=kt(t,S,h,1,y,m,i,e,zt,ah,null,rh),ae()),(!d||S&1&&l!==(l="schema-fields total-"+y[0].fields.length))&&p(e,"class",l);const T={};!c&&S&1&&(c=!0,T.collection=y[0],$e(()=>c=!1)),f.$set(T)},i(y){if(!d){for(let S=0;S<m.length;S+=1)O(t[S]);O(o.$$.fragment,y),O(f.$$.fragment,y),d=!0}},o(y){for(let S=0;S<t.length;S+=1)D(t[S]);D(o.$$.fragment,y),D(f.$$.fragment,y),d=!1},d(y){y&&(k(e),k(s),k(r),k(a),k(u));for(let S=0;S<t.length;S+=1)t[S].d();q(o,y),q(f,y)}}}function xM(n,e,t){let i,l;Qe(n,Mu,A=>t(18,l=A));let{collection:s}=e,o;const r={text:KM,number:dM,bool:oE,email:lk,url:GM,editor:EE,date:wE,select:HM,json:lM,file:XE,relation:IM,password:kM,autodate:iE};function a(A){s.fields[A]&&(s.fields.splice(A,1),t(0,s))}function u(A){const P=s.fields[A];if(!P)return;P.onMountSelect=!1;const R=structuredClone(P);R.id="",R.system=!1,R.name=c(R.name+"_copy"),R.onMountSelect=!0,s.fields.splice(A+1,0,R),t(0,s)}function f(A="text"){const P=z.initSchemaField({name:c(),type:A});P.onMountSelect=!0;const R=s.fields.findLastIndex(N=>N.type!="autodate");P.type!="autodate"&&R>=0?s.fields.splice(R+1,0,P):s.fields.push(P),t(0,s)}function c(A="field"){var j;let P=A,R=2,N=((j=A.match(/\d+$/))==null?void 0:j[0])||"",U=N?A.substring(0,A.length-N.length):A;for(;d(P);)P=U+((N<<0)+R),R++;return P}function d(A){var P;return!!((P=s==null?void 0:s.fields)!=null&&P.find(R=>R.name===A))}function m(A){return i.findIndex(P=>P===A)}function h(A,P){var R,N;!((R=s==null?void 0:s.fields)!=null&&R.length)||A===P||!P||(N=s==null?void 0:s.fields)!=null&&N.find(U=>U.name==A&&!U._toDelete)||t(0,s.indexes=s.indexes.map(U=>z.replaceIndexColumn(U,A,P)),s)}function g(){const A=s.fields||[],P=A.filter(N=>!N.system),R=structuredClone(l[s.type]);t(0,s.fields=R.fields,s);for(let N of A){if(!N.system)continue;const U=s.fields.findIndex(j=>j.name==N.name);U<0||t(0,s.fields[U]=Object.assign(s.fields[U],N),s)}for(let N of P)s.fields.push(N)}function _(A,P,R,N){R[N]=A,t(0,s)}const y=A=>a(A),S=A=>u(A),T=A=>h(A.detail.oldName,A.detail.newName);function $(A){n.$$.not_equal(s.fields,A)&&(s.fields=A,t(0,s))}const E=A=>{if(!A.detail)return;const P=A.detail.target;P.style.opacity=0,setTimeout(()=>{var R;(R=P==null?void 0:P.style)==null||R.removeProperty("opacity")},0),A.detail.dataTransfer.setDragImage(P,0,0)},M=()=>{Wt({})},L=A=>f(A.detail);function I(A){s=A,t(0,s)}return n.$$set=A=>{"collection"in A&&t(0,s=A.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),g()),n.$$.dirty&1&&(i=s.fields.filter(A=>!A._toDelete))},[s,r,a,u,f,m,h,o,_,y,S,T,$,E,M,L,I]}class eD extends ye{constructor(e){super(),be(this,e,xM,QM,_e,{collection:0})}}function uh(n,e,t){const i=n.slice();return i[9]=e[t],i}function tD(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(()=>ve(e,"value",s)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=ge()},m(a,u){e&&F(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{q(f,1)}),ae()}o?(e=jt(o,r(a)),ie.push(()=>ve(e,"value",s)),e.$on("change",a[6]),H(e.$$.fragment),O(e.$$.fragment,1),F(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,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&q(e,a)}}}function nD(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function fh(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=ch(uh(n,i,s));return{c(){e=b("div"),t=b("div");for(let s=0;s<l.length;s+=1)l[s].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(t,null)},p(s,o){if(o&8){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=uh(s,i,r);l[r]?l[r].p(a,o):(l[r]=ch(a),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&k(e),pt(l,s)}}}function ch(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=Y(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&ue(i,t)},d(l){l&&k(e)}}}function iD(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[nD,tD],m=[];function h(_,y){return _[2]?0:1}s=h(n),o=m[s]=d[s](n);let g=n[3].length&&fh(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=C(),o.c(),r=C(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li> <li>The query must have a unique <code>id</code> column.
                 <br/>
                 If your query doesn&#39;t have a suitable one, you can use the universal
-                <code>(ROW_NUMBER() OVER()) as id</code>.</li> <li>Expressions must be aliased with a valid formatted field name (eg.
-                <code>MAX(balance) as maxBalance</code>).</li></ul>`,u=C(),g&&g.c(),f=ge(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){v(_,e,y),w(e,t),v(_,l,y),m[s].m(_,y),v(_,r,y),v(_,a,y),v(_,u,y),g&&g.m(_,y),v(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,y):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,y):(o=m[s]=d[s](_),o.c()),O(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=fh(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(O(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(k(e),k(l),k(r),k(a),k(u),k(f)),m[s].d(_),g&&g.d(_)}}}function lD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[iD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function sD(n,e,t){let i;Qe(n,Sn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=z.getNestedVal(c,"fields",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=z.extractColumnsFromQuery(l==null?void 0:l.viewQuery);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,y=m[h]||h;r.push(z.sentenize(y+": "+_))}}Yt(async()=>{t(2,o=!0);try{t(1,s=(await Ot(async()=>{const{default:c}=await import("./CodeEditor-C_5qTJii.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&&fi("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 oD extends ye{constructor(e){super(),be(this,e,sD,lD,_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,_,y,S,T,$,E,M,L,I,A=pe(n[4]),P=[];for(let R=0;R<A.length;R+=1)P[R]=hh(dh(n,A,R));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=C(),o=b("div");for(let R=0;R<P.length;R+=1)P[R].c();r=C(),a=b("hr"),u=C(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=C(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.body.*</code> <code>@request.auth.*</code>",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
+                <code>(ROW_NUMBER() OVER()) as id</code>.</li> <li>Expressions must be aliased with a valid formatted field name, e.g.
+                <code>MAX(balance) as maxBalance</code>.</li> <li>Combined/multi-spaced expressions must be wrapped in parenthesis, e.g.
+                <code>(MAX(balance) + 1) as maxBalance</code>.</li></ul>`,u=C(),g&&g.c(),f=ge(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){v(_,e,y),w(e,t),v(_,l,y),m[s].m(_,y),v(_,r,y),v(_,a,y),v(_,u,y),g&&g.m(_,y),v(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,y):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,y):(o=m[s]=d[s](_),o.c()),O(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=fh(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(O(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(k(e),k(l),k(r),k(a),k(u),k(f)),m[s].d(_),g&&g.d(_)}}}function lD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[iD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function sD(n,e,t){let i;Qe(n,Sn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=z.getNestedVal(c,"fields",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=z.extractColumnsFromQuery(l==null?void 0:l.viewQuery);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,y=m[h]||h;r.push(z.sentenize(y+": "+_))}}Yt(async()=>{t(2,o=!0);try{t(1,s=(await Ot(async()=>{const{default:c}=await import("./CodeEditor-BMLITRTv.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&&fi("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 oD extends ye{constructor(e){super(),be(this,e,sD,lD,_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,_,y,S,T,$,E,M,L,I,A=pe(n[4]),P=[];for(let R=0;R<A.length;R+=1)P[R]=hh(dh(n,A,R));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=C(),o=b("div");for(let R=0;R<P.length;R+=1)P[R].c();r=C(),a=b("hr"),u=C(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=C(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.body.*</code> <code>@request.auth.*</code>",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
                         <em>@collection</em> filter:`,y=C(),S=b("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=C(),$=b("hr"),E=C(),M=b("p"),M.innerHTML=`Example rule:
                         <br/> <code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,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(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(R,N){v(R,e,N),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let U=0;U<P.length;U+=1)P[U]&&P[U].m(o,null);w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(i,h),w(i,g),w(i,_),w(i,y),w(i,S),w(i,T),w(i,$),w(i,E),w(i,M),I=!0},p(R,N){if(N&24){A=pe(R[4]);let U;for(U=0;U<A.length;U+=1){const j=dh(R,A,U);P[U]?P[U].p(j,N):(P[U]=hh(j),P[U].c(),P[U].m(o,null))}for(;U<P.length;U+=1)P[U].d(1);P.length=A.length}},i(R){I||(R&&nt(()=>{I&&(L||(L=ze(e,wt,{duration:150},!0)),L.run(1))}),I=!0)},o(R){R&&(L||(L=ze(e,wt,{duration:150},!1)),L.run(0)),I=!1},d(R){R&&k(e),pt(P,R),R&&L&&L.end()}}}function mh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=Y(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&ue(i,t)},d(l){l&&k(e)}}}function hh(n){let e=!n[3].includes(n[15]),t,i=e&&mh(n);return{c(){i&&i.c(),t=ge()},m(l,s){i&&i.m(l,s),v(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&&k(t),i&&i.d(l)}}}function _h(n){let e,t,i,l,s,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[rD,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new tl({props:c}),ie.push(()=>ve(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new tl({props:m}),ie.push(()=>ve(l,"rule",d));function h(_){n[10](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new tl({props:g}),ie.push(()=>ve(r,"rule",h)),{c(){H(e.$$.fragment),i=C(),H(l.$$.fragment),o=C(),H(r.$$.fragment)},m(_,y){F(e,_,y),v(_,i,y),F(l,_,y),v(_,o,y),F(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&278528&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,$e(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=_[0]),!s&&y&1&&(s=!0,T.rule=_[0].updateRule,$e(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=_[0]),!a&&y&1&&(a=!0,$.rule=_[0].deleteRule,$e(()=>a=!1)),r.$set($)},i(_){u||(O(e.$$.fragment,_),O(l.$$.fragment,_),O(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),q(e,_),q(l,_),q(r,_)}}}function gh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Me(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&&k(e),t=!1,i()}}}function rD(n){let e,t=!n[14]&&gh();return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(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&&k(e),t&&t.d(i)}}}function bh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,y){return _[2]?uD:aD}let m=d(n),h=m(n),g=n[2]&&yh(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(),g&&g.c(),a=ge(),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(_,y){v(_,e,y),v(_,t,y),v(_,i,y),w(i,l),w(i,s),h.m(i,null),v(_,r,y),g&&g.m(_,y),v(_,a,y),u=!0,f||(c=B(i,"click",n[11]),f=!0)},p(_,y){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||y&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,y),y&4&&O(g,1)):(g=yh(_),g.c(),O(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(O(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(k(e),k(t),k(i),k(r),k(a)),h.d(),g&&g.d(_),f=!1,c()}}}function aD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function uD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function yh(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:[fD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new tl({props:f}),ie.push(()=>ve(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:[cD]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new tl({props:d}),ie.push(()=>ve(s,"rule",c)),{c(){e=b("div"),H(t.$$.fragment),l=C(),H(s.$$.fragment),p(e,"class","block")},m(m,h){v(m,e,h),F(t,e,null),w(e,l),F(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,$e(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,$e(()=>o=!1)),s.$set(_)},i(m){a||(O(t.$$.fragment,m),O(s.$$.fragment,m),m&&nt(()=>{a&&(r||(r=ze(e,wt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=ze(e,wt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&k(e),q(t),q(s),m&&r&&r.end()}}}function fD(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
@@ -97,13 +98,13 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
                         `),l=b("strong"),o=Y(s),r=C(),a=b("i"),u=C(),f=b("strong"),d=Y(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(g,_){v(g,e,_),w(e,t),w(t,i),w(t,l),w(l,o),w(t,r),w(t,a),w(t,u),w(t,f),w(f,d)},p(g,_){var y,S;_&2&&s!==(s=((y=g[1])==null?void 0:y.name)+"")&&ue(o,s),_&4&&c!==(c=((S=g[2])==null?void 0:S.name)+"")&&ue(d,c)},d(g){g&&k(e)}}}function Ch(n){let e,t,i,l=pe(n[6]),s=[];for(let f=0;f<l.length;f+=1)s[f]=Oh(wh(n,l,f));let o=pe(n[8]),r=[];for(let f=0;f<o.length;f+=1)r[f]=Eh(vh(n,o,f));let a=pe(n[7]),u=[];for(let f=0;f<a.length;f+=1)u[f]=Mh(kh(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=C();for(let f=0;f<r.length;f+=1)r[f].c();t=C();for(let f=0;f<u.length;f+=1)u[f].c();i=ge()},m(f,c){for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(f,c);v(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);v(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);v(f,i,c)},p(f,c){if(c&64){l=pe(f[6]);let d;for(d=0;d<l.length;d+=1){const m=wh(f,l,d);s[d]?s[d].p(m,c):(s[d]=Oh(m),s[d].c(),s[d].m(e.parentNode,e))}for(;d<s.length;d+=1)s[d].d(1);s.length=l.length}if(c&256){o=pe(f[8]);let d;for(d=0;d<o.length;d+=1){const m=vh(f,o,d);r[d]?r[d].p(m,c):(r[d]=Eh(m),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&128){a=pe(f[7]);let d;for(d=0;d<a.length;d+=1){const m=kh(f,a,d);u[d]?u[d].p(m,c):(u[d]=Mh(m),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){f&&(k(e),k(t),k(i)),pt(s,f),pt(r,f),pt(u,f)}}}function Oh(n){let e,t,i,l=n[19].name+"",s,o,r;return{c(){e=b("li"),t=Y(`Multiple to single value conversion of field
                         `),i=b("strong"),s=Y(l),o=C(),r=b("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r)},p(a,u){u&64&&l!==(l=a[19].name+"")&&ue(s,l)},d(a){a&&k(e)}}}function Eh(n){let e,t,i,l,s=n[19]._originalName+"",o,r,a,u,f,c=n[19].name+"",d;return{c(){e=b("li"),t=b("div"),i=Y(`Renamed field
                             `),l=b("strong"),o=Y(s),r=C(),a=b("i"),u=C(),f=b("strong"),d=Y(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,h){v(m,e,h),w(e,t),w(t,i),w(t,l),w(l,o),w(t,r),w(t,a),w(t,u),w(t,f),w(f,d)},p(m,h){h&256&&s!==(s=m[19]._originalName+"")&&ue(o,s),h&256&&c!==(c=m[19].name+"")&&ue(d,c)},d(m){m&&k(e)}}}function Mh(n){let e,t,i,l=n[19].name+"",s,o;return{c(){e=b("li"),t=Y("Removed field "),i=b("span"),s=Y(l),o=C(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(i,s),w(e,o)},p(r,a){a&128&&l!==(l=r[19].name+"")&&ue(s,l)},d(r){r&&k(e)}}}function hD(n){let e,t,i,l,s,o,r,a,u=n[7].length&&Sh(),f=n[9]&&Th(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',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(),u&&u.c(),r=C(),f&&f.c(),a=ge(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),u&&u.m(l,null),v(c,r,d),f&&f.m(c,d),v(c,a,d)},p(c,d){c[7].length?u||(u=Sh(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=Th(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function _D(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function gD(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',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){v(o,e,r),v(o,t,r),v(o,i,r),e.focus(),l||(s=[B(e,"click",n[12]),B(i,"click",n[13])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,De(s)}}}function bD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[gD],header:[_D],default:[hD]},$$scope:{ctx:n}};return e=new ln({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&67109854&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[14](null),q(e,l)}}}function yD(n,e,t){let i,l,s,o,r,a;const u=_t();let f,c,d,m;async function h(M,L,I=!0){t(1,c=M),t(2,d=L),m=I,await fn(),i||s.length||o.length||r.length?f==null||f.show():_()}function g(){f==null||f.hide()}function _(){g(),u("confirm",m)}const y=()=>g(),S=()=>_();function T(M){ie[M?"unshift":"push"](()=>{f=M,t(5,f)})}function $(M){Pe.call(this,n,M)}function E(M){Pe.call(this,n,M)}return n.$$.update=()=>{var M,L,I;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((M=d==null?void 0:d.fields)==null?void 0:M.filter(A=>A.id&&!A._toDelete&&A._originalName!=A.name))||[]),n.$$.dirty&4&&t(7,o=((L=d==null?void 0:d.fields)==null?void 0:L.filter(A=>A.id&&A._toDelete))||[]),n.$$.dirty&6&&t(6,r=((I=d==null?void 0:d.fields)==null?void 0:I.filter(A=>{var R;const P=(R=c==null?void 0:c.fields)==null?void 0:R.find(N=>N.id==A.id);return P?P.maxSelect!=1&&A.maxSelect==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[g,c,d,i,l,f,r,o,s,a,_,h,y,S,T,$,E]}class kD extends ye{constructor(e){super(),be(this,e,yD,bD,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function Dh(n,e,t){const i=n.slice();return i[58]=e[t][0],i[59]=e[t][1],i}function vD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new eD({props:s}),ie.push(()=>ve(e,"collection",l)),{c(){H(e.$$.fragment)},m(o,r){F(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wD(n){let e,t,i;function l(o){n[42](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new oD({props:s}),ie.push(()=>ve(e,"collection",l)),{c(){H(e.$$.fragment)},m(o,r){F(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function Ih(n){let e,t,i,l;function s(r){n[44](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new mD({props:o}),ie.push(()=>ve(t,"collection",s)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){v(r,e,a),F(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u)},i(r){l||(O(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),q(t)}}}function Lh(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 yO({props:o}),ie.push(()=>ve(t,"collection",s)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===ss)},m(r,a){v(r,e,a),F(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&x(e,"active",r[3]===ss)},i(r){l||(O(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),q(t)}}}function SD(n){let e,t,i,l,s,o,r;const a=[wD,vD],u=[];function f(m,h){return m[16]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[14]&&n[3]===to&&Ih(n),d=n[17]&&Lh(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"),x(t,"active",n[3]===Xi),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){v(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 g=i;i=f(m),i===g?u[i].p(m,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),O(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Xi),!m[14]&&m[3]===to?c?(c.p(m,h),h[0]&16392&&O(c,1)):(c=Ih(m),c.c(),O(c,1),c.m(e,o)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),m[17]?d?(d.p(m,h),h[0]&131072&&O(d,1)):(d=Lh(m),d.c(),O(d,1),d.m(e,null)):d&&(re(),D(d,1,1,()=>{d=null}),ae())},i(m){r||(O(l),O(c),O(d),r=!0)},o(m){D(l),D(c),D(d),r=!1},d(m){m&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Ah(n){let e,t,i,l,s,o,r;return o=new Hn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[TD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),H(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){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),F(o,i,null),r=!0},p(a,u){const f={};u[2]&1&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),q(o)}}}function TD(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',t=C(),i=b("hr"),l=C(),s=b("button"),s.innerHTML='<i class="ri-eraser-line" aria-hidden="true"></i> <span class="txt">Truncate</span>',o=C(),r=b("button"),r.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item txt-danger"),p(r,"role","menuitem")},m(f,c){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(f,r,c),a||(u=[B(e,"click",n[33]),B(s,"click",n[34]),B(r,"click",On(tt(n[35])))],a=!0)},p:te,d(f){f&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r)),a=!1,De(u)}}}function Ph(n){let e,t,i,l;return i=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[$D]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){v(s,e,o),v(s,t,o),F(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&1&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(k(e),k(t)),q(i,s)}}}function Nh(n){let e,t,i,l,s,o=n[59]+"",r,a,u,f,c;function d(){return n[37](n[58])}return{c(){e=b("button"),t=b("i"),l=C(),s=b("span"),r=Y(o),a=Y(" collection"),u=C(),p(t,"class",i=js(z.getCollectionTypeIcon(n[58]))+" 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"),x(e,"selected",n[58]==n[2].type)},m(m,h){v(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=js(z.getCollectionTypeIcon(n[58]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[59]+"")&&ue(r,o),h[0]&68&&x(e,"selected",n[58]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function $D(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l<t.length;l+=1)i[l]=Nh(Dh(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s[0]&4194372){t=pe(Object.entries(l[6]));let o;for(o=0;o<t.length;o+=1){const r=Dh(l,t,o);i[o]?i[o].p(r,s):(i[o]=Nh(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function Rh(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function CD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y=(n[6][n[2].type]||"N/A")+"",S,T,$,E,M,L,I,A,P,R,N=!n[2].id&&Ph(n),U=n[2].system&&Rh();return{c(){e=b("label"),t=Y("Name"),l=C(),s=b("input"),f=C(),c=b("div"),d=b("div"),m=b("span"),h=C(),g=b("span"),_=Y("Type: "),S=Y(y),T=C(),N&&N.c(),L=C(),U&&U.c(),I=ge(),p(e,"for",i=n[57]),p(s,"type","text"),p(s,"id",o=n[57]),s.required=!0,s.disabled=n[15],p(s,"spellcheck","false"),s.autofocus=r=!n[2].id,p(s,"placeholder",a=n[17]?'eg. "users"':'eg. "posts"'),s.value=u=n[2].name,x(s,"txt-bold",n[2].system),p(m,"aria-hidden","true"),p(g,"class","txt"),p(d,"tabindex",$=n[2].id?-1:0),p(d,"role",E=n[2].id?"":"button"),p(d,"aria-label","View types"),p(d,"class",M="btn btn-sm p-r-10 p-l-10 "+(n[2].id?"btn-transparent":"btn-outline")),x(d,"btn-disabled",!!n[2].id),p(c,"class","form-field-addon")},m(j,V){v(j,e,V),w(e,t),v(j,l,V),v(j,s,V),v(j,f,V),v(j,c,V),w(c,d),w(d,m),w(d,h),w(d,g),w(g,_),w(g,S),w(d,T),N&&N.m(d,null),v(j,L,V),U&&U.m(j,V),v(j,I,V),A=!0,n[2].id||s.focus(),P||(R=B(s,"input",n[36]),P=!0)},p(j,V){(!A||V[1]&67108864&&i!==(i=j[57]))&&p(e,"for",i),(!A||V[1]&67108864&&o!==(o=j[57]))&&p(s,"id",o),(!A||V[0]&32768)&&(s.disabled=j[15]),(!A||V[0]&4&&r!==(r=!j[2].id))&&(s.autofocus=r),(!A||V[0]&131072&&a!==(a=j[17]?'eg. "users"':'eg. "posts"'))&&p(s,"placeholder",a),(!A||V[0]&4&&u!==(u=j[2].name)&&s.value!==u)&&(s.value=u),(!A||V[0]&4)&&x(s,"txt-bold",j[2].system),(!A||V[0]&68)&&y!==(y=(j[6][j[2].type]||"N/A")+"")&&ue(S,y),j[2].id?N&&(re(),D(N,1,1,()=>{N=null}),ae()):N?(N.p(j,V),V[0]&4&&O(N,1)):(N=Ph(j),N.c(),O(N,1),N.m(d,null)),(!A||V[0]&4&&$!==($=j[2].id?-1:0))&&p(d,"tabindex",$),(!A||V[0]&4&&E!==(E=j[2].id?"":"button"))&&p(d,"role",E),(!A||V[0]&4&&M!==(M="btn btn-sm p-r-10 p-l-10 "+(j[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",M),(!A||V[0]&4)&&x(d,"btn-disabled",!!j[2].id),j[2].system?U||(U=Rh(),U.c(),U.m(I.parentNode,I)):U&&(U.d(1),U=null)},i(j){A||(O(N),A=!0)},o(j){D(N),A=!1},d(j){j&&(k(e),k(l),k(s),k(f),k(c),k(L),k(I)),N&&N.d(),U&&U.d(j),P=!1,R()}}}function Fh(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){v(r,e,a),l=!0,s||(o=Me(t=He.call(null,e,n[11])),s=!0)},p(r,a){t&&Rt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&nt(()=>{l&&(i||(i=ze(e,Mt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=ze(e,Mt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&k(e),r&&i&&i.end(),s=!1,o()}}}function qh(n){var a,u,f,c,d,m,h;let e,t,i,l=!z.isEmpty((a=n[5])==null?void 0:a.listRule)||!z.isEmpty((u=n[5])==null?void 0:u.viewRule)||!z.isEmpty((f=n[5])==null?void 0:f.createRule)||!z.isEmpty((c=n[5])==null?void 0:c.updateRule)||!z.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!z.isEmpty((m=n[5])==null?void 0:m.authRule)||!z.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Hh();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"),x(e,"active",n[3]===to)},m(g,_){v(g,e,_),w(e,t),w(e,i),r&&r.m(e,null),s||(o=B(e,"click",n[40]),s=!0)},p(g,_){var y,S,T,$,E,M,L;_[0]&32&&(l=!z.isEmpty((y=g[5])==null?void 0:y.listRule)||!z.isEmpty((S=g[5])==null?void 0:S.viewRule)||!z.isEmpty((T=g[5])==null?void 0:T.createRule)||!z.isEmpty(($=g[5])==null?void 0:$.updateRule)||!z.isEmpty((E=g[5])==null?void 0:E.deleteRule)||!z.isEmpty((M=g[5])==null?void 0:M.authRule)||!z.isEmpty((L=g[5])==null?void 0:L.manageRule)),l?r?_[0]&32&&O(r,1):(r=Hh(),r.c(),O(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),_[0]&8&&x(e,"active",g[3]===to)},d(g){g&&k(e),r&&r.d(),s=!1,o()}}}function Hh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function jh(n){let e,t,i,l=n[5]&&n[24](n[5],n[12].concat(["manageRule","authRule"])),s,o,r=l&&zh();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"),x(e,"active",n[3]===ss)},m(a,u){v(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=B(e,"click",n[41]),s=!0)},p(a,u){u[0]&4128&&(l=a[5]&&a[24](a[5],a[12].concat(["manageRule","authRule"]))),l?r?u[0]&4128&&O(r,1):(r=zh(),r.c(),O(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u[0]&8&&x(e,"active",a[3]===ss)},d(a){a&&k(e),r&&r.d(),s=!1,o()}}}function zh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function OD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[16]?"Query":"Fields",g,_,y=!z.isEmpty(n[11]),S,T,$,E,M,L=!!n[2].id&&!n[2].system&&Ah(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[CD,({uniqueId:R})=>({57:R}),({uniqueId:R})=>[0,R?67108864:0]]},$$scope:{ctx:n}}});let I=y&&Fh(n),A=!n[14]&&qh(n),P=n[17]&&jh(n);return{c(){e=b("h4"),i=Y(t),l=C(),L&&L.c(),s=C(),o=b("form"),H(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),g=Y(h),_=C(),I&&I.c(),S=C(),A&&A.c(),T=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"),x(d,"active",n[3]===Xi),p(c,"class","tabs-header stretched")},m(R,N){v(R,e,N),w(e,i),v(R,l,N),L&&L.m(R,N),v(R,s,N),v(R,o,N),F(r,o,null),w(o,a),w(o,u),v(R,f,N),v(R,c,N),w(c,d),w(d,m),w(m,g),w(d,_),I&&I.m(d,null),w(c,S),A&&A.m(c,null),w(c,T),P&&P.m(c,null),$=!0,E||(M=[B(o,"submit",tt(n[38])),B(d,"click",n[39])],E=!0)},p(R,N){(!$||N[0]&4)&&t!==(t=R[2].id?"Edit collection":"New collection")&&ue(i,t),R[2].id&&!R[2].system?L?(L.p(R,N),N[0]&4&&O(L,1)):(L=Ah(R),L.c(),O(L,1),L.m(s.parentNode,s)):L&&(re(),D(L,1,1,()=>{L=null}),ae());const U={};N[0]&163908|N[1]&67108864|N[2]&1&&(U.$$scope={dirty:N,ctx:R}),r.$set(U),(!$||N[0]&65536)&&h!==(h=R[16]?"Query":"Fields")&&ue(g,h),N[0]&2048&&(y=!z.isEmpty(R[11])),y?I?(I.p(R,N),N[0]&2048&&O(I,1)):(I=Fh(R),I.c(),O(I,1),I.m(d,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae()),(!$||N[0]&8)&&x(d,"active",R[3]===Xi),R[14]?A&&(A.d(1),A=null):A?A.p(R,N):(A=qh(R),A.c(),A.m(c,T)),R[17]?P?P.p(R,N):(P=jh(R),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(R){$||(O(L),O(r.$$.fragment,R),O(I),$=!0)},o(R){D(L),D(r.$$.fragment,R),D(I),$=!1},d(R){R&&(k(e),k(l),k(s),k(o),k(f),k(c)),L&&L.d(R),q(r),I&&I.d(),A&&A.d(),P&&P.d(),E=!1,De(M)}}}function Uh(n){let e,t,i,l,s,o;return l=new Hn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[ED]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(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[13]||n[9]},m(r,a){v(r,e,a),w(e,t),w(e,i),F(l,e,null),o=!0},p(r,a){const u={};a[2]&1&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&8704&&s!==(s=!r[13]||r[9]))&&(e.disabled=s)},i(r){o||(O(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),q(l)}}}function ED(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Save and continue</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[32]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function MD(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&&Uh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("div"),s=b("button"),o=b("span"),a=Y(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,"class","btn btn-expanded"),p(s,"title","Save and close"),s.disabled=u=!n[13]||n[9],x(s,"btn-loading",n[9]),p(l,"class","btns-group no-gap")},m(g,_){v(g,e,_),w(e,t),v(g,i,_),v(g,l,_),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[30]),B(s,"click",n[31])],d=!0)},p(g,_){(!c||_[0]&512)&&(e.disabled=g[9]),(!c||_[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&ue(a,r),(!c||_[0]&8704&&u!==(u=!g[13]||g[9]))&&(s.disabled=u),(!c||_[0]&512)&&x(s,"btn-loading",g[9]),g[2].id?h?(h.p(g,_),_[0]&4&&O(h,1)):(h=Uh(g),h.c(),O(h,1),h.m(l,null)):h&&(re(),D(h,1,1,()=>{h=null}),ae())},i(g){c||(O(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(k(e),k(i),k(l)),h&&h.d(),d=!1,De(m)}}}function DD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[46],$$slots:{footer:[MD],header:[OD],default:[SD]},$$scope:{ctx:n}};e=new ln({props:s}),n[47](e),e.$on("hide",n[48]),e.$on("show",n[49]);let o={};return i=new kD({props:o}),n[50](i),i.$on("confirm",n[51]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){F(e,r,a),v(r,t,a),F(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[46]),a[0]&260716|a[2]&1&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[47](null),q(e,r),n[50](null),q(i,r)}}}const Xi="schema",to="api_rules",ss="options",ID="base",Vh="auth",Bh="view";function La(n){return JSON.stringify(n)}function LD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Mu,Fe=>t(29,u=Fe)),Qe(n,Qn,Fe=>t(52,f=Fe)),Qe(n,Sn,Fe=>t(5,c=Fe));const d={};d[ID]="Base",d[Bh]="View",d[Vh]="Auth";const m=_t();let h,g,_=null,y={},S=!1,T=!1,$=Xi,E=La(y),M="",L=[];function I(Fe){t(3,$=Fe)}function A(Fe){return N(Fe),t(10,T=!0),I(Xi),h==null?void 0:h.show()}function P(){return h==null?void 0:h.hide()}function R(){t(10,T=!1),P()}async function N(Fe){Wt({}),typeof Fe<"u"?(t(27,_=Fe),t(2,y=structuredClone(Fe))):(t(27,_=null),t(2,y=structuredClone(u.base)),y.fields.push({type:"autodate",name:"created",onCreate:!0}),y.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,y.fields=y.fields||[],y),t(2,y._originalName=y.name||"",y),await fn(),t(28,E=La(y))}function U(Fe=!0){y.id?g==null||g.show(_,y,Fe):j(Fe)}function j(Fe=!0){if(S)return;t(9,S=!0);const Dt=V(),Gt=!y.id;let mn;Gt?mn=me.collections.create(Dt):mn=me.collections.update(y.id,Dt),mn.then(hn=>{Ds(),Mw(hn),Fe?(t(10,T=!1),P()):N(hn),tn(y.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Gt,collection:hn}),Gt&&Nn(Qn,f=hn,f)}).catch(hn=>{me.error(hn)}).finally(()=>{t(9,S=!1)})}function V(){const Fe=Object.assign({},y);Fe.fields=Fe.fields.slice(0);for(let Dt=Fe.fields.length-1;Dt>=0;Dt--)Fe.fields[Dt]._toDelete&&Fe.fields.splice(Dt,1);return Fe}function K(){_!=null&&_.id&&pn(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>me.collections.truncate(_.id).then(()=>{R(),tn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Fe=>{me.error(Fe)}))}function J(){_!=null&&_.id&&pn(`Do you really want to delete collection "${_.name}" and all its records?`,()=>me.collections.delete(_.id).then(()=>{R(),tn(`Successfully deleted collection "${_.name}".`),m("delete",_),Dw(_)}).catch(Fe=>{me.error(Fe)}))}function ee(Fe){t(2,y.type=Fe,y),t(2,y=Object.assign(structuredClone(u[Fe]),y)),fi("fields")}function X(){r?pn("You have unsaved changes. Do you really want to discard them?",()=>{oe()}):oe()}async function oe(){const Fe=_?structuredClone(_):null;if(Fe){if(Fe.id="",Fe.created="",Fe.updated="",Fe.name+="_duplicate",!z.isEmpty(Fe.fields))for(const Dt of Fe.fields)Dt.id="";if(!z.isEmpty(Fe.indexes))for(let Dt=0;Dt<Fe.indexes.length;Dt++){const Gt=z.parseIndex(Fe.indexes[Dt]);Gt.indexName="idx_"+z.randomString(10),Gt.tableName=Fe.name,Fe.indexes[Dt]=z.buildIndex(Gt)}}A(Fe),await fn(),t(28,E="")}function Se(Fe,Dt=[]){if(z.isEmpty(Fe))return!1;const Gt=Object.keys(Fe);for(let mn of Gt)if(!Dt.includes(mn))return!0;return!1}const ke=()=>P(),Ce=()=>U(),We=()=>U(!1),st=()=>X(),et=()=>K(),Be=()=>J(),rt=Fe=>{t(2,y.name=z.slugify(Fe.target.value),y),Fe.target.value=y.name},Je=Fe=>ee(Fe),at=()=>{a&&U()},Ht=()=>I(Xi),Te=()=>I(to),Ze=()=>I(ss);function ot(Fe){y=Fe,t(2,y),t(27,_)}function Le(Fe){y=Fe,t(2,y),t(27,_)}function Ve(Fe){y=Fe,t(2,y),t(27,_)}function we(Fe){y=Fe,t(2,y),t(27,_)}const Oe=()=>r&&T?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,T=!1),P()}),!1):!0;function ut(Fe){ie[Fe?"unshift":"push"](()=>{h=Fe,t(7,h)})}function Ne(Fe){Pe.call(this,n,Fe)}function xe(Fe){Pe.call(this,n,Fe)}function qt(Fe){ie[Fe?"unshift":"push"](()=>{g=Fe,t(8,g)})}const Zt=Fe=>j(Fe.detail);return n.$$.update=()=>{var Fe;n.$$.dirty[0]&536870912&&t(12,L=Object.keys(u.base||{})),n.$$.dirty[0]&4&&y.type==="view"&&(t(2,y.createRule=null,y),t(2,y.updateRule=null,y),t(2,y.deleteRule=null,y),t(2,y.indexes=[],y)),n.$$.dirty[0]&134217732&&y.name&&(_==null?void 0:_.name)!=y.name&&y.indexes.length>0&&t(2,y.indexes=(Fe=y.indexes)==null?void 0:Fe.map(Dt=>z.replaceIndexTableName(Dt,y.name)),y),n.$$.dirty[0]&4&&t(17,i=y.type===Vh),n.$$.dirty[0]&4&&t(16,l=y.type===Bh),n.$$.dirty[0]&32&&(c.fields||c.viewQuery?t(11,M=z.getNestedVal(c,"fields.message")||"Has errors"):t(11,M="")),n.$$.dirty[0]&4&&t(15,s=!!y.id&&y.system),n.$$.dirty[0]&4&&t(14,o=!!y.id&&y.system&&y.name=="_superusers"),n.$$.dirty[0]&268435460&&t(4,r=E!=La(y)),n.$$.dirty[0]&20&&t(13,a=!y.id||r),n.$$.dirty[0]&12&&$===ss&&y.type!=="auth"&&I(Xi)},[I,P,y,$,r,c,d,h,g,S,T,M,L,a,o,s,l,i,U,j,K,J,ee,X,Se,A,R,_,E,u,ke,Ce,We,st,et,Be,rt,Je,at,Ht,Te,Ze,ot,Le,Ve,we,Oe,ut,Ne,xe,qt,Zt]}class nf extends ye{constructor(e){super(),be(this,e,LD,DD,_e,{changeTab:0,show:25,hide:1,forceHide:26},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[26]}}function AD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){v(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&&x(e,"dragging",l[1])},i:te,o:te,d(l){l&&k(e),n[4](null),t=!1,De(i)}}}function PD(n,e,t){const i=_t();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let y=_.clientX-o,S=_.clientY-r,T=_.clientX-a,$=_.clientY-u;!f&&Math.abs(T-s.offsetLeft)<l&&Math.abs($-s.offsetTop)<l||(_.preventDefault(),f||(t(1,f=!0),s.classList.add("no-pointer-events"),i("dragstart",{event:_,elem:s})),i("dragging",{event:_,elem:s,diffX:y,diffY:S}))}function h(_){ie[_?"unshift":"push"](()=>{s=_,t(0,s)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,h,g]}class ND extends ye{constructor(e){super(),be(this,e,PD,AD,_e,{tolerance:3})}}function RD(n){let e,t,i,l,s;const o=n[5].default,r=Lt(o,n,n[4],null);return l=new ND({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),H(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){v(a,e,u),r&&r.m(e,null),n[6](e),v(a,i,u),F(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&Pt(r,o,a,a[4],s?At(o,a[4],u,null):Nt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(O(r,a),O(l.$$.fragment,a),s=!0)},o(a){D(r,a),D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(i)),r&&r.d(a),n[6](null),q(l,a)}}}const Wh="@superuserSidebarWidth";function FD(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Wh)||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=()=>{z.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(Wh,a))},[s,o,a,r,l,i,u,f,c,d]}class sk extends ye{constructor(e){super(),be(this,e,FD,RD,_e,{class:0})}}function Yh(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){v(l,e,s),t||(i=Me(He.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(l){l&&k(e),t=!1,i()}}}function qD(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function HD(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function jD(n){var $,E;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&(($=n[0].oauth2)==null?void 0:$.enabled)&&!((E=n[0].oauth2.providers)!=null&&E.length)&&Yh();function y(M,L){return M[1]?HD:qD}let S=y(n),T=S(n);return{c(){var M;e=b("a"),t=b("i"),l=C(),s=b("span"),r=Y(o),a=C(),_&&_.c(),u=C(),f=b("span"),T.c(),p(t,"class",i=js(z.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?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),x(e,"active",((M=n[2])==null?void 0:M.id)===n[0].id)},m(M,L){v(M,e,L),w(e,t),w(e,l),w(e,s),w(s,r),w(e,a),_&&_.m(e,null),w(e,u),w(e,f),T.m(f,null),h||(g=[Me(c=He.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),B(f,"click",On(tt(n[5]))),Me(Un.call(null,e))],h=!0)},p(M,[L]){var I,A,P;L&1&&i!==(i=js(z.getCollectionTypeIcon(M[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=M[0].name+"")&&ue(r,o),M[0].type=="auth"&&((I=M[0].oauth2)!=null&&I.enabled)&&!((A=M[0].oauth2.providers)!=null&&A.length)?_||(_=Yh(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=y(M))&&(T.d(1),T=S(M),T&&(T.c(),T.m(f,null))),c&&Rt(c.update)&&L&2&&c.update.call(null,{position:"right",text:(M[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collectionId="+M[0].id)&&p(e,"href",d),L&1&&m!==(m=M[0].name)&&p(e,"title",m),L&5&&x(e,"active",((P=M[2])==null?void 0:P.id)===M[0].id)},i:te,o:te,d(M){M&&k(e),_&&_.d(),T.d(),h=!1,De(g)}}}function zD(n,e,t){let i,l;Qe(n,Qn,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?z.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 ye{constructor(e){super(),be(this,e,zD,jD,_e,{collection:0,pinnedIds:4})}}function Kh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Gh(n){let e,t,i=[],l=new Map,s,o,r=pe(n[2]);const a=u=>u[25].id;for(let u=0;u<r.length;u+=1){let f=Zh(n,r,u),c=a(f);l.set(c,i[u]=Xh(c,f))}return{c(){e=b("div"),e.textContent="Pinned",t=C();for(let u=0;u<i.length;u+=1)i[u].c();s=ge(),p(e,"class","sidebar-title")},m(u,f){v(u,e,f),v(u,t,f);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);v(u,s,f),o=!0},p(u,f){f[0]&6&&(r=pe(u[2]),re(),i=kt(i,f,a,1,u,r,l,s.parentNode,zt,Xh,s,Zh),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)O(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)D(i[f]);o=!1},d(u){u&&(k(e),k(t),k(s));for(let f=0;f<i.length;f+=1)i[f].d(u)}}}function Xh(n,e){let t,i,l,s;function o(a){e[17](a)}let r={collection:e[25]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new lf({props:r}),ie.push(()=>ve(i,"pinnedIds",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function Qh(n){let e,t=[],i=new Map,l,s,o=n[2].length&&xh(),r=pe(n[8]);const a=u=>u[25].id;for(let u=0;u<r.length;u+=1){let f=Jh(n,r,u),c=a(f);i.set(c,t[u]=e_(c,f))}return{c(){o&&o.c(),e=C();for(let u=0;u<t.length;u+=1)t[u].c();l=ge()},m(u,f){o&&o.m(u,f),v(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(u,f);v(u,l,f),s=!0},p(u,f){u[2].length?o||(o=xh(),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),f[0]&258&&(r=pe(u[8]),re(),t=kt(t,f,a,1,u,r,i,l.parentNode,zt,e_,l,Jh),ae())},i(u){if(!s){for(let f=0;f<r.length;f+=1)O(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)D(t[f]);s=!1},d(u){u&&(k(e),k(l)),o&&o.d(u);for(let f=0;f<t.length;f+=1)t[f].d(u)}}}function xh(n){let e;return{c(){e=b("div"),e.textContent="Others",p(e,"class","sidebar-title")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function e_(n,e){let t,i,l,s;function o(a){e[18](a)}let r={collection:e[25]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new lf({props:r}),ie.push(()=>ve(i,"pinnedIds",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function t_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&n_(n),m=(n[6]||n[4].length)&&i_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ge(),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,x(e,"link-hint",!n[4].length)},m(h,g){v(h,e,g),w(e,t),w(e,i),d&&d.m(e,null),v(h,r,g),m&&m.m(h,g),v(h,a,g),u=!0,f||(c=B(e,"click",n[19]),f=!0)},p(h,g){h[4].length?d&&(d.d(1),d=null):d?d.p(h,g):(d=n_(h),d.c(),d.m(e,null)),(!u||g[0]&64&&l!==(l=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",l),(!u||g[0]&80&&s!==(s=h[6]||h[4].length))&&p(e,"aria-expanded",s),(!u||g[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||g[0]&16)&&x(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&O(m,1)):(m=i_(h),m.c(),O(m,1),m.m(a.parentNode,a)):m&&(re(),D(m,1,1,()=>{m=null}),ae())},i(h){u||(O(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(k(e),k(r),k(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function n_(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){v(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&&k(e)}}}function i_(n){let e=[],t=new Map,i,l,s=pe(n[7]);const o=r=>r[25].id;for(let r=0;r<s.length;r+=1){let a=Kh(n,s,r),u=o(a);t.set(u,e[r]=l_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ge()},m(r,a){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(r,a);v(r,i,a),l=!0},p(r,a){a[0]&130&&(s=pe(r[7]),re(),e=kt(e,a,o,1,r,s,t,i.parentNode,zt,l_,i,Kh),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(e[a]);l=!0}},o(r){for(let a=0;a<e.length;a+=1)D(e[a]);l=!1},d(r){r&&k(i);for(let a=0;a<e.length;a+=1)e[a].d(r)}}}function l_(n,e){let t,i,l,s;function o(a){e[20](a)}let r={collection:e[25]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new lf({props:r}),ie.push(()=>ve(i,"pinnedIds",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function s_(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){v(t,e,i)},d(t){t&&k(e)}}}function o_(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML='<i class="ri-add-line"></i> <span class="txt">New collection</span>',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){v(s,e,o),w(e,t),i||(l=B(t,"click",n[21]),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function UD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T=n[2].length&&Gh(n),$=n[8].length&&Qh(n),E=n[7].length&&t_(n),M=n[4].length&&!n[3].length&&s_(),L=!n[11]&&o_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),T&&T.c(),c=C(),$&&$.c(),d=C(),E&&E.c(),m=C(),M&&M.c(),h=C(),L&&L.c(),g=ge(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(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"),x(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[10]),x(f,"sidebar-content-compact",n[3].length>20)},m(I,A){v(I,e,A),w(e,t),w(t,i),w(i,l),w(t,s),w(t,o),ce(o,n[0]),v(I,r,A),v(I,a,A),v(I,u,A),v(I,f,A),T&&T.m(f,null),w(f,c),$&&$.m(f,null),w(f,d),E&&E.m(f,null),w(f,m),M&&M.m(f,null),v(I,h,A),L&&L.m(I,A),v(I,g,A),_=!0,y||(S=[B(l,"click",n[15]),B(o,"input",n[16])],y=!0)},p(I,A){(!_||A[0]&512)&&x(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&ce(o,I[0]),(!_||A[0]&512)&&x(t,"active",I[9]),I[2].length?T?(T.p(I,A),A[0]&4&&O(T,1)):(T=Gh(I),T.c(),O(T,1),T.m(f,c)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),I[8].length?$?($.p(I,A),A[0]&256&&O($,1)):($=Qh(I),$.c(),O($,1),$.m(f,d)):$&&(re(),D($,1,1,()=>{$=null}),ae()),I[7].length?E?(E.p(I,A),A[0]&128&&O(E,1)):(E=t_(I),E.c(),O(E,1),E.m(f,m)):E&&(re(),D(E,1,1,()=>{E=null}),ae()),I[4].length&&!I[3].length?M||(M=s_(),M.c(),M.m(f,null)):M&&(M.d(1),M=null),(!_||A[0]&1024)&&x(f,"fade",I[10]),(!_||A[0]&8)&&x(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=o_(I),L.c(),L.m(g.parentNode,g))},i(I){_||(O(T),O($),O(E),_=!0)},o(I){D(T),D($),D(E),_=!1},d(I){I&&(k(e),k(r),k(a),k(u),k(f),k(h),k(g)),T&&T.d(),$&&$.d(),E&&E.d(),M&&M.d(),L&&L.d(I),y=!1,De(S)}}}function VD(n){let e,t,i,l;e=new sk({props:{class:"collection-sidebar",$$slots:{default:[UD]},$$scope:{ctx:n}}});let s={};return i=new nf({props:s}),n[22](i),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){F(e,o,r),v(o,t,r),F(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||(O(e.$$.fragment,o),O(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(e,o),n[22](null),q(i,o)}}}const r_="@pinnedCollections";function BD(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function WD(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,En,N=>t(13,u=N)),Qe(n,Qn,N=>t(14,f=N)),Qe(n,gr,N=>t(10,c=N)),Qe(n,Dl,N=>t(11,d=N));let m,h="",g=[],_=!1,y;S();function S(){t(1,g=[]);try{const N=localStorage.getItem(r_);N&&t(1,g=JSON.parse(N)||[])}catch{}}function T(){t(1,g=g.filter(N=>!!u.find(U=>U.id==N)))}const $=()=>t(0,h="");function E(){h=this.value,t(0,h)}function M(N){g=N,t(1,g)}function L(N){g=N,t(1,g)}const I=()=>{i.length||t(6,_=!_)};function A(N){g=N,t(1,g)}const P=()=>m==null?void 0:m.show();function R(N){ie[N?"unshift":"push"](()=>{m=N,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&(T(),BD()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,l=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(r_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,s=u.filter(N=>N.id==h||N.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty[0]&10&&t(2,o=s.filter(N=>g.includes(N.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(N=>!N.system&&!g.includes(N.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(N=>N.system&&!g.includes(N.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&y!=f.id&&(t(12,y=f.id),f.system&&!o.find(N=>N.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,s,i,m,_,a,r,l,c,d,y,u,f,$,E,M,L,I,A,P,R]}class YD extends ye{constructor(e){super(),be(this,e,WD,VD,_e,{},null,[-1,-1])}}function KD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function JD(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=Y(n[2]),l=C(),s=b("div"),o=Y(n[1]),r=Y(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(e,l),w(e,s),w(s,o),w(s,r),a||(u=Me(He.call(null,e,n[3])),a=!0)},p(f,c){c&4&&ue(i,f[2]),c&2&&ue(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function ZD(n){let e;function t(s,o){return s[0]?JD:KD}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function GD(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return z.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 ye{constructor(e){super(),be(this,e,GD,ZD,_e,{date:0})}}function a_(n){let e;function t(s,o){return s[4]==="image"?QD:XD}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function XD(n){let e,t;return{c(){e=b("object"),t=Y("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){v(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&&k(e)}}}function QD(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){v(l,e,s)},p(l,s){s&2&&!vn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&k(e)}}}function xD(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&a_(n);return{c(){i&&i.c(),t=ge()},m(s,o){i&&i.m(s,o),v(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=a_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&k(t),i&&i.d(s)}}}function eI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){v(l,e,s),t||(i=B(e,"click",tt(n[0])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function tI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=Y(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){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,s,d),v(c,o,d),v(c,r,d),v(c,a,d),u||(f=B(a,"click",n[0]),u=!0)},p(c,d){d&4&&ue(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(s),k(o),k(r),k(a)),u=!1,f()}}}function nI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[tI],header:[eI],default:[xD]},$$scope:{ctx:n}};return e=new ln({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[7](null),q(e,l)}}}function iI(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){Pe.call(this,n,m)}function d(m){Pe.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=z.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class lI extends ye{constructor(e){super(),be(this,e,iI,nI,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function sI(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?uI:u[3]==="video"||u[3]==="audio"?aI:rI}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){v(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&&k(e),a.d(),l=!1,s()}}}function oI(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function rI(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function aI(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function uI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),vn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){v(o,e,r),l||(s=B(e,"error",n[8]),l=!0)},p(o,r){r&32&&!vn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),l=!1,s()}}}function u_(n){let e,t,i={};return e=new lI({props:i}),n[12](e),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[12](null),q(e,l)}}}function fI(n){let e,t,i;function l(a,u){return a[2]?oI:sI}let s=l(n),o=s(n),r=n[7]&&u_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ge()},m(a,u){o.m(a,u),v(a,e,u),r&&r.m(a,u),v(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&&O(r,1)):(r=u_(a),r.c(),O(r,1),r.m(t.parentNode,t)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){i||(O(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function cI(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(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,u="")}const g=y=>{l&&(y.preventDefault(),a==null||a.show(f))};function _(y){ie[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=z.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 ye{constructor(e){super(),be(this,e,cI,fI,_e,{record:9,filename:0,size:1})}}function f_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function c_(n,e,t){const i=n.slice();i[7]=e[t];const l=z.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function d_(n,e,t){const i=n.slice();return i[13]=e[t],i}function p_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function m_(n){let e=!z.isEmpty(n[13]),t,i,l=e&&p_(n);return{c(){l&&l.c(),t=ge()},m(s,o){l&&l.m(s,o),v(s,t,o),i=!0},p(s,o){o&3&&(e=!z.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&O(l,1)):(l=p_(s),l.c(),O(l,1),l.m(t.parentNode,t)):l&&(re(),D(l,1,1,()=>{l=null}),ae())},i(s){i||(O(l),i=!0)},o(s){D(l),i=!1},d(s){s&&k(t),l&&l.d(s)}}}function h_(n){let e,t,i=pe(n[10]),l=[];for(let o=0;o<i.length;o+=1)l[o]=m_(d_(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ge()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);v(o,e,r),t=!0},p(o,r){if(r&3){i=pe(o[10]);let a;for(a=0;a<i.length;a+=1){const u=d_(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=m_(u),l[a].c(),O(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function __(n){let e=z.truncate(z.displayValue(n[0],[]),70)+"",t;return{c(){t=Y(e)},m(i,l){v(i,t,l)},p(i,l){l&1&&e!==(e=z.truncate(z.displayValue(i[0],[]),70)+"")&&ue(t,e)},d(i){i&&k(t)}}}function dI(n){let e;return{c(){e=Y(",")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function pI(n){let e=z.truncate(z.displayValue(n[0],[n[7].name]),70)+"",t;return{c(){t=Y(e)},m(i,l){v(i,t,l)},p(i,l){l&5&&e!==(e=z.truncate(z.displayValue(i[0],[i[7].name]),70)+"")&&ue(t,e)},i:te,o:te,d(i){i&&k(t)}}}function mI(n){let e,t,i;function l(o){n[5](o,n[7])}let s={};return n[0].expand[n[7].name]!==void 0&&(s.record=n[0].expand[n[7].name]),e=new ok({props:s}),ie.push(()=>ve(e,"record",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function g_(n){let e,t,i,l,s,o=n[9]>0&&dI();const r=[mI,pI],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=ge()},m(f,c){o&&o.m(f,c),v(f,e,c),a[t].m(f,c),v(f,l,c),s=!0},p(f,c){let d=t;t=u(f),t===d?a[t].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),i=a[t],i?i.p(f,c):(i=a[t]=r[t](f),i.c()),O(i,1),i.m(l.parentNode,l))},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&(k(e),k(l)),o&&o.d(f),a[t].d(f)}}}function hI(n){let e,t,i,l=pe(n[1]),s=[];for(let c=0;c<l.length;c+=1)s[c]=h_(c_(n,l,c));const o=c=>D(s[c],1,1,()=>{s[c]=null});let r=pe(n[2]),a=[];for(let c=0;c<r.length;c+=1)a[c]=g_(f_(n,r,c));const u=c=>D(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=__(n)),{c(){for(let c=0;c<s.length;c+=1)s[c].c();e=C();for(let c=0;c<a.length;c+=1)a[c].c();t=ge(),f&&f.c()},m(c,d){for(let m=0;m<s.length;m+=1)s[m]&&s[m].m(c,d);v(c,e,d);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(c,d);v(c,t,d),f&&f.m(c,d),i=!0},p(c,[d]){if(d&3){l=pe(c[1]);let m;for(m=0;m<l.length;m+=1){const h=c_(c,l,m);s[m]?(s[m].p(h,d),O(s[m],1)):(s[m]=h_(h),s[m].c(),O(s[m],1),s[m].m(e.parentNode,e))}for(re(),m=l.length;m<s.length;m+=1)o(m);ae()}if(d&5){r=pe(c[2]);let m;for(m=0;m<r.length;m+=1){const h=f_(c,r,m);a[m]?(a[m].p(h,d),O(a[m],1)):(a[m]=g_(h),a[m].c(),O(a[m],1),a[m].m(t.parentNode,t))}for(re(),m=r.length;m<a.length;m+=1)u(m);ae(),!r.length&&f?f.p(c,d):r.length?f&&(f.d(1),f=null):(f=__(c),f.c(),f.m(t.parentNode,t))}},i(c){if(!i){for(let d=0;d<l.length;d+=1)O(s[d]);for(let d=0;d<r.length;d+=1)O(a[d]);i=!0}},o(c){s=s.filter(Boolean);for(let d=0;d<s.length;d+=1)D(s[d]);a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)D(a[d]);i=!1},d(c){c&&(k(e),k(t)),pt(s,c),pt(a,c),f&&f.d(c)}}}function _I(n,e,t){let i,l;Qe(n,En,f=>t(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 ok extends ye{constructor(e){super(),be(this,e,_I,hI,_e,{record:0})}}function gI(n){let e,t,i,l,s,o,r,a,u,f;return t=new ok({props:{record:n[0]}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collectionId="+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){v(c,e,d),F(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Me(r=He.call(null,l,{text:`Open relation record in new tab:
+                you'll have to update it manually!`,o=C(),u&&u.c(),r=C(),f&&f.c(),a=ge(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),u&&u.m(l,null),v(c,r,d),f&&f.m(c,d),v(c,a,d)},p(c,d){c[7].length?u||(u=Sh(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=Th(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function _D(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function gD(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',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){v(o,e,r),v(o,t,r),v(o,i,r),e.focus(),l||(s=[B(e,"click",n[12]),B(i,"click",n[13])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,De(s)}}}function bD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[gD],header:[_D],default:[hD]},$$scope:{ctx:n}};return e=new ln({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&67109854&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[14](null),q(e,l)}}}function yD(n,e,t){let i,l,s,o,r,a;const u=gt();let f,c,d,m;async function h(M,L,I=!0){t(1,c=M),t(2,d=L),m=I,await fn(),i||s.length||o.length||r.length?f==null||f.show():_()}function g(){f==null||f.hide()}function _(){g(),u("confirm",m)}const y=()=>g(),S=()=>_();function T(M){ie[M?"unshift":"push"](()=>{f=M,t(5,f)})}function $(M){Pe.call(this,n,M)}function E(M){Pe.call(this,n,M)}return n.$$.update=()=>{var M,L,I;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((M=d==null?void 0:d.fields)==null?void 0:M.filter(A=>A.id&&!A._toDelete&&A._originalName!=A.name))||[]),n.$$.dirty&4&&t(7,o=((L=d==null?void 0:d.fields)==null?void 0:L.filter(A=>A.id&&A._toDelete))||[]),n.$$.dirty&6&&t(6,r=((I=d==null?void 0:d.fields)==null?void 0:I.filter(A=>{var R;const P=(R=c==null?void 0:c.fields)==null?void 0:R.find(N=>N.id==A.id);return P?P.maxSelect!=1&&A.maxSelect==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[g,c,d,i,l,f,r,o,s,a,_,h,y,S,T,$,E]}class kD extends ye{constructor(e){super(),be(this,e,yD,bD,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function Dh(n,e,t){const i=n.slice();return i[58]=e[t][0],i[59]=e[t][1],i}function vD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new eD({props:s}),ie.push(()=>ve(e,"collection",l)),{c(){H(e.$$.fragment)},m(o,r){F(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wD(n){let e,t,i;function l(o){n[42](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new oD({props:s}),ie.push(()=>ve(e,"collection",l)),{c(){H(e.$$.fragment)},m(o,r){F(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function Ih(n){let e,t,i,l;function s(r){n[44](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new mD({props:o}),ie.push(()=>ve(t,"collection",s)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){v(r,e,a),F(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u)},i(r){l||(O(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),q(t)}}}function Lh(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 yO({props:o}),ie.push(()=>ve(t,"collection",s)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===ss)},m(r,a){v(r,e,a),F(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&x(e,"active",r[3]===ss)},i(r){l||(O(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),q(t)}}}function SD(n){let e,t,i,l,s,o,r;const a=[wD,vD],u=[];function f(m,h){return m[16]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[14]&&n[3]===to&&Ih(n),d=n[17]&&Lh(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"),x(t,"active",n[3]===Xi),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){v(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 g=i;i=f(m),i===g?u[i].p(m,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),O(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Xi),!m[14]&&m[3]===to?c?(c.p(m,h),h[0]&16392&&O(c,1)):(c=Ih(m),c.c(),O(c,1),c.m(e,o)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),m[17]?d?(d.p(m,h),h[0]&131072&&O(d,1)):(d=Lh(m),d.c(),O(d,1),d.m(e,null)):d&&(re(),D(d,1,1,()=>{d=null}),ae())},i(m){r||(O(l),O(c),O(d),r=!0)},o(m){D(l),D(c),D(d),r=!1},d(m){m&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Ah(n){let e,t,i,l,s,o,r;return o=new Hn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[TD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),H(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){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),F(o,i,null),r=!0},p(a,u){const f={};u[2]&1&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),q(o)}}}function TD(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',t=C(),i=b("hr"),l=C(),s=b("button"),s.innerHTML='<i class="ri-eraser-line" aria-hidden="true"></i> <span class="txt">Truncate</span>',o=C(),r=b("button"),r.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item txt-danger"),p(r,"role","menuitem")},m(f,c){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(f,r,c),a||(u=[B(e,"click",n[33]),B(s,"click",n[34]),B(r,"click",On(tt(n[35])))],a=!0)},p:te,d(f){f&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r)),a=!1,De(u)}}}function Ph(n){let e,t,i,l;return i=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[$D]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){v(s,e,o),v(s,t,o),F(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&1&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(k(e),k(t)),q(i,s)}}}function Nh(n){let e,t,i,l,s,o=n[59]+"",r,a,u,f,c;function d(){return n[37](n[58])}return{c(){e=b("button"),t=b("i"),l=C(),s=b("span"),r=Y(o),a=Y(" collection"),u=C(),p(t,"class",i=js(z.getCollectionTypeIcon(n[58]))+" 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"),x(e,"selected",n[58]==n[2].type)},m(m,h){v(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=js(z.getCollectionTypeIcon(n[58]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[59]+"")&&ue(r,o),h[0]&68&&x(e,"selected",n[58]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function $D(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l<t.length;l+=1)i[l]=Nh(Dh(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s[0]&4194372){t=pe(Object.entries(l[6]));let o;for(o=0;o<t.length;o+=1){const r=Dh(l,t,o);i[o]?i[o].p(r,s):(i[o]=Nh(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function Rh(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function CD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y=(n[6][n[2].type]||"N/A")+"",S,T,$,E,M,L,I,A,P,R,N=!n[2].id&&Ph(n),U=n[2].system&&Rh();return{c(){e=b("label"),t=Y("Name"),l=C(),s=b("input"),f=C(),c=b("div"),d=b("div"),m=b("span"),h=C(),g=b("span"),_=Y("Type: "),S=Y(y),T=C(),N&&N.c(),L=C(),U&&U.c(),I=ge(),p(e,"for",i=n[57]),p(s,"type","text"),p(s,"id",o=n[57]),s.required=!0,s.disabled=n[15],p(s,"spellcheck","false"),s.autofocus=r=!n[2].id,p(s,"placeholder",a=n[17]?'eg. "users"':'eg. "posts"'),s.value=u=n[2].name,x(s,"txt-bold",n[2].system),p(m,"aria-hidden","true"),p(g,"class","txt"),p(d,"tabindex",$=n[2].id?-1:0),p(d,"role",E=n[2].id?"":"button"),p(d,"aria-label","View types"),p(d,"class",M="btn btn-sm p-r-10 p-l-10 "+(n[2].id?"btn-transparent":"btn-outline")),x(d,"btn-disabled",!!n[2].id),p(c,"class","form-field-addon")},m(j,V){v(j,e,V),w(e,t),v(j,l,V),v(j,s,V),v(j,f,V),v(j,c,V),w(c,d),w(d,m),w(d,h),w(d,g),w(g,_),w(g,S),w(d,T),N&&N.m(d,null),v(j,L,V),U&&U.m(j,V),v(j,I,V),A=!0,n[2].id||s.focus(),P||(R=B(s,"input",n[36]),P=!0)},p(j,V){(!A||V[1]&67108864&&i!==(i=j[57]))&&p(e,"for",i),(!A||V[1]&67108864&&o!==(o=j[57]))&&p(s,"id",o),(!A||V[0]&32768)&&(s.disabled=j[15]),(!A||V[0]&4&&r!==(r=!j[2].id))&&(s.autofocus=r),(!A||V[0]&131072&&a!==(a=j[17]?'eg. "users"':'eg. "posts"'))&&p(s,"placeholder",a),(!A||V[0]&4&&u!==(u=j[2].name)&&s.value!==u)&&(s.value=u),(!A||V[0]&4)&&x(s,"txt-bold",j[2].system),(!A||V[0]&68)&&y!==(y=(j[6][j[2].type]||"N/A")+"")&&ue(S,y),j[2].id?N&&(re(),D(N,1,1,()=>{N=null}),ae()):N?(N.p(j,V),V[0]&4&&O(N,1)):(N=Ph(j),N.c(),O(N,1),N.m(d,null)),(!A||V[0]&4&&$!==($=j[2].id?-1:0))&&p(d,"tabindex",$),(!A||V[0]&4&&E!==(E=j[2].id?"":"button"))&&p(d,"role",E),(!A||V[0]&4&&M!==(M="btn btn-sm p-r-10 p-l-10 "+(j[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",M),(!A||V[0]&4)&&x(d,"btn-disabled",!!j[2].id),j[2].system?U||(U=Rh(),U.c(),U.m(I.parentNode,I)):U&&(U.d(1),U=null)},i(j){A||(O(N),A=!0)},o(j){D(N),A=!1},d(j){j&&(k(e),k(l),k(s),k(f),k(c),k(L),k(I)),N&&N.d(),U&&U.d(j),P=!1,R()}}}function Fh(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){v(r,e,a),l=!0,s||(o=Me(t=He.call(null,e,n[11])),s=!0)},p(r,a){t&&Rt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&nt(()=>{l&&(i||(i=ze(e,Mt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=ze(e,Mt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&k(e),r&&i&&i.end(),s=!1,o()}}}function qh(n){var a,u,f,c,d,m,h;let e,t,i,l=!z.isEmpty((a=n[5])==null?void 0:a.listRule)||!z.isEmpty((u=n[5])==null?void 0:u.viewRule)||!z.isEmpty((f=n[5])==null?void 0:f.createRule)||!z.isEmpty((c=n[5])==null?void 0:c.updateRule)||!z.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!z.isEmpty((m=n[5])==null?void 0:m.authRule)||!z.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Hh();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"),x(e,"active",n[3]===to)},m(g,_){v(g,e,_),w(e,t),w(e,i),r&&r.m(e,null),s||(o=B(e,"click",n[40]),s=!0)},p(g,_){var y,S,T,$,E,M,L;_[0]&32&&(l=!z.isEmpty((y=g[5])==null?void 0:y.listRule)||!z.isEmpty((S=g[5])==null?void 0:S.viewRule)||!z.isEmpty((T=g[5])==null?void 0:T.createRule)||!z.isEmpty(($=g[5])==null?void 0:$.updateRule)||!z.isEmpty((E=g[5])==null?void 0:E.deleteRule)||!z.isEmpty((M=g[5])==null?void 0:M.authRule)||!z.isEmpty((L=g[5])==null?void 0:L.manageRule)),l?r?_[0]&32&&O(r,1):(r=Hh(),r.c(),O(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),_[0]&8&&x(e,"active",g[3]===to)},d(g){g&&k(e),r&&r.d(),s=!1,o()}}}function Hh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function jh(n){let e,t,i,l=n[5]&&n[24](n[5],n[12].concat(["manageRule","authRule"])),s,o,r=l&&zh();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"),x(e,"active",n[3]===ss)},m(a,u){v(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=B(e,"click",n[41]),s=!0)},p(a,u){u[0]&4128&&(l=a[5]&&a[24](a[5],a[12].concat(["manageRule","authRule"]))),l?r?u[0]&4128&&O(r,1):(r=zh(),r.c(),O(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u[0]&8&&x(e,"active",a[3]===ss)},d(a){a&&k(e),r&&r.d(),s=!1,o()}}}function zh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function OD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[16]?"Query":"Fields",g,_,y=!z.isEmpty(n[11]),S,T,$,E,M,L=!!n[2].id&&!n[2].system&&Ah(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[CD,({uniqueId:R})=>({57:R}),({uniqueId:R})=>[0,R?67108864:0]]},$$scope:{ctx:n}}});let I=y&&Fh(n),A=!n[14]&&qh(n),P=n[17]&&jh(n);return{c(){e=b("h4"),i=Y(t),l=C(),L&&L.c(),s=C(),o=b("form"),H(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),g=Y(h),_=C(),I&&I.c(),S=C(),A&&A.c(),T=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"),x(d,"active",n[3]===Xi),p(c,"class","tabs-header stretched")},m(R,N){v(R,e,N),w(e,i),v(R,l,N),L&&L.m(R,N),v(R,s,N),v(R,o,N),F(r,o,null),w(o,a),w(o,u),v(R,f,N),v(R,c,N),w(c,d),w(d,m),w(m,g),w(d,_),I&&I.m(d,null),w(c,S),A&&A.m(c,null),w(c,T),P&&P.m(c,null),$=!0,E||(M=[B(o,"submit",tt(n[38])),B(d,"click",n[39])],E=!0)},p(R,N){(!$||N[0]&4)&&t!==(t=R[2].id?"Edit collection":"New collection")&&ue(i,t),R[2].id&&!R[2].system?L?(L.p(R,N),N[0]&4&&O(L,1)):(L=Ah(R),L.c(),O(L,1),L.m(s.parentNode,s)):L&&(re(),D(L,1,1,()=>{L=null}),ae());const U={};N[0]&163908|N[1]&67108864|N[2]&1&&(U.$$scope={dirty:N,ctx:R}),r.$set(U),(!$||N[0]&65536)&&h!==(h=R[16]?"Query":"Fields")&&ue(g,h),N[0]&2048&&(y=!z.isEmpty(R[11])),y?I?(I.p(R,N),N[0]&2048&&O(I,1)):(I=Fh(R),I.c(),O(I,1),I.m(d,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae()),(!$||N[0]&8)&&x(d,"active",R[3]===Xi),R[14]?A&&(A.d(1),A=null):A?A.p(R,N):(A=qh(R),A.c(),A.m(c,T)),R[17]?P?P.p(R,N):(P=jh(R),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(R){$||(O(L),O(r.$$.fragment,R),O(I),$=!0)},o(R){D(L),D(r.$$.fragment,R),D(I),$=!1},d(R){R&&(k(e),k(l),k(s),k(o),k(f),k(c)),L&&L.d(R),q(r),I&&I.d(),A&&A.d(),P&&P.d(),E=!1,De(M)}}}function Uh(n){let e,t,i,l,s,o;return l=new Hn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[ED]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(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[13]||n[9]},m(r,a){v(r,e,a),w(e,t),w(e,i),F(l,e,null),o=!0},p(r,a){const u={};a[2]&1&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&8704&&s!==(s=!r[13]||r[9]))&&(e.disabled=s)},i(r){o||(O(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),q(l)}}}function ED(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Save and continue</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[32]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function MD(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&&Uh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("div"),s=b("button"),o=b("span"),a=Y(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,"class","btn btn-expanded"),p(s,"title","Save and close"),s.disabled=u=!n[13]||n[9],x(s,"btn-loading",n[9]),p(l,"class","btns-group no-gap")},m(g,_){v(g,e,_),w(e,t),v(g,i,_),v(g,l,_),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[30]),B(s,"click",n[31])],d=!0)},p(g,_){(!c||_[0]&512)&&(e.disabled=g[9]),(!c||_[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&ue(a,r),(!c||_[0]&8704&&u!==(u=!g[13]||g[9]))&&(s.disabled=u),(!c||_[0]&512)&&x(s,"btn-loading",g[9]),g[2].id?h?(h.p(g,_),_[0]&4&&O(h,1)):(h=Uh(g),h.c(),O(h,1),h.m(l,null)):h&&(re(),D(h,1,1,()=>{h=null}),ae())},i(g){c||(O(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(k(e),k(i),k(l)),h&&h.d(),d=!1,De(m)}}}function DD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[46],$$slots:{footer:[MD],header:[OD],default:[SD]},$$scope:{ctx:n}};e=new ln({props:s}),n[47](e),e.$on("hide",n[48]),e.$on("show",n[49]);let o={};return i=new kD({props:o}),n[50](i),i.$on("confirm",n[51]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){F(e,r,a),v(r,t,a),F(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[46]),a[0]&260716|a[2]&1&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[47](null),q(e,r),n[50](null),q(i,r)}}}const Xi="schema",to="api_rules",ss="options",ID="base",Vh="auth",Bh="view";function La(n){return JSON.stringify(n)}function LD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Mu,Fe=>t(29,u=Fe)),Qe(n,Qn,Fe=>t(52,f=Fe)),Qe(n,Sn,Fe=>t(5,c=Fe));const d={};d[ID]="Base",d[Bh]="View",d[Vh]="Auth";const m=gt();let h,g,_=null,y={},S=!1,T=!1,$=Xi,E=La(y),M="",L=[];function I(Fe){t(3,$=Fe)}function A(Fe){return N(Fe),t(10,T=!0),I(Xi),h==null?void 0:h.show()}function P(){return h==null?void 0:h.hide()}function R(){t(10,T=!1),P()}async function N(Fe){Wt({}),typeof Fe<"u"?(t(27,_=Fe),t(2,y=structuredClone(Fe))):(t(27,_=null),t(2,y=structuredClone(u.base)),y.fields.push({type:"autodate",name:"created",onCreate:!0}),y.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,y.fields=y.fields||[],y),t(2,y._originalName=y.name||"",y),await fn(),t(28,E=La(y))}function U(Fe=!0){y.id?g==null||g.show(_,y,Fe):j(Fe)}function j(Fe=!0){if(S)return;t(9,S=!0);const Dt=V(),Gt=!y.id;let mn;Gt?mn=me.collections.create(Dt):mn=me.collections.update(y.id,Dt),mn.then(hn=>{Ds(),Mw(hn),Fe?(t(10,T=!1),P()):N(hn),tn(y.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Gt,collection:hn}),Gt&&Nn(Qn,f=hn,f)}).catch(hn=>{me.error(hn)}).finally(()=>{t(9,S=!1)})}function V(){const Fe=Object.assign({},y);Fe.fields=Fe.fields.slice(0);for(let Dt=Fe.fields.length-1;Dt>=0;Dt--)Fe.fields[Dt]._toDelete&&Fe.fields.splice(Dt,1);return Fe}function K(){_!=null&&_.id&&pn(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>me.collections.truncate(_.id).then(()=>{R(),tn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Fe=>{me.error(Fe)}))}function J(){_!=null&&_.id&&pn(`Do you really want to delete collection "${_.name}" and all its records?`,()=>me.collections.delete(_.id).then(()=>{R(),tn(`Successfully deleted collection "${_.name}".`),m("delete",_),Dw(_)}).catch(Fe=>{me.error(Fe)}))}function ee(Fe){t(2,y.type=Fe,y),t(2,y=Object.assign(structuredClone(u[Fe]),y)),fi("fields")}function X(){r?pn("You have unsaved changes. Do you really want to discard them?",()=>{oe()}):oe()}async function oe(){const Fe=_?structuredClone(_):null;if(Fe){if(Fe.id="",Fe.created="",Fe.updated="",Fe.name+="_duplicate",!z.isEmpty(Fe.fields))for(const Dt of Fe.fields)Dt.id="";if(!z.isEmpty(Fe.indexes))for(let Dt=0;Dt<Fe.indexes.length;Dt++){const Gt=z.parseIndex(Fe.indexes[Dt]);Gt.indexName="idx_"+z.randomString(10),Gt.tableName=Fe.name,Fe.indexes[Dt]=z.buildIndex(Gt)}}A(Fe),await fn(),t(28,E="")}function Se(Fe,Dt=[]){if(z.isEmpty(Fe))return!1;const Gt=Object.keys(Fe);for(let mn of Gt)if(!Dt.includes(mn))return!0;return!1}const ke=()=>P(),Ce=()=>U(),We=()=>U(!1),st=()=>X(),et=()=>K(),Be=()=>J(),rt=Fe=>{t(2,y.name=z.slugify(Fe.target.value),y),Fe.target.value=y.name},Je=Fe=>ee(Fe),at=()=>{a&&U()},Ht=()=>I(Xi),Te=()=>I(to),Ze=()=>I(ss);function ot(Fe){y=Fe,t(2,y),t(27,_)}function Le(Fe){y=Fe,t(2,y),t(27,_)}function Ve(Fe){y=Fe,t(2,y),t(27,_)}function we(Fe){y=Fe,t(2,y),t(27,_)}const Oe=()=>r&&T?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,T=!1),P()}),!1):!0;function ut(Fe){ie[Fe?"unshift":"push"](()=>{h=Fe,t(7,h)})}function Ne(Fe){Pe.call(this,n,Fe)}function xe(Fe){Pe.call(this,n,Fe)}function qt(Fe){ie[Fe?"unshift":"push"](()=>{g=Fe,t(8,g)})}const Zt=Fe=>j(Fe.detail);return n.$$.update=()=>{var Fe;n.$$.dirty[0]&536870912&&t(12,L=Object.keys(u.base||{})),n.$$.dirty[0]&4&&y.type==="view"&&(t(2,y.createRule=null,y),t(2,y.updateRule=null,y),t(2,y.deleteRule=null,y),t(2,y.indexes=[],y)),n.$$.dirty[0]&134217732&&y.name&&(_==null?void 0:_.name)!=y.name&&y.indexes.length>0&&t(2,y.indexes=(Fe=y.indexes)==null?void 0:Fe.map(Dt=>z.replaceIndexTableName(Dt,y.name)),y),n.$$.dirty[0]&4&&t(17,i=y.type===Vh),n.$$.dirty[0]&4&&t(16,l=y.type===Bh),n.$$.dirty[0]&32&&(c.fields||c.viewQuery?t(11,M=z.getNestedVal(c,"fields.message")||"Has errors"):t(11,M="")),n.$$.dirty[0]&4&&t(15,s=!!y.id&&y.system),n.$$.dirty[0]&4&&t(14,o=!!y.id&&y.system&&y.name=="_superusers"),n.$$.dirty[0]&268435460&&t(4,r=E!=La(y)),n.$$.dirty[0]&20&&t(13,a=!y.id||r),n.$$.dirty[0]&12&&$===ss&&y.type!=="auth"&&I(Xi)},[I,P,y,$,r,c,d,h,g,S,T,M,L,a,o,s,l,i,U,j,K,J,ee,X,Se,A,R,_,E,u,ke,Ce,We,st,et,Be,rt,Je,at,Ht,Te,Ze,ot,Le,Ve,we,Oe,ut,Ne,xe,qt,Zt]}class nf extends ye{constructor(e){super(),be(this,e,LD,DD,_e,{changeTab:0,show:25,hide:1,forceHide:26},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[26]}}function AD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){v(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&&x(e,"dragging",l[1])},i:te,o:te,d(l){l&&k(e),n[4](null),t=!1,De(i)}}}function PD(n,e,t){const i=gt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let y=_.clientX-o,S=_.clientY-r,T=_.clientX-a,$=_.clientY-u;!f&&Math.abs(T-s.offsetLeft)<l&&Math.abs($-s.offsetTop)<l||(_.preventDefault(),f||(t(1,f=!0),s.classList.add("no-pointer-events"),i("dragstart",{event:_,elem:s})),i("dragging",{event:_,elem:s,diffX:y,diffY:S}))}function h(_){ie[_?"unshift":"push"](()=>{s=_,t(0,s)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,h,g]}class ND extends ye{constructor(e){super(),be(this,e,PD,AD,_e,{tolerance:3})}}function RD(n){let e,t,i,l,s;const o=n[5].default,r=Lt(o,n,n[4],null);return l=new ND({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),H(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){v(a,e,u),r&&r.m(e,null),n[6](e),v(a,i,u),F(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&Pt(r,o,a,a[4],s?At(o,a[4],u,null):Nt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(O(r,a),O(l.$$.fragment,a),s=!0)},o(a){D(r,a),D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(i)),r&&r.d(a),n[6](null),q(l,a)}}}const Wh="@superuserSidebarWidth";function FD(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Wh)||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=()=>{z.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(Wh,a))},[s,o,a,r,l,i,u,f,c,d]}class sk extends ye{constructor(e){super(),be(this,e,FD,RD,_e,{class:0})}}function Yh(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){v(l,e,s),t||(i=Me(He.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(l){l&&k(e),t=!1,i()}}}function qD(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function HD(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function jD(n){var $,E;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&(($=n[0].oauth2)==null?void 0:$.enabled)&&!((E=n[0].oauth2.providers)!=null&&E.length)&&Yh();function y(M,L){return M[1]?HD:qD}let S=y(n),T=S(n);return{c(){var M;e=b("a"),t=b("i"),l=C(),s=b("span"),r=Y(o),a=C(),_&&_.c(),u=C(),f=b("span"),T.c(),p(t,"class",i=js(z.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?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),x(e,"active",((M=n[2])==null?void 0:M.id)===n[0].id)},m(M,L){v(M,e,L),w(e,t),w(e,l),w(e,s),w(s,r),w(e,a),_&&_.m(e,null),w(e,u),w(e,f),T.m(f,null),h||(g=[Me(c=He.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),B(f,"click",On(tt(n[5]))),Me(Un.call(null,e))],h=!0)},p(M,[L]){var I,A,P;L&1&&i!==(i=js(z.getCollectionTypeIcon(M[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=M[0].name+"")&&ue(r,o),M[0].type=="auth"&&((I=M[0].oauth2)!=null&&I.enabled)&&!((A=M[0].oauth2.providers)!=null&&A.length)?_||(_=Yh(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=y(M))&&(T.d(1),T=S(M),T&&(T.c(),T.m(f,null))),c&&Rt(c.update)&&L&2&&c.update.call(null,{position:"right",text:(M[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collectionId="+M[0].id)&&p(e,"href",d),L&1&&m!==(m=M[0].name)&&p(e,"title",m),L&5&&x(e,"active",((P=M[2])==null?void 0:P.id)===M[0].id)},i:te,o:te,d(M){M&&k(e),_&&_.d(),T.d(),h=!1,De(g)}}}function zD(n,e,t){let i,l;Qe(n,Qn,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?z.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 ye{constructor(e){super(),be(this,e,zD,jD,_e,{collection:0,pinnedIds:4})}}function Kh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[25]=e[t],i}function Gh(n){let e,t,i=[],l=new Map,s,o,r=pe(n[2]);const a=u=>u[25].id;for(let u=0;u<r.length;u+=1){let f=Zh(n,r,u),c=a(f);l.set(c,i[u]=Xh(c,f))}return{c(){e=b("div"),e.textContent="Pinned",t=C();for(let u=0;u<i.length;u+=1)i[u].c();s=ge(),p(e,"class","sidebar-title")},m(u,f){v(u,e,f),v(u,t,f);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);v(u,s,f),o=!0},p(u,f){f[0]&6&&(r=pe(u[2]),re(),i=kt(i,f,a,1,u,r,l,s.parentNode,zt,Xh,s,Zh),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)O(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)D(i[f]);o=!1},d(u){u&&(k(e),k(t),k(s));for(let f=0;f<i.length;f+=1)i[f].d(u)}}}function Xh(n,e){let t,i,l,s;function o(a){e[17](a)}let r={collection:e[25]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new lf({props:r}),ie.push(()=>ve(i,"pinnedIds",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function Qh(n){let e,t=[],i=new Map,l,s,o=n[2].length&&xh(),r=pe(n[8]);const a=u=>u[25].id;for(let u=0;u<r.length;u+=1){let f=Jh(n,r,u),c=a(f);i.set(c,t[u]=e_(c,f))}return{c(){o&&o.c(),e=C();for(let u=0;u<t.length;u+=1)t[u].c();l=ge()},m(u,f){o&&o.m(u,f),v(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(u,f);v(u,l,f),s=!0},p(u,f){u[2].length?o||(o=xh(),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),f[0]&258&&(r=pe(u[8]),re(),t=kt(t,f,a,1,u,r,i,l.parentNode,zt,e_,l,Jh),ae())},i(u){if(!s){for(let f=0;f<r.length;f+=1)O(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)D(t[f]);s=!1},d(u){u&&(k(e),k(l)),o&&o.d(u);for(let f=0;f<t.length;f+=1)t[f].d(u)}}}function xh(n){let e;return{c(){e=b("div"),e.textContent="Others",p(e,"class","sidebar-title")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function e_(n,e){let t,i,l,s;function o(a){e[18](a)}let r={collection:e[25]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new lf({props:r}),ie.push(()=>ve(i,"pinnedIds",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function t_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&n_(n),m=(n[6]||n[4].length)&&i_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ge(),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,x(e,"link-hint",!n[4].length)},m(h,g){v(h,e,g),w(e,t),w(e,i),d&&d.m(e,null),v(h,r,g),m&&m.m(h,g),v(h,a,g),u=!0,f||(c=B(e,"click",n[19]),f=!0)},p(h,g){h[4].length?d&&(d.d(1),d=null):d?d.p(h,g):(d=n_(h),d.c(),d.m(e,null)),(!u||g[0]&64&&l!==(l=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",l),(!u||g[0]&80&&s!==(s=h[6]||h[4].length))&&p(e,"aria-expanded",s),(!u||g[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||g[0]&16)&&x(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&O(m,1)):(m=i_(h),m.c(),O(m,1),m.m(a.parentNode,a)):m&&(re(),D(m,1,1,()=>{m=null}),ae())},i(h){u||(O(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(k(e),k(r),k(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function n_(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){v(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&&k(e)}}}function i_(n){let e=[],t=new Map,i,l,s=pe(n[7]);const o=r=>r[25].id;for(let r=0;r<s.length;r+=1){let a=Kh(n,s,r),u=o(a);t.set(u,e[r]=l_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ge()},m(r,a){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(r,a);v(r,i,a),l=!0},p(r,a){a[0]&130&&(s=pe(r[7]),re(),e=kt(e,a,o,1,r,s,t,i.parentNode,zt,l_,i,Kh),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(e[a]);l=!0}},o(r){for(let a=0;a<e.length;a+=1)D(e[a]);l=!1},d(r){r&&k(i);for(let a=0;a<e.length;a+=1)e[a].d(r)}}}function l_(n,e){let t,i,l,s;function o(a){e[20](a)}let r={collection:e[25]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new lf({props:r}),ie.push(()=>ve(i,"pinnedIds",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function s_(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){v(t,e,i)},d(t){t&&k(e)}}}function o_(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML='<i class="ri-add-line"></i> <span class="txt">New collection</span>',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){v(s,e,o),w(e,t),i||(l=B(t,"click",n[21]),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function UD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T=n[2].length&&Gh(n),$=n[8].length&&Qh(n),E=n[7].length&&t_(n),M=n[4].length&&!n[3].length&&s_(),L=!n[11]&&o_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),T&&T.c(),c=C(),$&&$.c(),d=C(),E&&E.c(),m=C(),M&&M.c(),h=C(),L&&L.c(),g=ge(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(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"),x(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[10]),x(f,"sidebar-content-compact",n[3].length>20)},m(I,A){v(I,e,A),w(e,t),w(t,i),w(i,l),w(t,s),w(t,o),ce(o,n[0]),v(I,r,A),v(I,a,A),v(I,u,A),v(I,f,A),T&&T.m(f,null),w(f,c),$&&$.m(f,null),w(f,d),E&&E.m(f,null),w(f,m),M&&M.m(f,null),v(I,h,A),L&&L.m(I,A),v(I,g,A),_=!0,y||(S=[B(l,"click",n[15]),B(o,"input",n[16])],y=!0)},p(I,A){(!_||A[0]&512)&&x(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&ce(o,I[0]),(!_||A[0]&512)&&x(t,"active",I[9]),I[2].length?T?(T.p(I,A),A[0]&4&&O(T,1)):(T=Gh(I),T.c(),O(T,1),T.m(f,c)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),I[8].length?$?($.p(I,A),A[0]&256&&O($,1)):($=Qh(I),$.c(),O($,1),$.m(f,d)):$&&(re(),D($,1,1,()=>{$=null}),ae()),I[7].length?E?(E.p(I,A),A[0]&128&&O(E,1)):(E=t_(I),E.c(),O(E,1),E.m(f,m)):E&&(re(),D(E,1,1,()=>{E=null}),ae()),I[4].length&&!I[3].length?M||(M=s_(),M.c(),M.m(f,null)):M&&(M.d(1),M=null),(!_||A[0]&1024)&&x(f,"fade",I[10]),(!_||A[0]&8)&&x(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=o_(I),L.c(),L.m(g.parentNode,g))},i(I){_||(O(T),O($),O(E),_=!0)},o(I){D(T),D($),D(E),_=!1},d(I){I&&(k(e),k(r),k(a),k(u),k(f),k(h),k(g)),T&&T.d(),$&&$.d(),E&&E.d(),M&&M.d(),L&&L.d(I),y=!1,De(S)}}}function VD(n){let e,t,i,l;e=new sk({props:{class:"collection-sidebar",$$slots:{default:[UD]},$$scope:{ctx:n}}});let s={};return i=new nf({props:s}),n[22](i),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){F(e,o,r),v(o,t,r),F(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||(O(e.$$.fragment,o),O(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(e,o),n[22](null),q(i,o)}}}const r_="@pinnedCollections";function BD(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function WD(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,En,N=>t(13,u=N)),Qe(n,Qn,N=>t(14,f=N)),Qe(n,gr,N=>t(10,c=N)),Qe(n,Dl,N=>t(11,d=N));let m,h="",g=[],_=!1,y;S();function S(){t(1,g=[]);try{const N=localStorage.getItem(r_);N&&t(1,g=JSON.parse(N)||[])}catch{}}function T(){t(1,g=g.filter(N=>!!u.find(U=>U.id==N)))}const $=()=>t(0,h="");function E(){h=this.value,t(0,h)}function M(N){g=N,t(1,g)}function L(N){g=N,t(1,g)}const I=()=>{i.length||t(6,_=!_)};function A(N){g=N,t(1,g)}const P=()=>m==null?void 0:m.show();function R(N){ie[N?"unshift":"push"](()=>{m=N,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&(T(),BD()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,l=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(r_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,s=u.filter(N=>N.id==h||N.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty[0]&10&&t(2,o=s.filter(N=>g.includes(N.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(N=>!N.system&&!g.includes(N.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(N=>N.system&&!g.includes(N.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&y!=f.id&&(t(12,y=f.id),f.system&&!o.find(N=>N.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,s,i,m,_,a,r,l,c,d,y,u,f,$,E,M,L,I,A,P,R]}class YD extends ye{constructor(e){super(),be(this,e,WD,VD,_e,{},null,[-1,-1])}}function KD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function JD(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=Y(n[2]),l=C(),s=b("div"),o=Y(n[1]),r=Y(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(e,l),w(e,s),w(s,o),w(s,r),a||(u=Me(He.call(null,e,n[3])),a=!0)},p(f,c){c&4&&ue(i,f[2]),c&2&&ue(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function ZD(n){let e;function t(s,o){return s[0]?JD:KD}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function GD(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return z.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 ye{constructor(e){super(),be(this,e,GD,ZD,_e,{date:0})}}function a_(n){let e;function t(s,o){return s[4]==="image"?QD:XD}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function XD(n){let e,t;return{c(){e=b("object"),t=Y("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){v(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&&k(e)}}}function QD(n){let e,t,i;return{c(){e=b("img"),vn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){v(l,e,s)},p(l,s){s&2&&!vn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&k(e)}}}function xD(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&a_(n);return{c(){i&&i.c(),t=ge()},m(s,o){i&&i.m(s,o),v(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=a_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&k(t),i&&i.d(s)}}}function eI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){v(l,e,s),t||(i=B(e,"click",tt(n[0])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function tI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=Y(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){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,s,d),v(c,o,d),v(c,r,d),v(c,a,d),u||(f=B(a,"click",n[0]),u=!0)},p(c,d){d&4&&ue(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(s),k(o),k(r),k(a)),u=!1,f()}}}function nI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[tI],header:[eI],default:[xD]},$$scope:{ctx:n}};return e=new ln({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[7](null),q(e,l)}}}function iI(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){Pe.call(this,n,m)}function d(m){Pe.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=z.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class lI extends ye{constructor(e){super(),be(this,e,iI,nI,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function sI(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?uI:u[3]==="video"||u[3]==="audio"?aI:rI}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){v(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&&k(e),a.d(),l=!1,s()}}}function oI(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function rI(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function aI(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function uI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),vn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){v(o,e,r),l||(s=B(e,"error",n[8]),l=!0)},p(o,r){r&32&&!vn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),l=!1,s()}}}function u_(n){let e,t,i={};return e=new lI({props:i}),n[12](e),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[12](null),q(e,l)}}}function fI(n){let e,t,i;function l(a,u){return a[2]?oI:sI}let s=l(n),o=s(n),r=n[7]&&u_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ge()},m(a,u){o.m(a,u),v(a,e,u),r&&r.m(a,u),v(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&&O(r,1)):(r=u_(a),r.c(),O(r,1),r.m(t.parentNode,t)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){i||(O(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function cI(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(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,u="")}const g=y=>{l&&(y.preventDefault(),a==null||a.show(f))};function _(y){ie[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=z.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 ye{constructor(e){super(),be(this,e,cI,fI,_e,{record:9,filename:0,size:1})}}function f_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function c_(n,e,t){const i=n.slice();i[7]=e[t];const l=z.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function d_(n,e,t){const i=n.slice();return i[13]=e[t],i}function p_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function m_(n){let e=!z.isEmpty(n[13]),t,i,l=e&&p_(n);return{c(){l&&l.c(),t=ge()},m(s,o){l&&l.m(s,o),v(s,t,o),i=!0},p(s,o){o&3&&(e=!z.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&O(l,1)):(l=p_(s),l.c(),O(l,1),l.m(t.parentNode,t)):l&&(re(),D(l,1,1,()=>{l=null}),ae())},i(s){i||(O(l),i=!0)},o(s){D(l),i=!1},d(s){s&&k(t),l&&l.d(s)}}}function h_(n){let e,t,i=pe(n[10]),l=[];for(let o=0;o<i.length;o+=1)l[o]=m_(d_(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ge()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);v(o,e,r),t=!0},p(o,r){if(r&3){i=pe(o[10]);let a;for(a=0;a<i.length;a+=1){const u=d_(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=m_(u),l[a].c(),O(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function __(n){let e=z.truncate(z.displayValue(n[0],[]),70)+"",t;return{c(){t=Y(e)},m(i,l){v(i,t,l)},p(i,l){l&1&&e!==(e=z.truncate(z.displayValue(i[0],[]),70)+"")&&ue(t,e)},d(i){i&&k(t)}}}function dI(n){let e;return{c(){e=Y(",")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function pI(n){let e=z.truncate(z.displayValue(n[0],[n[7].name]),70)+"",t;return{c(){t=Y(e)},m(i,l){v(i,t,l)},p(i,l){l&5&&e!==(e=z.truncate(z.displayValue(i[0],[i[7].name]),70)+"")&&ue(t,e)},i:te,o:te,d(i){i&&k(t)}}}function mI(n){let e,t,i;function l(o){n[5](o,n[7])}let s={};return n[0].expand[n[7].name]!==void 0&&(s.record=n[0].expand[n[7].name]),e=new ok({props:s}),ie.push(()=>ve(e,"record",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function g_(n){let e,t,i,l,s,o=n[9]>0&&dI();const r=[mI,pI],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=ge()},m(f,c){o&&o.m(f,c),v(f,e,c),a[t].m(f,c),v(f,l,c),s=!0},p(f,c){let d=t;t=u(f),t===d?a[t].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),i=a[t],i?i.p(f,c):(i=a[t]=r[t](f),i.c()),O(i,1),i.m(l.parentNode,l))},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&(k(e),k(l)),o&&o.d(f),a[t].d(f)}}}function hI(n){let e,t,i,l=pe(n[1]),s=[];for(let c=0;c<l.length;c+=1)s[c]=h_(c_(n,l,c));const o=c=>D(s[c],1,1,()=>{s[c]=null});let r=pe(n[2]),a=[];for(let c=0;c<r.length;c+=1)a[c]=g_(f_(n,r,c));const u=c=>D(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=__(n)),{c(){for(let c=0;c<s.length;c+=1)s[c].c();e=C();for(let c=0;c<a.length;c+=1)a[c].c();t=ge(),f&&f.c()},m(c,d){for(let m=0;m<s.length;m+=1)s[m]&&s[m].m(c,d);v(c,e,d);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(c,d);v(c,t,d),f&&f.m(c,d),i=!0},p(c,[d]){if(d&3){l=pe(c[1]);let m;for(m=0;m<l.length;m+=1){const h=c_(c,l,m);s[m]?(s[m].p(h,d),O(s[m],1)):(s[m]=h_(h),s[m].c(),O(s[m],1),s[m].m(e.parentNode,e))}for(re(),m=l.length;m<s.length;m+=1)o(m);ae()}if(d&5){r=pe(c[2]);let m;for(m=0;m<r.length;m+=1){const h=f_(c,r,m);a[m]?(a[m].p(h,d),O(a[m],1)):(a[m]=g_(h),a[m].c(),O(a[m],1),a[m].m(t.parentNode,t))}for(re(),m=r.length;m<a.length;m+=1)u(m);ae(),!r.length&&f?f.p(c,d):r.length?f&&(f.d(1),f=null):(f=__(c),f.c(),f.m(t.parentNode,t))}},i(c){if(!i){for(let d=0;d<l.length;d+=1)O(s[d]);for(let d=0;d<r.length;d+=1)O(a[d]);i=!0}},o(c){s=s.filter(Boolean);for(let d=0;d<s.length;d+=1)D(s[d]);a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)D(a[d]);i=!1},d(c){c&&(k(e),k(t)),pt(s,c),pt(a,c),f&&f.d(c)}}}function _I(n,e,t){let i,l;Qe(n,En,f=>t(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 ok extends ye{constructor(e){super(),be(this,e,_I,hI,_e,{record:0})}}function gI(n){let e,t,i,l,s,o,r,a,u,f;return t=new ok({props:{record:n[0]}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collectionId="+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){v(c,e,d),F(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Me(r=He.call(null,l,{text:`Open relation record in new tab:
 `+z.truncate(JSON.stringify(z.truncateObject(b_(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?collectionId="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&Rt(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab:
 `+z.truncate(JSON.stringify(z.truncateObject(b_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(O(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&k(e),q(t),u=!1,De(f)}}}function b_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function bI(n,e,t){let{record:i}=e;function l(o){Pe.call(this,n,o)}function s(o){Pe.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Ur extends ye{constructor(e){super(),be(this,e,bI,gI,_e,{record:0})}}function y_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function k_(n,e,t){const i=n.slice();return i[14]=e[t],i}function v_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function w_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function yI(n){const e=n.slice(),t=z.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function kI(n){var s,o;const e=n.slice(),t=z.toArray(e[3]);e[10]=t;const i=z.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 vI(n){const e=n.slice(),t=z.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function wI(n){let e,t;return{c(){e=b("div"),t=Y(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&ue(t,i[3])},i:te,o:te,d(i){i&&k(e)}}}function SI(n){let e,t=z.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=z.truncate(n[3]))},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=z.truncate(s[3])+"")&&ue(i,t),o&8&&l!==(l=z.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&k(e)}}}function TI(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;u<o.length;u+=1){let f=y_(n,o,u),c=r(f);i.set(c,t[u]=S_(c,f))}let a=n[17].length>n[18]&&T_();return{c(){e=b("div");for(let u=0;u<t.length;u+=1)t[u].c();l=C(),a&&a.c(),p(e,"class","inline-flex"),x(e,"multiple",n[1].maxSelect!=1)},m(u,f){v(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);w(e,l),a&&a.m(e,null),s=!0},p(u,f){f&13&&(o=pe(u[17].slice(0,u[18])),re(),t=kt(t,f,r,1,u,o,i,e,zt,S_,l,y_),ae()),u[17].length>u[18]?a||(a=T_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;f<o.length;f+=1)O(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)D(t[f]);s=!1},d(u){u&&k(e);for(let f=0;f<t.length;f+=1)t[f].d();a&&a.d()}}}function $I(n){let e,t,i,l,s;const o=[RI,NI],r=[];function a(f,c){return f[11].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[10].length>n[12]&&O_();return{c(){e=b("div"),i.c(),l=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){v(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):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),O(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=O_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function CI(n){let e,t=[],i=new Map,l=pe(z.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o<l.length;o+=1){let r=w_(n,l,o),a=s(r);i.set(a,t[o]=E_(a,r))}return{c(){e=b("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","inline-flex")},m(o,r){v(o,e,r);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null)},p(o,r){r&8&&(l=pe(z.toArray(o[3])),t=kt(t,r,s,1,o,l,i,e,ci,E_,null,w_))},i:te,o:te,d(o){o&&k(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function OI(n){let e,t;return e=new sf({props:{date:n[3]}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.date=i[3]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function EI(n){let e,t,i,l;const s=[qI,FI],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function MI(n){let e,t=z.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=Y(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){v(o,e,r),w(e,i),l||(s=[Me(He.call(null,e,"Open in new tab")),B(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=z.truncate(o[3])+"")&&ue(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&k(e),l=!1,De(s)}}}function DI(n){let e,t;return{c(){e=b("span"),t=Y(n[3]),p(e,"class","txt")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&ue(t,i[3])},i:te,o:te,d(i){i&&k(e)}}}function II(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label"),x(e,"label-success",!!n[3])},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&ue(i,t),s&8&&x(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&k(e)}}}function LI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function AI(n){let e,t,i,l;const s=[jI,HI],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function PI(n){let e,t,i,l,s,o,r,a;t=new ai({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&D_();return{c(){e=b("div"),H(t.$$.fragment),i=C(),l=b("div"),s=Y(n[3]),o=C(),u&&u.c(),r=ge(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){v(f,e,c),F(t,e,null),w(e,i),w(e,l),w(l,s),v(f,o,c),u&&u.m(f,c),v(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&ue(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=D_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(O(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(k(e),k(o),k(r)),q(t),u&&u.d(f)}}}function S_(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=ge(),H(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),F(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||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(i,s)}}}function T_(n){let e;return{c(){e=Y("...")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function NI(n){let e,t=pe(n[10].slice(0,n[12])),i=[];for(let l=0;l<t.length;l+=1)i[l]=$_(k_(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&12){t=pe(l[10].slice(0,l[12]));let o;for(o=0;o<t.length;o+=1){const r=k_(l,t,o);i[o]?i[o].p(r,s):(i[o]=$_(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(l){l&&k(e),pt(i,l)}}}function RI(n){let e=[],t=new Map,i,l,s=pe(n[11].slice(0,n[12]));const o=r=>r[9]+r[7];for(let r=0;r<s.length;r+=1){let a=v_(n,s,r),u=o(a);t.set(u,e[r]=C_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ge()},m(r,a){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(r,a);v(r,i,a),l=!0},p(r,a){a&7&&(s=pe(r[11].slice(0,r[12])),re(),e=kt(e,a,o,1,r,s,t,i.parentNode,zt,C_,i,v_),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)O(e[a]);l=!0}},o(r){for(let a=0;a<e.length;a+=1)D(e[a]);l=!1},d(r){r&&k(i);for(let a=0;a<e.length;a+=1)e[a].d(r)}}}function $_(n){let e,t=n[14]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&12&&t!==(t=l[14]+"")&&ue(i,t)},d(l){l&&k(e)}}}function C_(n,e){let t,i,l,s;return i=new Ur({props:{record:e[7]}}),{key:n,first:null,c(){t=b("span"),H(i.$$.fragment),l=C(),p(t,"class","label"),this.first=t},m(o,r){v(o,t,r),F(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&7&&(a.record=e[7]),i.$set(a)},i(o){s||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),q(i)}}}function O_(n){let e;return{c(){e=Y("...")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function E_(n,e){let t,i=e[7]+"",l;return{key:n,first:null,c(){t=b("span"),l=Y(i),p(t,"class","label"),this.first=t},m(s,o){v(s,t,o),w(t,l)},p(s,o){e=s,o&8&&i!==(i=e[7]+"")&&ue(l,i)},d(s){s&&k(t)}}}function FI(n){let e,t;return e=new Tu({props:{cssClass:"tinymce-preview",conf:{branding:!1,promotion:!1,menubar:!1,statusbar:!1,min_height:30,height:59,max_height:500,autoresize_bottom_margin:5,resize:!1,content_style:"body { font-size: 14px }",toolbar:"",plugins:["autoresize"],skin:"pocketbase"},value:n[3],disabled:!0}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=i[3]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function qI(n){let e,t=z.truncate(z.plainText(n[3]),195)+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=z.truncate(z.plainText(l[3]),195)+"")&&ue(i,t)},i:te,o:te,d(l){l&&k(e)}}}function HI(n){let e,t=z.truncate(n[6],500,!0)+"",i,l,s,o,r=n[6].length>500&&M_(n);return{c(){e=b("span"),i=Y(t),l=C(),r&&r.c(),s=ge(),p(e,"class","txt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=z.truncate(a[6],500,!0)+"")&&ue(i,t),a[6].length>500?r?(r.p(a,u),u&8&&O(r,1)):(r=M_(a),r.c(),O(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){o||(O(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(k(e),k(l),k(s)),r&&r.d(a)}}}function jI(n){let e,t=z.truncate(n[6])+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=z.truncate(l[6])+"")&&ue(i,t)},i:te,o:te,d(l){l&&k(e)}}}function M_(n){let e,t;return e=new ai({props:{value:JSON.stringify(n[3],null,2)}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function D_(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function zI(n){let e,t,i,l,s;const o=[PI,AI,LI,II,DI,MI,EI,OI,CI,$I,TI,SI,wI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!z.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?vI(f):c===9?kI(f):c===10?yI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ge()},m(f,c){r[t].m(f,c),v(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),O(i,1),i.m(l.parentNode,l))},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&k(l),r[t].d(f)}}}function UI(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){Pe.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 rk extends ye{constructor(e){super(),be(this,e,UI,zI,_e,{record:0,field:1,short:2})}}function I_(n,e,t){const i=n.slice();return i[13]=e[t],i}function L_(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new rk({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),H(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){v(u,e,f),w(e,t),w(t,l),w(e,s),w(e,o),F(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&ue(l,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(O(r.$$.fragment,u),a=!0)},o(u){D(r.$$.fragment,u),a=!1},d(u){u&&k(e),q(r)}}}function A_(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"),H(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),F(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(O(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&k(e),q(s)}}}function P_(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"),H(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),F(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(O(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&k(e),q(s)}}}function VI(n){var M;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,h,g,_;a=new ai({props:{value:n[3].id}});let y=pe((M=n[0])==null?void 0:M.fields),S=[];for(let L=0;L<y.length;L+=1)S[L]=L_(I_(n,y,L));const T=L=>D(S[L],1,1,()=>{S[L]=null});let $=n[3].created&&A_(n),E=n[3].updated&&P_(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"),H(a.$$.fragment),u=C(),f=b("span"),d=Y(c),m=C();for(let L=0;L<S.length;L+=1)S[L].c();h=C(),$&&$.c(),g=C(),E&&E.c(),p(l,"class","min-width txt-hint txt-bold"),p(f,"class","txt"),p(r,"class","label"),p(o,"class","col-field svelte-1nt58f7"),p(e,"class","table-border preview-table"),x(e,"table-loading",n[4])},m(L,I){v(L,e,I),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,r),F(a,r,null),w(r,u),w(r,f),w(f,d),w(t,m);for(let A=0;A<S.length;A+=1)S[A]&&S[A].m(t,null);w(t,h),$&&$.m(t,null),w(t,g),E&&E.m(t,null),_=!0},p(L,I){var P;const A={};if(I&8&&(A.value=L[3].id),a.$set(A),(!_||I&8)&&c!==(c=(L[3].id||"...")+"")&&ue(d,c),I&9){y=pe((P=L[0])==null?void 0:P.fields);let R;for(R=0;R<y.length;R+=1){const N=I_(L,y,R);S[R]?(S[R].p(N,I),O(S[R],1)):(S[R]=L_(N),S[R].c(),O(S[R],1),S[R].m(t,h))}for(re(),R=y.length;R<S.length;R+=1)T(R);ae()}L[3].created?$?($.p(L,I),I&8&&O($,1)):($=A_(L),$.c(),O($,1),$.m(t,g)):$&&(re(),D($,1,1,()=>{$=null}),ae()),L[3].updated?E?(E.p(L,I),I&8&&O(E,1)):(E=P_(L),E.c(),O(E,1),E.m(t,null)):E&&(re(),D(E,1,1,()=>{E=null}),ae()),(!_||I&16)&&x(e,"table-loading",L[4])},i(L){if(!_){O(a.$$.fragment,L);for(let I=0;I<y.length;I+=1)O(S[I]);O($),O(E),_=!0}},o(L){D(a.$$.fragment,L),S=S.filter(Boolean);for(let I=0;I<S.length;I+=1)D(S[I]);D($),D(E),_=!1},d(L){L&&k(e),q(a),pt(S,L),$&&$.d(),E&&E.d()}}}function BI(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",l,s;return{c(){e=b("h4"),t=b("strong"),l=Y(i),s=Y(" record preview")},m(r,a){v(r,e,a),w(e,t),w(t,l),w(e,s)},p(r,a){var u;a&1&&i!==(i=((u=r[0])==null?void 0:u.name)+"")&&ue(l,i)},d(r){r&&k(e)}}}function WI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[7]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function YI(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[WI],header:[BI],default:[VI]},$$scope:{ctx:n}};return e=new ln({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),q(e,l)}}}function KI(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(_){return f(_),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await me.collection(l.id).getOne(_)}catch(y){y.isAbort||(u(),console.warn("resolveModel:",y),$i(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){ie[_?"unshift":"push"](()=>{s=_,t(2,s)})}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,l=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=l==null?void 0:l.fields)!=null&&_.find(y=>y.type==="editor")))},[l,u,s,o,r,i,a,d,m,h,g]}class JI extends ye{constructor(e){super(),be(this,e,KI,YI,_e,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function ZI(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){v(s,e,o),i||(l=Me(t=He.call(null,e,{text:n[0].join(`
 `),position:"left"})),i=!0)},p(s,[o]){t&&Rt(t.update)&&o&1&&t.update.call(null,{text:s[0].join(`
-`),position:"left"})},i:te,o:te,d(s){s&&k(e),i=!1,l()}}}const GI="yyyy-MM-dd HH:mm:ss.SSS";function XI(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+": "+z.formatToLocalDate(s[u.name],GI)+" 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 QI extends ye{constructor(e){super(),be(this,e,XI,ZI,_e,{record:1})}}function N_(n,e,t){const i=n.slice();return i[9]=e[t],i}function xI(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){v(t,e,i)},p:te,d(t){t&&k(e)}}}function eL(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=R_(N_(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","list")},m(l,s){v(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s&58){t=pe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=N_(l,t,o);i[o]?i[o].p(r,s):(i[o]=R_(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function tL(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function R_(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,_,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=Y(r),u=C(),f=b("div"),c=Y("ID: "),m=Y(d),h=C(),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=C(),vn(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,E){v($,e,E),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,g),w(e,_),y||(S=B(g,"click",T),y=!0)},p($,E){var M;n=$,E&2&&!vn(i.src,l="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",l),E&2&&r!==(r=n[4](n[9].provider)+"")&&ue(a,r),E&2&&d!==(d=n[9].providerId+"")&&ue(m,d)},d($){$&&k(e),y=!1,S()}}}function nL(n){let e;function t(s,o){var r;return s[2]?tL:(r=s[0])!=null&&r.id&&s[1].length?eL:xI}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function iL(n,e,t){const i=_t();let{record:l}=e,s=[],o=!1;function r(d){return ef.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||z.sentenize(d,!1)}async function u(){if(!(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 lL extends ye{constructor(e){super(),be(this,e,iL,nL,_e,{record:0})}}function sL(n){let e,t,i,l,s,o,r,a,u,f;return s=new ai({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=C(),H(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){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),F(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Me(He.call(null,r,"Refresh")),B(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&ue(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(O(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),q(s),u=!1,De(f)}}}function oL(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:[sL]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new Hn({props:d}),ie.push(()=>ve(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),H(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){v(m,e,h),w(e,t),w(e,i),F(l,e,null),a=!0,u||(f=Me(r=He.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const g={};h&518&&(g.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,g.active=m[3],$e(()=>s=!1)),l.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Rt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(O(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&k(e),q(l),u=!1,f()}}}function rL(n,e,t){const i=_t();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=z.randomSecret(s)),i("generate",o),await fn(),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 aL extends ye{constructor(e){super(),be(this,e,rL,oL,_e,{class:0,length:5})}}function F_(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=Y("Public: "),o=Y(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){v(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Me(He.call(null,t,{text:"Make email public or private",position:"top-right"})),B(t,"click",tt(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&ue(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&&k(e),a=!1,De(u)}}}function uL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&F_(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",z.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,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),m&&m.m(h,g),v(h,r,g),v(h,a,g),ce(a,n[0].email),n[1]&&a.focus(),c||(d=B(a,"input",n[8]),c=!0)},p(h,g){g&16384&&s!==(s=h[14])&&p(e,"for",s),h[5]?m&&(m.d(1),m=null):m?m.p(h,g):(m=F_(h),m.c(),m.m(r.parentNode,r)),g&2&&(a.autofocus=h[1]),g&16384&&u!==(u=h[14])&&p(a,"id",u),g&16&&f!==(f=h[4].required)&&(a.required=f),g&1&&a.value!==h[0].email&&ce(a,h[0].email)},d(h){h&&(k(e),k(o),k(r),k(a)),m&&m.d(h),c=!1,d()}}}function q_(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[fL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function fL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function H_(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[cL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[dL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(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)&&x(t,"p-t-xs",f[2])},i(f){u||(O(l.$$.fragment,f),O(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=ze(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=ze(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(l),q(r),f&&a&&a.end()}}}function cL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new aL({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"),H(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,_){v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,o,_),v(g,r,_),ce(r,n[0].password),v(g,u,_),v(g,f,_),F(c,f,null),d=!0,m||(h=B(r,"input",n[10]),m=!0)},p(g,_){(!d||_&16384&&s!==(s=g[14]))&&p(e,"for",s),(!d||_&16384&&a!==(a=g[14]))&&p(r,"id",a),_&1&&r.value!==g[0].password&&ce(r,g[0].password);const y={};_&8&&(y.length=Math.max(15,g[3].min||0)),c.$set(y)},i(g){d||(O(c.$$.fragment,g),d=!0)},o(g){D(c.$$.fragment,g),d=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),q(c),m=!1,h()}}}function dL(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){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(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&&(k(e),k(o),k(r)),u=!1,f()}}}function j_(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[pL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function pL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[0].verified,v(u,i,f),v(u,l,f),w(l,s),r||(a=[B(e,"change",n[12]),B(e,"change",tt(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&&(k(e),k(i),k(l)),r=!1,De(a)}}}function mL(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:[uL,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&q_(n),f=(n[1]||n[2])&&H_(n),c=!n[5]&&j_(n);return{c(){e=b("div"),t=b("div"),H(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){v(m,e,h),w(e,t),F(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 _;const g={};h&16&&(g.class="form-field "+((_=m[4])!=null&&_.required?"required":"")),h&49203&&(g.$$scope={dirty:h,ctx:m}),i.$set(g),m[1]?u&&(re(),D(u,1,1,()=>{u=null}),ae()):u?(u.p(m,h),h&2&&O(u,1)):(u=q_(m),u.c(),O(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&O(f,1)):(f=H_(m),f.c(),O(f,1),f.m(s,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),m[5]?c&&(re(),D(c,1,1,()=>{c=null}),ae()):c?(c.p(m,h),h&32&&O(c,1)):(c=j_(m),c.c(),O(c,1),c.m(e,null))},i(m){a||(O(i.$$.fragment,m),O(u),O(f),O(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&k(e),q(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function hL(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 g(){o.verified=this.checked,t(0,o),t(2,u)}const _=y=>{a||pn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!y.target.checked,o)})};return n.$$set=y=>{"record"in y&&t(0,o=y.record),"collection"in y&&t(6,r=y.collection),"isNew"in y&&t(1,a=y.isNew)},n.$$.update=()=>{var y,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,l=((y=r==null?void 0:r.fields)==null?void 0:y.find(T=>T.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find(T=>T.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),fi("password"),fi("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,g,_]}class _L extends ye{constructor(e){super(),be(this,e,hL,mL,_e,{record:0,collection:6,isNew:1})}}function z_(n){let e;function t(s,o){return s[1].primaryKey?bL:gL}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function gL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=z.getFieldTypeIcon(n[1].type))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t=z.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function bL(n){let e;return{c(){e=b("i"),p(e,"class",z.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function U_(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function yL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&z_(n),f=n[1].hidden&&U_();const c=n[4].default,d=Lt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),s=Y(l),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){v(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=z_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&ue(s,l),m[1].hidden?f||(f=U_(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&Pt(d,c,m,m[3],a?At(c,m[3],h,null):Nt(m[3]),null),(!a||h&1)&&p(e,"for",m[0])},i(m){a||(O(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&k(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function kL(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 ti extends ye{constructor(e){super(),be(this,e,kL,yL,_e,{uniqueId:0,field:1,icon:2})}}function vL(n){let e,t,i,l,s,o,r;return l=new ti({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),H(l.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){v(a,e,u),e.checked=n[0],v(a,i,u),F(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||(O(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(i)),q(l,a),o=!1,r()}}}function wL(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:[vL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function SL(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 TL extends ye{constructor(e){super(),be(this,e,SL,wL,_e,{field:1,value:0})}}function V_(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){v(s,e,o),w(e,t),i||(l=[Me(He.call(null,t,"Clear")),B(t,"click",n[5])],i=!0)},p:te,d(s){s&&k(e),i=!1,De(l)}}}function $L(n){let e,t,i,l,s,o,r;e=new ti({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&V_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:z.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(()=>ve(l,"value",u)),ie.push(()=>ve(l,"formattedValue",f)),l.$on("close",n[3]),{c(){H(e.$$.fragment),t=C(),a&&a.c(),i=C(),H(l.$$.fragment)},m(d,m){F(e,d,m),v(d,t,m),a&&a.m(d,m),v(d,i,m),F(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=V_(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const g={};m&256&&(g.id=d[8]),!s&&m&4&&(s=!0,g.value=d[2],$e(()=>s=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],$e(()=>o=!1)),l.$set(g)},i(d){r||(O(e.$$.fragment,d),O(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(k(t),k(i)),q(e,d),a&&a.d(d),q(l,d)}}}function CL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$L,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OL(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 EL extends ye{constructor(e){super(),be(this,e,OL,CL,_e,{field:1,value:0})}}function B_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function W_(n,e,t){const i=n.slice();return i[48]=e[t],i}function Y_(n,e,t){const i=n.slice();return i[51]=e[t],i}function ML(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,g,_=pe(n[7]);const y=S=>S[51].id;for(let S=0;S<_.length;S+=1){let T=Y_(n,_,S),$=y(T);l.set($,i[S]=K_($,T))}return a=new Hr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Pu({props:{class:"files-list",vThreshold:100,$$slots:{default:[NL]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;S<i.length;S+=1)i[S].c();s=C(),o=b("div"),r=b("div"),H(a.$$.fragment),u=C(),f=b("button"),f.innerHTML='<div class="txt">New record</div>',c=C(),H(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,T){v(S,e,T),w(e,t);for(let $=0;$<i.length;$+=1)i[$]&&i[$].m(t,null);w(e,s),w(e,o),w(o,r),F(a,r,null),w(r,u),w(r,f),w(o,c),F(d,o,null),m=!0,h||(g=B(f,"click",n[31]),h=!0)},p(S,T){T[0]&384&&(_=pe(S[7]),i=kt(i,T,y,1,S,_,l,t,ci,K_,null,Y_));const $={};T[0]&16&&($.value=S[4]),T[0]&256&&($.autocompleteCollection=S[8]),a.$set($);const E={};T[0]&98416|T[1]&8388608&&(E.$$scope={dirty:T,ctx:S}),d.$set(E)},i(S){m||(O(a.$$.fragment,S),O(d.$$.fragment,S),m=!0)},o(S){D(a.$$.fragment,S),D(d.$$.fragment,S),m=!1},d(S){S&&k(e);for(let T=0;T<i.length;T+=1)i[T].d();q(a),q(d),h=!1,g()}}}function DL(n){let e;return{c(){e=b("h6"),e.innerHTML="You currently don&#39;t have any collection with <code>file</code> field.",p(e,"class","txt-center txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function K_(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=Y(i),s=C(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){v(u,t,f),w(t,l),w(t,s),o||(r=B(t,"click",tt(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&ue(l,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function IL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&J_(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){v(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=J_(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function LL(n){let e=[],t=new Map,i,l=pe(n[5]);const s=o=>o[44].id;for(let o=0;o<l.length;o+=1){let r=B_(n,l,o),a=s(r);t.set(a,e[o]=G_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r[0]&1638432&&(l=pe(o[5]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,G_,i,B_))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function J_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filter</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",tt(n[17])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function AL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function PL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),vn(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){v(l,e,s)},p(l,s){s[0]&32&&!vn(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&&k(e)}}}function Z_(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!z.hasImageExtension(f[48])),t?PL:AL}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"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){v(f,e,c),u.m(e,null),w(e,i),s||(o=[Me(l=He.call(null,e,n[48]+`
+`),position:"left"})},i:te,o:te,d(s){s&&k(e),i=!1,l()}}}const GI="yyyy-MM-dd HH:mm:ss.SSS";function XI(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+": "+z.formatToLocalDate(s[u.name],GI)+" 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 QI extends ye{constructor(e){super(),be(this,e,XI,ZI,_e,{record:1})}}function N_(n,e,t){const i=n.slice();return i[9]=e[t],i}function xI(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){v(t,e,i)},p:te,d(t){t&&k(e)}}}function eL(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=R_(N_(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","list")},m(l,s){v(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s&58){t=pe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=N_(l,t,o);i[o]?i[o].p(r,s):(i[o]=R_(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function tL(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function R_(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,_,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=Y(r),u=C(),f=b("div"),c=Y("ID: "),m=Y(d),h=C(),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=C(),vn(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,E){v($,e,E),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,g),w(e,_),y||(S=B(g,"click",T),y=!0)},p($,E){var M;n=$,E&2&&!vn(i.src,l="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",l),E&2&&r!==(r=n[4](n[9].provider)+"")&&ue(a,r),E&2&&d!==(d=n[9].providerId+"")&&ue(m,d)},d($){$&&k(e),y=!1,S()}}}function nL(n){let e;function t(s,o){var r;return s[2]?tL:(r=s[0])!=null&&r.id&&s[1].length?eL:xI}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function iL(n,e,t){const i=gt();let{record:l}=e,s=[],o=!1;function r(d){return ef.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||z.sentenize(d,!1)}async function u(){if(!(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 lL extends ye{constructor(e){super(),be(this,e,iL,nL,_e,{record:0})}}function sL(n){let e,t,i,l,s,o,r,a,u,f;return s=new ai({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=C(),H(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){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),F(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Me(He.call(null,r,"Refresh")),B(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&ue(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(O(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),q(s),u=!1,De(f)}}}function oL(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:[sL]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new Hn({props:d}),ie.push(()=>ve(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),H(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){v(m,e,h),w(e,t),w(e,i),F(l,e,null),a=!0,u||(f=Me(r=He.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const g={};h&518&&(g.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,g.active=m[3],$e(()=>s=!1)),l.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Rt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(O(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&k(e),q(l),u=!1,f()}}}function rL(n,e,t){const i=gt();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=z.randomSecret(s)),i("generate",o),await fn(),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 aL extends ye{constructor(e){super(),be(this,e,rL,oL,_e,{class:0,length:5})}}function F_(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=Y("Public: "),o=Y(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){v(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Me(He.call(null,t,{text:"Make email public or private",position:"top-right"})),B(t,"click",tt(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&ue(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&&k(e),a=!1,De(u)}}}function uL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&F_(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",z.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,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),m&&m.m(h,g),v(h,r,g),v(h,a,g),ce(a,n[0].email),n[1]&&a.focus(),c||(d=B(a,"input",n[8]),c=!0)},p(h,g){g&16384&&s!==(s=h[14])&&p(e,"for",s),h[5]?m&&(m.d(1),m=null):m?m.p(h,g):(m=F_(h),m.c(),m.m(r.parentNode,r)),g&2&&(a.autofocus=h[1]),g&16384&&u!==(u=h[14])&&p(a,"id",u),g&16&&f!==(f=h[4].required)&&(a.required=f),g&1&&a.value!==h[0].email&&ce(a,h[0].email)},d(h){h&&(k(e),k(o),k(r),k(a)),m&&m.d(h),c=!1,d()}}}function q_(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[fL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function fL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function H_(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[cL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[dL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(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)&&x(t,"p-t-xs",f[2])},i(f){u||(O(l.$$.fragment,f),O(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=ze(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=ze(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(l),q(r),f&&a&&a.end()}}}function cL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new aL({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"),H(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,_){v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,o,_),v(g,r,_),ce(r,n[0].password),v(g,u,_),v(g,f,_),F(c,f,null),d=!0,m||(h=B(r,"input",n[10]),m=!0)},p(g,_){(!d||_&16384&&s!==(s=g[14]))&&p(e,"for",s),(!d||_&16384&&a!==(a=g[14]))&&p(r,"id",a),_&1&&r.value!==g[0].password&&ce(r,g[0].password);const y={};_&8&&(y.length=Math.max(15,g[3].min||0)),c.$set(y)},i(g){d||(O(c.$$.fragment,g),d=!0)},o(g){D(c.$$.fragment,g),d=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),q(c),m=!1,h()}}}function dL(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){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(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&&(k(e),k(o),k(r)),u=!1,f()}}}function j_(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[pL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function pL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[0].verified,v(u,i,f),v(u,l,f),w(l,s),r||(a=[B(e,"change",n[12]),B(e,"change",tt(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&&(k(e),k(i),k(l)),r=!1,De(a)}}}function mL(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:[uL,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&q_(n),f=(n[1]||n[2])&&H_(n),c=!n[5]&&j_(n);return{c(){e=b("div"),t=b("div"),H(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){v(m,e,h),w(e,t),F(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 _;const g={};h&16&&(g.class="form-field "+((_=m[4])!=null&&_.required?"required":"")),h&49203&&(g.$$scope={dirty:h,ctx:m}),i.$set(g),m[1]?u&&(re(),D(u,1,1,()=>{u=null}),ae()):u?(u.p(m,h),h&2&&O(u,1)):(u=q_(m),u.c(),O(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&O(f,1)):(f=H_(m),f.c(),O(f,1),f.m(s,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),m[5]?c&&(re(),D(c,1,1,()=>{c=null}),ae()):c?(c.p(m,h),h&32&&O(c,1)):(c=j_(m),c.c(),O(c,1),c.m(e,null))},i(m){a||(O(i.$$.fragment,m),O(u),O(f),O(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&k(e),q(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function hL(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 g(){o.verified=this.checked,t(0,o),t(2,u)}const _=y=>{a||pn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!y.target.checked,o)})};return n.$$set=y=>{"record"in y&&t(0,o=y.record),"collection"in y&&t(6,r=y.collection),"isNew"in y&&t(1,a=y.isNew)},n.$$.update=()=>{var y,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,l=((y=r==null?void 0:r.fields)==null?void 0:y.find(T=>T.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find(T=>T.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),fi("password"),fi("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,g,_]}class _L extends ye{constructor(e){super(),be(this,e,hL,mL,_e,{record:0,collection:6,isNew:1})}}function z_(n){let e;function t(s,o){return s[1].primaryKey?bL:gL}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function gL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=z.getFieldTypeIcon(n[1].type))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t=z.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function bL(n){let e;return{c(){e=b("i"),p(e,"class",z.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function U_(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function yL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&z_(n),f=n[1].hidden&&U_();const c=n[4].default,d=Lt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),s=Y(l),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){v(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=z_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&ue(s,l),m[1].hidden?f||(f=U_(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&Pt(d,c,m,m[3],a?At(c,m[3],h,null):Nt(m[3]),null),(!a||h&1)&&p(e,"for",m[0])},i(m){a||(O(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&k(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function kL(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 ti extends ye{constructor(e){super(),be(this,e,kL,yL,_e,{uniqueId:0,field:1,icon:2})}}function vL(n){let e,t,i,l,s,o,r;return l=new ti({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),H(l.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){v(a,e,u),e.checked=n[0],v(a,i,u),F(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||(O(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(i)),q(l,a),o=!1,r()}}}function wL(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:[vL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function SL(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 TL extends ye{constructor(e){super(),be(this,e,SL,wL,_e,{field:1,value:0})}}function V_(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){v(s,e,o),w(e,t),i||(l=[Me(He.call(null,t,"Clear")),B(t,"click",n[5])],i=!0)},p:te,d(s){s&&k(e),i=!1,De(l)}}}function $L(n){let e,t,i,l,s,o,r;e=new ti({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&V_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:z.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(()=>ve(l,"value",u)),ie.push(()=>ve(l,"formattedValue",f)),l.$on("close",n[3]),{c(){H(e.$$.fragment),t=C(),a&&a.c(),i=C(),H(l.$$.fragment)},m(d,m){F(e,d,m),v(d,t,m),a&&a.m(d,m),v(d,i,m),F(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=V_(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const g={};m&256&&(g.id=d[8]),!s&&m&4&&(s=!0,g.value=d[2],$e(()=>s=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],$e(()=>o=!1)),l.$set(g)},i(d){r||(O(e.$$.fragment,d),O(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(k(t),k(i)),q(e,d),a&&a.d(d),q(l,d)}}}function CL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$L,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OL(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 EL extends ye{constructor(e){super(),be(this,e,OL,CL,_e,{field:1,value:0})}}function B_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function W_(n,e,t){const i=n.slice();return i[48]=e[t],i}function Y_(n,e,t){const i=n.slice();return i[51]=e[t],i}function ML(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,g,_=pe(n[7]);const y=S=>S[51].id;for(let S=0;S<_.length;S+=1){let T=Y_(n,_,S),$=y(T);l.set($,i[S]=K_($,T))}return a=new Hr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Pu({props:{class:"files-list",vThreshold:100,$$slots:{default:[NL]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;S<i.length;S+=1)i[S].c();s=C(),o=b("div"),r=b("div"),H(a.$$.fragment),u=C(),f=b("button"),f.innerHTML='<div class="txt">New record</div>',c=C(),H(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,T){v(S,e,T),w(e,t);for(let $=0;$<i.length;$+=1)i[$]&&i[$].m(t,null);w(e,s),w(e,o),w(o,r),F(a,r,null),w(r,u),w(r,f),w(o,c),F(d,o,null),m=!0,h||(g=B(f,"click",n[31]),h=!0)},p(S,T){T[0]&384&&(_=pe(S[7]),i=kt(i,T,y,1,S,_,l,t,ci,K_,null,Y_));const $={};T[0]&16&&($.value=S[4]),T[0]&256&&($.autocompleteCollection=S[8]),a.$set($);const E={};T[0]&98416|T[1]&8388608&&(E.$$scope={dirty:T,ctx:S}),d.$set(E)},i(S){m||(O(a.$$.fragment,S),O(d.$$.fragment,S),m=!0)},o(S){D(a.$$.fragment,S),D(d.$$.fragment,S),m=!1},d(S){S&&k(e);for(let T=0;T<i.length;T+=1)i[T].d();q(a),q(d),h=!1,g()}}}function DL(n){let e;return{c(){e=b("h6"),e.innerHTML="You currently don&#39;t have any collection with <code>file</code> field.",p(e,"class","txt-center txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function K_(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=Y(i),s=C(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){v(u,t,f),w(t,l),w(t,s),o||(r=B(t,"click",tt(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&ue(l,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function IL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&J_(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){v(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=J_(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function LL(n){let e=[],t=new Map,i,l=pe(n[5]);const s=o=>o[44].id;for(let o=0;o<l.length;o+=1){let r=B_(n,l,o),a=s(r);t.set(a,e[o]=G_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r[0]&1638432&&(l=pe(o[5]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,G_,i,B_))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function J_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filter</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",tt(n[17])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function AL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function PL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),vn(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){v(l,e,s)},p(l,s){s[0]&32&&!vn(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&&k(e)}}}function Z_(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!z.hasImageExtension(f[48])),t?PL:AL}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"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){v(f,e,c),u.m(e,null),w(e,i),s||(o=[Me(l=He.call(null,e,n[48]+`
 (record: `+n[44].id+")")),B(e,"click",tt(function(){Rt(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&&Rt(l.update)&&c[0]&32&&l.update.call(null,n[48]+`
-(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),s=!1,De(o)}}}function G_(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Z_(W_(e,l,o));return{key:n,first:null,c(){t=ge();for(let o=0;o<s.length;o+=1)s[o].c();i=ge(),this.first=t},m(o,r){v(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);v(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=pe(e[45]);let a;for(a=0;a<l.length;a+=1){const u=W_(e,l,a);s[a]?s[a].p(u,r):(s[a]=Z_(u),s[a].c(),s[a].m(i.parentNode,i))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&(k(t),k(i)),pt(s,o)}}}function X_(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function NL(n){let e,t;function i(r,a){if(r[15])return LL;if(!r[6])return IL}let l=i(n),s=l&&l(n),o=n[6]&&X_();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ge()},m(r,a){s&&s.m(r,a),v(r,e,a),o&&o.m(r,a),v(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=X_(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(k(e),k(t)),s&&s.d(r),o&&o.d(r)}}}function RL(n){let e,t,i,l;const s=[DL,ML],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=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function FL(n){let e,t;return{c(){e=b("h4"),t=Y(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&ue(t,i[0])},d(i){i&&k(e)}}}function Q_(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[qL,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function qL(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function HL(n){var h;let e,t,i,l=z.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&Q_(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=Y(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,_){v(g,e,_),w(e,t),v(g,i,_),m&&m.m(g,_),v(g,s,_),v(g,o,_),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 y;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=z.hasImageExtension((y=g[9])==null?void 0:y.name)),l?m?(m.p(g,_),_[0]&512&&O(m,1)):(m=Q_(g),m.c(),O(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&ue(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(O(m),f=!0)},o(g){D(m),f=!1},d(g){g&&(k(e),k(i),k(s),k(o)),m&&m.d(g),c=!1,De(d)}}}function jL(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[HL],header:[FL],default:[RL]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new ln({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new rf({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?vt(s,[s[0],s[1],Ft(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&256&&(c.collection=a[8]),i.$set(c)},i(a){l||(O(e.$$.fragment,a),O(i.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),l=!1},d(a){a&&k(t),n[33](null),q(e,a),n[36](null),q(i,a)}}}const x_=50;function zL(n,e,t){let i,l,s,o;const r=["title","submitText","fileTypes","show","hide"];let a=lt(e,r),u;Qe(n,En,Te=>t(27,u=Te));const f=_t(),c="file_picker_"+z.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,g,_,y="",S=[],T=1,$=0,E=!1,M=[],L=[],I=[],A={},P={},R="";function N(){return K(!0),g==null?void 0:g.show()}function U(){return g==null?void 0:g.hide()}function j(){t(5,S=[]),t(9,P={}),t(12,R="")}function V(){t(4,y="")}async function K(Te=!1){if(A!=null&&A.id){t(6,E=!0),Te&&j();try{const Ze=Te?1:T+1,ot=z.getAllCollectionIdentifiers(A);let Le=z.normalizeSearchFilter(y,ot)||"";Le&&(Le+=" && "),Le+="("+L.map(we=>`${we.name}:length>0`).join("||")+")";const Ve=await me.collection(A.id).getList(Ze,x_,{filter:Le,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=z.filterDuplicatesByKey(S.concat(Ve.items))),T=Ve.page,t(26,$=Ve.items.length),t(6,E=!1)}catch(Ze){Ze.isAbort||(me.error(Ze),t(6,E=!1))}}}function J(){var Ze;let Te=["100x100"];if((Ze=P==null?void 0:P.record)!=null&&Ze.id){for(const ot of L)if(z.toArray(P.record[ot.name]).includes(P.name)){Te=Te.concat(z.toArray(ot.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const ot of Te)I.push({label:`${ot} thumb`,value:ot});R&&!Te.includes(R)&&t(12,R="")}function ee(Te){let Ze=[];for(const ot of L){const Le=z.toArray(Te[ot.name]);for(const Ve of Le)h.includes(z.getFileType(Ve))&&Ze.push(Ve)}return Ze}function X(Te,Ze){t(9,P={record:Te,name:Ze})}function oe(){o&&(f("submit",Object.assign({size:R},P)),U())}function Se(Te){R=Te,t(12,R)}const ke=Te=>{t(8,A=Te)},Ce=Te=>t(4,y=Te.detail),We=()=>_==null?void 0:_.show(),st=()=>{s&&K()};function et(Te){ie[Te?"unshift":"push"](()=>{g=Te,t(3,g)})}function Be(Te){Pe.call(this,n,Te)}function rt(Te){Pe.call(this,n,Te)}function Je(Te){ie[Te?"unshift":"push"](()=>{_=Te,t(10,_)})}const at=Te=>{z.removeByKey(S,"id",Te.detail.record.id),S.unshift(Te.detail.record),t(5,S);const Ze=ee(Te.detail.record);Ze.length>0&&X(Te.detail.record,Ze[0])},Ht=Te=>{var Ze;((Ze=P==null?void 0:P.record)==null?void 0:Ze.id)==Te.detail.id&&t(9,P={}),z.removeByKey(S,"id",Te.detail.id),t(5,S)};return n.$$set=Te=>{e=je(je({},e),Ut(Te)),t(22,a=lt(e,r)),"title"in Te&&t(0,d=Te.title),"submitText"in Te&&t(1,m=Te.submitText),"fileTypes"in Te&&t(24,h=Te.fileTypes)},n.$$.update=()=>{var Te;n.$$.dirty[0]&134217728&&t(7,M=u.filter(Ze=>Ze.type!=="view"&&!!z.toArray(Ze.fields).find(ot=>{var Le,Ve;return ot.type==="file"&&!ot.protected&&(!((Le=ot.mimeTypes)!=null&&Le.length)||!!((Ve=ot.mimeTypes)!=null&&Ve.find(we=>we.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&M.length>0&&t(8,A=M[0]),n.$$.dirty[0]&256&&(L=(Te=A==null?void 0:A.fields)==null?void 0:Te.filter(Ze=>Ze.type==="file"&&!Ze.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(V(),J()),n.$$.dirty[0]&512&&P!=null&&P.name&&J(),n.$$.dirty[0]&280&&typeof y<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&K(!0),n.$$.dirty[0]&512&&t(16,i=(Ze,ot)=>{var Le;return(P==null?void 0:P.name)==ot&&((Le=P==null?void 0:P.record)==null?void 0:Le.id)==Ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Ze=>ee(Ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!E&&$==x_),n.$$.dirty[0]&576&&t(13,o=!E&&!!(P!=null&&P.name))},[d,m,U,g,y,S,E,M,A,P,_,I,R,o,s,l,i,V,K,ee,X,oe,a,c,h,N,$,u,Se,ke,Ce,We,st,et,Be,rt,Je,at,Ht]}class UL extends ye{constructor(e){super(),be(this,e,zL,jL,_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 VL(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function BL(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(()=>ve(e,"value",l)),e.$on("init",n[7]),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function WL(n){let e,t,i,l,s,o;e=new ti({props:{uniqueId:n[11],field:n[1]}});const r=[BL,VL],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),l.c(),s=ge()},m(f,c){F(e,f,c),v(f,t,c),a[i].m(f,c),v(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):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(e.$$.fragment,f),O(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),q(e,f),a[i].d(f)}}}function YL(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:[WL,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new UL({props:s}),n[8](i),i.$on("submit",n[9]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){F(e,o,r),v(o,t,r),F(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||(O(e.$$.fragment,o),O(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(e,o),n[8](null),q(i,o)}}}function KL(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Yt(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(z.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 JL extends ye{constructor(e){super(),be(this,e,KL,YL,_e,{field:1,value:0})}}function ZL(n){let e,t,i,l,s,o,r,a;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,u,f),v(u,t,f),v(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||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),q(e,u),r=!1,a()}}}function GL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[ZL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function XL(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 QL extends ye{constructor(e){super(),be(this,e,XL,GL,_e,{field:1,value:0})}}function xL(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){v(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function eA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),vn(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){v(l,e,s)},p(l,s){s&4&&!vn(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&&k(e)}}}function tA(n){let e;function t(s,o){return s[2]?eA:xL}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function nA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){z.hasImageExtension(l==null?void 0:l.name)?z.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 iA extends ye{constructor(e){super(),be(this,e,nA,tA,_e,{file:0,size:1})}}function eg(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function tg(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 lA(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){v(s,e,o),t||(i=[Me(He.call(null,e,"Remove file")),B(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,De(i)}}}function sA(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){v(s,e,o),t||(i=B(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,i()}}}function oA(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(y,S){return y[35]?sA:lA}let g=h(n),_=g(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),o=b("a"),a=Y(r),c=C(),d=b("div"),_.c(),x(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"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){v(y,e,S),w(e,t),F(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,c),w(e,d),_.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&ue(a,r),(!m||S[0]&1064&&u!==(u=me.files.getURL(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),g===(g=h(y))&&_?_.p(y,S):(_.d(1),_=g(y),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(O(i.$$.fragment,y),m=!0)},o(y){D(i.$$.fragment,y),m=!1},d(y){y&&k(e),q(i),_.d()}}}function ng(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:[oA,({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 ho({props:r}),ie.push(()=>ve(i,"list",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function rA(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,h,g,_;i=new iA({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),H(i.$$.fragment),l=C(),s=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=Y(u),d=C(),m=b("button"),m.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){v(S,e,T),w(e,t),F(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||(_=[Me(He.call(null,m,"Remove file")),B(m,"click",y)],g=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&u!==(u=n[29].name+"")&&ue(f,u),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(O(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&k(e),q(i),g=!1,De(_)}}}function ig(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:[rA,({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 ho({props:r}),ie.push(()=>ve(i,"list",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function aA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,y,S,T,$;e=new ti({props:{uniqueId:n[28],field:n[4]}});let E=pe(n[5]);const M=A=>A[34]+A[3].id;for(let A=0;A<E.length;A+=1){let P=tg(n,E,A),R=M(P);s.set(R,l[A]=ng(R,P))}let L=pe(n[1]);const I=A=>A[29].name+A[31];for(let A=0;A<L.length;A+=1){let P=eg(n,L,A),R=I(P);a.set(R,r[A]=ig(R,P))}return{c(){var A;H(e.$$.fragment),t=C(),i=b("div");for(let P=0;P<l.length;P+=1)l[P].c();o=C();for(let P=0;P<r.length;P+=1)r[P].c();u=C(),f=b("div"),c=b("input"),m=C(),h=b("button"),g=b("i"),_=C(),y=b("span"),y.textContent="Upload new file",p(c,"type","file"),p(c,"class","hidden"),p(c,"accept",d=((A=n[4].mimeTypes)==null?void 0:A.join(","))||null),c.multiple=n[6],p(g,"class","ri-upload-cloud-line"),p(y,"class","txt"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),h.disabled=n[11],p(f,"class","list-item list-item-btn"),p(i,"class","list")},m(A,P){F(e,A,P),v(A,t,P),v(A,i,P);for(let R=0;R<l.length;R+=1)l[R]&&l[R].m(i,null);w(i,o);for(let R=0;R<r.length;R+=1)r[R]&&r[R].m(i,null);w(i,u),w(i,f),w(f,c),n[21](c),w(f,m),w(f,h),w(h,g),w(h,_),w(h,y),n[24](i),S=!0,T||($=[B(c,"change",n[22]),B(h,"click",n[23])],T=!0)},p(A,P){var N;const R={};P[0]&268435456&&(R.uniqueId=A[28]),P[0]&16&&(R.field=A[4]),e.$set(R),P[0]&13437|P[1]&6&&(E=pe(A[5]),re(),l=kt(l,P,M,1,A,E,s,i,zt,ng,o,tg),ae()),P[0]&16466|P[1]&6&&(L=pe(A[1]),re(),r=kt(r,P,I,1,A,L,a,i,zt,ig,u,eg),ae()),(!S||P[0]&16&&d!==(d=((N=A[4].mimeTypes)==null?void 0:N.join(","))||null))&&p(c,"accept",d),(!S||P[0]&64)&&(c.multiple=A[6]),(!S||P[0]&2048)&&(h.disabled=A[11])},i(A){if(!S){O(e.$$.fragment,A);for(let P=0;P<E.length;P+=1)O(l[P]);for(let P=0;P<L.length;P+=1)O(r[P]);S=!0}},o(A){D(e.$$.fragment,A);for(let P=0;P<l.length;P+=1)D(l[P]);for(let P=0;P<r.length;P+=1)D(r[P]);S=!1},d(A){A&&(k(t),k(i)),q(e,A);for(let P=0;P<l.length;P+=1)l[P].d();for(let P=0;P<r.length;P+=1)r[P].d();n[21](null),n[24](null),T=!1,De($)}}}function uA(n){let e,t,i,l,s;return t=new fe({props:{class:`
+(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),s=!1,De(o)}}}function G_(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Z_(W_(e,l,o));return{key:n,first:null,c(){t=ge();for(let o=0;o<s.length;o+=1)s[o].c();i=ge(),this.first=t},m(o,r){v(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);v(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=pe(e[45]);let a;for(a=0;a<l.length;a+=1){const u=W_(e,l,a);s[a]?s[a].p(u,r):(s[a]=Z_(u),s[a].c(),s[a].m(i.parentNode,i))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&(k(t),k(i)),pt(s,o)}}}function X_(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function NL(n){let e,t;function i(r,a){if(r[15])return LL;if(!r[6])return IL}let l=i(n),s=l&&l(n),o=n[6]&&X_();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ge()},m(r,a){s&&s.m(r,a),v(r,e,a),o&&o.m(r,a),v(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=X_(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(k(e),k(t)),s&&s.d(r),o&&o.d(r)}}}function RL(n){let e,t,i,l;const s=[DL,ML],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=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function FL(n){let e,t;return{c(){e=b("h4"),t=Y(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&ue(t,i[0])},d(i){i&&k(e)}}}function Q_(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[qL,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function qL(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 xn({props:s}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function HL(n){var h;let e,t,i,l=z.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&Q_(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=Y(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,_){v(g,e,_),w(e,t),v(g,i,_),m&&m.m(g,_),v(g,s,_),v(g,o,_),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 y;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=z.hasImageExtension((y=g[9])==null?void 0:y.name)),l?m?(m.p(g,_),_[0]&512&&O(m,1)):(m=Q_(g),m.c(),O(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&ue(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(O(m),f=!0)},o(g){D(m),f=!1},d(g){g&&(k(e),k(i),k(s),k(o)),m&&m.d(g),c=!1,De(d)}}}function jL(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[HL],header:[FL],default:[RL]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new ln({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new rf({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?vt(s,[s[0],s[1],Ft(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&256&&(c.collection=a[8]),i.$set(c)},i(a){l||(O(e.$$.fragment,a),O(i.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),l=!1},d(a){a&&k(t),n[33](null),q(e,a),n[36](null),q(i,a)}}}const x_=50;function zL(n,e,t){let i,l,s,o;const r=["title","submitText","fileTypes","show","hide"];let a=lt(e,r),u;Qe(n,En,Te=>t(27,u=Te));const f=gt(),c="file_picker_"+z.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,g,_,y="",S=[],T=1,$=0,E=!1,M=[],L=[],I=[],A={},P={},R="";function N(){return K(!0),g==null?void 0:g.show()}function U(){return g==null?void 0:g.hide()}function j(){t(5,S=[]),t(9,P={}),t(12,R="")}function V(){t(4,y="")}async function K(Te=!1){if(A!=null&&A.id){t(6,E=!0),Te&&j();try{const Ze=Te?1:T+1,ot=z.getAllCollectionIdentifiers(A);let Le=z.normalizeSearchFilter(y,ot)||"";Le&&(Le+=" && "),Le+="("+L.map(we=>`${we.name}:length>0`).join("||")+")";const Ve=await me.collection(A.id).getList(Ze,x_,{filter:Le,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=z.filterDuplicatesByKey(S.concat(Ve.items))),T=Ve.page,t(26,$=Ve.items.length),t(6,E=!1)}catch(Ze){Ze.isAbort||(me.error(Ze),t(6,E=!1))}}}function J(){var Ze;let Te=["100x100"];if((Ze=P==null?void 0:P.record)!=null&&Ze.id){for(const ot of L)if(z.toArray(P.record[ot.name]).includes(P.name)){Te=Te.concat(z.toArray(ot.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const ot of Te)I.push({label:`${ot} thumb`,value:ot});R&&!Te.includes(R)&&t(12,R="")}function ee(Te){let Ze=[];for(const ot of L){const Le=z.toArray(Te[ot.name]);for(const Ve of Le)h.includes(z.getFileType(Ve))&&Ze.push(Ve)}return Ze}function X(Te,Ze){t(9,P={record:Te,name:Ze})}function oe(){o&&(f("submit",Object.assign({size:R},P)),U())}function Se(Te){R=Te,t(12,R)}const ke=Te=>{t(8,A=Te)},Ce=Te=>t(4,y=Te.detail),We=()=>_==null?void 0:_.show(),st=()=>{s&&K()};function et(Te){ie[Te?"unshift":"push"](()=>{g=Te,t(3,g)})}function Be(Te){Pe.call(this,n,Te)}function rt(Te){Pe.call(this,n,Te)}function Je(Te){ie[Te?"unshift":"push"](()=>{_=Te,t(10,_)})}const at=Te=>{z.removeByKey(S,"id",Te.detail.record.id),S.unshift(Te.detail.record),t(5,S);const Ze=ee(Te.detail.record);Ze.length>0&&X(Te.detail.record,Ze[0])},Ht=Te=>{var Ze;((Ze=P==null?void 0:P.record)==null?void 0:Ze.id)==Te.detail.id&&t(9,P={}),z.removeByKey(S,"id",Te.detail.id),t(5,S)};return n.$$set=Te=>{e=je(je({},e),Ut(Te)),t(22,a=lt(e,r)),"title"in Te&&t(0,d=Te.title),"submitText"in Te&&t(1,m=Te.submitText),"fileTypes"in Te&&t(24,h=Te.fileTypes)},n.$$.update=()=>{var Te;n.$$.dirty[0]&134217728&&t(7,M=u.filter(Ze=>Ze.type!=="view"&&!!z.toArray(Ze.fields).find(ot=>{var Le,Ve;return ot.type==="file"&&!ot.protected&&(!((Le=ot.mimeTypes)!=null&&Le.length)||!!((Ve=ot.mimeTypes)!=null&&Ve.find(we=>we.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&M.length>0&&t(8,A=M[0]),n.$$.dirty[0]&256&&(L=(Te=A==null?void 0:A.fields)==null?void 0:Te.filter(Ze=>Ze.type==="file"&&!Ze.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(V(),J()),n.$$.dirty[0]&512&&P!=null&&P.name&&J(),n.$$.dirty[0]&280&&typeof y<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&K(!0),n.$$.dirty[0]&512&&t(16,i=(Ze,ot)=>{var Le;return(P==null?void 0:P.name)==ot&&((Le=P==null?void 0:P.record)==null?void 0:Le.id)==Ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Ze=>ee(Ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!E&&$==x_),n.$$.dirty[0]&576&&t(13,o=!E&&!!(P!=null&&P.name))},[d,m,U,g,y,S,E,M,A,P,_,I,R,o,s,l,i,V,K,ee,X,oe,a,c,h,N,$,u,Se,ke,Ce,We,st,et,Be,rt,Je,at,Ht]}class UL extends ye{constructor(e){super(),be(this,e,zL,jL,_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 VL(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function BL(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(()=>ve(e,"value",l)),e.$on("init",n[7]),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function WL(n){let e,t,i,l,s,o;e=new ti({props:{uniqueId:n[11],field:n[1]}});const r=[BL,VL],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),l.c(),s=ge()},m(f,c){F(e,f,c),v(f,t,c),a[i].m(f,c),v(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):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(e.$$.fragment,f),O(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),q(e,f),a[i].d(f)}}}function YL(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:[WL,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new UL({props:s}),n[8](i),i.$on("submit",n[9]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){F(e,o,r),v(o,t,r),F(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||(O(e.$$.fragment,o),O(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(e,o),n[8](null),q(i,o)}}}function KL(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Yt(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(z.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 JL extends ye{constructor(e){super(),be(this,e,KL,YL,_e,{field:1,value:0})}}function ZL(n){let e,t,i,l,s,o,r,a;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,u,f),v(u,t,f),v(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||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),q(e,u),r=!1,a()}}}function GL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[ZL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function XL(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 QL extends ye{constructor(e){super(),be(this,e,XL,GL,_e,{field:1,value:0})}}function xL(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){v(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function eA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),vn(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){v(l,e,s)},p(l,s){s&4&&!vn(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&&k(e)}}}function tA(n){let e;function t(s,o){return s[2]?eA:xL}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function nA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){z.hasImageExtension(l==null?void 0:l.name)?z.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 iA extends ye{constructor(e){super(),be(this,e,nA,tA,_e,{file:0,size:1})}}function eg(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function tg(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 lA(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){v(s,e,o),t||(i=[Me(He.call(null,e,"Remove file")),B(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,De(i)}}}function sA(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){v(s,e,o),t||(i=B(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,i()}}}function oA(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(y,S){return y[35]?sA:lA}let g=h(n),_=g(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),o=b("a"),a=Y(r),c=C(),d=b("div"),_.c(),x(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"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){v(y,e,S),w(e,t),F(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,c),w(e,d),_.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&ue(a,r),(!m||S[0]&1064&&u!==(u=me.files.getURL(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),g===(g=h(y))&&_?_.p(y,S):(_.d(1),_=g(y),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(O(i.$$.fragment,y),m=!0)},o(y){D(i.$$.fragment,y),m=!1},d(y){y&&k(e),q(i),_.d()}}}function ng(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:[oA,({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 ho({props:r}),ie.push(()=>ve(i,"list",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function rA(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,h,g,_;i=new iA({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),H(i.$$.fragment),l=C(),s=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=Y(u),d=C(),m=b("button"),m.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){v(S,e,T),w(e,t),F(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||(_=[Me(He.call(null,m,"Remove file")),B(m,"click",y)],g=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&u!==(u=n[29].name+"")&&ue(f,u),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(O(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&k(e),q(i),g=!1,De(_)}}}function ig(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:[rA,({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 ho({props:r}),ie.push(()=>ve(i,"list",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function aA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,y,S,T,$;e=new ti({props:{uniqueId:n[28],field:n[4]}});let E=pe(n[5]);const M=A=>A[34]+A[3].id;for(let A=0;A<E.length;A+=1){let P=tg(n,E,A),R=M(P);s.set(R,l[A]=ng(R,P))}let L=pe(n[1]);const I=A=>A[29].name+A[31];for(let A=0;A<L.length;A+=1){let P=eg(n,L,A),R=I(P);a.set(R,r[A]=ig(R,P))}return{c(){var A;H(e.$$.fragment),t=C(),i=b("div");for(let P=0;P<l.length;P+=1)l[P].c();o=C();for(let P=0;P<r.length;P+=1)r[P].c();u=C(),f=b("div"),c=b("input"),m=C(),h=b("button"),g=b("i"),_=C(),y=b("span"),y.textContent="Upload new file",p(c,"type","file"),p(c,"class","hidden"),p(c,"accept",d=((A=n[4].mimeTypes)==null?void 0:A.join(","))||null),c.multiple=n[6],p(g,"class","ri-upload-cloud-line"),p(y,"class","txt"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),h.disabled=n[11],p(f,"class","list-item list-item-btn"),p(i,"class","list")},m(A,P){F(e,A,P),v(A,t,P),v(A,i,P);for(let R=0;R<l.length;R+=1)l[R]&&l[R].m(i,null);w(i,o);for(let R=0;R<r.length;R+=1)r[R]&&r[R].m(i,null);w(i,u),w(i,f),w(f,c),n[21](c),w(f,m),w(f,h),w(h,g),w(h,_),w(h,y),n[24](i),S=!0,T||($=[B(c,"change",n[22]),B(h,"click",n[23])],T=!0)},p(A,P){var N;const R={};P[0]&268435456&&(R.uniqueId=A[28]),P[0]&16&&(R.field=A[4]),e.$set(R),P[0]&13437|P[1]&6&&(E=pe(A[5]),re(),l=kt(l,P,M,1,A,E,s,i,zt,ng,o,tg),ae()),P[0]&16466|P[1]&6&&(L=pe(A[1]),re(),r=kt(r,P,I,1,A,L,a,i,zt,ig,u,eg),ae()),(!S||P[0]&16&&d!==(d=((N=A[4].mimeTypes)==null?void 0:N.join(","))||null))&&p(c,"accept",d),(!S||P[0]&64)&&(c.multiple=A[6]),(!S||P[0]&2048)&&(h.disabled=A[11])},i(A){if(!S){O(e.$$.fragment,A);for(let P=0;P<E.length;P+=1)O(l[P]);for(let P=0;P<L.length;P+=1)O(r[P]);S=!0}},o(A){D(e.$$.fragment,A);for(let P=0;P<l.length;P+=1)D(l[P]);for(let P=0;P<r.length;P+=1)D(r[P]);S=!1},d(A){A&&(k(t),k(i)),q(e,A);for(let P=0;P<l.length;P+=1)l[P].d();for(let P=0;P<r.length;P+=1)r[P].d();n[21](null),n[24](null),T=!1,De($)}}}function uA(n){let e,t,i,l,s;return t=new fe({props:{class:`
             form-field form-field-list form-field-file
             `+(n[4].required?"required":"")+`
             `+(n[9]?"dragover":"")+`
@@ -111,8 +112,8 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
             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||(O(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&k(e),q(t),l=!1,De(s)}}}function fA(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 g(V){z.removeByValue(f,V),t(2,f)}function _(V){z.pushUnique(f,V),t(2,f)}function y(V){z.isEmpty(u[V])||u.splice(V,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function T(V){var J;V.preventDefault(),t(9,m=!1);const K=((J=V.dataTransfer)==null?void 0:J.files)||[];if(!(s||!K.length)){for(const ee of K){const X=l.length+u.length-f.length;if(r.maxSelect<=X)break;u.push(ee)}t(1,u)}}Yt(async()=>{t(10,h=await me.getSuperuserFileToken(o.collectionId))});const $=V=>g(V),E=V=>_(V);function M(V){a=V,t(0,a),t(6,i),t(4,r)}const L=V=>y(V);function I(V){u=V,t(1,u)}function A(V){ie[V?"unshift":"push"](()=>{c=V,t(7,c)})}const P=()=>{for(let V of c.files)u.push(V);t(1,u),t(7,c.value=null,c)},R=()=>c==null?void 0:c.click();function N(V){ie[V?"unshift":"push"](()=>{d=V,t(8,d)})}const U=()=>{t(9,m=!0)},j=()=>{t(9,m=!1)};return n.$$set=V=>{"record"in V&&t(3,o=V.record),"field"in V&&t(4,r=V.field),"value"in V&&t(0,a=V.value),"uploadedFiles"in V&&t(1,u=V.uploadedFiles),"deletedFileNames"in V&&t(2,f=V.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=z.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect!=1),n.$$.dirty[0]&65&&z.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=z.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,_,y,T,$,E,M,L,I,A,P,R,N,U,j]}class cA extends ye{constructor(e){super(),be(this,e,fA,uA,_e,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function dA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function pA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function mA(n){let e,t,i,l;function s(a,u){return a[4]?pA:dA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Me(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&&Rt(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&k(e),r.d(),i=!1,l()}}}function hA(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){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function _A(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&&H(e.$$.fragment),t=ge()},m(o,r){e&&F(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{q(a,1)}),ae()}l?(e=jt(l,s(o)),e.$on("change",o[5]),H(e.$$.fragment),O(e.$$.fragment,1),F(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&&O(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&q(e,o)}}}function gA(n){let e,t,i,l,s,o;e=new ti({props:{uniqueId:n[6],field:n[1],$$slots:{default:[mA]},$$scope:{ctx:n}}});const r=[_A,hA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),l.c(),s=ge()},m(f,c){F(e,f,c),v(f,t,c),a[i].m(f,c),v(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):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(e.$$.fragment,f),O(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),q(e,f),a[i].d(f)}}}function bA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lg(n){return typeof n=="string"&&ak(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function ak(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function yA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=lg(s);Yt(async()=>{try{t(3,o=(await Ot(async()=>{const{default:u}=await import("./CodeEditor-C_5qTJii.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=lg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=ak(r))},[s,l,r,o,i,a]}class kA extends ye{constructor(e){super(),be(this,e,yA,bA,_e,{field:1,value:0})}}function vA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,c,d),v(c,t,d),v(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&&yt(i.value)!==c[0]&&ce(i,c[0])},i(c){a||(O(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(k(t),k(i)),q(e,c),u=!1,f()}}}function wA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[vA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function SA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=yt(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 TA extends ye{constructor(e){super(),be(this,e,SA,wA,_e,{field:1,value:0})}}function $A(n){let e,t,i,l,s,o,r,a;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,u,f),v(u,t,f),v(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||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),q(e,u),r=!1,a()}}}function CA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$A,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OA(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 EA extends ye{constructor(e){super(),be(this,e,OA,CA,_e,{field:1,value:0})}}function sg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function MA(n,e){e=sg(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=sg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function og(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function rg(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function ag(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<div class="txt">New record</div>',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[31]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function ug(n){let e,t=!n[13]&&fg(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=fg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function fg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&cg(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){v(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=cg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function cg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[35]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function DA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function IA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function dg(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-pencil-line"></i>',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){v(o,e,r),w(e,t),i||(l=[Me(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&&k(e),i=!1,De(l)}}}function pg(n,e){let t,i,l,s,o,r,a,u;function f(_,y){return _[6]?IA:DA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&dg(e);function h(){return e[33](e[50])}function g(..._){return e[34](e[50],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),H(s.$$.fragment),o=C(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){v(_,t,y),d.m(t,null),w(t,i),w(t,l),F(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[B(t,"click",h),B(t,"keydown",g)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=dg(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(O(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),q(s),m&&m.d(),a=!1,De(u)}}}function mg(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="block txt-center"><span class="loader loader-sm active"></span></div>',p(e,"class","list-item")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function hg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=Y("("),i=Y(t),l=Y(" of MAX "),s=Y(n[4]),o=Y(")")},m(r,a){v(r,e,a),v(r,i,a),v(r,l,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&ue(i,t),a[0]&16&&ue(s,r[4])},d(r){r&&(k(e),k(i),k(l),k(s),k(o))}}}function LA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function AA(n){let e,t,i=pe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=_g(og(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o<l.length;o+=1)l[o].c();p(e,"class","selected-list svelte-1u8jhky")},m(o,r){v(o,e,r);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);t=!0},p(o,r){if(r[0]&65600|r[1]&12582912){i=pe(o[6]);let a;for(a=0;a<i.length;a+=1){const u=og(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=_g(u),l[a].c(),O(l[a],1),l[a].m(e,null))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function PA(n){let e,t,i,l,s,o,r,a;t=new Ur({props:{record:n[50]}});function u(){return n[37](n[50])}return{c(){e=b("span"),H(t.$$.fragment),i=C(),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',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"),x(e,"label-danger",n[53]),x(e,"label-warning",n[54])},m(f,c){v(f,e,c),F(t,e,null),w(e,i),w(e,l),v(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)&&x(e,"label-danger",n[53]),(!o||c[1]&8388608)&&x(e,"label-warning",n[54])},i(f){o||(O(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(s)),q(t),r=!1,a()}}}function _g(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[PA,({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 ho({props:s}),ie.push(()=>ve(e,"list",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function NA(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,y,S,T;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&ag(n),E=pe(n[8]);const M=U=>U[50].id;for(let U=0;U<E.length;U+=1){let j=rg(n,E,U),V=M(j);r.set(V,o[U]=pg(V,j))}let L=null;E.length||(L=ug(n));let I=n[13]&&mg(),A=n[4]>1&&hg(n);const P=[AA,LA],R=[];function N(U,j){return U[6].length?0:1}return h=N(n),g=R[h]=P[h](n),{c(){e=b("div"),H(t.$$.fragment),i=C(),$&&$.c(),l=C(),s=b("div");for(let U=0;U<o.length;U+=1)o[U].c();L&&L.c(),a=C(),I&&I.c(),f=C(),c=b("h5"),d=Y(`Selected
-        `),A&&A.c(),m=C(),g.c(),_=ge(),p(e,"class","flex m-b-base flex-gap-10"),p(s,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(U,j){v(U,e,j),F(t,e,null),w(e,i),$&&$.m(e,null),v(U,l,j),v(U,s,j);for(let V=0;V<o.length;V+=1)o[V]&&o[V].m(s,null);L&&L.m(s,null),w(s,a),I&&I.m(s,null),v(U,f,j),v(U,c,j),w(c,d),A&&A.m(c,null),v(U,m,j),R[h].m(U,j),v(U,_,j),y=!0,S||(T=Me(u=MA.call(null,s,n[36])),S=!0)},p(U,j){const V={};j[0]&4&&(V.value=U[2]),j[0]&32&&(V.autocompleteCollection=U[5]),t.$set(V),U[11]?$&&($.d(1),$=null):$?$.p(U,j):($=ag(U),$.c(),$.m(e,null)),j[0]&143252&&(E=pe(U[8]),re(),o=kt(o,j,M,1,U,E,r,s,zt,pg,a,rg),ae(),!E.length&&L?L.p(U,j):E.length?L&&(L.d(1),L=null):(L=ug(U),L.c(),L.m(s,a))),U[13]?I||(I=mg(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&Rt(u.update)&&j[0]&4104&&u.update.call(null,U[36]),U[4]>1?A?A.p(U,j):(A=hg(U),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let K=h;h=N(U),h===K?R[h].p(U,j):(re(),D(R[K],1,1,()=>{R[K]=null}),ae(),g=R[h],g?g.p(U,j):(g=R[h]=P[h](U),g.c()),O(g,1),g.m(_.parentNode,_))},i(U){if(!y){O(t.$$.fragment,U);for(let j=0;j<E.length;j+=1)O(o[j]);O(g),y=!0}},o(U){D(t.$$.fragment,U);for(let j=0;j<o.length;j+=1)D(o[j]);D(g),y=!1},d(U){U&&(k(e),k(l),k(s),k(f),k(c),k(m),k(_)),q(t),$&&$.d();for(let j=0;j<o.length;j+=1)o[j].d();L&&L.d(),I&&I.d(),A&&A.d(),R[h].d(U),S=!1,T()}}}function RA(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=Y("Select "),i=b("strong"),s=Y(l),o=Y(" records")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(i,s),w(e,o)},p(a,u){var f;u[0]&32&&l!==(l=(((f=a[5])==null?void 0:f.name)||"")+"")&&ue(s,l)},d(a){a&&k(e)}}}function FA(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[B(e,"click",n[28]),B(i,"click",n[29])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,De(s)}}}function qA(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[FA],header:[RA],default:[NA]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new ln({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new rf({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),l=!0},p(a,u){const f=u[0]&524288?vt(s,[s[0],s[1],Ft(a[19])]):{};u[0]&16380|u[1]&67108864&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){l||(O(e.$$.fragment,a),O(i.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),l=!1},d(a){a&&k(t),n[39](null),q(e,a),n[42](null),q(i,a)}}}const Go=50;function HA(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=lt(e,c),m;Qe(n,En,Oe=>t(26,m=Oe));const h=_t(),g="picker_"+z.randomString(5);let{value:_}=e,{field:y}=e,S,T,$="",E=[],M=[],L=1,I=0,A=!1,P=!1;function R(){return t(2,$=""),t(8,E=[]),t(6,M=[]),j(),V(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}function U(){var Ne;let Oe="";const ut=(Ne=s==null?void 0:s.fields)==null?void 0:Ne.filter(xe=>!xe.hidden&&xe.presentable&&xe.type=="relation");for(const xe of ut){const qt=z.getExpandPresentableRelField(xe,m,2);qt&&(Oe!=""&&(Oe+=","),Oe+=qt)}return Oe}async function j(){const Oe=z.toArray(_);if(!l||!Oe.length)return;t(24,P=!0);let ut=[];const Ne=Oe.slice(),xe=[];for(;Ne.length>0;){const qt=[];for(const Zt of Ne.splice(0,Go))qt.push(`id="${Zt}"`);xe.push(me.collection(l).getFullList({batch:Go,filter:qt.join("||"),fields:"*:excerpt(200)",expand:U(),requestKey:null}))}try{await Promise.all(xe).then(qt=>{ut=ut.concat(...qt)}),t(6,M=[]);for(const qt of Oe){const Zt=z.findByKey(ut,"id",qt);Zt&&M.push(Zt)}$.trim()||t(8,E=z.filterDuplicatesByKey(M.concat(E))),t(24,P=!1)}catch(qt){qt.isAbort||(me.error(qt),t(24,P=!1))}}async function V(Oe=!1){if(l){t(3,A=!0),Oe&&($.trim()?t(8,E=[]):t(8,E=z.toArray(M).slice()));try{const ut=Oe?1:L+1,Ne=z.getAllCollectionIdentifiers(s),xe=await me.collection(l).getList(ut,Go,{filter:z.normalizeSearchFilter($,Ne),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,expand:U(),requestKey:g+"loadList"});t(8,E=z.filterDuplicatesByKey(E.concat(xe.items))),L=xe.page,t(23,I=xe.items.length),t(3,A=!1)}catch(ut){ut.isAbort||(me.error(ut),t(3,A=!1))}}}function K(Oe){i==1?t(6,M=[Oe]):u&&(z.pushOrReplaceByKey(M,Oe),t(6,M))}function J(Oe){z.removeByKey(M,"id",Oe.id),t(6,M)}function ee(Oe){f(Oe)?J(Oe):K(Oe)}function X(){var Oe;i!=1?t(20,_=M.map(ut=>ut.id)):t(20,_=((Oe=M==null?void 0:M[0])==null?void 0:Oe.id)||""),h("save",M),N()}function oe(Oe){Pe.call(this,n,Oe)}const Se=()=>N(),ke=()=>X(),Ce=Oe=>t(2,$=Oe.detail),We=()=>T==null?void 0:T.show(),st=Oe=>T==null?void 0:T.show(Oe.id),et=Oe=>ee(Oe),Be=(Oe,ut)=>{(ut.code==="Enter"||ut.code==="Space")&&(ut.preventDefault(),ut.stopPropagation(),ee(Oe))},rt=()=>t(2,$=""),Je=()=>{a&&!A&&V()},at=Oe=>J(Oe);function Ht(Oe){M=Oe,t(6,M)}function Te(Oe){ie[Oe?"unshift":"push"](()=>{S=Oe,t(1,S)})}function Ze(Oe){Pe.call(this,n,Oe)}function ot(Oe){Pe.call(this,n,Oe)}function Le(Oe){ie[Oe?"unshift":"push"](()=>{T=Oe,t(7,T)})}const Ve=Oe=>{z.removeByKey(E,"id",Oe.detail.record.id),E.unshift(Oe.detail.record),t(8,E),K(Oe.detail.record)},we=Oe=>{z.removeByKey(E,"id",Oe.detail.id),t(8,E),J(Oe.detail)};return n.$$set=Oe=>{e=je(je({},e),Ut(Oe)),t(19,d=lt(e,c)),"value"in Oe&&t(20,_=Oe.value),"field"in Oe&&t(21,y=Oe.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(y==null?void 0:y.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=y==null?void 0:y.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Oe=>Oe.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&V(!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==Go),n.$$.dirty[0]&80&&t(10,u=i<=0||i>M.length),n.$$.dirty[0]&64&&t(9,f=function(Oe){return z.findByKey(M,"id",Oe.id)})},[N,S,$,A,i,s,M,T,E,f,u,o,a,r,V,K,J,ee,X,d,_,y,R,I,P,l,m,oe,Se,ke,Ce,We,st,et,Be,rt,Je,at,Ht,Te,Ze,ot,Le,Ve,we]}class jA extends ye{constructor(e){super(),be(this,e,HA,qA,_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 gg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function bg(n,e,t){const i=n.slice();return i[27]=e[t],i}function yg(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){v(s,e,o),i||(l=Me(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&&Rt(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&&k(e),i=!1,l()}}}function zA(n){let e,t=n[6].length&&yg(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=yg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function kg(n){let e,t=n[5]&&vg(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=vg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function vg(n){let e,t=pe(z.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l<t.length;l+=1)i[l]=wg(bg(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&1){t=pe(z.toArray(l[0]).slice(0,10));let o;for(o=0;o<t.length;o+=1){const r=bg(l,t,o);i[o]?i[o].p(r,s):(i[o]=wg(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function wg(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="skeleton-loader"></div> ',p(e,"class","list-item")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function UA(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"),H(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',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"),x(e,"dragging",n[25]),x(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),F(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Me(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)&&x(e,"dragging",n[25]),(!a||m&67108864)&&x(e,"dragover",n[26])},i(d){a||(O(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),q(i),u=!1,De(f)}}}function Sg(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:[UA,({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 ho({props:r}),ie.push(()=>ve(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function VA(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ti({props:{uniqueId:n[21],field:n[2],$$slots:{default:[zA]},$$scope:{ctx:n}}});let m=pe(n[4]);const h=_=>_[22].id;for(let _=0;_<m.length;_+=1){let y=gg(n,m,_),S=h(y);o.set(S,s[_]=Sg(S,y))}let g=null;return m.length||(g=kg(n)),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div");for(let _=0;_<s.length;_+=1)s[_].c();g&&g.c(),r=C(),a=b("div"),u=b("button"),u.innerHTML='<i class="ri-magic-line"></i> <span class="txt">Open picker</span>',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(_,y){F(e,_,y),v(_,t,y),v(_,i,y),w(i,l);for(let S=0;S<s.length;S+=1)s[S]&&s[S].m(l,null);g&&g.m(l,null),w(i,r),w(i,a),w(a,u),f=!0,c||(d=B(u,"click",n[14]),c=!0)},p(_,y){const S={};y&2097152&&(S.uniqueId=_[21]),y&4&&(S.field=_[2]),y&1073741888&&(S.$$scope={dirty:y,ctx:_}),e.$set(S),y&100664245&&(m=pe(_[4]),re(),s=kt(s,y,h,1,_,m,o,l,zt,Sg,null,gg),ae(),!m.length&&g?g.p(_,y):m.length?g&&(g.d(1),g=null):(g=kg(_),g.c(),g.m(l,null)))},i(_){if(!f){O(e.$$.fragment,_);for(let y=0;y<m.length;y+=1)O(s[y]);f=!0}},o(_){D(e.$$.fragment,_);for(let y=0;y<s.length;y+=1)D(s[y]);f=!1},d(_){_&&(k(t),k(i)),q(e,_);for(let y=0;y<s.length;y+=1)s[y].d();g&&g.d(),c=!1,d()}}}function BA(n){let e,t,i,l,s={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[VA,({uniqueId:r})=>({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 jA({props:o}),n[16](i),i.$on("save",n[17]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){F(e,r,a),v(r,t,a),F(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||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[15](null),q(e,r),n[16](null),q(i,r)}}}const Tg=100;function WA(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=z.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var U,j;const I=z.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=(j=(U=l.find(V=>V.id==s.collectionId))==null?void 0:U.fields)==null?void 0:j.filter(V=>!V.hidden&&V.presentable&&V.type=="relation");for(const V of P){const K=z.getExpandPresentableRelField(V,l,2);K&&(A!=""&&(A+=","),A+=K)}const R=I.slice(),N=[];for(;R.length>0;){const V=[];for(const K of R.splice(0,Tg))V.push(`id="${K}"`);N.push(me.collection(s.collectionId).getFullList(Tg,{filter:V.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let V=[];await Promise.all(N).then(K=>{V=V.concat(...K)});for(const K of I){const J=z.findByKey(V,"id",K);J?u.push(J):d.push(K)}t(4,u),_()}catch(V){me.error(V)}t(5,f=!1)}function g(I){z.removeByKey(u,"id",I.id),t(4,u),_()}function _(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}so(()=>{clearTimeout(c)});const y=I=>g(I);function S(I){u=I,t(4,u)}const T=()=>{_()},$=()=>r==null?void 0:r.show();function E(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,y,S,T,$,E,M,L]}class YA extends ye{constructor(e){super(),be(this,e,WA,BA,_e,{field:2,value:0,picker:1})}}function $g(n){let e,t,i,l;return{c(){e=b("div"),t=Y("Select up to "),i=Y(n[2]),l=Y(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&ue(i,s[2])},d(s){s&&k(e)}}}function KA(n){var c,d;let e,t,i,l,s,o,r;e=new ti({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(()=>ve(i,"selected",a));let f=n[1].maxSelect!=1&&$g(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),f&&f.c(),o=ge()},m(m,h){F(e,m,h),v(m,t,h),F(i,m,h),v(m,s,h),f&&f.m(m,h),v(m,o,h),r=!0},p(m,h){var y,S;const g={};h&32&&(g.uniqueId=m[5]),h&2&&(g.field=m[1]),e.$set(g);const _={};h&32&&(_.id=m[5]),h&10&&(_.toggle=!m[1].required||m[3]),h&8&&(_.multiple=m[3]),h&11&&(_.closable=!m[3]||((y=m[0])==null?void 0:y.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,_.selected=m[0],$e(()=>l=!1)),i.$set(_),m[1].maxSelect!=1?f?f.p(m,h):(f=$g(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(O(e.$$.fragment,m),O(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(k(t),k(s),k(o)),q(e,m),q(i,m),f&&f.d(m)}}}function JA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[KA,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function ZA(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 GA extends ye{constructor(e){super(),be(this,e,ZA,JA,_e,{field:1,value:0})}}function XA(n){let e,t,i,l=[n[3]],s={};for(let o=0;o<l.length;o+=1)s=je(s,l[o]);return{c(){e=b("textarea"),Xn(e,s),x(e,"svelte-1x1pbts",!0)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),ce(e,n[0]),t||(i=[B(e,"input",n[6]),B(e,"keydown",n[2])],t=!0)},p(o,[r]){Xn(e,s=vt(l,[r&8&&o[3]])),r&1&&ce(e,o[0]),x(e,"svelte-1x1pbts",!0)},i:te,o:te,d(o){o&&k(e),n[5](null),t=!1,De(i)}}}function QA(n,e,t){const i=["value","maxHeight"];let l=lt(e,i),{value:s=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{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()}}Yt(()=>(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=je(je({},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 xA extends ye{constructor(e){super(),be(this,e,QA,XA,_e,{value:0,maxHeight:4})}}function eP(n){let e,t,i,l,s;e=new ti({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 xA({props:r}),ie.push(()=>ve(i,"value",o)),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(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],$e(()=>l=!1)),i.$set(c)},i(a){s||(O(e.$$.fragment,a),O(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(e,a),q(i,a)}}}function tP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[eP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function nP(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=!z.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class iP extends ye{constructor(e){super(),be(this,e,nP,tP,_e,{original:4,field:1,value:0})}}function lP(n){let e,t,i,l,s,o,r,a;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,u,f),v(u,t,f),v(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||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),q(e,u),r=!1,a()}}}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})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oP(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 rP extends ye{constructor(e){super(),be(this,e,oP,sP,_e,{field:1,value:0})}}function Cg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Og(n,e,t){const i=n.slice();return i[6]=e[t],i}function Eg(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=Y(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),x(t,"active",e[1]===e[6].language),this.first=t},m(f,c){v(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+"")&&ue(s,l),c&6&&x(t,"active",e[1]===e[6].language)},d(f){f&&k(t),r=!1,a()}}}function Mg(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"),H(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=Y(a),f=Y(" 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"),x(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),F(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,g){e=h;const _={};g&4&&(_.language=e[6].language),g&4&&(_.content=e[6].content),i.$set(_),(!m||g&4)&&a!==(a=e[6].title+"")&&ue(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&x(t,"active",e[1]===e[6].language)},i(h){m||(O(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&k(t),q(i)}}}function aP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=pe(n[2]);const d=g=>g[6].language;for(let g=0;g<c.length;g+=1){let _=Og(n,c,g),y=d(_);l.set(y,i[g]=Eg(y,_))}let m=pe(n[2]);const h=g=>g[6].language;for(let g=0;g<m.length;g+=1){let _=Cg(n,m,g),y=h(_);a.set(y,r[g]=Mg(y,_))}return{c(){e=b("div"),t=b("div");for(let g=0;g<i.length;g+=1)i[g].c();s=C(),o=b("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact combined left"),p(o,"class","tabs-content"),p(e,"class",u="tabs sdk-tabs "+n[0]+" svelte-1maocj6")},m(g,_){v(g,e,_),w(e,t);for(let y=0;y<i.length;y+=1)i[y]&&i[y].m(t,null);w(e,s),w(e,o);for(let y=0;y<r.length;y+=1)r[y]&&r[y].m(o,null);f=!0},p(g,[_]){_&6&&(c=pe(g[2]),i=kt(i,_,d,1,g,c,l,t,ci,Eg,null,Og)),_&6&&(m=pe(g[2]),re(),r=kt(r,_,h,1,g,m,a,o,zt,Mg,null,Cg),ae()),(!f||_&1&&u!==(u="tabs sdk-tabs "+g[0]+" svelte-1maocj6"))&&p(e,"class",u)},i(g){if(!f){for(let _=0;_<m.length;_+=1)O(r[_]);f=!0}},o(g){for(let _=0;_<r.length;_+=1)D(r[_]);f=!1},d(g){g&&k(e);for(let _=0;_<i.length;_+=1)i[_].d();for(let _=0;_<r.length;_+=1)r[_].d()}}}const Dg="pb_sdk_preference";function uP(n,e,t){let i,{class:l="m-b-sm"}=e,{js:s=""}=e,{dart:o=""}=e,r=localStorage.getItem(Dg)||"javascript";const a=u=>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(Dg,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 fP extends ye{constructor(e){super(),be(this,e,uP,aP,_e,{class:0,js:3,dart:4})}}function cP(n){let e,t,i,l,s=z.displayValue(n[1])+"",o,r,a,u,f,c,d;return u=new fe({props:{class:"form-field m-b-0 m-t-sm",name:"duration",$$slots:{default:[pP,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("p"),i=Y(`Generate a non-refreshable auth token for
+        `),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||(O(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&k(e),q(t),l=!1,De(s)}}}function fA(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 g(V){z.removeByValue(f,V),t(2,f)}function _(V){z.pushUnique(f,V),t(2,f)}function y(V){z.isEmpty(u[V])||u.splice(V,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function T(V){var J;V.preventDefault(),t(9,m=!1);const K=((J=V.dataTransfer)==null?void 0:J.files)||[];if(!(s||!K.length)){for(const ee of K){const X=l.length+u.length-f.length;if(r.maxSelect<=X)break;u.push(ee)}t(1,u)}}Yt(async()=>{t(10,h=await me.getSuperuserFileToken(o.collectionId))});const $=V=>g(V),E=V=>_(V);function M(V){a=V,t(0,a),t(6,i),t(4,r)}const L=V=>y(V);function I(V){u=V,t(1,u)}function A(V){ie[V?"unshift":"push"](()=>{c=V,t(7,c)})}const P=()=>{for(let V of c.files)u.push(V);t(1,u),t(7,c.value=null,c)},R=()=>c==null?void 0:c.click();function N(V){ie[V?"unshift":"push"](()=>{d=V,t(8,d)})}const U=()=>{t(9,m=!0)},j=()=>{t(9,m=!1)};return n.$$set=V=>{"record"in V&&t(3,o=V.record),"field"in V&&t(4,r=V.field),"value"in V&&t(0,a=V.value),"uploadedFiles"in V&&t(1,u=V.uploadedFiles),"deletedFileNames"in V&&t(2,f=V.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=z.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect!=1),n.$$.dirty[0]&65&&z.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=z.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,_,y,T,$,E,M,L,I,A,P,R,N,U,j]}class cA extends ye{constructor(e){super(),be(this,e,fA,uA,_e,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function dA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function pA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function mA(n){let e,t,i,l;function s(a,u){return a[4]?pA:dA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Me(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&&Rt(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&k(e),r.d(),i=!1,l()}}}function hA(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){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function _A(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&&H(e.$$.fragment),t=ge()},m(o,r){e&&F(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{q(a,1)}),ae()}l?(e=jt(l,s(o)),e.$on("change",o[5]),H(e.$$.fragment),O(e.$$.fragment,1),F(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&&O(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&q(e,o)}}}function gA(n){let e,t,i,l,s,o;e=new ti({props:{uniqueId:n[6],field:n[1],$$slots:{default:[mA]},$$scope:{ctx:n}}});const r=[_A,hA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),l.c(),s=ge()},m(f,c){F(e,f,c),v(f,t,c),a[i].m(f,c),v(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):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(e.$$.fragment,f),O(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),q(e,f),a[i].d(f)}}}function bA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lg(n){return typeof n=="string"&&ak(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function ak(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function yA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=lg(s);Yt(async()=>{try{t(3,o=(await Ot(async()=>{const{default:u}=await import("./CodeEditor-BMLITRTv.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=lg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=ak(r))},[s,l,r,o,i,a]}class kA extends ye{constructor(e){super(),be(this,e,yA,bA,_e,{field:1,value:0})}}function vA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,c,d),v(c,t,d),v(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&&_t(i.value)!==c[0]&&ce(i,c[0])},i(c){a||(O(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(k(t),k(i)),q(e,c),u=!1,f()}}}function wA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[vA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function SA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=_t(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 TA extends ye{constructor(e){super(),be(this,e,SA,wA,_e,{field:1,value:0})}}function $A(n){let e,t,i,l,s,o,r,a;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,u,f),v(u,t,f),v(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||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),q(e,u),r=!1,a()}}}function CA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$A,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OA(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 EA extends ye{constructor(e){super(),be(this,e,OA,CA,_e,{field:1,value:0})}}function sg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function MA(n,e){e=sg(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=sg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function og(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function rg(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function ag(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<div class="txt">New record</div>',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[31]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function ug(n){let e,t=!n[13]&&fg(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=fg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function fg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&cg(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){v(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=cg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function cg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[35]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function DA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function IA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function dg(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-pencil-line"></i>',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){v(o,e,r),w(e,t),i||(l=[Me(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&&k(e),i=!1,De(l)}}}function pg(n,e){let t,i,l,s,o,r,a,u;function f(_,y){return _[6]?IA:DA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&dg(e);function h(){return e[33](e[50])}function g(..._){return e[34](e[50],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),H(s.$$.fragment),o=C(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){v(_,t,y),d.m(t,null),w(t,i),w(t,l),F(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[B(t,"click",h),B(t,"keydown",g)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=dg(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(O(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),q(s),m&&m.d(),a=!1,De(u)}}}function mg(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="block txt-center"><span class="loader loader-sm active"></span></div>',p(e,"class","list-item")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function hg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=Y("("),i=Y(t),l=Y(" of MAX "),s=Y(n[4]),o=Y(")")},m(r,a){v(r,e,a),v(r,i,a),v(r,l,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&ue(i,t),a[0]&16&&ue(s,r[4])},d(r){r&&(k(e),k(i),k(l),k(s),k(o))}}}function LA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function AA(n){let e,t,i=pe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=_g(og(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o<l.length;o+=1)l[o].c();p(e,"class","selected-list svelte-1u8jhky")},m(o,r){v(o,e,r);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);t=!0},p(o,r){if(r[0]&65600|r[1]&12582912){i=pe(o[6]);let a;for(a=0;a<i.length;a+=1){const u=og(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=_g(u),l[a].c(),O(l[a],1),l[a].m(e,null))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function PA(n){let e,t,i,l,s,o,r,a;t=new Ur({props:{record:n[50]}});function u(){return n[37](n[50])}return{c(){e=b("span"),H(t.$$.fragment),i=C(),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',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"),x(e,"label-danger",n[53]),x(e,"label-warning",n[54])},m(f,c){v(f,e,c),F(t,e,null),w(e,i),w(e,l),v(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)&&x(e,"label-danger",n[53]),(!o||c[1]&8388608)&&x(e,"label-warning",n[54])},i(f){o||(O(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(s)),q(t),r=!1,a()}}}function _g(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[PA,({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 ho({props:s}),ie.push(()=>ve(e,"list",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function NA(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,y,S,T;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&ag(n),E=pe(n[8]);const M=U=>U[50].id;for(let U=0;U<E.length;U+=1){let j=rg(n,E,U),V=M(j);r.set(V,o[U]=pg(V,j))}let L=null;E.length||(L=ug(n));let I=n[13]&&mg(),A=n[4]>1&&hg(n);const P=[AA,LA],R=[];function N(U,j){return U[6].length?0:1}return h=N(n),g=R[h]=P[h](n),{c(){e=b("div"),H(t.$$.fragment),i=C(),$&&$.c(),l=C(),s=b("div");for(let U=0;U<o.length;U+=1)o[U].c();L&&L.c(),a=C(),I&&I.c(),f=C(),c=b("h5"),d=Y(`Selected
+        `),A&&A.c(),m=C(),g.c(),_=ge(),p(e,"class","flex m-b-base flex-gap-10"),p(s,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(U,j){v(U,e,j),F(t,e,null),w(e,i),$&&$.m(e,null),v(U,l,j),v(U,s,j);for(let V=0;V<o.length;V+=1)o[V]&&o[V].m(s,null);L&&L.m(s,null),w(s,a),I&&I.m(s,null),v(U,f,j),v(U,c,j),w(c,d),A&&A.m(c,null),v(U,m,j),R[h].m(U,j),v(U,_,j),y=!0,S||(T=Me(u=MA.call(null,s,n[36])),S=!0)},p(U,j){const V={};j[0]&4&&(V.value=U[2]),j[0]&32&&(V.autocompleteCollection=U[5]),t.$set(V),U[11]?$&&($.d(1),$=null):$?$.p(U,j):($=ag(U),$.c(),$.m(e,null)),j[0]&143252&&(E=pe(U[8]),re(),o=kt(o,j,M,1,U,E,r,s,zt,pg,a,rg),ae(),!E.length&&L?L.p(U,j):E.length?L&&(L.d(1),L=null):(L=ug(U),L.c(),L.m(s,a))),U[13]?I||(I=mg(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&Rt(u.update)&&j[0]&4104&&u.update.call(null,U[36]),U[4]>1?A?A.p(U,j):(A=hg(U),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let K=h;h=N(U),h===K?R[h].p(U,j):(re(),D(R[K],1,1,()=>{R[K]=null}),ae(),g=R[h],g?g.p(U,j):(g=R[h]=P[h](U),g.c()),O(g,1),g.m(_.parentNode,_))},i(U){if(!y){O(t.$$.fragment,U);for(let j=0;j<E.length;j+=1)O(o[j]);O(g),y=!0}},o(U){D(t.$$.fragment,U);for(let j=0;j<o.length;j+=1)D(o[j]);D(g),y=!1},d(U){U&&(k(e),k(l),k(s),k(f),k(c),k(m),k(_)),q(t),$&&$.d();for(let j=0;j<o.length;j+=1)o[j].d();L&&L.d(),I&&I.d(),A&&A.d(),R[h].d(U),S=!1,T()}}}function RA(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=Y("Select "),i=b("strong"),s=Y(l),o=Y(" records")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(i,s),w(e,o)},p(a,u){var f;u[0]&32&&l!==(l=(((f=a[5])==null?void 0:f.name)||"")+"")&&ue(s,l)},d(a){a&&k(e)}}}function FA(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[B(e,"click",n[28]),B(i,"click",n[29])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,De(s)}}}function qA(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[FA],header:[RA],default:[NA]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new ln({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new rf({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),l=!0},p(a,u){const f=u[0]&524288?vt(s,[s[0],s[1],Ft(a[19])]):{};u[0]&16380|u[1]&67108864&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){l||(O(e.$$.fragment,a),O(i.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),l=!1},d(a){a&&k(t),n[39](null),q(e,a),n[42](null),q(i,a)}}}const Go=50;function HA(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=lt(e,c),m;Qe(n,En,Oe=>t(26,m=Oe));const h=gt(),g="picker_"+z.randomString(5);let{value:_}=e,{field:y}=e,S,T,$="",E=[],M=[],L=1,I=0,A=!1,P=!1;function R(){return t(2,$=""),t(8,E=[]),t(6,M=[]),j(),V(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}function U(){var Ne;let Oe="";const ut=(Ne=s==null?void 0:s.fields)==null?void 0:Ne.filter(xe=>!xe.hidden&&xe.presentable&&xe.type=="relation");for(const xe of ut){const qt=z.getExpandPresentableRelField(xe,m,2);qt&&(Oe!=""&&(Oe+=","),Oe+=qt)}return Oe}async function j(){const Oe=z.toArray(_);if(!l||!Oe.length)return;t(24,P=!0);let ut=[];const Ne=Oe.slice(),xe=[];for(;Ne.length>0;){const qt=[];for(const Zt of Ne.splice(0,Go))qt.push(`id="${Zt}"`);xe.push(me.collection(l).getFullList({batch:Go,filter:qt.join("||"),fields:"*:excerpt(200)",expand:U(),requestKey:null}))}try{await Promise.all(xe).then(qt=>{ut=ut.concat(...qt)}),t(6,M=[]);for(const qt of Oe){const Zt=z.findByKey(ut,"id",qt);Zt&&M.push(Zt)}$.trim()||t(8,E=z.filterDuplicatesByKey(M.concat(E))),t(24,P=!1)}catch(qt){qt.isAbort||(me.error(qt),t(24,P=!1))}}async function V(Oe=!1){if(l){t(3,A=!0),Oe&&($.trim()?t(8,E=[]):t(8,E=z.toArray(M).slice()));try{const ut=Oe?1:L+1,Ne=z.getAllCollectionIdentifiers(s),xe=await me.collection(l).getList(ut,Go,{filter:z.normalizeSearchFilter($,Ne),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,expand:U(),requestKey:g+"loadList"});t(8,E=z.filterDuplicatesByKey(E.concat(xe.items))),L=xe.page,t(23,I=xe.items.length),t(3,A=!1)}catch(ut){ut.isAbort||(me.error(ut),t(3,A=!1))}}}function K(Oe){i==1?t(6,M=[Oe]):u&&(z.pushOrReplaceByKey(M,Oe),t(6,M))}function J(Oe){z.removeByKey(M,"id",Oe.id),t(6,M)}function ee(Oe){f(Oe)?J(Oe):K(Oe)}function X(){var Oe;i!=1?t(20,_=M.map(ut=>ut.id)):t(20,_=((Oe=M==null?void 0:M[0])==null?void 0:Oe.id)||""),h("save",M),N()}function oe(Oe){Pe.call(this,n,Oe)}const Se=()=>N(),ke=()=>X(),Ce=Oe=>t(2,$=Oe.detail),We=()=>T==null?void 0:T.show(),st=Oe=>T==null?void 0:T.show(Oe.id),et=Oe=>ee(Oe),Be=(Oe,ut)=>{(ut.code==="Enter"||ut.code==="Space")&&(ut.preventDefault(),ut.stopPropagation(),ee(Oe))},rt=()=>t(2,$=""),Je=()=>{a&&!A&&V()},at=Oe=>J(Oe);function Ht(Oe){M=Oe,t(6,M)}function Te(Oe){ie[Oe?"unshift":"push"](()=>{S=Oe,t(1,S)})}function Ze(Oe){Pe.call(this,n,Oe)}function ot(Oe){Pe.call(this,n,Oe)}function Le(Oe){ie[Oe?"unshift":"push"](()=>{T=Oe,t(7,T)})}const Ve=Oe=>{z.removeByKey(E,"id",Oe.detail.record.id),E.unshift(Oe.detail.record),t(8,E),K(Oe.detail.record)},we=Oe=>{z.removeByKey(E,"id",Oe.detail.id),t(8,E),J(Oe.detail)};return n.$$set=Oe=>{e=je(je({},e),Ut(Oe)),t(19,d=lt(e,c)),"value"in Oe&&t(20,_=Oe.value),"field"in Oe&&t(21,y=Oe.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(y==null?void 0:y.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=y==null?void 0:y.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Oe=>Oe.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&V(!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==Go),n.$$.dirty[0]&80&&t(10,u=i<=0||i>M.length),n.$$.dirty[0]&64&&t(9,f=function(Oe){return z.findByKey(M,"id",Oe.id)})},[N,S,$,A,i,s,M,T,E,f,u,o,a,r,V,K,J,ee,X,d,_,y,R,I,P,l,m,oe,Se,ke,Ce,We,st,et,Be,rt,Je,at,Ht,Te,Ze,ot,Le,Ve,we]}class jA extends ye{constructor(e){super(),be(this,e,HA,qA,_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 gg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function bg(n,e,t){const i=n.slice();return i[27]=e[t],i}function yg(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){v(s,e,o),i||(l=Me(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&&Rt(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&&k(e),i=!1,l()}}}function zA(n){let e,t=n[6].length&&yg(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=yg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function kg(n){let e,t=n[5]&&vg(n);return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=vg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function vg(n){let e,t=pe(z.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l<t.length;l+=1)i[l]=wg(bg(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&1){t=pe(z.toArray(l[0]).slice(0,10));let o;for(o=0;o<t.length;o+=1){const r=bg(l,t,o);i[o]?i[o].p(r,s):(i[o]=wg(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function wg(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="skeleton-loader"></div> ',p(e,"class","list-item")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function UA(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"),H(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',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"),x(e,"dragging",n[25]),x(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),F(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Me(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)&&x(e,"dragging",n[25]),(!a||m&67108864)&&x(e,"dragover",n[26])},i(d){a||(O(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),q(i),u=!1,De(f)}}}function Sg(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:[UA,({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 ho({props:r}),ie.push(()=>ve(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(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],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function VA(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ti({props:{uniqueId:n[21],field:n[2],$$slots:{default:[zA]},$$scope:{ctx:n}}});let m=pe(n[4]);const h=_=>_[22].id;for(let _=0;_<m.length;_+=1){let y=gg(n,m,_),S=h(y);o.set(S,s[_]=Sg(S,y))}let g=null;return m.length||(g=kg(n)),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div");for(let _=0;_<s.length;_+=1)s[_].c();g&&g.c(),r=C(),a=b("div"),u=b("button"),u.innerHTML='<i class="ri-magic-line"></i> <span class="txt">Open picker</span>',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(_,y){F(e,_,y),v(_,t,y),v(_,i,y),w(i,l);for(let S=0;S<s.length;S+=1)s[S]&&s[S].m(l,null);g&&g.m(l,null),w(i,r),w(i,a),w(a,u),f=!0,c||(d=B(u,"click",n[14]),c=!0)},p(_,y){const S={};y&2097152&&(S.uniqueId=_[21]),y&4&&(S.field=_[2]),y&1073741888&&(S.$$scope={dirty:y,ctx:_}),e.$set(S),y&100664245&&(m=pe(_[4]),re(),s=kt(s,y,h,1,_,m,o,l,zt,Sg,null,gg),ae(),!m.length&&g?g.p(_,y):m.length?g&&(g.d(1),g=null):(g=kg(_),g.c(),g.m(l,null)))},i(_){if(!f){O(e.$$.fragment,_);for(let y=0;y<m.length;y+=1)O(s[y]);f=!0}},o(_){D(e.$$.fragment,_);for(let y=0;y<s.length;y+=1)D(s[y]);f=!1},d(_){_&&(k(t),k(i)),q(e,_);for(let y=0;y<s.length;y+=1)s[y].d();g&&g.d(),c=!1,d()}}}function BA(n){let e,t,i,l,s={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[VA,({uniqueId:r})=>({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 jA({props:o}),n[16](i),i.$on("save",n[17]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){F(e,r,a),v(r,t,a),F(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||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[15](null),q(e,r),n[16](null),q(i,r)}}}const Tg=100;function WA(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=z.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var U,j;const I=z.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=(j=(U=l.find(V=>V.id==s.collectionId))==null?void 0:U.fields)==null?void 0:j.filter(V=>!V.hidden&&V.presentable&&V.type=="relation");for(const V of P){const K=z.getExpandPresentableRelField(V,l,2);K&&(A!=""&&(A+=","),A+=K)}const R=I.slice(),N=[];for(;R.length>0;){const V=[];for(const K of R.splice(0,Tg))V.push(`id="${K}"`);N.push(me.collection(s.collectionId).getFullList(Tg,{filter:V.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let V=[];await Promise.all(N).then(K=>{V=V.concat(...K)});for(const K of I){const J=z.findByKey(V,"id",K);J?u.push(J):d.push(K)}t(4,u),_()}catch(V){me.error(V)}t(5,f=!1)}function g(I){z.removeByKey(u,"id",I.id),t(4,u),_()}function _(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}so(()=>{clearTimeout(c)});const y=I=>g(I);function S(I){u=I,t(4,u)}const T=()=>{_()},$=()=>r==null?void 0:r.show();function E(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,y,S,T,$,E,M,L]}class YA extends ye{constructor(e){super(),be(this,e,WA,BA,_e,{field:2,value:0,picker:1})}}function $g(n){let e,t,i,l;return{c(){e=b("div"),t=Y("Select up to "),i=Y(n[2]),l=Y(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&ue(i,s[2])},d(s){s&&k(e)}}}function KA(n){var c,d;let e,t,i,l,s,o,r;e=new ti({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(()=>ve(i,"selected",a));let f=n[1].maxSelect!=1&&$g(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),f&&f.c(),o=ge()},m(m,h){F(e,m,h),v(m,t,h),F(i,m,h),v(m,s,h),f&&f.m(m,h),v(m,o,h),r=!0},p(m,h){var y,S;const g={};h&32&&(g.uniqueId=m[5]),h&2&&(g.field=m[1]),e.$set(g);const _={};h&32&&(_.id=m[5]),h&10&&(_.toggle=!m[1].required||m[3]),h&8&&(_.multiple=m[3]),h&11&&(_.closable=!m[3]||((y=m[0])==null?void 0:y.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,_.selected=m[0],$e(()=>l=!1)),i.$set(_),m[1].maxSelect!=1?f?f.p(m,h):(f=$g(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(O(e.$$.fragment,m),O(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(k(t),k(s),k(o)),q(e,m),q(i,m),f&&f.d(m)}}}function JA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[KA,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function ZA(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 GA extends ye{constructor(e){super(),be(this,e,ZA,JA,_e,{field:1,value:0})}}function XA(n){let e,t,i,l=[n[3]],s={};for(let o=0;o<l.length;o+=1)s=je(s,l[o]);return{c(){e=b("textarea"),Xn(e,s),x(e,"svelte-1x1pbts",!0)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),ce(e,n[0]),t||(i=[B(e,"input",n[6]),B(e,"keydown",n[2])],t=!0)},p(o,[r]){Xn(e,s=vt(l,[r&8&&o[3]])),r&1&&ce(e,o[0]),x(e,"svelte-1x1pbts",!0)},i:te,o:te,d(o){o&&k(e),n[5](null),t=!1,De(i)}}}function QA(n,e,t){const i=["value","maxHeight"];let l=lt(e,i),{value:s=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{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()}}Yt(()=>(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=je(je({},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 xA extends ye{constructor(e){super(),be(this,e,QA,XA,_e,{value:0,maxHeight:4})}}function eP(n){let e,t,i,l,s;e=new ti({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 xA({props:r}),ie.push(()=>ve(i,"value",o)),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(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],$e(()=>l=!1)),i.$set(c)},i(a){s||(O(e.$$.fragment,a),O(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(e,a),q(i,a)}}}function tP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[eP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function nP(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=!z.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class iP extends ye{constructor(e){super(),be(this,e,nP,tP,_e,{original:4,field:1,value:0})}}function lP(n){let e,t,i,l,s,o,r,a;return e=new ti({props:{uniqueId:n[3],field:n[1]}}),{c(){H(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){F(e,u,f),v(u,t,f),v(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||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),q(e,u),r=!1,a()}}}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})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oP(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 rP extends ye{constructor(e){super(),be(this,e,oP,sP,_e,{field:1,value:0})}}function Cg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Og(n,e,t){const i=n.slice();return i[6]=e[t],i}function Eg(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=Y(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),x(t,"active",e[1]===e[6].language),this.first=t},m(f,c){v(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+"")&&ue(s,l),c&6&&x(t,"active",e[1]===e[6].language)},d(f){f&&k(t),r=!1,a()}}}function Mg(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"),H(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=Y(a),f=Y(" 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"),x(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),F(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,g){e=h;const _={};g&4&&(_.language=e[6].language),g&4&&(_.content=e[6].content),i.$set(_),(!m||g&4)&&a!==(a=e[6].title+"")&&ue(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&x(t,"active",e[1]===e[6].language)},i(h){m||(O(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&k(t),q(i)}}}function aP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=pe(n[2]);const d=g=>g[6].language;for(let g=0;g<c.length;g+=1){let _=Og(n,c,g),y=d(_);l.set(y,i[g]=Eg(y,_))}let m=pe(n[2]);const h=g=>g[6].language;for(let g=0;g<m.length;g+=1){let _=Cg(n,m,g),y=h(_);a.set(y,r[g]=Mg(y,_))}return{c(){e=b("div"),t=b("div");for(let g=0;g<i.length;g+=1)i[g].c();s=C(),o=b("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact combined left"),p(o,"class","tabs-content"),p(e,"class",u="tabs sdk-tabs "+n[0]+" svelte-1maocj6")},m(g,_){v(g,e,_),w(e,t);for(let y=0;y<i.length;y+=1)i[y]&&i[y].m(t,null);w(e,s),w(e,o);for(let y=0;y<r.length;y+=1)r[y]&&r[y].m(o,null);f=!0},p(g,[_]){_&6&&(c=pe(g[2]),i=kt(i,_,d,1,g,c,l,t,ci,Eg,null,Og)),_&6&&(m=pe(g[2]),re(),r=kt(r,_,h,1,g,m,a,o,zt,Mg,null,Cg),ae()),(!f||_&1&&u!==(u="tabs sdk-tabs "+g[0]+" svelte-1maocj6"))&&p(e,"class",u)},i(g){if(!f){for(let _=0;_<m.length;_+=1)O(r[_]);f=!0}},o(g){for(let _=0;_<r.length;_+=1)D(r[_]);f=!1},d(g){g&&k(e);for(let _=0;_<i.length;_+=1)i[_].d();for(let _=0;_<r.length;_+=1)r[_].d()}}}const Dg="pb_sdk_preference";function uP(n,e,t){let i,{class:l="m-b-sm"}=e,{js:s=""}=e,{dart:o=""}=e,r=localStorage.getItem(Dg)||"javascript";const a=u=>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(Dg,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 fP extends ye{constructor(e){super(),be(this,e,uP,aP,_e,{class:0,js:3,dart:4})}}function cP(n){let e,t,i,l,s=z.displayValue(n[1])+"",o,r,a,u,f,c,d;return u=new fe({props:{class:"form-field m-b-0 m-t-sm",name:"duration",$$slots:{default:[pP,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("p"),i=Y(`Generate a non-refreshable auth token for
                 `),l=b("strong"),o=Y(s),r=Y(":"),a=C(),H(u.$$.fragment),p(e,"id",n[8])},m(m,h){v(m,e,h),w(e,t),w(t,i),w(t,l),w(l,o),w(l,r),w(e,a),F(u,e,null),f=!0,c||(d=B(e,"submit",tt(n[9])),c=!0)},p(m,h){(!f||h&2)&&s!==(s=z.displayValue(m[1])+"")&&ue(o,s);const g={};h&3145761&&(g.$$scope={dirty:h,ctx:m}),u.$set(g)},i(m){f||(O(u.$$.fragment,m),f=!0)},o(m){D(u.$$.fragment,m),f=!1},d(m){m&&k(e),q(u),c=!1,d()}}}function dP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new ai({props:{value:n[3].authStore.token}}),u=new fP({props:{js:`
                 import PocketBase from 'pocketbase';
 
@@ -145,7 +146,7 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
                 final pb = PocketBase('${c[7]}');
 
                 pb.authStore.save(token, null);
-            `),u.$set(h)},i(c){f||(O(r.$$.fragment,c),O(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(k(e),k(a)),q(r),q(u,c)}}}function pP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(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&&(k(e),k(l),k(s)),u=!1,f()}}}function mP(n){let e,t,i,l,s,o;const r=[dP,cP],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=ge(),p(e,"class","clearfix")},m(f,c){v(f,e,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(e),k(t),k(s)),a[i].d(f)}}}function hP(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function _P(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],x(e,"btn-loading",n[6])},m(s,o){v(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&&x(e,"btn-loading",s[6])},d(s){s&&k(e),i=!1,l()}}}function gP(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){v(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&&k(e),i=!1,l()}}}function bP(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?gP:_P}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ge(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){v(f,e,c),w(e,t),v(f,i,c),u.m(f,c),v(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&&(k(e),k(i),k(l)),u.d(f),s=!1,o()}}}function yP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[bP],header:[hP],default:[mP]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),q(e,l)}}}function kP(n,e,t){let i;const l=_t(),s="impersonate_"+z.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(),g()}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 g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),y=()=>h(),S=L=>t(5,u=L.target.value<<0),T=()=>!f;function $(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function E(L){Pe.call(this,n,L)}function M(L){Pe.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=z.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,y,S,T,$,E,M]}class vP extends ye{constructor(e){super(),be(this,e,kP,yP,_e,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function Ig(n,e,t){const i=n.slice();return i[82]=e[t],i[83]=e,i[84]=t,i}function Lg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-information-line"></i>',l=C(),s=b("div"),o=Y(`The record has previous unsaved changes.
+            `),u.$set(h)},i(c){f||(O(r.$$.fragment,c),O(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(k(e),k(a)),q(r),q(u,c)}}}function pP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(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&&(k(e),k(l),k(s)),u=!1,f()}}}function mP(n){let e,t,i,l,s,o;const r=[dP,cP],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=ge(),p(e,"class","clearfix")},m(f,c){v(f,e,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(e),k(t),k(s)),a[i].d(f)}}}function hP(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function _P(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],x(e,"btn-loading",n[6])},m(s,o){v(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&&x(e,"btn-loading",s[6])},d(s){s&&k(e),i=!1,l()}}}function gP(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){v(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&&k(e),i=!1,l()}}}function bP(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?gP:_P}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ge(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){v(f,e,c),w(e,t),v(f,i,c),u.m(f,c),v(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&&(k(e),k(i),k(l)),u.d(f),s=!1,o()}}}function yP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[bP],header:[hP],default:[mP]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),q(e,l)}}}function kP(n,e,t){let i;const l=gt(),s="impersonate_"+z.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(),g()}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 g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),y=()=>h(),S=L=>t(5,u=L.target.value<<0),T=()=>!f;function $(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function E(L){Pe.call(this,n,L)}function M(L){Pe.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=z.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,y,S,T,$,E,M]}class vP extends ye{constructor(e){super(),be(this,e,kP,yP,_e,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function Ig(n,e,t){const i=n.slice();return i[82]=e[t],i[83]=e,i[84]=t,i}function Lg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-information-line"></i>',l=C(),s=b("div"),o=Y(`The record has previous unsaved changes.
                             `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',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(_,y){v(_,e,y),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||(g=[B(r,"click",n[46]),Me(He.call(null,u,"Discard draft")),B(u,"click",tt(n[47]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=mu(e,wt,{duration:150})),m=!1},d(_){_&&k(e),_&&d&&d.end(),h=!1,De(g)}}}function Ag(n){let e,t,i;return t=new QI({props:{record:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function wP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=!n[6]&&Ag(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",js(z.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]&&!z.isEmpty((T=n[19])==null?void 0:T.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=($=n[19])==null?void 0:$.min),f.readOnly=h=!n[6]},m(T,$){v(T,e,$),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),v(T,a,$),S&&S.m(T,$),v(T,u,$),v(T,f,$),ce(f,n[3].id),g=!0,_||(y=B(f,"input",n[48]),_=!0)},p(T,$){var E,M;(!g||$[2]&8388608&&r!==(r=T[85]))&&p(e,"for",r),T[6]?S&&(re(),D(S,1,1,()=>{S=null}),ae()):S?(S.p(T,$),$[0]&64&&O(S,1)):(S=Ag(T),S.c(),O(S,1),S.m(u.parentNode,u)),(!g||$[2]&8388608&&c!==(c=T[85]))&&p(f,"id",c),(!g||$[0]&524416&&d!==(d=!T[7]&&!z.isEmpty((E=T[19])==null?void 0:E.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!g||$[0]&524288&&m!==(m=(M=T[19])==null?void 0:M.min))&&p(f,"minlength",m),(!g||$[0]&64&&h!==(h=!T[6]))&&(f.readOnly=h),$[0]&8&&f.value!==T[3].id&&ce(f,T[3].id)},i(T){g||(O(S),g=!0)},o(T){D(S),g=!1},d(T){T&&(k(e),k(a),k(u),k(f)),S&&S.d(T),_=!1,y()}}}function Pg(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 _L({props:r}),ie.push(()=>ve(e,"record",o));let a=n[16].length&&Ng();return{c(){H(e.$$.fragment),i=C(),a&&a.c(),l=ge()},m(u,f){F(e,u,f),v(u,i,f),a&&a.m(u,f),v(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],$e(()=>t=!1)),e.$set(c),u[16].length?a||(a=Ng(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(O(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(k(i),k(l)),q(e,u),a&&a.d(u)}}}function Ng(n){let e;return{c(){e=b("hr")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function SP(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 EA({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function TP(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 YA({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function $P(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 cA({props:u}),ie.push(()=>ve(e,"value",o)),ie.push(()=>ve(e,"uploadedFiles",r)),ie.push(()=>ve(e,"deletedFileNames",a)),{c(){H(e.$$.fragment)},m(f,c){F(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],$e(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[82].name],$e(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[82].name],$e(()=>l=!1)),e.$set(d)},i(f){s||(O(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){q(e,f)}}}function CP(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 kA({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function OP(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 GA({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function EP(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 EL({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function MP(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 JL({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function DP(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 rP({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function IP(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 QL({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function LP(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 TL({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function AP(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 TA({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function PP(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 iP({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function Rg(n,e){let t,i,l,s,o;const r=[PP,AP,LP,IP,DP,MP,EP,OP,CP,$P,TP,SP],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=ge(),l&&l.c(),s=ge(),this.first=t},m(f,c){v(f,t,c),~i&&a[i].m(f,c),v(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&&(re(),D(a[d],1,1,()=>{a[d]=null}),ae()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),O(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(O(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(t),k(s)),~i&&a[i].d(f)}}}function Fg(n){let e,t,i;return t=new lL({props:{record:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[15]===no)},m(l,s){v(l,e,s),F(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&x(e,"active",l[15]===no)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function NP(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&Lg(n);l=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[wP,({uniqueId:S})=>({85:S}),({uniqueId:S})=>[0,0,S?8388608:0]]},$$scope:{ctx:n}}});let h=n[9]&&Pg(n),g=pe(n[16]);const _=S=>S[82].name;for(let S=0;S<g.length;S+=1){let T=Ig(n,g,S),$=_(T);a.set($,r[S]=Rg($,T))}let y=n[9]&&!n[17]&&!n[6]&&Fg(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=C(),H(l.$$.fragment),s=C(),h&&h.c(),o=C();for(let S=0;S<r.length;S+=1)r[S].c();u=C(),y&&y.c(),p(t,"id",n[21]),p(t,"class","tab-item"),x(t,"no-pointer-events",n[7]),x(t,"active",n[15]===Ml),p(e,"class","tabs-content no-animations")},m(S,T){v(S,e,T),w(e,t),m&&m.m(t,null),w(t,i),F(l,t,null),w(t,s),h&&h.m(t,null),w(t,o);for(let $=0;$<r.length;$+=1)r[$]&&r[$].m(t,null);w(e,u),y&&y.m(e,null),f=!0,c||(d=[B(t,"submit",tt(n[25])),B(t,"keydown",n[30])],c=!0)},p(S,T){!S[8]&&S[12]&&!S[7]?m?(m.p(S,T),T[0]&4480&&O(m,1)):(m=Lg(S),m.c(),O(m,1),m.m(t,i)):m&&(re(),D(m,1,1,()=>{m=null}),ae());const $={};T[0]&64&&($.class="form-field "+(S[6]?"":"readonly")),T[0]&524488|T[2]&25165824&&($.$$scope={dirty:T,ctx:S}),l.$set($),S[9]?h?(h.p(S,T),T[0]&512&&O(h,1)):(h=Pg(S),h.c(),O(h,1),h.m(t,o)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),T[0]&65596&&(g=pe(S[16]),re(),r=kt(r,T,_,1,S,g,a,t,zt,Rg,null,Ig),ae()),(!f||T[0]&128)&&x(t,"no-pointer-events",S[7]),(!f||T[0]&32768)&&x(t,"active",S[15]===Ml),S[9]&&!S[17]&&!S[6]?y?(y.p(S,T),T[0]&131648&&O(y,1)):(y=Fg(S),y.c(),O(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(S){if(!f){O(m),O(l.$$.fragment,S),O(h);for(let T=0;T<g.length;T+=1)O(r[T]);O(y),f=!0}},o(S){D(m),D(l.$$.fragment,S),D(h);for(let T=0;T<r.length;T+=1)D(r[T]);D(y),f=!1},d(S){S&&k(e),m&&m.d(),q(l),h&&h.d();for(let T=0;T<r.length;T+=1)r[T].d();y&&y.d(),c=!1,De(d)}}}function RP(n){var m;let e,t=n[6]?"New":"Edit",i,l,s,o=((m=n[0])==null?void 0:m.name)+"",r,a,u,f,c,d=!n[6]&&qg(n);return{c(){e=b("h4"),i=Y(t),l=C(),s=b("strong"),r=Y(o),a=Y(" record"),u=C(),d&&d.c(),f=ge(),p(e,"class","panel-title svelte-qc5ngu")},m(h,g){v(h,e,g),w(e,i),w(e,l),w(e,s),w(s,r),w(e,a),v(h,u,g),d&&d.m(h,g),v(h,f,g),c=!0},p(h,g){var _;(!c||g[0]&64)&&t!==(t=h[6]?"New":"Edit")&&ue(i,t),(!c||g[0]&1)&&o!==(o=((_=h[0])==null?void 0:_.name)+"")&&ue(r,o),h[6]?d&&(re(),D(d,1,1,()=>{d=null}),ae()):d?(d.p(h,g),g[0]&64&&O(d,1)):(d=qg(h),d.c(),O(d,1),d.m(f.parentNode,f))},i(h){c||(O(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(k(e),k(u),k(f)),d&&d.d(h)}}}function FP(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){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,i:te,o:te,d(l){l&&(k(e),k(t),k(i))}}}function qg(n){let e,t,i,l,s,o,r;return o=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[qP]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),H(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){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),F(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||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),q(o)}}}function Hg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-check-line" aria-hidden="true"></i> <span class="txt">Send verification email</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[39]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function jg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-lock-line" aria-hidden="true"></i> <span class="txt">Send password reset email</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[40]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function qP(n){let e,t,i,l,s,o,r,a,u,f=n[9]&&!n[2].verified&&n[2].email&&Hg(n),c=n[9]&&n[2].email&&jg(n);return{c(){f&&f.c(),e=C(),c&&c.c(),t=C(),i=b("button"),i.innerHTML='<i class="ri-id-card-line" aria-hidden="true"></i> <span class="txt">Impersonate</span>',l=C(),s=b("button"),s.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',o=C(),r=b("button"),r.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',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),v(d,e,m),c&&c.m(d,m),v(d,t,m),v(d,i,m),v(d,l,m),v(d,s,m),v(d,o,m),v(d,r,m),a||(u=[B(i,"click",n[41]),B(s,"click",n[42]),B(r,"click",On(tt(n[43])))],a=!0)},p(d,m){d[9]&&!d[2].verified&&d[2].email?f?f.p(d,m):(f=Hg(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=jg(d),c.c(),c.m(t.parentNode,t)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r)),f&&f.d(d),c&&c.d(d),a=!1,De(u)}}}function zg(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"),x(t,"active",n[15]===Ml),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[15]===no),p(e,"class","tabs-header stretched")},m(r,a){v(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&&x(t,"active",r[15]===Ml),a[0]&32768&&x(l,"active",r[15]===no)},d(r){r&&k(e),s=!1,De(o)}}}function HP(n){let e,t,i,l,s;const o=[FP,RP],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]&&zg(n);return{c(){t.c(),i=C(),u&&u.c(),l=ge()},m(f,c){r[e].m(f,c),v(f,i,c),u&&u.m(f,c),v(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),O(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=zg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(O(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(k(i),k(l)),r[e].d(f),u&&u.d(f)}}}function Ug(n){let e,t,i,l,s,o;return l=new Hn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[jP]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(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){v(r,e,a),w(e,t),w(e,i),F(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||(O(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),q(l)}}}function jP(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Save and continue</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[38]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function zP(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,g=!n[6]&&Ug(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=C(),s=b("div"),o=b("button"),r=b("span"),u=Y(a),c=C(),g&&g.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 btn-expanded"),o.disabled=f=!n[18]||n[13],x(o,"btn-loading",n[13]||n[7]),p(s,"class","btns-group no-gap")},m(_,y){v(_,e,y),w(e,t),v(_,l,y),v(_,s,y),w(s,o),w(o,r),w(r,u),w(s,c),g&&g.m(s,null),d=!0,m||(h=B(e,"click",n[37]),m=!0)},p(_,y){(!d||y[0]&8320&&i!==(i=_[13]||_[7]))&&(e.disabled=i),(!d||y[0]&64)&&a!==(a=_[6]?"Create":"Save changes")&&ue(u,a),(!d||y[0]&270336&&f!==(f=!_[18]||_[13]))&&(o.disabled=f),(!d||y[0]&8320)&&x(o,"btn-loading",_[13]||_[7]),_[6]?g&&(re(),D(g,1,1,()=>{g=null}),ae()):g?(g.p(_,y),y[0]&64&&O(g,1)):(g=Ug(_),g.c(),O(g,1),g.m(s,null))},i(_){d||(O(g),d=!0)},o(_){D(g),d=!1},d(_){_&&(k(e),k(l),k(s)),g&&g.d(),m=!1,h()}}}function UP(n){let e,t,i,l,s={class:`
         record-panel
         `+(n[20]?"overlay-panel-xl":"overlay-panel-lg")+`
@@ -154,21 +155,21 @@ Do you really want to upload and initialize "${$.name}"?`,()=>{h($)},()=>{d()})}
         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||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[65](null),q(e,r),n[68](null),q(i,r)}}}const Ml="form",no="providers";function VP(n,e,t){let i,l,s,o,r,a,u,f;const c=_t(),d="record_"+z.randomString(5);let{collection:m}=e,h,g,_={},y={},S=null,T=!1,$=!1,E={},M={},L=JSON.stringify(_),I=L,A=Ml,P=!0,R=!0,N=m,U=[];const j=["id"],V=j.concat("email","emailVisibility","verified","tokenKey","password");function K(le){return Se(le),t(14,$=!0),t(15,A=Ml),h==null?void 0:h.show()}function J(){return h==null?void 0:h.hide()}function ee(){t(14,$=!1),J()}function X(){t(34,N=m),h!=null&&h.isActive()&&(st(JSON.stringify(y)),ee())}async function oe(le){if(le&&typeof le=="string"){try{return await me.collection(m.id).getOne(le)}catch(Ee){Ee.isAbort||(ee(),console.warn("resolveModel:",Ee),$i(`Unable to load record with id "${le}"`))}return null}return le}async function Se(le){t(7,R=!0),Wt({}),t(4,E={}),t(5,M={}),t(2,_=typeof le=="string"?{id:le,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:le||{}),t(3,y=structuredClone(_)),t(2,_=await oe(le)||{}),t(3,y=structuredClone(_)),await fn(),t(12,S=We()),!S||Be(y,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(32,L=JSON.stringify(y)),t(7,R=!1)}async function ke(le){var Re,Ke;Wt({}),t(2,_=le||{}),t(4,E={}),t(5,M={});const Ee=((Ke=(Re=m==null?void 0:m.fields)==null?void 0:Re.filter(Ae=>Ae.type!="file"))==null?void 0:Ke.map(Ae=>Ae.name))||[];for(let Ae in le)Ee.includes(Ae)||t(3,y[Ae]=le[Ae],y);await fn(),t(32,L=JSON.stringify(y)),rt()}function Ce(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function We(le){try{const Ee=window.localStorage.getItem(Ce());if(Ee)return JSON.parse(Ee)}catch{}return le}function st(le){try{window.localStorage.setItem(Ce(),le)}catch(Ee){console.warn("updateDraft failure:",Ee),window.localStorage.removeItem(Ce())}}function et(){S&&(t(3,y=S),t(12,S=null))}function Be(le,Ee){var ft;const Re=structuredClone(le||{}),Ke=structuredClone(Ee||{}),Ae=(ft=m==null?void 0:m.fields)==null?void 0:ft.filter(Xt=>Xt.type==="file");for(let Xt of Ae)delete Re[Xt.name],delete Ke[Xt.name];const Ge=["expand","password","passwordConfirm"];for(let Xt of Ge)delete Re[Xt],delete Ke[Xt];return JSON.stringify(Re)==JSON.stringify(Ke)}function rt(){t(12,S=null),window.localStorage.removeItem(Ce())}async function Je(le=!0){var Ee;if(!(T||!u||!(m!=null&&m.id))){t(13,T=!0);try{const Re=Ht();let Ke;if(P?Ke=await me.collection(m.id).create(Re):Ke=await me.collection(m.id).update(y.id,Re),tn(P?"Successfully created record.":"Successfully updated record."),rt(),l&&(y==null?void 0:y.id)==((Ee=me.authStore.record)==null?void 0:Ee.id)&&Re.get("password"))return me.logout();le?ee():ke(Ke),c("save",{isNew:P,record:Ke})}catch(Re){me.error(Re)}t(13,T=!1)}}function at(){_!=null&&_.id&&pn("Do you really want to delete the selected record?",()=>me.collection(_.collectionId).delete(_.id).then(()=>{ee(),tn("Successfully deleted record."),c("delete",_)}).catch(le=>{me.error(le)}))}function Ht(){const le=structuredClone(y||{}),Ee=new FormData,Re={},Ke={};for(const Ae of(m==null?void 0:m.fields)||[])Ae.type=="autodate"||i&&Ae.type=="password"||(Re[Ae.name]=!0,Ae.type=="json"&&(Ke[Ae.name]=!0));i&&le.password&&(Re.password=!0),i&&le.passwordConfirm&&(Re.passwordConfirm=!0);for(const Ae in le)if(Re[Ae]){if(typeof le[Ae]>"u"&&(le[Ae]=null),Ke[Ae]&&le[Ae]!=="")try{JSON.parse(le[Ae])}catch(Ge){const ft={};throw ft[Ae]={code:"invalid_json",message:Ge.toString()},new Rn({status:400,response:{data:ft}})}z.addValueToFormData(Ee,Ae,le[Ae])}for(const Ae in E){const Ge=z.toArray(E[Ae]);for(const ft of Ge)Ee.append(Ae+"+",ft)}for(const Ae in M){const Ge=z.toArray(M[Ae]);for(const ft of Ge)Ee.append(Ae+"-",ft)}return Ee}function Te(){!(m!=null&&m.id)||!(_!=null&&_.email)||pn(`Do you really want to sent verification email to ${_.email}?`,()=>me.collection(m.id).requestVerification(_.email).then(()=>{tn(`Successfully sent verification email to ${_.email}.`)}).catch(le=>{me.error(le)}))}function Ze(){!(m!=null&&m.id)||!(_!=null&&_.email)||pn(`Do you really want to sent password reset email to ${_.email}?`,()=>me.collection(m.id).requestPasswordReset(_.email).then(()=>{tn(`Successfully sent password reset email to ${_.email}.`)}).catch(le=>{me.error(le)}))}function ot(){a?pn("You have unsaved changes. Do you really want to discard them?",()=>{Le()}):Le()}async function Le(){let le=_?structuredClone(_):null;if(le){const Ee=["file","autodate"],Re=(m==null?void 0:m.fields)||[];for(const Ke of Re)Ee.includes(Ke.type)&&delete le[Ke.name];le.id=""}rt(),K(le),await fn(),t(32,L="")}function Ve(le){(le.ctrlKey||le.metaKey)&&le.code=="KeyS"&&(le.preventDefault(),le.stopPropagation(),Je(!1))}const we=()=>J(),Oe=()=>Je(!1),ut=()=>Te(),Ne=()=>Ze(),xe=()=>g==null?void 0:g.show(),qt=()=>ot(),Zt=()=>at(),Fe=()=>t(15,A=Ml),Dt=()=>t(15,A=no),Gt=()=>et(),mn=()=>rt();function hn(){y.id=this.value,t(3,y)}function pi(le){y=le,t(3,y)}function Ci(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function gt(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function rn(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function sn(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function rl(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function It(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function al(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function ul(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function Hi(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function ji(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function fl(le,Ee){n.$$.not_equal(E[Ee.name],le)&&(E[Ee.name]=le,t(4,E))}function Mn(le,Ee){n.$$.not_equal(M[Ee.name],le)&&(M[Ee.name]=le,t(5,M))}function Rl(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function cl(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}const Z=()=>a&&$?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{ee()}),!1):(Wt({}),rt(),!0);function Q(le){ie[le?"unshift":"push"](()=>{h=le,t(10,h)})}function se(le){Pe.call(this,n,le)}function he(le){Pe.call(this,n,le)}function qe(le){ie[le?"unshift":"push"](()=>{g=le,t(11,g)})}return n.$$set=le=>{"collection"in le&&t(0,m=le.collection)},n.$$.update=()=>{var le,Ee,Re;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(Ke=>Ke.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Ee=m==null?void 0:m.fields)==null?void 0:Ee.find(Ke=>Ke.name==="id")),n.$$.dirty[0]&48&&t(36,r=z.hasNonEmptyProps(E)||z.hasNonEmptyProps(M)),n.$$.dirty[0]&8&&t(33,I=JSON.stringify(y)),n.$$.dirty[1]&38&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!_||!_.id),n.$$.dirty[0]&448&&t(18,u=!R&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&4&&(R||st(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&m&&(N==null?void 0:N.id)!=(m==null?void 0:m.id)&&X(),n.$$.dirty[0]&512&&t(35,f=i?V:j),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&t(16,U=((Re=m==null?void 0:m.fields)==null?void 0:Re.filter(Ke=>!f.includes(Ke.name)&&Ke.type!="autodate"))||[])},[m,J,_,y,E,M,P,R,a,i,h,g,S,T,$,A,U,l,u,o,s,d,ee,et,rt,Je,at,Te,Ze,ot,Ve,K,L,I,N,f,r,we,Oe,ut,Ne,xe,qt,Zt,Fe,Dt,Gt,mn,hn,pi,Ci,gt,rn,sn,rl,It,al,ul,Hi,ji,fl,Mn,Rl,cl,Z,Q,se,he,qe]}class rf extends ye{constructor(e){super(),be(this,e,VP,UP,_e,{collection:0,show:31,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[31]}get hide(){return this.$$.ctx[1]}}function BP(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=Y(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){v(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])+"")&&ue(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&&k(e)}}}function WP(n,e,t){const i=_t();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=z.getAllCollectionIdentifiers(l),c=await me.collection(l.id).getList(1,1,{filter:z.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 YP extends ye{constructor(e){super(),be(this,e,WP,BP,_e,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function Vg(n,e,t){const i=n.slice();return i[57]=e[t],i}function Bg(n,e,t){const i=n.slice();return i[60]=e[t],i}function Wg(n,e,t){const i=n.slice();return i[60]=e[t],i}function Yg(n,e,t){const i=n.slice();return i[53]=e[t],i}function Kg(n){let e;function t(s,o){return s[9]?JP:KP}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){v(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&&k(e),l.d()}}}function KP(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){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=B(t,"change",n[30]),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&&k(e),o=!1,r()}}}function JP(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function ZP(n){let e,t;return{c(){e=b("i"),p(e,"class",t=z.getFieldTypeIcon(n[60].type))},m(i,l){v(i,e,l)},p(i,l){l[0]&32768&&t!==(t=z.getFieldTypeIcon(i[60].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function GP(n){let e;return{c(){e=b("i"),p(e,"class",z.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function XP(n){let e,t,i,l=n[60].name+"",s;function o(u,f){return u[60].primaryKey?GP:ZP}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),s=Y(l),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){v(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[60].name+"")&&ue(s,l)},d(u){u&&k(e),a.d()}}}function Jg(n,e){let t,i,l,s;function o(a){e[31](a)}let r={class:"col-type-"+e[60].type+" col-field-"+e[60].name,name:e[60].name,$$slots:{default:[XP]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new ir({props:r}),ie.push(()=>ve(i,"sort",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[60].type+" col-field-"+e[60].name),u[0]&32768&&(f.name=e[60].name),u[0]&32768|u[2]&8&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function Zg(n){let e;return{c(){e=b("button"),e.innerHTML='<i class="ri-more-line"></i>',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){v(t,e,i),n[32](e)},p:te,d(t){t&&k(e),n[32](null)}}}function Gg(n){let e;function t(s,o){return s[9]?xP:QP}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function QP(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return tN;if(!a[16])return eN}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){v(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&&k(e),r&&r.d()}}}function xP(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>'},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function eN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-add-line"></i> <span class="txt">New record</span>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[37]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function tN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[36]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Xg(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[33](n[57])}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[57].id),i.checked=s=n[4][n[57].id],p(r,"for",a="checkbox_"+n[57].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){v(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[28]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[57].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[57].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[57].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,De(f)}}}function Qg(n,e){let t,i,l,s;return i=new rk({props:{short:!0,record:e[57],field:e[60]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",l="col-type-"+e[60].type+" col-field-"+e[60].name),this.first=t},m(o,r){v(o,t,r),F(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[57]),r[0]&32768&&(a.field=e[60]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[60].type+" col-field-"+e[60].name))&&p(t,"class",l)},i(o){s||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),q(i)}}}function xg(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&Xg(e),d=pe(e[15]);const m=_=>_[60].id;for(let _=0;_<d.length;_+=1){let y=Bg(e,d,_),S=m(y);s.set(S,l[_]=Qg(S,y))}function h(){return e[34](e[57])}function g(..._){return e[35](e[57],..._)}return{key:n,first:null,c(){t=b("tr"),c&&c.c(),i=C();for(let _=0;_<l.length;_+=1)l[_].c();o=C(),r=b("td"),r.innerHTML='<i class="ri-arrow-right-line"></i>',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(_,y){v(_,t,y),c&&c.m(t,null),w(t,i);for(let S=0;S<l.length;S+=1)l[S]&&l[S].m(t,null);w(t,o),w(t,r),a=!0,u||(f=[B(t,"click",h),B(t,"keydown",g)],u=!0)},p(_,y){e=_,e[16]?c&&(c.d(1),c=null):c?c.p(e,y):(c=Xg(e),c.c(),c.m(t,i)),y[0]&32776&&(d=pe(e[15]),re(),l=kt(l,y,m,1,e,d,s,t,zt,Qg,o,Bg),ae())},i(_){if(!a){for(let y=0;y<d.length;y+=1)O(l[y]);a=!0}},o(_){for(let y=0;y<l.length;y+=1)D(l[y]);a=!1},d(_){_&&k(t),c&&c.d();for(let y=0;y<l.length;y+=1)l[y].d();u=!1,De(f)}}}function e1(n){let e,t,i,l,s,o;return{c(){e=b("tr"),t=b("td"),i=b("button"),l=b("span"),l.textContent="Load more",p(l,"class","txt"),p(i,"class","btn btn-expanded-lg btn-secondary btn-horizontal-sticky"),i.disabled=n[9],x(i,"btn-loading",n[9]),p(t,"colspan","99"),p(t,"class","txt-center")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(i,l),s||(o=B(i,"click",tt(n[38])),s=!0)},p(r,a){a[0]&512&&(i.disabled=r[9]),a[0]&512&&x(i,"btn-loading",r[9])},d(r){r&&k(e),s=!1,o()}}}function nN(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c=[],d=new Map,m,h,g=!n[16]&&Kg(n),_=pe(n[15]);const y=L=>L[60].id;for(let L=0;L<_.length;L+=1){let I=Wg(n,_,L),A=y(I);o.set(A,s[L]=Jg(A,I))}let S=n[12].length&&Zg(n),T=pe(n[3]);const $=L=>L[16]?L[57]:L[57].id;for(let L=0;L<T.length;L+=1){let I=Vg(n,T,L),A=$(I);d.set(A,c[L]=xg(A,I))}let E=null;T.length||(E=Gg(n));let M=n[3].length&&n[14]&&e1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),l=C();for(let L=0;L<s.length;L+=1)s[L].c();r=C(),a=b("th"),S&&S.c(),u=C(),f=b("tbody");for(let L=0;L<c.length;L+=1)c[L].c();E&&E.c(),m=C(),M&&M.c(),p(a,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[9])},m(L,I){v(L,e,I),w(e,t),w(t,i),g&&g.m(i,null),w(i,l);for(let A=0;A<s.length;A+=1)s[A]&&s[A].m(i,null);w(i,r),w(i,a),S&&S.m(a,null),w(e,u),w(e,f);for(let A=0;A<c.length;A+=1)c[A]&&c[A].m(f,null);E&&E.m(f,null),w(f,m),M&&M.m(f,null),h=!0},p(L,I){L[16]?g&&(g.d(1),g=null):g?g.p(L,I):(g=Kg(L),g.c(),g.m(i,l)),I[0]&32769&&(_=pe(L[15]),re(),s=kt(s,I,y,1,L,_,o,i,zt,Jg,r,Wg),ae()),L[12].length?S?S.p(L,I):(S=Zg(L),S.c(),S.m(a,null)):S&&(S.d(1),S=null),I[0]&1278490&&(T=pe(L[3]),re(),c=kt(c,I,$,1,L,T,d,f,zt,xg,m,Vg),ae(),!T.length&&E?E.p(L,I):T.length?E&&(E.d(1),E=null):(E=Gg(L),E.c(),E.m(f,m))),L[3].length&&L[14]?M?M.p(L,I):(M=e1(L),M.c(),M.m(f,null)):M&&(M.d(1),M=null),(!h||I[0]&512)&&x(e,"table-loading",L[9])},i(L){if(!h){for(let I=0;I<_.length;I+=1)O(s[I]);for(let I=0;I<T.length;I+=1)O(c[I]);h=!0}},o(L){for(let I=0;I<s.length;I+=1)D(s[I]);for(let I=0;I<c.length;I+=1)D(c[I]);h=!1},d(L){L&&k(e),g&&g.d();for(let I=0;I<s.length;I+=1)s[I].d();S&&S.d();for(let I=0;I<c.length;I+=1)c[I].d();E&&E.d(),M&&M.d()}}}function t1(n){let e,t;return e=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[11],$$slots:{default:[lN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l[0]&2048&&(s.trigger=i[11]),l[0]&4128|l[2]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function iN(n){let e,t,i,l,s,o=n[53].name+"",r,a,u,f,c;function d(...m){return n[29](n[53],...m)}return{c(){e=b("input"),l=C(),s=b("label"),r=Y(o),u=C(),p(e,"type","checkbox"),p(e,"id",t=n[56]),e.checked=i=!n[5].includes(n[53].id),p(s,"for",a=n[56])},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),v(m,u,h),f||(c=B(e,"change",d),f=!0)},p(m,h){n=m,h[1]&33554432&&t!==(t=n[56])&&p(e,"id",t),h[0]&4128&&i!==(i=!n[5].includes(n[53].id))&&(e.checked=i),h[0]&4096&&o!==(o=n[53].name+"")&&ue(r,o),h[1]&33554432&&a!==(a=n[56])&&p(s,"for",a)},d(m){m&&(k(e),k(l),k(s),k(u)),f=!1,c()}}}function n1(n,e){let t,i,l;return i=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[iN,({uniqueId:s})=>({56:s}),({uniqueId:s})=>[0,s?33554432:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),F(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&33554432|o[2]&8&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(i,s)}}}function lN(n){let e,t,i=[],l=new Map,s,o,r=pe(n[12]);const a=u=>u[53].id+u[53].name;for(let u=0;u<r.length;u+=1){let f=Yg(n,r,u),c=a(f);l.set(c,i[u]=n1(c,f))}return{c(){e=b("div"),e.textContent="Toggle columns",t=C();for(let u=0;u<i.length;u+=1)i[u].c();s=ge(),p(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){v(u,e,f),v(u,t,f);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);v(u,s,f),o=!0},p(u,f){f[0]&4128|f[1]&33554432&&(r=pe(u[12]),re(),i=kt(i,f,a,1,u,r,l,s.parentNode,zt,n1,s,Yg),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)O(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)D(i[f]);o=!1},d(u){u&&(k(e),k(t),k(s));for(let f=0;f<i.length;f+=1)i[f].d(u)}}}function sN(n){let e,t,i=n[11]&&t1(n);return{c(){i&&i.c(),e=ge()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,s){l[11]?i?(i.p(l,s),s[0]&2048&&O(i,1)):(i=t1(l),i.c(),O(i,1),i.m(e.parentNode,e)):i&&(re(),D(i,1,1,()=>{i=null}),ae())},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function i1(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,g,_,y,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[6]),o=C(),a=Y(r),u=C(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[10]),x(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m(T,$){v(T,e,$),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),_=!0,y||(S=[B(f,"click",n[40]),B(h,"click",n[41])],y=!0)},p(T,$){(!_||$[0]&64)&&ue(s,T[6]),(!_||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&ue(a,r),(!_||$[0]&1024)&&x(f,"btn-disabled",T[10]),(!_||$[0]&1024)&&x(h,"btn-loading",T[10]),(!_||$[0]&1024)&&x(h,"btn-disabled",T[10])},i(T){_||(T&&nt(()=>{_&&(g||(g=ze(e,Fn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(T){T&&(g||(g=ze(e,Fn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(T){T&&k(e),T&&g&&g.end(),y=!1,De(S)}}}function oN(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[sN],default:[nN]},$$scope:{ctx:n}};e=new Pu({props:s}),n[39](e);let o=n[6]&&i1(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=ge()},m(r,a){F(e,r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l=!0},p(r,a){const u={};a[0]&129851|a[2]&8&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&O(o,1)):(o=i1(r),o.c(),O(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(O(e.$$.fragment,r),O(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(k(t),k(i)),n[39](null),q(e,r),o&&o.d(r)}}}const rN=/^([\+\-])?(\w+)$/,l1=40;function aN(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,En,Ne=>t(46,d=Ne));const m=_t();let{collection:h}=e,{sort:g=""}=e,{filter:_=""}=e,y,S=[],T=1,$=0,E={},M=!0,L=!1,I=0,A,P=[],R=[],N="";const U=["verified","emailVisibility"];function j(){h!=null&&h.id&&(P.length?localStorage.setItem(N,JSON.stringify(P)):localStorage.removeItem(N))}function V(){if(t(5,P=[]),!!(h!=null&&h.id))try{const Ne=localStorage.getItem(N);Ne&&t(5,P=JSON.parse(Ne)||[])}catch{}}function K(Ne){return!!S.find(xe=>xe.id==Ne)}async function J(){const Ne=T;for(let xe=1;xe<=Ne;xe++)(xe===1||u)&&await ee(xe,!1)}async function ee(Ne=1,xe=!0){var hn,pi,Ci;if(!(h!=null&&h.id))return;t(9,M=!0);let qt=g;const Zt=qt.match(rN),Fe=Zt?r.find(gt=>gt.name===Zt[2]):null;if(Zt&&Fe){const gt=((Ci=(pi=(hn=d==null?void 0:d.find(sn=>sn.id==Fe.collectionId))==null?void 0:hn.fields)==null?void 0:pi.filter(sn=>sn.presentable))==null?void 0:Ci.map(sn=>sn.name))||[],rn=[];for(const sn of gt)rn.push((Zt[1]||"")+Zt[2]+"."+sn);rn.length>0&&(qt=rn.join(","))}const Dt=z.getAllCollectionIdentifiers(h),Gt=o.map(gt=>gt.name+":excerpt(200)").concat(r.map(gt=>"expand."+gt.name+".*:excerpt(200)"));Gt.length&&Gt.unshift("*");const mn=[];for(const gt of r){const rn=z.getExpandPresentableRelField(gt,d,2);rn&&mn.push(rn)}return me.collection(h.id).getList(Ne,l1,{sort:qt,skipTotal:1,filter:z.normalizeSearchFilter(_,Dt),expand:mn.join(","),fields:Gt.join(","),requestKey:"records_list"}).then(async gt=>{var rn;if(Ne<=1&&X(),t(9,M=!1),t(8,T=gt.page),t(25,$=gt.items.length),m("load",S.concat(gt.items)),o.length)for(let sn of gt.items)sn._partial=!0;if(xe){const sn=++I;for(;(rn=gt.items)!=null&&rn.length&&I==sn;){const rl=gt.items.splice(0,20);for(let It of rl)z.pushOrReplaceByKey(S,It);t(3,S),await z.yieldToMain()}}else{for(let sn of gt.items)z.pushOrReplaceByKey(S,sn);t(3,S)}}).catch(gt=>{gt!=null&&gt.isAbort||(t(9,M=!1),console.warn(gt),X(),me.error(gt,!_||(gt==null?void 0:gt.status)!=400))})}function X(){y==null||y.resetVerticalScroll(),t(3,S=[]),t(8,T=1),t(25,$=0),t(4,E={})}function oe(){c?Se():ke()}function Se(){t(4,E={})}function ke(){for(const Ne of S)t(4,E[Ne.id]=Ne,E);t(4,E)}function Ce(Ne){E[Ne.id]?delete E[Ne.id]:t(4,E[Ne.id]=Ne,E),t(4,E)}function We(){pn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,st)}async function st(){if(L||!f||!(h!=null&&h.id))return;let Ne=[];for(const xe of Object.keys(E))Ne.push(me.collection(h.id).delete(xe));return t(10,L=!0),Promise.all(Ne).then(()=>{tn(`Successfully deleted the selected ${f===1?"record":"records"}.`),m("delete",E),Se()}).catch(xe=>{me.error(xe)}).finally(()=>(t(10,L=!1),J()))}function et(Ne){Pe.call(this,n,Ne)}const Be=(Ne,xe)=>{xe.target.checked?z.removeByValue(P,Ne.id):z.pushUnique(P,Ne.id),t(5,P)},rt=()=>oe();function Je(Ne){g=Ne,t(0,g)}function at(Ne){ie[Ne?"unshift":"push"](()=>{A=Ne,t(11,A)})}const Ht=Ne=>Ce(Ne),Te=Ne=>m("select",Ne),Ze=(Ne,xe)=>{xe.code==="Enter"&&(xe.preventDefault(),m("select",Ne))},ot=()=>t(1,_=""),Le=()=>m("new"),Ve=()=>ee(T+1);function we(Ne){ie[Ne?"unshift":"push"](()=>{y=Ne,t(7,y)})}const Oe=()=>Se(),ut=()=>We();return n.$$set=Ne=>{"collection"in Ne&&t(22,h=Ne.collection),"sort"in Ne&&t(0,g=Ne.sort),"filter"in Ne&&t(1,_=Ne.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&h!=null&&h.id&&(N=h.id+"@hiddenColumns",V(),X()),n.$$.dirty[0]&4194304&&t(16,i=(h==null?void 0:h.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(h==null?void 0:h.type)==="auth"&&h.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((h==null?void 0:h.fields)||[]).filter(Ne=>!Ne.hidden&&(!l||!U.includes(Ne.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Ne=>Ne.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Ne=>Ne.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Ne=>!P.includes(Ne.id))),n.$$.dirty[0]&4194307&&h!=null&&h.id&&g!==-1&&_!==-1&&ee(1),n.$$.dirty[0]&33554432&&t(14,u=$>=l1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=S.length&&f===S.length),n.$$.dirty[0]&32&&P!==-1&&j(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Ne=>!Ne.primaryKey).map(Ne=>({id:Ne.id,name:Ne.name})))},[g,_,ee,S,E,P,f,y,T,M,L,A,R,c,u,a,i,m,oe,Se,Ce,We,h,K,J,$,s,l,et,Be,rt,Je,at,Ht,Te,Ze,ot,Le,Ve,we,Oe,ut]}class uN extends ye{constructor(e){super(),be(this,e,aN,oN,_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 fN(n){let e,t,i,l;return e=new YD({}),i=new di({props:{class:"flex-content",$$slots:{footer:[mN],default:[pN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&16384&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function cN(n){let e,t;return e=new di({props:{center:!0,$$slots:{default:[gN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&16384&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dN(n){let e,t;return e=new di({props:{center:!0,$$slots:{default:[bN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l[1]&16384&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){v(l,e,s),t||(i=[Me(He.call(null,e,{text:"Edit collection",position:"right"})),B(e,"click",n[20])],t=!0)},p:te,d(l){l&&k(e),t=!1,De(i)}}}function o1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-add-line"></i> <span class="txt">New record</span>',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[23]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function pN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R=!n[12]&&s1(n);c=new Au({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&o1(n);y=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function U(K){n[26](K)}function j(K){n[27](K)}let V={collection:n[2]};return n[0]!==void 0&&(V.filter=n[0]),n[1]!==void 0&&(V.sort=n[1]),E=new uN({props:V}),n[25](E),ie.push(()=>ve(E,"filter",U)),ie.push(()=>ve(E,"sort",j)),E.$on("select",n[28]),E.$on("delete",n[29]),E.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=C(),s=b("div"),r=Y(o),a=C(),u=b("div"),R&&R.c(),f=C(),H(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML='<i class="ri-code-s-slash-line"></i> <span class="txt">API Preview</span>',g=C(),N&&N.c(),_=C(),H(y.$$.fragment),S=C(),T=b("div"),$=C(),H(E.$$.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(T,"class","clearfix m-b-sm")},m(K,J){v(K,e,J),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),R&&R.m(u,null),w(u,f),F(c,u,null),w(e,d),w(e,m),w(m,h),w(m,g),N&&N.m(m,null),v(K,_,J),F(y,K,J),v(K,S,J),v(K,T,J),v(K,$,J),F(E,K,J),I=!0,A||(P=B(h,"click",n[22]),A=!0)},p(K,J){(!I||J[0]&4)&&o!==(o=K[2].name+"")&&ue(r,o),K[12]?R&&(R.d(1),R=null):R?R.p(K,J):(R=s1(K),R.c(),R.m(u,f)),K[2].type!=="view"?N?N.p(K,J):(N=o1(K),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const ee={};J[0]&1&&(ee.value=K[0]),J[0]&4&&(ee.autocompleteCollection=K[2]),y.$set(ee);const X={};J[0]&4&&(X.collection=K[2]),!M&&J[0]&1&&(M=!0,X.filter=K[0],$e(()=>M=!1)),!L&&J[0]&2&&(L=!0,X.sort=K[1],$e(()=>L=!1)),E.$set(X)},i(K){I||(O(c.$$.fragment,K),O(y.$$.fragment,K),O(E.$$.fragment,K),I=!0)},o(K){D(c.$$.fragment,K),D(y.$$.fragment,K),D(E.$$.fragment,K),I=!1},d(K){K&&(k(e),k(_),k(S),k(T),k($)),R&&R.d(),q(c),N&&N.d(),q(y,K),n[25](null),q(E,K),A=!1,P()}}}function mN(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new YP({props:s}),n[18](e),ie.push(()=>ve(e,"totalCount",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[18](null),q(e,o)}}}function hN(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='<i class="ri-add-line"></i> <span class="txt">Create new collection</span>',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=B(i,"click",n[17]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function _N(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){v(t,e,i)},p:te,d(t){t&&k(e)}}}function gN(n){let e,t,i;function l(r,a){return r[12]?_N:hN}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){v(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&&k(e),o.d()}}}function bN(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-lg"></span> <h1>Loading collections...</h1>',p(e,"class","placeholder-section m-b-base")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function yN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[dN,cN,fN],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};l=new nf({props:g}),n[31](l),l.$on("truncate",n[32]);let _={};o=new $5({props:_}),n[33](o);let y={collection:n[2]};a=new rf({props:y}),n[34](a),a.$on("hide",n[35]),a.$on("save",n[36]),a.$on("delete",n[37]);let S={collection:n[2]};return f=new JI({props:S}),n[38](f),f.$on("hide",n[39]),{c(){t.c(),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),H(f.$$.fragment)},m(T,$){m[e].m(T,$),v(T,i,$),F(l,T,$),v(T,s,$),F(o,T,$),v(T,r,$),F(a,T,$),v(T,u,$),F(f,T,$),c=!0},p(T,$){let E=e;e=h(T),e===E?m[e].p(T,$):(re(),D(m[E],1,1,()=>{m[E]=null}),ae(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),O(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const L={};o.$set(L);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const A={};$[0]&4&&(A.collection=T[2]),f.$set(A)},i(T){c||(O(t),O(l.$$.fragment,T),O(o.$$.fragment,T),O(a.$$.fragment,T),O(f.$$.fragment,T),c=!0)},o(T){D(t),D(l.$$.fragment,T),D(o.$$.fragment,T),D(a.$$.fragment,T),D(f.$$.fragment,T),c=!1},d(T){T&&(k(i),k(s),k(r),k(u)),m[e].d(T),n[31](null),q(l,T),n[33](null),q(o,T),n[34](null),q(a,T),n[38](null),q(f,T)}}}function kN(n,e,t){let i,l,s,o,r,a,u;Qe(n,Qn,Te=>t(2,l=Te)),Qe(n,cn,Te=>t(40,s=Te)),Qe(n,gr,Te=>t(3,o=Te)),Qe(n,Lu,Te=>t(16,r=Te)),Qe(n,En,Te=>t(11,a=Te)),Qe(n,Dl,Te=>t(12,u=Te));const f=new URLSearchParams(r);let c,d,m,h,g,_,y=f.get("filter")||"",S=f.get("sort")||"-@rowid",T=f.get("collectionId")||(l==null?void 0:l.id),$=0;Du(T);async function E(Te){await fn(),(l==null?void 0:l.type)==="view"?h.show(Te):m==null||m.show(Te)}function M(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-@rowid"),I({recordId:null}),L(),c==null||c.forceHide(),d==null||d.hide()}async function L(){if(!S)return;const Te=z.getAllCollectionIdentifiers(l),Ze=S.split(",").map(ot=>ot.startsWith("+")||ot.startsWith("-")?ot.substring(1):ot);Ze.filter(ot=>Te.includes(ot)).length!=Ze.length&&((l==null?void 0:l.type)!="view"?t(1,S="-@rowid"):Te.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Te={}){const Ze=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Te);z.replaceHashQueryParams(Ze)}const A=()=>c==null?void 0:c.show();function P(Te){ie[Te?"unshift":"push"](()=>{_=Te,t(9,_)})}function R(Te){$=Te,t(10,$)}const N=()=>c==null?void 0:c.show(l),U=()=>{g==null||g.load(),_==null||_.reload()},j=()=>d==null?void 0:d.show(l),V=()=>m==null?void 0:m.show(),K=Te=>t(0,y=Te.detail);function J(Te){ie[Te?"unshift":"push"](()=>{g=Te,t(8,g)})}function ee(Te){y=Te,t(0,y)}function X(Te){S=Te,t(1,S)}const oe=Te=>{I({recordId:Te.detail.id});let Ze=Te.detail._partial?Te.detail.id:Te.detail;l.type==="view"?h==null||h.show(Ze):m==null||m.show(Ze)},Se=()=>{_==null||_.reload()},ke=()=>m==null?void 0:m.show();function Ce(Te){ie[Te?"unshift":"push"](()=>{c=Te,t(4,c)})}const We=()=>{g==null||g.load(),_==null||_.reload()};function st(Te){ie[Te?"unshift":"push"](()=>{d=Te,t(5,d)})}function et(Te){ie[Te?"unshift":"push"](()=>{m=Te,t(6,m)})}const Be=()=>{I({recordId:null})},rt=Te=>{y?_==null||_.reload():Te.detail.isNew&&t(10,$++,$),g==null||g.reloadLoadedPages()},Je=Te=>{(!y||g!=null&&g.hasRecord(Te.detail.id))&&t(10,$--,$),g==null||g.reloadLoadedPages()};function at(Te){ie[Te?"unshift":"push"](()=>{h=Te,t(7,h)})}const Ht=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&Ew(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&M(),n.$$.dirty[0]&4&&l!=null&&l.id&&L(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&E(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&Nn(cn,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,g,_,$,a,u,I,T,i,r,A,P,R,N,U,j,V,K,J,ee,X,oe,Se,ke,Ce,We,st,et,Be,rt,Je,at,Ht]}class vN extends ye{constructor(e){super(),be(this,e,kN,yN,_e,{},null,[-1,-1])}}function r1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='<span class="txt">Sync</span>',t=C(),i=b("a"),i.innerHTML='<i class="ri-uninstall-line" aria-hidden="true"></i> <span class="txt">Export collections</span>',l=C(),s=b("a"),s.innerHTML='<i class="ri-install-line" aria-hidden="true"></i> <span class="txt">Import collections</span>',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){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),o||(r=[Me(Ri.call(null,i,{path:"/settings/export-collections/?.*"})),Me(Un.call(null,i)),Me(Ri.call(null,s,{path:"/settings/import-collections/?.*"})),Me(Un.call(null,s))],o=!0)},d(a){a&&(k(e),k(t),k(i),k(l),k(s)),o=!1,De(r)}}}function wN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&r1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),l=b("a"),l.innerHTML='<i class="ri-home-gear-line" aria-hidden="true"></i> <span class="txt">Application</span>',s=C(),o=b("a"),o.innerHTML='<i class="ri-send-plane-2-line" aria-hidden="true"></i> <span class="txt">Mail settings</span>',r=C(),a=b("a"),a.innerHTML='<i class="ri-archive-drawer-line" aria-hidden="true"></i> <span class="txt">Files storage</span>',u=C(),f=b("a"),f.innerHTML='<i class="ri-archive-line" aria-hidden="true"></i> <span class="txt">Backups</span>',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,_){v(g,e,_),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=[Me(Ri.call(null,l,{path:"/settings"})),Me(Un.call(null,l)),Me(Ri.call(null,o,{path:"/settings/mail/?.*"})),Me(Un.call(null,o)),Me(Ri.call(null,a,{path:"/settings/storage/?.*"})),Me(Un.call(null,a)),Me(Ri.call(null,f,{path:"/settings/backups/?.*"})),Me(Un.call(null,f))],d=!0)},p(g,_){g[0]?h&&(h.d(1),h=null):h||(h=r1(),h.c(),h.m(e,null))},d(g){g&&k(e),h&&h.d(),d=!1,De(m)}}}function SN(n){let e,t;return e=new sk({props:{class:"settings-sidebar",$$slots:{default:[wN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function TN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class ps extends ye{constructor(e){super(),be(this,e,TN,SN,_e,{})}}function $N(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(u,f){v(u,e,f),e.checked=n[0].batch.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function CN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].batch.maxRequests&&ce(s,u[0].batch.maxRequests)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function ON(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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].batch.timeout&&ce(s,u[0].batch.timeout)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function EN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function MN(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:[$N,({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:[CN,({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:[ON,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[EN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div"),H(s.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),u=C(),f=b("div"),H(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){F(e,m,h),v(m,t,h),v(m,i,h),w(i,l),F(s,l,null),w(i,o),w(i,r),F(a,r,null),w(i,u),w(i,f),F(c,f,null),d=!0},p(m,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.class="form-field "+(m[1]?"required":"")),h&771&&(_.$$scope={dirty:h,ctx:m}),s.$set(_);const y={};h&2&&(y.class="form-field "+(m[1]?"required":"")),h&771&&(y.$$scope={dirty:h,ctx:m}),a.$set(y);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(O(e.$$.fragment,m),O(s.$$.fragment,m),O(a.$$.fragment,m),O(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&&(k(t),k(i)),q(e,m),q(s),q(a),q(c)}}}function DN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function IN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function a1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function LN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?IN:DN}let a=r(n),u=a(n),f=n[2]&&a1();return{c(){e=b("div"),e.innerHTML='<i class="ri-archive-stack-line"></i> <span class="txt">Batch API</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=a1(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function AN(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[LN],default:[MN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function PN(n,e,t){let i,l,s;Qe(n,Sn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=yt(this.value),t(0,o)}function u(){o.batch.timeout=yt(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=!z.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 NN extends ye{constructor(e){super(),be(this,e,PN,AN,_e,{formSettings:0})}}function u1(n,e,t){const i=n.slice();return i[17]=e[t],i}function f1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=Y(t),l=Y(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&ue(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function RN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function y(E){n[11](E)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new _o({props:S}),ie.push(()=>ve(s,"value",y));let T=pe(n[2]),$=[];for(let E=0;E<T.length;E+=1)$[E]=f1(u1(n,T,E));return{c(){e=b("label"),t=Y("Trusted proxy headers"),l=C(),H(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=Y(`Comma separated list of headers 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||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[65](null),q(e,r),n[68](null),q(i,r)}}}const Ml="form",no="providers";function VP(n,e,t){let i,l,s,o,r,a,u,f;const c=gt(),d="record_"+z.randomString(5);let{collection:m}=e,h,g,_={},y={},S=null,T=!1,$=!1,E={},M={},L=JSON.stringify(_),I=L,A=Ml,P=!0,R=!0,N=m,U=[];const j=["id"],V=j.concat("email","emailVisibility","verified","tokenKey","password");function K(le){return Se(le),t(14,$=!0),t(15,A=Ml),h==null?void 0:h.show()}function J(){return h==null?void 0:h.hide()}function ee(){t(14,$=!1),J()}function X(){t(34,N=m),h!=null&&h.isActive()&&(st(JSON.stringify(y)),ee())}async function oe(le){if(le&&typeof le=="string"){try{return await me.collection(m.id).getOne(le)}catch(Ee){Ee.isAbort||(ee(),console.warn("resolveModel:",Ee),$i(`Unable to load record with id "${le}"`))}return null}return le}async function Se(le){t(7,R=!0),Wt({}),t(4,E={}),t(5,M={}),t(2,_=typeof le=="string"?{id:le,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:le||{}),t(3,y=structuredClone(_)),t(2,_=await oe(le)||{}),t(3,y=structuredClone(_)),await fn(),t(12,S=We()),!S||Be(y,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(32,L=JSON.stringify(y)),t(7,R=!1)}async function ke(le){var Re,Ke;Wt({}),t(2,_=le||{}),t(4,E={}),t(5,M={});const Ee=((Ke=(Re=m==null?void 0:m.fields)==null?void 0:Re.filter(Ae=>Ae.type!="file"))==null?void 0:Ke.map(Ae=>Ae.name))||[];for(let Ae in le)Ee.includes(Ae)||t(3,y[Ae]=le[Ae],y);await fn(),t(32,L=JSON.stringify(y)),rt()}function Ce(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function We(le){try{const Ee=window.localStorage.getItem(Ce());if(Ee)return JSON.parse(Ee)}catch{}return le}function st(le){try{window.localStorage.setItem(Ce(),le)}catch(Ee){console.warn("updateDraft failure:",Ee),window.localStorage.removeItem(Ce())}}function et(){S&&(t(3,y=S),t(12,S=null))}function Be(le,Ee){var ft;const Re=structuredClone(le||{}),Ke=structuredClone(Ee||{}),Ae=(ft=m==null?void 0:m.fields)==null?void 0:ft.filter(Xt=>Xt.type==="file");for(let Xt of Ae)delete Re[Xt.name],delete Ke[Xt.name];const Ge=["expand","password","passwordConfirm"];for(let Xt of Ge)delete Re[Xt],delete Ke[Xt];return JSON.stringify(Re)==JSON.stringify(Ke)}function rt(){t(12,S=null),window.localStorage.removeItem(Ce())}async function Je(le=!0){var Ee;if(!(T||!u||!(m!=null&&m.id))){t(13,T=!0);try{const Re=Ht();let Ke;if(P?Ke=await me.collection(m.id).create(Re):Ke=await me.collection(m.id).update(y.id,Re),tn(P?"Successfully created record.":"Successfully updated record."),rt(),l&&(y==null?void 0:y.id)==((Ee=me.authStore.record)==null?void 0:Ee.id)&&Re.get("password"))return me.logout();le?ee():ke(Ke),c("save",{isNew:P,record:Ke})}catch(Re){me.error(Re)}t(13,T=!1)}}function at(){_!=null&&_.id&&pn("Do you really want to delete the selected record?",()=>me.collection(_.collectionId).delete(_.id).then(()=>{ee(),tn("Successfully deleted record."),c("delete",_)}).catch(le=>{me.error(le)}))}function Ht(){const le=structuredClone(y||{}),Ee=new FormData,Re={},Ke={};for(const Ae of(m==null?void 0:m.fields)||[])Ae.type=="autodate"||i&&Ae.type=="password"||(Re[Ae.name]=!0,Ae.type=="json"&&(Ke[Ae.name]=!0));i&&le.password&&(Re.password=!0),i&&le.passwordConfirm&&(Re.passwordConfirm=!0);for(const Ae in le)if(Re[Ae]){if(typeof le[Ae]>"u"&&(le[Ae]=null),Ke[Ae]&&le[Ae]!=="")try{JSON.parse(le[Ae])}catch(Ge){const ft={};throw ft[Ae]={code:"invalid_json",message:Ge.toString()},new Rn({status:400,response:{data:ft}})}z.addValueToFormData(Ee,Ae,le[Ae])}for(const Ae in E){const Ge=z.toArray(E[Ae]);for(const ft of Ge)Ee.append(Ae+"+",ft)}for(const Ae in M){const Ge=z.toArray(M[Ae]);for(const ft of Ge)Ee.append(Ae+"-",ft)}return Ee}function Te(){!(m!=null&&m.id)||!(_!=null&&_.email)||pn(`Do you really want to sent verification email to ${_.email}?`,()=>me.collection(m.id).requestVerification(_.email).then(()=>{tn(`Successfully sent verification email to ${_.email}.`)}).catch(le=>{me.error(le)}))}function Ze(){!(m!=null&&m.id)||!(_!=null&&_.email)||pn(`Do you really want to sent password reset email to ${_.email}?`,()=>me.collection(m.id).requestPasswordReset(_.email).then(()=>{tn(`Successfully sent password reset email to ${_.email}.`)}).catch(le=>{me.error(le)}))}function ot(){a?pn("You have unsaved changes. Do you really want to discard them?",()=>{Le()}):Le()}async function Le(){let le=_?structuredClone(_):null;if(le){const Ee=["file","autodate"],Re=(m==null?void 0:m.fields)||[];for(const Ke of Re)Ee.includes(Ke.type)&&delete le[Ke.name];le.id=""}rt(),K(le),await fn(),t(32,L="")}function Ve(le){(le.ctrlKey||le.metaKey)&&le.code=="KeyS"&&(le.preventDefault(),le.stopPropagation(),Je(!1))}const we=()=>J(),Oe=()=>Je(!1),ut=()=>Te(),Ne=()=>Ze(),xe=()=>g==null?void 0:g.show(),qt=()=>ot(),Zt=()=>at(),Fe=()=>t(15,A=Ml),Dt=()=>t(15,A=no),Gt=()=>et(),mn=()=>rt();function hn(){y.id=this.value,t(3,y)}function pi(le){y=le,t(3,y)}function Ci(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function bt(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function rn(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function sn(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function rl(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function It(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function al(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function ul(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function Hi(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function ji(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function fl(le,Ee){n.$$.not_equal(E[Ee.name],le)&&(E[Ee.name]=le,t(4,E))}function Mn(le,Ee){n.$$.not_equal(M[Ee.name],le)&&(M[Ee.name]=le,t(5,M))}function Rl(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}function cl(le,Ee){n.$$.not_equal(y[Ee.name],le)&&(y[Ee.name]=le,t(3,y))}const Z=()=>a&&$?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{ee()}),!1):(Wt({}),rt(),!0);function Q(le){ie[le?"unshift":"push"](()=>{h=le,t(10,h)})}function se(le){Pe.call(this,n,le)}function he(le){Pe.call(this,n,le)}function qe(le){ie[le?"unshift":"push"](()=>{g=le,t(11,g)})}return n.$$set=le=>{"collection"in le&&t(0,m=le.collection)},n.$$.update=()=>{var le,Ee,Re;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(Ke=>Ke.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Ee=m==null?void 0:m.fields)==null?void 0:Ee.find(Ke=>Ke.name==="id")),n.$$.dirty[0]&48&&t(36,r=z.hasNonEmptyProps(E)||z.hasNonEmptyProps(M)),n.$$.dirty[0]&8&&t(33,I=JSON.stringify(y)),n.$$.dirty[1]&38&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!_||!_.id),n.$$.dirty[0]&448&&t(18,u=!R&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&4&&(R||st(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&m&&(N==null?void 0:N.id)!=(m==null?void 0:m.id)&&X(),n.$$.dirty[0]&512&&t(35,f=i?V:j),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&t(16,U=((Re=m==null?void 0:m.fields)==null?void 0:Re.filter(Ke=>!f.includes(Ke.name)&&Ke.type!="autodate"))||[])},[m,J,_,y,E,M,P,R,a,i,h,g,S,T,$,A,U,l,u,o,s,d,ee,et,rt,Je,at,Te,Ze,ot,Ve,K,L,I,N,f,r,we,Oe,ut,Ne,xe,qt,Zt,Fe,Dt,Gt,mn,hn,pi,Ci,bt,rn,sn,rl,It,al,ul,Hi,ji,fl,Mn,Rl,cl,Z,Q,se,he,qe]}class rf extends ye{constructor(e){super(),be(this,e,VP,UP,_e,{collection:0,show:31,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[31]}get hide(){return this.$$.ctx[1]}}function BP(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=Y(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){v(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])+"")&&ue(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&&k(e)}}}function WP(n,e,t){const i=gt();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=z.getAllCollectionIdentifiers(l),c=await me.collection(l.id).getList(1,1,{filter:z.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 YP extends ye{constructor(e){super(),be(this,e,WP,BP,_e,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function Vg(n,e,t){const i=n.slice();return i[57]=e[t],i}function Bg(n,e,t){const i=n.slice();return i[60]=e[t],i}function Wg(n,e,t){const i=n.slice();return i[60]=e[t],i}function Yg(n,e,t){const i=n.slice();return i[53]=e[t],i}function Kg(n){let e;function t(s,o){return s[9]?JP:KP}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){v(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&&k(e),l.d()}}}function KP(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){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=B(t,"change",n[30]),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&&k(e),o=!1,r()}}}function JP(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function ZP(n){let e,t;return{c(){e=b("i"),p(e,"class",t=z.getFieldTypeIcon(n[60].type))},m(i,l){v(i,e,l)},p(i,l){l[0]&32768&&t!==(t=z.getFieldTypeIcon(i[60].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function GP(n){let e;return{c(){e=b("i"),p(e,"class",z.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function XP(n){let e,t,i,l=n[60].name+"",s;function o(u,f){return u[60].primaryKey?GP:ZP}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),s=Y(l),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){v(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[60].name+"")&&ue(s,l)},d(u){u&&k(e),a.d()}}}function Jg(n,e){let t,i,l,s;function o(a){e[31](a)}let r={class:"col-type-"+e[60].type+" col-field-"+e[60].name,name:e[60].name,$$slots:{default:[XP]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new ir({props:r}),ie.push(()=>ve(i,"sort",o)),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),F(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[60].type+" col-field-"+e[60].name),u[0]&32768&&(f.name=e[60].name),u[0]&32768|u[2]&8&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),q(i,a)}}}function Zg(n){let e;return{c(){e=b("button"),e.innerHTML='<i class="ri-more-line"></i>',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){v(t,e,i),n[32](e)},p:te,d(t){t&&k(e),n[32](null)}}}function Gg(n){let e;function t(s,o){return s[9]?xP:QP}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function QP(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return tN;if(!a[16])return eN}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){v(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&&k(e),r&&r.d()}}}function xP(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>'},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function eN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-add-line"></i> <span class="txt">New record</span>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[37]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function tN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[36]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Xg(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[33](n[57])}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[57].id),i.checked=s=n[4][n[57].id],p(r,"for",a="checkbox_"+n[57].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){v(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[28]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[57].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[57].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[57].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,De(f)}}}function Qg(n,e){let t,i,l,s;return i=new rk({props:{short:!0,record:e[57],field:e[60]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",l="col-type-"+e[60].type+" col-field-"+e[60].name),this.first=t},m(o,r){v(o,t,r),F(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[57]),r[0]&32768&&(a.field=e[60]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[60].type+" col-field-"+e[60].name))&&p(t,"class",l)},i(o){s||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),q(i)}}}function xg(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&Xg(e),d=pe(e[15]);const m=_=>_[60].id;for(let _=0;_<d.length;_+=1){let y=Bg(e,d,_),S=m(y);s.set(S,l[_]=Qg(S,y))}function h(){return e[34](e[57])}function g(..._){return e[35](e[57],..._)}return{key:n,first:null,c(){t=b("tr"),c&&c.c(),i=C();for(let _=0;_<l.length;_+=1)l[_].c();o=C(),r=b("td"),r.innerHTML='<i class="ri-arrow-right-line"></i>',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(_,y){v(_,t,y),c&&c.m(t,null),w(t,i);for(let S=0;S<l.length;S+=1)l[S]&&l[S].m(t,null);w(t,o),w(t,r),a=!0,u||(f=[B(t,"click",h),B(t,"keydown",g)],u=!0)},p(_,y){e=_,e[16]?c&&(c.d(1),c=null):c?c.p(e,y):(c=Xg(e),c.c(),c.m(t,i)),y[0]&32776&&(d=pe(e[15]),re(),l=kt(l,y,m,1,e,d,s,t,zt,Qg,o,Bg),ae())},i(_){if(!a){for(let y=0;y<d.length;y+=1)O(l[y]);a=!0}},o(_){for(let y=0;y<l.length;y+=1)D(l[y]);a=!1},d(_){_&&k(t),c&&c.d();for(let y=0;y<l.length;y+=1)l[y].d();u=!1,De(f)}}}function e1(n){let e,t,i,l,s,o;return{c(){e=b("tr"),t=b("td"),i=b("button"),l=b("span"),l.textContent="Load more",p(l,"class","txt"),p(i,"class","btn btn-expanded-lg btn-secondary btn-horizontal-sticky"),i.disabled=n[9],x(i,"btn-loading",n[9]),p(t,"colspan","99"),p(t,"class","txt-center")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(i,l),s||(o=B(i,"click",tt(n[38])),s=!0)},p(r,a){a[0]&512&&(i.disabled=r[9]),a[0]&512&&x(i,"btn-loading",r[9])},d(r){r&&k(e),s=!1,o()}}}function nN(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c=[],d=new Map,m,h,g=!n[16]&&Kg(n),_=pe(n[15]);const y=L=>L[60].id;for(let L=0;L<_.length;L+=1){let I=Wg(n,_,L),A=y(I);o.set(A,s[L]=Jg(A,I))}let S=n[12].length&&Zg(n),T=pe(n[3]);const $=L=>L[16]?L[57]:L[57].id;for(let L=0;L<T.length;L+=1){let I=Vg(n,T,L),A=$(I);d.set(A,c[L]=xg(A,I))}let E=null;T.length||(E=Gg(n));let M=n[3].length&&n[14]&&e1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),l=C();for(let L=0;L<s.length;L+=1)s[L].c();r=C(),a=b("th"),S&&S.c(),u=C(),f=b("tbody");for(let L=0;L<c.length;L+=1)c[L].c();E&&E.c(),m=C(),M&&M.c(),p(a,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[9])},m(L,I){v(L,e,I),w(e,t),w(t,i),g&&g.m(i,null),w(i,l);for(let A=0;A<s.length;A+=1)s[A]&&s[A].m(i,null);w(i,r),w(i,a),S&&S.m(a,null),w(e,u),w(e,f);for(let A=0;A<c.length;A+=1)c[A]&&c[A].m(f,null);E&&E.m(f,null),w(f,m),M&&M.m(f,null),h=!0},p(L,I){L[16]?g&&(g.d(1),g=null):g?g.p(L,I):(g=Kg(L),g.c(),g.m(i,l)),I[0]&32769&&(_=pe(L[15]),re(),s=kt(s,I,y,1,L,_,o,i,zt,Jg,r,Wg),ae()),L[12].length?S?S.p(L,I):(S=Zg(L),S.c(),S.m(a,null)):S&&(S.d(1),S=null),I[0]&1278490&&(T=pe(L[3]),re(),c=kt(c,I,$,1,L,T,d,f,zt,xg,m,Vg),ae(),!T.length&&E?E.p(L,I):T.length?E&&(E.d(1),E=null):(E=Gg(L),E.c(),E.m(f,m))),L[3].length&&L[14]?M?M.p(L,I):(M=e1(L),M.c(),M.m(f,null)):M&&(M.d(1),M=null),(!h||I[0]&512)&&x(e,"table-loading",L[9])},i(L){if(!h){for(let I=0;I<_.length;I+=1)O(s[I]);for(let I=0;I<T.length;I+=1)O(c[I]);h=!0}},o(L){for(let I=0;I<s.length;I+=1)D(s[I]);for(let I=0;I<c.length;I+=1)D(c[I]);h=!1},d(L){L&&k(e),g&&g.d();for(let I=0;I<s.length;I+=1)s[I].d();S&&S.d();for(let I=0;I<c.length;I+=1)c[I].d();E&&E.d(),M&&M.d()}}}function t1(n){let e,t;return e=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[11],$$slots:{default:[lN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l[0]&2048&&(s.trigger=i[11]),l[0]&4128|l[2]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function iN(n){let e,t,i,l,s,o=n[53].name+"",r,a,u,f,c;function d(...m){return n[29](n[53],...m)}return{c(){e=b("input"),l=C(),s=b("label"),r=Y(o),u=C(),p(e,"type","checkbox"),p(e,"id",t=n[56]),e.checked=i=!n[5].includes(n[53].id),p(s,"for",a=n[56])},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),v(m,u,h),f||(c=B(e,"change",d),f=!0)},p(m,h){n=m,h[1]&33554432&&t!==(t=n[56])&&p(e,"id",t),h[0]&4128&&i!==(i=!n[5].includes(n[53].id))&&(e.checked=i),h[0]&4096&&o!==(o=n[53].name+"")&&ue(r,o),h[1]&33554432&&a!==(a=n[56])&&p(s,"for",a)},d(m){m&&(k(e),k(l),k(s),k(u)),f=!1,c()}}}function n1(n,e){let t,i,l;return i=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[iN,({uniqueId:s})=>({56:s}),({uniqueId:s})=>[0,s?33554432:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ge(),H(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),F(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&33554432|o[2]&8&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(i,s)}}}function lN(n){let e,t,i=[],l=new Map,s,o,r=pe(n[12]);const a=u=>u[53].id+u[53].name;for(let u=0;u<r.length;u+=1){let f=Yg(n,r,u),c=a(f);l.set(c,i[u]=n1(c,f))}return{c(){e=b("div"),e.textContent="Toggle columns",t=C();for(let u=0;u<i.length;u+=1)i[u].c();s=ge(),p(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){v(u,e,f),v(u,t,f);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);v(u,s,f),o=!0},p(u,f){f[0]&4128|f[1]&33554432&&(r=pe(u[12]),re(),i=kt(i,f,a,1,u,r,l,s.parentNode,zt,n1,s,Yg),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)O(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)D(i[f]);o=!1},d(u){u&&(k(e),k(t),k(s));for(let f=0;f<i.length;f+=1)i[f].d(u)}}}function sN(n){let e,t,i=n[11]&&t1(n);return{c(){i&&i.c(),e=ge()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,s){l[11]?i?(i.p(l,s),s[0]&2048&&O(i,1)):(i=t1(l),i.c(),O(i,1),i.m(e.parentNode,e)):i&&(re(),D(i,1,1,()=>{i=null}),ae())},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function i1(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,g,_,y,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[6]),o=C(),a=Y(r),u=C(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[10]),x(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m(T,$){v(T,e,$),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),_=!0,y||(S=[B(f,"click",n[40]),B(h,"click",n[41])],y=!0)},p(T,$){(!_||$[0]&64)&&ue(s,T[6]),(!_||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&ue(a,r),(!_||$[0]&1024)&&x(f,"btn-disabled",T[10]),(!_||$[0]&1024)&&x(h,"btn-loading",T[10]),(!_||$[0]&1024)&&x(h,"btn-disabled",T[10])},i(T){_||(T&&nt(()=>{_&&(g||(g=ze(e,Fn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(T){T&&(g||(g=ze(e,Fn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(T){T&&k(e),T&&g&&g.end(),y=!1,De(S)}}}function oN(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[sN],default:[nN]},$$scope:{ctx:n}};e=new Pu({props:s}),n[39](e);let o=n[6]&&i1(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=ge()},m(r,a){F(e,r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l=!0},p(r,a){const u={};a[0]&129851|a[2]&8&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&O(o,1)):(o=i1(r),o.c(),O(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(O(e.$$.fragment,r),O(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(k(t),k(i)),n[39](null),q(e,r),o&&o.d(r)}}}const rN=/^([\+\-])?(\w+)$/,l1=40;function aN(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,En,Ne=>t(46,d=Ne));const m=gt();let{collection:h}=e,{sort:g=""}=e,{filter:_=""}=e,y,S=[],T=1,$=0,E={},M=!0,L=!1,I=0,A,P=[],R=[],N="";const U=["verified","emailVisibility"];function j(){h!=null&&h.id&&(P.length?localStorage.setItem(N,JSON.stringify(P)):localStorage.removeItem(N))}function V(){if(t(5,P=[]),!!(h!=null&&h.id))try{const Ne=localStorage.getItem(N);Ne&&t(5,P=JSON.parse(Ne)||[])}catch{}}function K(Ne){return!!S.find(xe=>xe.id==Ne)}async function J(){const Ne=T;for(let xe=1;xe<=Ne;xe++)(xe===1||u)&&await ee(xe,!1)}async function ee(Ne=1,xe=!0){var hn,pi,Ci;if(!(h!=null&&h.id))return;t(9,M=!0);let qt=g;const Zt=qt.match(rN),Fe=Zt?r.find(bt=>bt.name===Zt[2]):null;if(Zt&&Fe){const bt=((Ci=(pi=(hn=d==null?void 0:d.find(sn=>sn.id==Fe.collectionId))==null?void 0:hn.fields)==null?void 0:pi.filter(sn=>sn.presentable))==null?void 0:Ci.map(sn=>sn.name))||[],rn=[];for(const sn of bt)rn.push((Zt[1]||"")+Zt[2]+"."+sn);rn.length>0&&(qt=rn.join(","))}const Dt=z.getAllCollectionIdentifiers(h),Gt=o.map(bt=>bt.name+":excerpt(200)").concat(r.map(bt=>"expand."+bt.name+".*:excerpt(200)"));Gt.length&&Gt.unshift("*");const mn=[];for(const bt of r){const rn=z.getExpandPresentableRelField(bt,d,2);rn&&mn.push(rn)}return me.collection(h.id).getList(Ne,l1,{sort:qt,skipTotal:1,filter:z.normalizeSearchFilter(_,Dt),expand:mn.join(","),fields:Gt.join(","),requestKey:"records_list"}).then(async bt=>{var rn;if(Ne<=1&&X(),t(9,M=!1),t(8,T=bt.page),t(25,$=bt.items.length),m("load",S.concat(bt.items)),o.length)for(let sn of bt.items)sn._partial=!0;if(xe){const sn=++I;for(;(rn=bt.items)!=null&&rn.length&&I==sn;){const rl=bt.items.splice(0,20);for(let It of rl)z.pushOrReplaceByKey(S,It);t(3,S),await z.yieldToMain()}}else{for(let sn of bt.items)z.pushOrReplaceByKey(S,sn);t(3,S)}}).catch(bt=>{bt!=null&&bt.isAbort||(t(9,M=!1),console.warn(bt),X(),me.error(bt,!_||(bt==null?void 0:bt.status)!=400))})}function X(){y==null||y.resetVerticalScroll(),t(3,S=[]),t(8,T=1),t(25,$=0),t(4,E={})}function oe(){c?Se():ke()}function Se(){t(4,E={})}function ke(){for(const Ne of S)t(4,E[Ne.id]=Ne,E);t(4,E)}function Ce(Ne){E[Ne.id]?delete E[Ne.id]:t(4,E[Ne.id]=Ne,E),t(4,E)}function We(){pn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,st)}async function st(){if(L||!f||!(h!=null&&h.id))return;let Ne=[];for(const xe of Object.keys(E))Ne.push(me.collection(h.id).delete(xe));return t(10,L=!0),Promise.all(Ne).then(()=>{tn(`Successfully deleted the selected ${f===1?"record":"records"}.`),m("delete",E),Se()}).catch(xe=>{me.error(xe)}).finally(()=>(t(10,L=!1),J()))}function et(Ne){Pe.call(this,n,Ne)}const Be=(Ne,xe)=>{xe.target.checked?z.removeByValue(P,Ne.id):z.pushUnique(P,Ne.id),t(5,P)},rt=()=>oe();function Je(Ne){g=Ne,t(0,g)}function at(Ne){ie[Ne?"unshift":"push"](()=>{A=Ne,t(11,A)})}const Ht=Ne=>Ce(Ne),Te=Ne=>m("select",Ne),Ze=(Ne,xe)=>{xe.code==="Enter"&&(xe.preventDefault(),m("select",Ne))},ot=()=>t(1,_=""),Le=()=>m("new"),Ve=()=>ee(T+1);function we(Ne){ie[Ne?"unshift":"push"](()=>{y=Ne,t(7,y)})}const Oe=()=>Se(),ut=()=>We();return n.$$set=Ne=>{"collection"in Ne&&t(22,h=Ne.collection),"sort"in Ne&&t(0,g=Ne.sort),"filter"in Ne&&t(1,_=Ne.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&h!=null&&h.id&&(N=h.id+"@hiddenColumns",V(),X()),n.$$.dirty[0]&4194304&&t(16,i=(h==null?void 0:h.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(h==null?void 0:h.type)==="auth"&&h.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((h==null?void 0:h.fields)||[]).filter(Ne=>!Ne.hidden&&(!l||!U.includes(Ne.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Ne=>Ne.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Ne=>Ne.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Ne=>!P.includes(Ne.id))),n.$$.dirty[0]&4194307&&h!=null&&h.id&&g!==-1&&_!==-1&&ee(1),n.$$.dirty[0]&33554432&&t(14,u=$>=l1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=S.length&&f===S.length),n.$$.dirty[0]&32&&P!==-1&&j(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Ne=>!Ne.primaryKey).map(Ne=>({id:Ne.id,name:Ne.name})))},[g,_,ee,S,E,P,f,y,T,M,L,A,R,c,u,a,i,m,oe,Se,Ce,We,h,K,J,$,s,l,et,Be,rt,Je,at,Ht,Te,Ze,ot,Le,Ve,we,Oe,ut]}class uN extends ye{constructor(e){super(),be(this,e,aN,oN,_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 fN(n){let e,t,i,l;return e=new YD({}),i=new di({props:{class:"flex-content",$$slots:{footer:[mN],default:[pN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&16384&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function cN(n){let e,t;return e=new di({props:{center:!0,$$slots:{default:[gN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&16384&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dN(n){let e,t;return e=new di({props:{center:!0,$$slots:{default:[bN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,l){const s={};l[1]&16384&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){v(l,e,s),t||(i=[Me(He.call(null,e,{text:"Edit collection",position:"right"})),B(e,"click",n[20])],t=!0)},p:te,d(l){l&&k(e),t=!1,De(i)}}}function o1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-add-line"></i> <span class="txt">New record</span>',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[23]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function pN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R=!n[12]&&s1(n);c=new Au({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&o1(n);y=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function U(K){n[26](K)}function j(K){n[27](K)}let V={collection:n[2]};return n[0]!==void 0&&(V.filter=n[0]),n[1]!==void 0&&(V.sort=n[1]),E=new uN({props:V}),n[25](E),ie.push(()=>ve(E,"filter",U)),ie.push(()=>ve(E,"sort",j)),E.$on("select",n[28]),E.$on("delete",n[29]),E.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=C(),s=b("div"),r=Y(o),a=C(),u=b("div"),R&&R.c(),f=C(),H(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML='<i class="ri-code-s-slash-line"></i> <span class="txt">API Preview</span>',g=C(),N&&N.c(),_=C(),H(y.$$.fragment),S=C(),T=b("div"),$=C(),H(E.$$.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(T,"class","clearfix m-b-sm")},m(K,J){v(K,e,J),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),R&&R.m(u,null),w(u,f),F(c,u,null),w(e,d),w(e,m),w(m,h),w(m,g),N&&N.m(m,null),v(K,_,J),F(y,K,J),v(K,S,J),v(K,T,J),v(K,$,J),F(E,K,J),I=!0,A||(P=B(h,"click",n[22]),A=!0)},p(K,J){(!I||J[0]&4)&&o!==(o=K[2].name+"")&&ue(r,o),K[12]?R&&(R.d(1),R=null):R?R.p(K,J):(R=s1(K),R.c(),R.m(u,f)),K[2].type!=="view"?N?N.p(K,J):(N=o1(K),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const ee={};J[0]&1&&(ee.value=K[0]),J[0]&4&&(ee.autocompleteCollection=K[2]),y.$set(ee);const X={};J[0]&4&&(X.collection=K[2]),!M&&J[0]&1&&(M=!0,X.filter=K[0],$e(()=>M=!1)),!L&&J[0]&2&&(L=!0,X.sort=K[1],$e(()=>L=!1)),E.$set(X)},i(K){I||(O(c.$$.fragment,K),O(y.$$.fragment,K),O(E.$$.fragment,K),I=!0)},o(K){D(c.$$.fragment,K),D(y.$$.fragment,K),D(E.$$.fragment,K),I=!1},d(K){K&&(k(e),k(_),k(S),k(T),k($)),R&&R.d(),q(c),N&&N.d(),q(y,K),n[25](null),q(E,K),A=!1,P()}}}function mN(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new YP({props:s}),n[18](e),ie.push(()=>ve(e,"totalCount",l)),{c(){H(e.$$.fragment)},m(o,r){F(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[18](null),q(e,o)}}}function hN(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='<i class="ri-add-line"></i> <span class="txt">Create new collection</span>',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=B(i,"click",n[17]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function _N(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){v(t,e,i)},p:te,d(t){t&&k(e)}}}function gN(n){let e,t,i;function l(r,a){return r[12]?_N:hN}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){v(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&&k(e),o.d()}}}function bN(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-lg"></span> <h1>Loading collections...</h1>',p(e,"class","placeholder-section m-b-base")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function yN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[dN,cN,fN],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};l=new nf({props:g}),n[31](l),l.$on("truncate",n[32]);let _={};o=new $5({props:_}),n[33](o);let y={collection:n[2]};a=new rf({props:y}),n[34](a),a.$on("hide",n[35]),a.$on("save",n[36]),a.$on("delete",n[37]);let S={collection:n[2]};return f=new JI({props:S}),n[38](f),f.$on("hide",n[39]),{c(){t.c(),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),H(f.$$.fragment)},m(T,$){m[e].m(T,$),v(T,i,$),F(l,T,$),v(T,s,$),F(o,T,$),v(T,r,$),F(a,T,$),v(T,u,$),F(f,T,$),c=!0},p(T,$){let E=e;e=h(T),e===E?m[e].p(T,$):(re(),D(m[E],1,1,()=>{m[E]=null}),ae(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),O(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const L={};o.$set(L);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const A={};$[0]&4&&(A.collection=T[2]),f.$set(A)},i(T){c||(O(t),O(l.$$.fragment,T),O(o.$$.fragment,T),O(a.$$.fragment,T),O(f.$$.fragment,T),c=!0)},o(T){D(t),D(l.$$.fragment,T),D(o.$$.fragment,T),D(a.$$.fragment,T),D(f.$$.fragment,T),c=!1},d(T){T&&(k(i),k(s),k(r),k(u)),m[e].d(T),n[31](null),q(l,T),n[33](null),q(o,T),n[34](null),q(a,T),n[38](null),q(f,T)}}}function kN(n,e,t){let i,l,s,o,r,a,u;Qe(n,Qn,Te=>t(2,l=Te)),Qe(n,cn,Te=>t(40,s=Te)),Qe(n,gr,Te=>t(3,o=Te)),Qe(n,Lu,Te=>t(16,r=Te)),Qe(n,En,Te=>t(11,a=Te)),Qe(n,Dl,Te=>t(12,u=Te));const f=new URLSearchParams(r);let c,d,m,h,g,_,y=f.get("filter")||"",S=f.get("sort")||"-@rowid",T=f.get("collectionId")||(l==null?void 0:l.id),$=0;Du(T);async function E(Te){await fn(),(l==null?void 0:l.type)==="view"?h.show(Te):m==null||m.show(Te)}function M(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-@rowid"),I({recordId:null}),L(),c==null||c.forceHide(),d==null||d.hide()}async function L(){if(!S)return;const Te=z.getAllCollectionIdentifiers(l),Ze=S.split(",").map(ot=>ot.startsWith("+")||ot.startsWith("-")?ot.substring(1):ot);Ze.filter(ot=>Te.includes(ot)).length!=Ze.length&&((l==null?void 0:l.type)!="view"?t(1,S="-@rowid"):Te.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Te={}){const Ze=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Te);z.replaceHashQueryParams(Ze)}const A=()=>c==null?void 0:c.show();function P(Te){ie[Te?"unshift":"push"](()=>{_=Te,t(9,_)})}function R(Te){$=Te,t(10,$)}const N=()=>c==null?void 0:c.show(l),U=()=>{g==null||g.load(),_==null||_.reload()},j=()=>d==null?void 0:d.show(l),V=()=>m==null?void 0:m.show(),K=Te=>t(0,y=Te.detail);function J(Te){ie[Te?"unshift":"push"](()=>{g=Te,t(8,g)})}function ee(Te){y=Te,t(0,y)}function X(Te){S=Te,t(1,S)}const oe=Te=>{I({recordId:Te.detail.id});let Ze=Te.detail._partial?Te.detail.id:Te.detail;l.type==="view"?h==null||h.show(Ze):m==null||m.show(Ze)},Se=()=>{_==null||_.reload()},ke=()=>m==null?void 0:m.show();function Ce(Te){ie[Te?"unshift":"push"](()=>{c=Te,t(4,c)})}const We=()=>{g==null||g.load(),_==null||_.reload()};function st(Te){ie[Te?"unshift":"push"](()=>{d=Te,t(5,d)})}function et(Te){ie[Te?"unshift":"push"](()=>{m=Te,t(6,m)})}const Be=()=>{I({recordId:null})},rt=Te=>{y?_==null||_.reload():Te.detail.isNew&&t(10,$++,$),g==null||g.reloadLoadedPages()},Je=Te=>{(!y||g!=null&&g.hasRecord(Te.detail.id))&&t(10,$--,$),g==null||g.reloadLoadedPages()};function at(Te){ie[Te?"unshift":"push"](()=>{h=Te,t(7,h)})}const Ht=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&Ew(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&M(),n.$$.dirty[0]&4&&l!=null&&l.id&&L(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&E(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&Nn(cn,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,g,_,$,a,u,I,T,i,r,A,P,R,N,U,j,V,K,J,ee,X,oe,Se,ke,Ce,We,st,et,Be,rt,Je,at,Ht]}class vN extends ye{constructor(e){super(),be(this,e,kN,yN,_e,{},null,[-1,-1])}}function r1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='<span class="txt">Sync</span>',t=C(),i=b("a"),i.innerHTML='<i class="ri-uninstall-line" aria-hidden="true"></i> <span class="txt">Export collections</span>',l=C(),s=b("a"),s.innerHTML='<i class="ri-install-line" aria-hidden="true"></i> <span class="txt">Import collections</span>',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){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),o||(r=[Me(Ri.call(null,i,{path:"/settings/export-collections/?.*"})),Me(Un.call(null,i)),Me(Ri.call(null,s,{path:"/settings/import-collections/?.*"})),Me(Un.call(null,s))],o=!0)},d(a){a&&(k(e),k(t),k(i),k(l),k(s)),o=!1,De(r)}}}function wN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&r1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),l=b("a"),l.innerHTML='<i class="ri-home-gear-line" aria-hidden="true"></i> <span class="txt">Application</span>',s=C(),o=b("a"),o.innerHTML='<i class="ri-send-plane-2-line" aria-hidden="true"></i> <span class="txt">Mail settings</span>',r=C(),a=b("a"),a.innerHTML='<i class="ri-archive-drawer-line" aria-hidden="true"></i> <span class="txt">Files storage</span>',u=C(),f=b("a"),f.innerHTML='<i class="ri-archive-line" aria-hidden="true"></i> <span class="txt">Backups</span>',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,_){v(g,e,_),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=[Me(Ri.call(null,l,{path:"/settings"})),Me(Un.call(null,l)),Me(Ri.call(null,o,{path:"/settings/mail/?.*"})),Me(Un.call(null,o)),Me(Ri.call(null,a,{path:"/settings/storage/?.*"})),Me(Un.call(null,a)),Me(Ri.call(null,f,{path:"/settings/backups/?.*"})),Me(Un.call(null,f))],d=!0)},p(g,_){g[0]?h&&(h.d(1),h=null):h||(h=r1(),h.c(),h.m(e,null))},d(g){g&&k(e),h&&h.d(),d=!1,De(m)}}}function SN(n){let e,t;return e=new sk({props:{class:"settings-sidebar",$$slots:{default:[wN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function TN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class ps extends ye{constructor(e){super(),be(this,e,TN,SN,_e,{})}}function $N(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(u,f){v(u,e,f),e.checked=n[0].batch.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function CN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].batch.maxRequests&&ce(s,u[0].batch.maxRequests)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function ON(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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].batch.timeout&&ce(s,u[0].batch.timeout)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function EN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("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){v(f,e,c),w(e,t),v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function MN(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:[$N,({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:[CN,({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:[ON,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[EN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div"),H(s.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),u=C(),f=b("div"),H(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){F(e,m,h),v(m,t,h),v(m,i,h),w(i,l),F(s,l,null),w(i,o),w(i,r),F(a,r,null),w(i,u),w(i,f),F(c,f,null),d=!0},p(m,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.class="form-field "+(m[1]?"required":"")),h&771&&(_.$$scope={dirty:h,ctx:m}),s.$set(_);const y={};h&2&&(y.class="form-field "+(m[1]?"required":"")),h&771&&(y.$$scope={dirty:h,ctx:m}),a.$set(y);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(O(e.$$.fragment,m),O(s.$$.fragment,m),O(a.$$.fragment,m),O(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&&(k(t),k(i)),q(e,m),q(s),q(a),q(c)}}}function DN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function IN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function a1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function LN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?IN:DN}let a=r(n),u=a(n),f=n[2]&&a1();return{c(){e=b("div"),e.innerHTML='<i class="ri-archive-stack-line"></i> <span class="txt">Batch API</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(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&&O(f,1):(f=a1(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),u.d(c),f&&f.d(c)}}}function AN(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[LN],default:[MN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function PN(n,e,t){let i,l,s;Qe(n,Sn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=_t(this.value),t(0,o)}function u(){o.batch.timeout=_t(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=!z.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 NN extends ye{constructor(e){super(),be(this,e,PN,AN,_e,{formSettings:0})}}function u1(n,e,t){const i=n.slice();return i[17]=e[t],i}function f1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=Y(t),l=Y(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=B(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&ue(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function RN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function y(E){n[11](E)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new _o({props:S}),ie.push(()=>ve(s,"value",y));let T=pe(n[2]),$=[];for(let E=0;E<T.length;E+=1)$[E]=f1(u1(n,T,E));return{c(){e=b("label"),t=Y("Trusted proxy headers"),l=C(),H(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=Y(`Comma separated list of headers such as:
                         `);for(let E=0;E<$.length;E+=1)$[E].c();p(e,"for",i=n[16]),p(u,"type","button"),p(u,"class","btn btn-sm btn-hint btn-transparent btn-clear"),x(u,"hidden",z.isEmpty(n[0].trustedProxy.headers)),p(a,"class","form-field-addon"),p(c,"class","help-block")},m(E,M){v(E,e,M),w(e,t),v(E,l,M),F(s,E,M),v(E,r,M),v(E,a,M),w(a,u),v(E,f,M),v(E,c,M),w(c,d),w(d,m);for(let L=0;L<$.length;L+=1)$[L]&&$[L].m(d,null);h=!0,g||(_=B(u,"click",n[12]),g=!0)},p(E,M){(!h||M&65536&&i!==(i=E[16]))&&p(e,"for",i);const L={};if(M&65536&&(L.id=E[16]),!o&&M&1&&(o=!0,L.value=E[0].trustedProxy.headers,$e(()=>o=!1)),s.$set(L),(!h||M&1)&&x(u,"hidden",z.isEmpty(E[0].trustedProxy.headers)),M&68){T=pe(E[2]);let I;for(I=0;I<T.length;I+=1){const A=u1(E,T,I);$[I]?$[I].p(A,M):($[I]=f1(A),$[I].c(),$[I].m(d,null))}for(;I<$.length;I+=1)$[I].d(1);$.length=T.length}},i(E){h||(O(s.$$.fragment,E),h=!0)},o(E){D(s.$$.fragment,E),h=!1},d(E){E&&(k(e),k(l),k(r),k(a),k(f),k(c)),q(s,E),pt($,E),g=!1,_()}}}function FN(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[14](h)}let m={items:n[7]};return n[0].trustedProxy.useLeftmostIP!==void 0&&(m.keyOfSelected=n[0].trustedProxy.useLeftmostIP),r=new xn({props:m}),ie.push(()=>ve(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),l=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),F(r,h,g),u=!0,f||(c=Me(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,g){(!u||g&65536&&s!==(s=h[16]))&&p(e,"for",s);const _={};!a&&g&1&&(a=!0,_.keyOfSelected=h[0].trustedProxy.useLeftmostIP,$e(()=>a=!1)),r.$set(_)},i(h){u||(O(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(k(e),k(o)),q(r,h),f=!1,c()}}}function qN(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,g,_,y,S=(n[1].possibleProxyHeader||"N/A")+"",T,$,E,M,L,I,A,P,R,N,U,j,V;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[RN,({uniqueId:K})=>({16:K}),({uniqueId:K})=>K?65536:0]},$$scope:{ctx:n}}}),N=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[FN,({uniqueId:K})=>({16:K}),({uniqueId:K})=>K?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=Y(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=C(),y=b("strong"),T=Y(S),$=C(),E=b("div"),E.innerHTML=`<p>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).</p> <p>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.</p> <p class="txt-bold">When using such proxy, to avoid spoofing it is recommended to:</p> <ul class="m-t-0 txt-bold"><li>use headers that are controlled only by the proxy and cannot be manually set by the users</li> <li>make sure that the PocketBase server can be accessed only through the proxy</li></ul> <p>You can clear the headers field if PocketBase is not deployed behind a proxy.</p>`,M=C(),L=b("div"),I=b("div"),H(A.$$.fragment),P=C(),R=b("div"),H(N.$$.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(E,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(R,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(K,J){v(K,e,J),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,g),w(h,_),w(h,y),w(y,T),v(K,$,J),v(K,E,J),v(K,M,J),v(K,L,J),w(L,I),F(A,I,null),w(L,P),w(L,R),F(N,R,null),U=!0,j||(V=Me(He.call(null,f,`Must show your actual IP.
 If not, set the correct proxy header.`)),j=!0)},p(K,J){(!U||J&2)&&r!==(r=(K[1].realIP||"N/A")+"")&&ue(a,r),(!U||J&2)&&S!==(S=(K[1].possibleProxyHeader||"N/A")+"")&&ue(T,S);const ee={};J&1114117&&(ee.$$scope={dirty:J,ctx:K}),A.$set(ee);const X={};J&1114113&&(X.$$scope={dirty:J,ctx:K}),N.$set(X)},i(K){U||(O(A.$$.fragment,K),O(N.$$.fragment,K),U=!0)},o(K){D(A.$$.fragment,K),D(N.$$.fragment,K),U=!1},d(K){K&&(k(e),k($),k(E),k(M),k(L)),q(A),q(N),j=!1,V()}}}function HN(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){v(l,e,s),t||(i=Me(He.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&k(e),t=!1,i()}}}function jN(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){v(l,e,s),t||(i=Me(He.call(null,e,`Detected proxy header.
-It is recommend to list it as trusted.`)),t=!0)},d(l){l&&k(e),t=!1,i()}}}function zN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function UN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function c1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function VN(n){let e,t,i,l,s,o,r,a,u,f,c;function d(T,$){if($&43&&(o=null),!T[3]&&T[1].possibleProxyHeader)return jN;if(o==null&&(o=!!(T[3]&&!T[5]&&!T[0].trustedProxy.headers.includes(T[1].possibleProxyHeader))),o)return HN}let m=d(n,-1),h=m&&m(n);function g(T,$){return T[3]?UN:zN}let _=g(n),y=_(n),S=n[4]&&c1();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(),y.c(),f=C(),S&&S.c(),c=ge(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m(T,$){v(T,e,$),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v(T,r,$),v(T,a,$),v(T,u,$),y.m(T,$),v(T,f,$),S&&S.m(T,$),v(T,c,$)},p(T,$){m!==(m=d(T,$))&&(h&&h.d(1),h=m&&m(T),h&&(h.c(),h.m(e,null))),_!==(_=g(T))&&(y.d(1),y=_(T),y&&(y.c(),y.m(f.parentNode,f))),T[4]?S?$&16&&O(S,1):(S=c1(),S.c(),O(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d(T){T&&(k(e),k(r),k(a),k(u),k(f),k(c)),h&&h.d(),y.d(T),S&&S.d(T)}}}function BN(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[VN],default:[qN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function WN(n,e,t){let i,l,s,o,r,a;Qe(n,Sn,T=>t(10,a=T));const u=["X-Forward-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m(T){t(0,f.trustedProxy.headers=[T],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g(T){n.$$.not_equal(f.trustedProxy.headers,T)&&(f.trustedProxy.headers=T,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),y=T=>m(T);function S(T){n.$$.not_equal(f.trustedProxy.useLeftmostIP,T)&&(f.trustedProxy.useLeftmostIP=T,t(0,f))}return n.$$set=T=>{"formSettings"in T&&t(0,f=T.formSettings),"healthData"in T&&t(1,c=T.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=!z.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!z.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter(T=>T!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,y,S]}class YN extends ye{constructor(e){super(),be(this,e,WN,BN,_e,{formSettings:0,healthData:1})}}function d1(n,e,t){const i=n.slice();return i[5]=e[t],i}function p1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=Y(t),e.__value=l=n[5].value,ce(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&ue(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,ce(e,e.__value))},d(s){s&&k(e)}}}function KN(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<r.length;c+=1)a=je(a,r[c]);let u=pe(n[1]),f=[];for(let c=0;c<u.length;c+=1)f[c]=p1(d1(n,u,c));return{c(){e=b("input"),i=C(),l=b("datalist");for(let c=0;c<f.length;c+=1)f[c].c();Xn(e,a),p(l,"id",n[2])},m(c,d){v(c,e,d),"value"in a&&(e.value=a.value),e.autofocus&&e.focus(),v(c,i,d),v(c,l,d);for(let m=0;m<f.length;m+=1)f[m]&&f[m].m(l,null);s||(o=B(e,"input",n[4]),s=!0)},p(c,[d]){if(Xn(e,a=vt(r,[d&8&&t!==(t=c[3].type||"text")&&{type:t},{list:c[2]},d&1&&e.value!==c[0]&&{value:c[0]},d&8&&c[3]])),"value"in a&&(e.value=a.value),d&2){u=pe(c[1]);let m;for(m=0;m<u.length;m+=1){const h=d1(c,u,m);f[m]?f[m].p(h,d):(f[m]=p1(h),f[m].c(),f[m].m(l,null))}for(;m<f.length;m+=1)f[m].d(1);f.length=u.length}},i:te,o:te,d(c){c&&(k(e),k(i),k(l)),pt(f,c),s=!1,o()}}}function JN(n,e,t){const i=["value","options"];let l=lt(e,i),{value:s=""}=e,{options:o=[]}=e;const r="list_"+z.randomString(5),a=u=>{t(0,s=u.target.value)};return n.$$set=u=>{e=je(je({},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 ZN extends ye{constructor(e){super(),be(this,e,JN,KN,_e,{value:0,options:1})}}function m1(n,e,t){const i=n.slice();return i[15]=e[t],i[16]=e,i[17]=t,i}function GN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(l,"for",o=n[18])},m(u,f){v(u,e,f),e.checked=n[0].rateLimits.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function h1(n){let e,t,i,l,s,o=pe(n[0].rateLimits.rules||[]),r=[];for(let u=0;u<o.length;u+=1)r[u]=_1(m1(n,o,u));const a=u=>D(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML="<tr><th>Rate limit label</th> <th>Max requests (per IP)</th> <th>Interval (in seconds)</th> <th></th></tr>",i=C(),l=b("tbody");for(let u=0;u<r.length;u+=1)r[u].c();p(e,"class","rate-limit-table")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l);for(let c=0;c<r.length;c+=1)r[c]&&r[c].m(l,null);s=!0},p(u,f){if(f&37){o=pe(u[0].rateLimits.rules||[]);let c;for(c=0;c<o.length;c+=1){const d=m1(u,o,c);r[c]?(r[c].p(d,f),O(r[c],1)):(r[c]=_1(d),r[c].c(),O(r[c],1),r[c].m(l,null))}for(re(),c=o.length;c<r.length;c+=1)a(c);ae()}},i(u){if(!s){for(let f=0;f<o.length;f+=1)O(r[f]);s=!0}},o(u){r=r.filter(Boolean);for(let f=0;f<r.length;f+=1)D(r[f]);s=!1},d(u){u&&k(e),pt(r,u)}}}function XN(n){let e,t,i;function l(o){n[7](o,n[15])}let s={required:!0,placeholder:"tag (users:create) or path (/api/)",options:n[2]};return n[15].label!==void 0&&(s.value=n[15].label),e=new ZN({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function QN(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){v(s,e,o),ce(e,n[15].maxRequests),t||(i=B(e,"input",l),t=!0)},p(s,o){n=s,o&1&&yt(e.value)!==n[15].maxRequests&&ce(e,n[15].maxRequests)},d(s){s&&k(e),t=!1,i()}}}function xN(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){v(s,e,o),ce(e,n[15].duration),t||(i=B(e,"input",l),t=!0)},p(s,o){n=s,o&1&&yt(e.value)!==n[15].duration&&ce(e,n[15].duration)},d(s){s&&k(e),t=!1,i()}}}function _1(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:[XN]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".maxRequests",inlineError:!0,$$slots:{default:[QN]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".duration",inlineError:!0,$$slots:{default:[xN]},$$scope:{ctx:n}}});function y(){return n[10](n[17])}return{c(){e=b("tr"),t=b("td"),H(i.$$.fragment),l=C(),s=b("td"),H(o.$$.fragment),r=C(),a=b("td"),H(u.$$.fragment),f=C(),c=b("td"),d=b("button"),d.innerHTML='<i class="ri-close-line"></i>',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,T){v(S,e,T),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),w(c,d),w(e,m),h=!0,g||(_=B(d,"click",y),g=!0)},p(S,T){n=S;const $={};T&524293&&($.$$scope={dirty:T,ctx:n}),i.$set($);const E={};T&524289&&(E.$$scope={dirty:T,ctx:n}),o.$set(E);const M={};T&524289&&(M.$$scope={dirty:T,ctx:n}),u.$set(M)},i(S){h||(O(i.$$.fragment,S),O(o.$$.fragment,S),O(u.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),D(o.$$.fragment,S),D(u.$$.fragment,S),h=!1},d(S){S&&k(e),q(i),q(o),q(u),g=!1,_()}}}function e7(n){let e,t,i=!z.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:[GN,({uniqueId:m})=>({18:m}),({uniqueId:m})=>m?262144:0]},$$scope:{ctx:n}}});let d=i&&h1(n);return{c(){var m,h,g;H(e.$$.fragment),t=C(),d&&d.c(),l=C(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add rate limit rule</span>',r=C(),a=b("a"),a.innerHTML="<em>Learn more about the rate limit rules</em>",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),x(o,"btn-danger",(g=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:g.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){F(e,m,h),v(m,t,h),d&&d.m(m,h),v(m,l,h),v(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 _,y,S;const g={};h&786433&&(g.$$scope={dirty:h,ctx:m}),e.$set(g),h&1&&(i=!z.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&O(d,1)):(d=h1(m),d.c(),O(d,1),d.m(l.parentNode,l)):d&&(re(),D(d,1,1,()=>{d=null}),ae()),(!u||h&2)&&x(o,"btn-danger",(S=(y=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:y.rules)==null?void 0:S.message)},i(m){u||(O(e.$$.fragment,m),O(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(k(t),k(l),k(s)),q(e,m),d&&d.d(m),f=!1,c()}}}function g1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function t7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function n7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function i7(n){let e,t,i,l,s,o,r=n[3]&&g1();function a(c,d){return c[0].rateLimits.enabled?n7:t7}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML='<i class="ri-pulse-fill"></i> <span class="txt">Rate limiting</span>',t=C(),i=b("div"),l=C(),r&&r.c(),s=C(),f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),r&&r.m(c,d),v(c,s,d),f.m(c,d),v(c,o,d)},p(c,d){c[3]?r?d&8&&O(r,1):(r=g1(),r.c(),O(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),r&&r.d(c),f.d(c)}}}function l7(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[i7],default:[e7]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&524303&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s7(n,e,t){let i,l,s;Qe(n,En,S=>t(12,l=S)),Qe(n,Sn,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(T=>T.type=="file")&&a.push({value:S.name+":file"}));t(2,a=a.concat(r))}function f(){Wt({}),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){Wt({}),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,T){n.$$.not_equal(T.label,S)&&(T.label=S,t(0,o))}function h(S,T){S[T].maxRequests=yt(this.value),t(0,o)}function g(S,T){S[T].duration=yt(this.value),t(0,o)}const _=S=>c(S),y=()=>f();return n.$$set=S=>{"formSettings"in S&&t(0,o=S.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=!z.isEmpty(s==null?void 0:s.rateLimits))},[o,s,a,i,f,c,d,m,h,g,_,y]}class o7 extends ye{constructor(e){super(),be(this,e,s7,l7,_e,{formSettings:0})}}function r7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U,j,V;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[u7,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[f7,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});function K(Ce){n[11](Ce)}let J={healthData:n[3]};n[0]!==void 0&&(J.formSettings=n[0]),f=new YN({props:J}),ie.push(()=>ve(f,"formSettings",K));function ee(Ce){n[12](Ce)}let X={};n[0]!==void 0&&(X.formSettings=n[0]),m=new o7({props:X}),ie.push(()=>ve(m,"formSettings",ee));function oe(Ce){n[13](Ce)}let Se={};n[0]!==void 0&&(Se.formSettings=n[0]),_=new NN({props:Se}),ie.push(()=>ve(_,"formSettings",oe)),$=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[c7,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});let ke=n[4]&&b1(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),u=b("div"),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),H(_.$$.fragment),S=C(),T=b("div"),H($.$$.fragment),E=C(),M=b("div"),L=b("div"),I=C(),ke&&ke.c(),A=C(),P=b("button"),R=b("span"),R.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(T,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(R,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=N=!n[4]||n[2],x(P,"btn-loading",n[2]),p(M,"class","flex m-t-base")},m(Ce,We){v(Ce,e,We),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),w(a,u),F(f,u,null),w(u,d),F(m,u,null),w(u,g),F(_,u,null),w(e,S),w(e,T),F($,T,null),v(Ce,E,We),v(Ce,M,We),w(M,L),w(M,I),ke&&ke.m(M,null),w(M,A),w(M,P),w(P,R),U=!0,j||(V=B(P,"click",n[16]),j=!0)},p(Ce,We){const st={};We&25165825&&(st.$$scope={dirty:We,ctx:Ce}),i.$set(st);const et={};We&25165825&&(et.$$scope={dirty:We,ctx:Ce}),o.$set(et);const Be={};We&8&&(Be.healthData=Ce[3]),!c&&We&1&&(c=!0,Be.formSettings=Ce[0],$e(()=>c=!1)),f.$set(Be);const rt={};!h&&We&1&&(h=!0,rt.formSettings=Ce[0],$e(()=>h=!1)),m.$set(rt);const Je={};!y&&We&1&&(y=!0,Je.formSettings=Ce[0],$e(()=>y=!1)),_.$set(Je);const at={};We&25165825&&(at.$$scope={dirty:We,ctx:Ce}),$.$set(at),Ce[4]?ke?ke.p(Ce,We):(ke=b1(Ce),ke.c(),ke.m(M,A)):ke&&(ke.d(1),ke=null),(!U||We&20&&N!==(N=!Ce[4]||Ce[2]))&&(P.disabled=N),(!U||We&4)&&x(P,"btn-loading",Ce[2])},i(Ce){U||(O(i.$$.fragment,Ce),O(o.$$.fragment,Ce),O(f.$$.fragment,Ce),O(m.$$.fragment,Ce),O(_.$$.fragment,Ce),O($.$$.fragment,Ce),U=!0)},o(Ce){D(i.$$.fragment,Ce),D(o.$$.fragment,Ce),D(f.$$.fragment,Ce),D(m.$$.fragment,Ce),D(_.$$.fragment,Ce),D($.$$.fragment,Ce),U=!1},d(Ce){Ce&&(k(e),k(E),k(M)),q(i),q(o),q(f),q(m),q(_),q($),ke&&ke.d(),j=!1,V()}}}function a7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function u7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function f7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function c7(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){v(c,e,d),e.checked=n[0].meta.hideControls,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[14]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function b1(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){v(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&&k(e),i=!1,l()}}}function d7(n){let e,t,i,l,s,o,r,a,u;const f=[a7,r7],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='<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div> <div class="breadcrumb-item">Application</div></nav>',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){v(m,e,h),v(m,t,h),v(m,i,h),w(i,l),c[s].m(l,null),r=!0,a||(u=B(l,"submit",tt(n[5])),a=!0)},p(m,h){let g=s;s=d(m),s===g?c[s].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),O(o,1),o.m(l,null))},i(m){r||(O(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(k(e),k(t),k(i)),c[s].d(),a=!1,u()}}}function p7(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[d7]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function m7(n,e,t){let i,l,s,o;Qe(n,Dl,P=>t(17,l=P)),Qe(n,_r,P=>t(18,s=P)),Qe(n,cn,P=>t(19,o=P)),Nn(cn,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(R){console.warn("Health check failed:",R)}}async function h(){t(1,u=!0);try{const P=await me.settings.getAll()||{};_(P),await m()}catch(P){me.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0);try{const P=await me.settings.update(z.filterRedactedProps(a));_(P),await m(),tn("Successfully saved application settings.")}catch(P){me.error(P)}t(2,f=!1)}}function _(P={}){var R,N;Nn(_r,s=(R=P==null?void 0:P.meta)==null?void 0:R.appName,s),Nn(Dl,l=!!((N=P==null?void 0:P.meta)!=null&&N.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 y(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function T(){a.meta.appURL=this.value,t(0,a)}function $(P){a=P,t(0,a)}function E(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=()=>y(),A=()=>g();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,g,y,r,c,S,T,$,E,M,L,I,A]}class h7 extends ye{constructor(e){super(),be(this,e,m7,p7,_e,{})}}function _7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[2]),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function g7(n){let e,t,i,l,s,o,r;return l=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[_7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
+It is recommend to list it as trusted.`)),t=!0)},d(l){l&&k(e),t=!1,i()}}}function zN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function UN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function c1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function VN(n){let e,t,i,l,s,o,r,a,u,f,c;function d(T,$){if($&43&&(o=null),!T[3]&&T[1].possibleProxyHeader)return jN;if(o==null&&(o=!!(T[3]&&!T[5]&&!T[0].trustedProxy.headers.includes(T[1].possibleProxyHeader))),o)return HN}let m=d(n,-1),h=m&&m(n);function g(T,$){return T[3]?UN:zN}let _=g(n),y=_(n),S=n[4]&&c1();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(),y.c(),f=C(),S&&S.c(),c=ge(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m(T,$){v(T,e,$),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v(T,r,$),v(T,a,$),v(T,u,$),y.m(T,$),v(T,f,$),S&&S.m(T,$),v(T,c,$)},p(T,$){m!==(m=d(T,$))&&(h&&h.d(1),h=m&&m(T),h&&(h.c(),h.m(e,null))),_!==(_=g(T))&&(y.d(1),y=_(T),y&&(y.c(),y.m(f.parentNode,f))),T[4]?S?$&16&&O(S,1):(S=c1(),S.c(),O(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d(T){T&&(k(e),k(r),k(a),k(u),k(f),k(c)),h&&h.d(),y.d(T),S&&S.d(T)}}}function BN(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[VN],default:[qN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function WN(n,e,t){let i,l,s,o,r,a;Qe(n,Sn,T=>t(10,a=T));const u=["X-Forward-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m(T){t(0,f.trustedProxy.headers=[T],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g(T){n.$$.not_equal(f.trustedProxy.headers,T)&&(f.trustedProxy.headers=T,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),y=T=>m(T);function S(T){n.$$.not_equal(f.trustedProxy.useLeftmostIP,T)&&(f.trustedProxy.useLeftmostIP=T,t(0,f))}return n.$$set=T=>{"formSettings"in T&&t(0,f=T.formSettings),"healthData"in T&&t(1,c=T.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=!z.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!z.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter(T=>T!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,y,S]}class YN extends ye{constructor(e){super(),be(this,e,WN,BN,_e,{formSettings:0,healthData:1})}}function d1(n,e,t){const i=n.slice();return i[5]=e[t],i}function p1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=Y(t),e.__value=l=n[5].value,ce(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&ue(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,ce(e,e.__value))},d(s){s&&k(e)}}}function KN(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<r.length;c+=1)a=je(a,r[c]);let u=pe(n[1]),f=[];for(let c=0;c<u.length;c+=1)f[c]=p1(d1(n,u,c));return{c(){e=b("input"),i=C(),l=b("datalist");for(let c=0;c<f.length;c+=1)f[c].c();Xn(e,a),p(l,"id",n[2])},m(c,d){v(c,e,d),"value"in a&&(e.value=a.value),e.autofocus&&e.focus(),v(c,i,d),v(c,l,d);for(let m=0;m<f.length;m+=1)f[m]&&f[m].m(l,null);s||(o=B(e,"input",n[4]),s=!0)},p(c,[d]){if(Xn(e,a=vt(r,[d&8&&t!==(t=c[3].type||"text")&&{type:t},{list:c[2]},d&1&&e.value!==c[0]&&{value:c[0]},d&8&&c[3]])),"value"in a&&(e.value=a.value),d&2){u=pe(c[1]);let m;for(m=0;m<u.length;m+=1){const h=d1(c,u,m);f[m]?f[m].p(h,d):(f[m]=p1(h),f[m].c(),f[m].m(l,null))}for(;m<f.length;m+=1)f[m].d(1);f.length=u.length}},i:te,o:te,d(c){c&&(k(e),k(i),k(l)),pt(f,c),s=!1,o()}}}function JN(n,e,t){const i=["value","options"];let l=lt(e,i),{value:s=""}=e,{options:o=[]}=e;const r="list_"+z.randomString(5),a=u=>{t(0,s=u.target.value)};return n.$$set=u=>{e=je(je({},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 ZN extends ye{constructor(e){super(),be(this,e,JN,KN,_e,{value:0,options:1})}}function m1(n,e,t){const i=n.slice();return i[15]=e[t],i[16]=e,i[17]=t,i}function GN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(l,"for",o=n[18])},m(u,f){v(u,e,f),e.checked=n[0].rateLimits.enabled,v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function h1(n){let e,t,i,l,s,o=pe(n[0].rateLimits.rules||[]),r=[];for(let u=0;u<o.length;u+=1)r[u]=_1(m1(n,o,u));const a=u=>D(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML="<tr><th>Rate limit label</th> <th>Max requests (per IP)</th> <th>Interval (in seconds)</th> <th></th></tr>",i=C(),l=b("tbody");for(let u=0;u<r.length;u+=1)r[u].c();p(e,"class","rate-limit-table")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l);for(let c=0;c<r.length;c+=1)r[c]&&r[c].m(l,null);s=!0},p(u,f){if(f&37){o=pe(u[0].rateLimits.rules||[]);let c;for(c=0;c<o.length;c+=1){const d=m1(u,o,c);r[c]?(r[c].p(d,f),O(r[c],1)):(r[c]=_1(d),r[c].c(),O(r[c],1),r[c].m(l,null))}for(re(),c=o.length;c<r.length;c+=1)a(c);ae()}},i(u){if(!s){for(let f=0;f<o.length;f+=1)O(r[f]);s=!0}},o(u){r=r.filter(Boolean);for(let f=0;f<r.length;f+=1)D(r[f]);s=!1},d(u){u&&k(e),pt(r,u)}}}function XN(n){let e,t,i;function l(o){n[7](o,n[15])}let s={required:!0,placeholder:"tag (users:create) or path (/api/)",options:n[2]};return n[15].label!==void 0&&(s.value=n[15].label),e=new ZN({props:s}),ie.push(()=>ve(e,"value",l)),{c(){H(e.$$.fragment)},m(o,r){F(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function QN(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){v(s,e,o),ce(e,n[15].maxRequests),t||(i=B(e,"input",l),t=!0)},p(s,o){n=s,o&1&&_t(e.value)!==n[15].maxRequests&&ce(e,n[15].maxRequests)},d(s){s&&k(e),t=!1,i()}}}function xN(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){v(s,e,o),ce(e,n[15].duration),t||(i=B(e,"input",l),t=!0)},p(s,o){n=s,o&1&&_t(e.value)!==n[15].duration&&ce(e,n[15].duration)},d(s){s&&k(e),t=!1,i()}}}function _1(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:[XN]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".maxRequests",inlineError:!0,$$slots:{default:[QN]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[17]+".duration",inlineError:!0,$$slots:{default:[xN]},$$scope:{ctx:n}}});function y(){return n[10](n[17])}return{c(){e=b("tr"),t=b("td"),H(i.$$.fragment),l=C(),s=b("td"),H(o.$$.fragment),r=C(),a=b("td"),H(u.$$.fragment),f=C(),c=b("td"),d=b("button"),d.innerHTML='<i class="ri-close-line"></i>',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,T){v(S,e,T),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),w(c,d),w(e,m),h=!0,g||(_=B(d,"click",y),g=!0)},p(S,T){n=S;const $={};T&524293&&($.$$scope={dirty:T,ctx:n}),i.$set($);const E={};T&524289&&(E.$$scope={dirty:T,ctx:n}),o.$set(E);const M={};T&524289&&(M.$$scope={dirty:T,ctx:n}),u.$set(M)},i(S){h||(O(i.$$.fragment,S),O(o.$$.fragment,S),O(u.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),D(o.$$.fragment,S),D(u.$$.fragment,S),h=!1},d(S){S&&k(e),q(i),q(o),q(u),g=!1,_()}}}function e7(n){let e,t,i=!z.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:[GN,({uniqueId:m})=>({18:m}),({uniqueId:m})=>m?262144:0]},$$scope:{ctx:n}}});let d=i&&h1(n);return{c(){var m,h,g;H(e.$$.fragment),t=C(),d&&d.c(),l=C(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add rate limit rule</span>',r=C(),a=b("a"),a.innerHTML="<em>Learn more about the rate limit rules</em>",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),x(o,"btn-danger",(g=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:g.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){F(e,m,h),v(m,t,h),d&&d.m(m,h),v(m,l,h),v(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 _,y,S;const g={};h&786433&&(g.$$scope={dirty:h,ctx:m}),e.$set(g),h&1&&(i=!z.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&O(d,1)):(d=h1(m),d.c(),O(d,1),d.m(l.parentNode,l)):d&&(re(),D(d,1,1,()=>{d=null}),ae()),(!u||h&2)&&x(o,"btn-danger",(S=(y=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:y.rules)==null?void 0:S.message)},i(m){u||(O(e.$$.fragment,m),O(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(k(t),k(l),k(s)),q(e,m),d&&d.d(m),f=!1,c()}}}function g1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(He.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=ze(e,Mt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=ze(e,Mt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function t7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function n7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function i7(n){let e,t,i,l,s,o,r=n[3]&&g1();function a(c,d){return c[0].rateLimits.enabled?n7:t7}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML='<i class="ri-pulse-fill"></i> <span class="txt">Rate limiting</span>',t=C(),i=b("div"),l=C(),r&&r.c(),s=C(),f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),r&&r.m(c,d),v(c,s,d),f.m(c,d),v(c,o,d)},p(c,d){c[3]?r?d&8&&O(r,1):(r=g1(),r.c(),O(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(k(e),k(t),k(i),k(l),k(s),k(o)),r&&r.d(c),f.d(c)}}}function l7(n){let e,t;return e=new qi({props:{single:!0,$$slots:{header:[i7],default:[e7]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&524303&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s7(n,e,t){let i,l,s;Qe(n,En,S=>t(12,l=S)),Qe(n,Sn,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(T=>T.type=="file")&&a.push({value:S.name+":file"}));t(2,a=a.concat(r))}function f(){Wt({}),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){Wt({}),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,T){n.$$.not_equal(T.label,S)&&(T.label=S,t(0,o))}function h(S,T){S[T].maxRequests=_t(this.value),t(0,o)}function g(S,T){S[T].duration=_t(this.value),t(0,o)}const _=S=>c(S),y=()=>f();return n.$$set=S=>{"formSettings"in S&&t(0,o=S.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=!z.isEmpty(s==null?void 0:s.rateLimits))},[o,s,a,i,f,c,d,m,h,g,_,y]}class o7 extends ye{constructor(e){super(),be(this,e,s7,l7,_e,{formSettings:0})}}function r7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U,j,V;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[u7,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[f7,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});function K(Ce){n[11](Ce)}let J={healthData:n[3]};n[0]!==void 0&&(J.formSettings=n[0]),f=new YN({props:J}),ie.push(()=>ve(f,"formSettings",K));function ee(Ce){n[12](Ce)}let X={};n[0]!==void 0&&(X.formSettings=n[0]),m=new o7({props:X}),ie.push(()=>ve(m,"formSettings",ee));function oe(Ce){n[13](Ce)}let Se={};n[0]!==void 0&&(Se.formSettings=n[0]),_=new NN({props:Se}),ie.push(()=>ve(_,"formSettings",oe)),$=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[c7,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});let ke=n[4]&&b1(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),u=b("div"),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),H(_.$$.fragment),S=C(),T=b("div"),H($.$$.fragment),E=C(),M=b("div"),L=b("div"),I=C(),ke&&ke.c(),A=C(),P=b("button"),R=b("span"),R.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(T,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(R,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=N=!n[4]||n[2],x(P,"btn-loading",n[2]),p(M,"class","flex m-t-base")},m(Ce,We){v(Ce,e,We),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),w(a,u),F(f,u,null),w(u,d),F(m,u,null),w(u,g),F(_,u,null),w(e,S),w(e,T),F($,T,null),v(Ce,E,We),v(Ce,M,We),w(M,L),w(M,I),ke&&ke.m(M,null),w(M,A),w(M,P),w(P,R),U=!0,j||(V=B(P,"click",n[16]),j=!0)},p(Ce,We){const st={};We&25165825&&(st.$$scope={dirty:We,ctx:Ce}),i.$set(st);const et={};We&25165825&&(et.$$scope={dirty:We,ctx:Ce}),o.$set(et);const Be={};We&8&&(Be.healthData=Ce[3]),!c&&We&1&&(c=!0,Be.formSettings=Ce[0],$e(()=>c=!1)),f.$set(Be);const rt={};!h&&We&1&&(h=!0,rt.formSettings=Ce[0],$e(()=>h=!1)),m.$set(rt);const Je={};!y&&We&1&&(y=!0,Je.formSettings=Ce[0],$e(()=>y=!1)),_.$set(Je);const at={};We&25165825&&(at.$$scope={dirty:We,ctx:Ce}),$.$set(at),Ce[4]?ke?ke.p(Ce,We):(ke=b1(Ce),ke.c(),ke.m(M,A)):ke&&(ke.d(1),ke=null),(!U||We&20&&N!==(N=!Ce[4]||Ce[2]))&&(P.disabled=N),(!U||We&4)&&x(P,"btn-loading",Ce[2])},i(Ce){U||(O(i.$$.fragment,Ce),O(o.$$.fragment,Ce),O(f.$$.fragment,Ce),O(m.$$.fragment,Ce),O(_.$$.fragment,Ce),O($.$$.fragment,Ce),U=!0)},o(Ce){D(i.$$.fragment,Ce),D(o.$$.fragment,Ce),D(f.$$.fragment,Ce),D(m.$$.fragment,Ce),D(_.$$.fragment,Ce),D($.$$.fragment,Ce),U=!1},d(Ce){Ce&&(k(e),k(E),k(M)),q(i),q(o),q(f),q(m),q(_),q($),ke&&ke.d(),j=!1,V()}}}function a7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function u7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function f7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function c7(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){v(c,e,d),e.checked=n[0].meta.hideControls,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[14]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function b1(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){v(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&&k(e),i=!1,l()}}}function d7(n){let e,t,i,l,s,o,r,a,u;const f=[a7,r7],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='<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div> <div class="breadcrumb-item">Application</div></nav>',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){v(m,e,h),v(m,t,h),v(m,i,h),w(i,l),c[s].m(l,null),r=!0,a||(u=B(l,"submit",tt(n[5])),a=!0)},p(m,h){let g=s;s=d(m),s===g?c[s].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),O(o,1),o.m(l,null))},i(m){r||(O(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(k(e),k(t),k(i)),c[s].d(),a=!1,u()}}}function p7(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[d7]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function m7(n,e,t){let i,l,s,o;Qe(n,Dl,P=>t(17,l=P)),Qe(n,_r,P=>t(18,s=P)),Qe(n,cn,P=>t(19,o=P)),Nn(cn,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(R){console.warn("Health check failed:",R)}}async function h(){t(1,u=!0);try{const P=await me.settings.getAll()||{};_(P),await m()}catch(P){me.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0);try{const P=await me.settings.update(z.filterRedactedProps(a));_(P),await m(),tn("Successfully saved application settings.")}catch(P){me.error(P)}t(2,f=!1)}}function _(P={}){var R,N;Nn(_r,s=(R=P==null?void 0:P.meta)==null?void 0:R.appName,s),Nn(Dl,l=!!((N=P==null?void 0:P.meta)!=null&&N.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 y(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function T(){a.meta.appURL=this.value,t(0,a)}function $(P){a=P,t(0,a)}function E(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=()=>y(),A=()=>g();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,g,y,r,c,S,T,$,E,M,L,I,A]}class h7 extends ye{constructor(e){super(),be(this,e,m7,p7,_e,{})}}function _7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("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){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),ce(s,n[2]),v(c,r,d),v(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&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function g7(n){let e,t,i,l,s,o,r;return l=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[_7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
                 database will be temporary &quot;locked&quot; (this usually happens only during the ZIP generation).</p> <p class="txt-bold">If you are using S3 storage for the collections file upload, you&#39;ll have to backup them
-                separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=C(),i=b("form"),H(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),F(l,i,null),s=!0,o||(r=B(i,"submit",tt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(O(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(t),k(i)),q(l),o=!1,r()}}}function b7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function y7(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],x(l,"btn-loading",n[3])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(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&&x(l,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(l)),o=!1,r()}}}function k7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[y7],header:[b7],default:[g7]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),q(e,l)}}}function v7(n,e,t){const i=_t(),l="backup_create_"+z.randomString(5);let s,o="",r=!1,a;function u(S){Wt({}),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)}}so(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ys("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ys("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Pe.call(this,n,S)}function y(S){Pe.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,g,_,y]}class w7 extends ye{constructor(e){super(),be(this,e,v7,k7,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function S7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function T7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new ai({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[S7,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution and use it only with trusted backups!</p> <p>Backup restore is experimental and works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
+                separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=C(),i=b("form"),H(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),F(l,i,null),s=!0,o||(r=B(i,"submit",tt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(O(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(t),k(i)),q(l),o=!1,r()}}}function b7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function y7(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],x(l,"btn-loading",n[3])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(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&&x(l,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(l)),o=!1,r()}}}function k7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[y7],header:[b7],default:[g7]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),q(e,l)}}}function v7(n,e,t){const i=gt(),l="backup_create_"+z.randomString(5);let s,o="",r=!1,a;function u(S){Wt({}),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)}}so(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ys("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ys("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Pe.call(this,n,S)}function y(S){Pe.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,g,_,y]}class w7 extends ye{constructor(e){super(),be(this,e,v7,k7,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function S7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function T7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new ai({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[S7,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution and use it only with trusted backups!</p> <p>Backup restore is experimental and works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
                 the backup and will restart the application process.</p> <p>This means that on success all of your data (including app settings, users, superusers, etc.) will
                 be replaced with the ones from the backup.</p> <p>Nothing will happen if the backup is invalid or incompatible (ex. missing
                 <code>data.db</code> file).</p></div>`,t=C(),i=b("div"),l=Y(`Type the backup name
         `),s=b("div"),o=b("span"),r=Y(n[1]),a=C(),H(u.$$.fragment),f=Y(`
-        to confirm:`),c=C(),d=b("form"),H(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(y,S){v(y,e,S),v(y,t,S),v(y,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),F(u,s,null),w(i,f),v(y,c,S),v(y,d,S),F(m,d,null),h=!0,g||(_=B(d,"submit",tt(n[7])),g=!0)},p(y,S){(!h||S&2)&&ue(r,y[1]);const T={};S&2&&(T.value=y[1]),u.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(O(u.$$.fragment,y),O(m.$$.fragment,y),h=!0)},o(y){D(u.$$.fragment,y),D(m.$$.fragment,y),h=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),q(u),q(m),g=!1,_()}}}function $7(n){let e,t,i,l;return{c(){e=b("h4"),t=Y("Restore "),i=b("strong"),l=Y(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&ue(l,s[1])},d(s){s&&k(e)}}}function C7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("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],x(l,"btn-loading",n[4])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(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&&x(l,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function O7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[C7],header:[$7],default:[T7]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}function E7(n,e,t){let i;const l="backup_restore_"+z.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Wt({}),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(T){clearTimeout(u),T!=null&&T.isAbort||(t(4,a=!1),$i(((S=T.response)==null?void 0:S.message)||T.message))}}}so(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Pe.call(this,n,S)}function y(S){Pe.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,_,y]}class M7 extends ye{constructor(e){super(),be(this,e,E7,O7,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function y1(n,e,t){const i=n.slice();return i[22]=e[t],i}function k1(n,e,t){const i=n.slice();return i[19]=e[t],i}function D7(n){let e=[],t=new Map,i,l,s=pe(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let u=y1(n,s,a),f=o(u);t.set(f,e[a]=w1(f,u))}let r=null;return s.length||(r=v1()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ge(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);v(a,i,u),r&&r.m(a,u),l=!0},p(a,u){u&876&&(s=pe(a[3]),re(),e=kt(e,u,o,1,a,s,t,i.parentNode,zt,w1,i,y1),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=v1(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)O(e[u]);l=!0}},o(a){for(let u=0;u<e.length;u+=1)D(e[u]);l=!1},d(a){a&&k(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function I7(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=S1(k1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&8){t=pe(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=k1(l,t,o);i[o]?i[o].p(r,s):(i[o]=S1(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(l){l&&k(e),pt(i,l)}}}function v1(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="txt">No backups yet.</span> ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function w1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=z.formattedFileSize(e[22].size)+"",h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U,j,V,K,J;function ee(){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=Y(r),f=C(),c=b("span"),d=Y("("),h=Y(m),g=Y(")"),_=C(),y=b("div"),S=b("button"),T=b("i"),E=C(),M=b("button"),L=b("i"),A=C(),P=b("button"),R=b("i"),U=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(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(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(R,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=N=e[6][e[22].key],p(P,"aria-label","Delete"),x(P,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(Se,ke){v(Se,t,ke),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,g),w(t,_),w(t,y),w(y,S),w(S,T),w(y,E),w(y,M),w(M,L),w(y,A),w(y,P),w(P,R),w(t,U),V=!0,K||(J=[Me(He.call(null,S,"Download")),B(S,"click",tt(ee)),Me(He.call(null,M,"Restore")),B(M,"click",tt(X)),Me(He.call(null,P,"Delete")),B(P,"click",tt(oe))],K=!0)},p(Se,ke){e=Se,(!V||ke&8)&&r!==(r=e[22].key+"")&&ue(a,r),(!V||ke&8&&u!==(u=e[22].key))&&p(o,"title",u),(!V||ke&8)&&m!==(m=z.formattedFileSize(e[22].size)+"")&&ue(h,m),(!V||ke&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!V||ke&40)&&x(S,"btn-loading",e[5][e[22].key]),(!V||ke&72&&I!==(I=e[6][e[22].key]))&&(M.disabled=I),(!V||ke&72&&N!==(N=e[6][e[22].key]))&&(P.disabled=N),(!V||ke&72)&&x(P,"btn-loading",e[6][e[22].key])},i(Se){V||(Se&&nt(()=>{V&&(j||(j=ze(t,wt,{duration:150},!0)),j.run(1))}),V=!0)},o(Se){Se&&(j||(j=ze(t,wt,{duration:150},!1)),j.run(0)),V=!1},d(Se){Se&&k(t),Se&&j&&j.end(),K=!1,De(J)}}}function S1(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="skeleton-loader"></span> ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function L7(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function A7(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function P7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;const _=[I7,D7],y=[];function S(I,A){return I[4]?0:1}i=S(n),l=y[i]=_[i](n);function T(I,A){return I[7]?A7:L7}let $=T(n),E=$(n),M={};f=new w7({props:M}),n[14](f),f.$on("submit",n[15]);let L={};return d=new M7({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=C(),o=b("div"),r=b("button"),E.c(),u=C(),H(f.$$.fragment),c=C(),H(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){v(I,e,A),w(e,t),y[i].m(t,null),w(e,s),w(e,o),w(o,r),E.m(r,null),v(I,u,A),F(f,I,A),v(I,c,A),F(d,I,A),m=!0,h||(g=B(r,"click",n[13]),h=!0)},p(I,[A]){let P=i;i=S(I),i===P?y[i].p(I,A):(re(),D(y[P],1,1,()=>{y[P]=null}),ae(),l=y[i],l?l.p(I,A):(l=y[i]=_[i](I),l.c()),O(l,1),l.m(t,null)),$!==($=T(I))&&(E.d(1),E=$(I),E&&(E.c(),E.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const R={};f.$set(R);const N={};d.$set(N)},i(I){m||(O(l),O(f.$$.fragment,I),O(d.$$.fragment,I),m=!0)},o(I){D(l),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(k(e),k(u),k(c)),y[i].d(),E.d(),n[14](null),q(f,I),n[16](null),q(d,I),h=!1,g()}}}function N7(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.modified<L.modified?1:M.modified>L.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);z.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),z.removeByKey(s,"name",M),f(),tn(`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{}}Yt(()=>{let M=setInterval(()=>{h()},3e3);return()=>{clearInterval(M)}});const g=M=>c(M.key),_=M=>l.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function T(M){ie[M?"unshift":"push"](()=>{i=M,t(1,i)})}const $=()=>{f()};function E(M){ie[M?"unshift":"push"](()=>{l=M,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,g,_,y,S,T,$,E]}class R7 extends ye{constructor(e){super(),be(this,e,N7,P7,_e,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const F7=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),T1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function q7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[0].enabled,v(u,i,f),v(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&&ue(s,u[4]),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function $1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[H7,({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:[j7,({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:[z7,({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:[U7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[V7,({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:[B7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("div"),H(g.$$.fragment),_=C(),y=b("div"),H(S.$$.fragment),T=C(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(L,I){v(L,e,I),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),F(d,c,null),w(e,m),w(e,h),F(g,h,null),w(e,_),w(e,y),F(S,y,null),w(e,T),w(e,$),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 R={};I&8&&(R.name=L[3]+".region"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),u.$set(R);const N={};I&8&&(N.name=L[3]+".accessKey"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),d.$set(N);const U={};I&8&&(U.name=L[3]+".secret"),I&8519713&&(U.$$scope={dirty:I,ctx:L}),g.$set(U);const j={};I&8&&(j.name=L[3]+".forcePathStyle"),I&8519681&&(j.$$scope={dirty:I,ctx:L}),S.$set(j)},i(L){M||(O(i.$$.fragment,L),O(o.$$.fragment,L),O(u.$$.fragment,L),O(d.$$.fragment,L),O(g.$$.fragment,L),O(S.$$.fragment,L),L&&nt(()=>{M&&(E||(E=ze(e,wt,{duration:150},!0)),E.run(1))}),M=!0)},o(L){D(i.$$.fragment,L),D(o.$$.fragment,L),D(u.$$.fragment,L),D(d.$$.fragment,L),D(g.$$.fragment,L),D(S.$$.fragment,L),L&&(E||(E=ze(e,wt,{duration:150},!1)),E.run(0)),M=!1},d(L){L&&k(e),q(i),q(o),q(u),q(d),q(g),q(S),L&&E&&E.end()}}}function H7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function j7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function z7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function U7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function V7(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(()=>ve(s,"mask",u)),ie.push(()=>ve(s,"value",f)),{c(){e=b("label"),t=Y("Secret"),l=C(),H(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function B7(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){v(c,e,d),e.checked=n[0].forcePathStyle,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[16]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function W7(n){let e,t,i,l,s;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[q7,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Lt(o,n,n[17],T1);let a=n[0].enabled&&$1(n);return{c(){H(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),l=ge()},m(u,f){F(e,u,f),v(u,t,f),r&&r.m(u,f),v(u,i,f),a&&a.m(u,f),v(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)&&Pt(r,o,u,u[17],s?At(o,u[17],f,F7):Nt(u[17]),T1),u[0].enabled?a?(a.p(u,f),f&1&&O(a,1)):(a=$1(u),a.c(),O(a,1),a.m(l.parentNode,l)):a&&(re(),D(a,1,1,()=>{a=null}),ae())},i(u){s||(O(e.$$.fragment,u),O(r,u),O(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(k(t),k(i),k(l)),q(e,u),r&&r.d(u),a&&a.d(u)}}}const Aa="s3_test_request";function Y7(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 g(){t(5,h=!!(s!=null&&s.accessKey))}function _(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{y()},P)}async function y(){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(R){P=R}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}Yt(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function T(){o.endpoint=this.value,t(0,o)}function $(){o.bucket=this.value,t(0,o)}function E(){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||fi(r))},[o,f,c,r,a,h,s,u,i,S,T,$,E,M,L,I,A,l]}class uk extends ye{constructor(e){super(),be(this,e,Y7,W7,_e,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function K7(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"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){v(a,e,u),w(e,t),v(a,l,u),v(a,s,u),n[5](s),o||(r=[Me(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&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(k(e),k(l),k(s)),n[5](null),o=!1,De(r)}}}const C1="upload_backup";function J7(n,e,t){const i=_t();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.
+        to confirm:`),c=C(),d=b("form"),H(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(y,S){v(y,e,S),v(y,t,S),v(y,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),F(u,s,null),w(i,f),v(y,c,S),v(y,d,S),F(m,d,null),h=!0,g||(_=B(d,"submit",tt(n[7])),g=!0)},p(y,S){(!h||S&2)&&ue(r,y[1]);const T={};S&2&&(T.value=y[1]),u.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(O(u.$$.fragment,y),O(m.$$.fragment,y),h=!0)},o(y){D(u.$$.fragment,y),D(m.$$.fragment,y),h=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),q(u),q(m),g=!1,_()}}}function $7(n){let e,t,i,l;return{c(){e=b("h4"),t=Y("Restore "),i=b("strong"),l=Y(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&ue(l,s[1])},d(s){s&&k(e)}}}function C7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("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],x(l,"btn-loading",n[4])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(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&&x(l,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function O7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[C7],header:[$7],default:[T7]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(l,s){F(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||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}function E7(n,e,t){let i;const l="backup_restore_"+z.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Wt({}),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(T){clearTimeout(u),T!=null&&T.isAbort||(t(4,a=!1),$i(((S=T.response)==null?void 0:S.message)||T.message))}}}so(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Pe.call(this,n,S)}function y(S){Pe.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,_,y]}class M7 extends ye{constructor(e){super(),be(this,e,E7,O7,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function y1(n,e,t){const i=n.slice();return i[22]=e[t],i}function k1(n,e,t){const i=n.slice();return i[19]=e[t],i}function D7(n){let e=[],t=new Map,i,l,s=pe(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let u=y1(n,s,a),f=o(u);t.set(f,e[a]=w1(f,u))}let r=null;return s.length||(r=v1()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ge(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);v(a,i,u),r&&r.m(a,u),l=!0},p(a,u){u&876&&(s=pe(a[3]),re(),e=kt(e,u,o,1,a,s,t,i.parentNode,zt,w1,i,y1),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=v1(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)O(e[u]);l=!0}},o(a){for(let u=0;u<e.length;u+=1)D(e[u]);l=!1},d(a){a&&k(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function I7(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=S1(k1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&8){t=pe(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=k1(l,t,o);i[o]?i[o].p(r,s):(i[o]=S1(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(l){l&&k(e),pt(i,l)}}}function v1(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="txt">No backups yet.</span> ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function w1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=z.formattedFileSize(e[22].size)+"",h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U,j,V,K,J;function ee(){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=Y(r),f=C(),c=b("span"),d=Y("("),h=Y(m),g=Y(")"),_=C(),y=b("div"),S=b("button"),T=b("i"),E=C(),M=b("button"),L=b("i"),A=C(),P=b("button"),R=b("i"),U=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(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(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(R,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=N=e[6][e[22].key],p(P,"aria-label","Delete"),x(P,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(Se,ke){v(Se,t,ke),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,g),w(t,_),w(t,y),w(y,S),w(S,T),w(y,E),w(y,M),w(M,L),w(y,A),w(y,P),w(P,R),w(t,U),V=!0,K||(J=[Me(He.call(null,S,"Download")),B(S,"click",tt(ee)),Me(He.call(null,M,"Restore")),B(M,"click",tt(X)),Me(He.call(null,P,"Delete")),B(P,"click",tt(oe))],K=!0)},p(Se,ke){e=Se,(!V||ke&8)&&r!==(r=e[22].key+"")&&ue(a,r),(!V||ke&8&&u!==(u=e[22].key))&&p(o,"title",u),(!V||ke&8)&&m!==(m=z.formattedFileSize(e[22].size)+"")&&ue(h,m),(!V||ke&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!V||ke&40)&&x(S,"btn-loading",e[5][e[22].key]),(!V||ke&72&&I!==(I=e[6][e[22].key]))&&(M.disabled=I),(!V||ke&72&&N!==(N=e[6][e[22].key]))&&(P.disabled=N),(!V||ke&72)&&x(P,"btn-loading",e[6][e[22].key])},i(Se){V||(Se&&nt(()=>{V&&(j||(j=ze(t,wt,{duration:150},!0)),j.run(1))}),V=!0)},o(Se){Se&&(j||(j=ze(t,wt,{duration:150},!1)),j.run(0)),V=!1},d(Se){Se&&k(t),Se&&j&&j.end(),K=!1,De(J)}}}function S1(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="skeleton-loader"></span> ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function L7(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function A7(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function P7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;const _=[I7,D7],y=[];function S(I,A){return I[4]?0:1}i=S(n),l=y[i]=_[i](n);function T(I,A){return I[7]?A7:L7}let $=T(n),E=$(n),M={};f=new w7({props:M}),n[14](f),f.$on("submit",n[15]);let L={};return d=new M7({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=C(),o=b("div"),r=b("button"),E.c(),u=C(),H(f.$$.fragment),c=C(),H(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){v(I,e,A),w(e,t),y[i].m(t,null),w(e,s),w(e,o),w(o,r),E.m(r,null),v(I,u,A),F(f,I,A),v(I,c,A),F(d,I,A),m=!0,h||(g=B(r,"click",n[13]),h=!0)},p(I,[A]){let P=i;i=S(I),i===P?y[i].p(I,A):(re(),D(y[P],1,1,()=>{y[P]=null}),ae(),l=y[i],l?l.p(I,A):(l=y[i]=_[i](I),l.c()),O(l,1),l.m(t,null)),$!==($=T(I))&&(E.d(1),E=$(I),E&&(E.c(),E.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const R={};f.$set(R);const N={};d.$set(N)},i(I){m||(O(l),O(f.$$.fragment,I),O(d.$$.fragment,I),m=!0)},o(I){D(l),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(k(e),k(u),k(c)),y[i].d(),E.d(),n[14](null),q(f,I),n[16](null),q(d,I),h=!1,g()}}}function N7(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.modified<L.modified?1:M.modified>L.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);z.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),z.removeByKey(s,"name",M),f(),tn(`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{}}Yt(()=>{let M=setInterval(()=>{h()},3e3);return()=>{clearInterval(M)}});const g=M=>c(M.key),_=M=>l.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function T(M){ie[M?"unshift":"push"](()=>{i=M,t(1,i)})}const $=()=>{f()};function E(M){ie[M?"unshift":"push"](()=>{l=M,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,g,_,y,S,T,$,E]}class R7 extends ye{constructor(e){super(),be(this,e,N7,P7,_e,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const F7=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),T1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function q7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[0].enabled,v(u,i,f),v(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&&ue(s,u[4]),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function $1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[H7,({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:[j7,({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:[z7,({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:[U7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[V7,({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:[B7,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("div"),H(g.$$.fragment),_=C(),y=b("div"),H(S.$$.fragment),T=C(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(L,I){v(L,e,I),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),F(d,c,null),w(e,m),w(e,h),F(g,h,null),w(e,_),w(e,y),F(S,y,null),w(e,T),w(e,$),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 R={};I&8&&(R.name=L[3]+".region"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),u.$set(R);const N={};I&8&&(N.name=L[3]+".accessKey"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),d.$set(N);const U={};I&8&&(U.name=L[3]+".secret"),I&8519713&&(U.$$scope={dirty:I,ctx:L}),g.$set(U);const j={};I&8&&(j.name=L[3]+".forcePathStyle"),I&8519681&&(j.$$scope={dirty:I,ctx:L}),S.$set(j)},i(L){M||(O(i.$$.fragment,L),O(o.$$.fragment,L),O(u.$$.fragment,L),O(d.$$.fragment,L),O(g.$$.fragment,L),O(S.$$.fragment,L),L&&nt(()=>{M&&(E||(E=ze(e,wt,{duration:150},!0)),E.run(1))}),M=!0)},o(L){D(i.$$.fragment,L),D(o.$$.fragment,L),D(u.$$.fragment,L),D(d.$$.fragment,L),D(g.$$.fragment,L),D(S.$$.fragment,L),L&&(E||(E=ze(e,wt,{duration:150},!1)),E.run(0)),M=!1},d(L){L&&k(e),q(i),q(o),q(u),q(d),q(g),q(S),L&&E&&E.end()}}}function H7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function j7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function z7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function U7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function V7(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(()=>ve(s,"mask",u)),ie.push(()=>ve(s,"value",f)),{c(){e=b("label"),t=Y("Secret"),l=C(),H(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function B7(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){v(c,e,d),e.checked=n[0].forcePathStyle,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[16]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function W7(n){let e,t,i,l,s;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[q7,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Lt(o,n,n[17],T1);let a=n[0].enabled&&$1(n);return{c(){H(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),l=ge()},m(u,f){F(e,u,f),v(u,t,f),r&&r.m(u,f),v(u,i,f),a&&a.m(u,f),v(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)&&Pt(r,o,u,u[17],s?At(o,u[17],f,F7):Nt(u[17]),T1),u[0].enabled?a?(a.p(u,f),f&1&&O(a,1)):(a=$1(u),a.c(),O(a,1),a.m(l.parentNode,l)):a&&(re(),D(a,1,1,()=>{a=null}),ae())},i(u){s||(O(e.$$.fragment,u),O(r,u),O(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(k(t),k(i),k(l)),q(e,u),r&&r.d(u),a&&a.d(u)}}}const Aa="s3_test_request";function Y7(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 g(){t(5,h=!!(s!=null&&s.accessKey))}function _(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{y()},P)}async function y(){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(R){P=R}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}Yt(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function T(){o.endpoint=this.value,t(0,o)}function $(){o.bucket=this.value,t(0,o)}function E(){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||fi(r))},[o,f,c,r,a,h,s,u,i,S,T,$,E,M,L,I,A,l]}class uk extends ye{constructor(e){super(),be(this,e,Y7,W7,_e,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function K7(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"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){v(a,e,u),w(e,t),v(a,l,u),v(a,s,u),n[5](s),o||(r=[Me(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&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(k(e),k(l),k(s)),n[5](null),o=!1,De(r)}}}const C1="upload_backup";function J7(n,e,t){const i=gt();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,_,y;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await me.backups.upload(h,{requestKey:C1}),t(2,o=!1),i("success"),tn("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(y=(_=(g=S.response)==null?void 0:g.data)==null?void 0:_.file)!=null&&y.message?$i(S.response.data.file.message):me.error(S))}r()}so(()=>{me.cancelRequest(C1)});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,g;a((g=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:g[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class Z7 extends ye{constructor(e){super(),be(this,e,J7,K7,_e,{class:0})}}function G7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function X7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function O1(n){var V,K,J;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[Q7,({uniqueId:ee})=>({31:ee}),({uniqueId:ee})=>[0,ee?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&E1(n);function A(ee){n[24](ee)}function P(ee){n[25](ee)}function R(ee){n[26](ee)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(V=n[0].backups)==null?void 0:V.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new uk({props:N}),ie.push(()=>ve(r,"config",A)),ie.push(()=>ve(r,"isTesting",P)),ie.push(()=>ve(r,"testError",R));let U=((J=(K=n[1].backups)==null?void 0:K.s3)==null?void 0:J.enabled)&&!n[9]&&!n[5]&&M1(n),j=n[9]&&D1(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),I&&I.c(),l=C(),s=b("div"),o=C(),H(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),U&&U.c(),g=C(),j&&j.c(),_=C(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(ee,X){v(ee,e,X),F(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),F(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),U&&U.m(d,null),w(d,g),j&&j.m(d,null),w(d,_),w(d,y),w(y,S),E=!0,M||(L=[B(y,"click",n[28]),B(e,"submit",tt(n[11]))],M=!0)},p(ee,X){var ke,Ce,We;const oe={};X[0]&4|X[1]&3&&(oe.$$scope={dirty:X,ctx:ee}),t.$set(oe),ee[2]?I?(I.p(ee,X),X[0]&4&&O(I,1)):(I=E1(ee),I.c(),O(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const Se={};X[0]&1&&(Se.originalConfig=(ke=ee[0].backups)==null?void 0:ke.s3),!a&&X[0]&2&&(a=!0,Se.config=ee[1].backups.s3,$e(()=>a=!1)),!u&&X[0]&128&&(u=!0,Se.isTesting=ee[7],$e(()=>u=!1)),!f&&X[0]&256&&(f=!0,Se.testError=ee[8],$e(()=>f=!1)),r.$set(Se),(We=(Ce=ee[1].backups)==null?void 0:Ce.s3)!=null&&We.enabled&&!ee[9]&&!ee[5]?U?U.p(ee,X):(U=M1(ee),U.c(),U.m(d,g)):U&&(U.d(1),U=null),ee[9]?j?j.p(ee,X):(j=D1(ee),j.c(),j.m(d,_)):j&&(j.d(1),j=null),(!E||X[0]&544&&T!==(T=!ee[9]||ee[5]))&&(y.disabled=T),(!E||X[0]&32)&&x(y,"btn-loading",ee[5])},i(ee){E||(O(t.$$.fragment,ee),O(I),O(r.$$.fragment,ee),ee&&nt(()=>{E&&($||($=ze(e,wt,{duration:150},!0)),$.run(1))}),E=!0)},o(ee){D(t.$$.fragment,ee),D(I),D(r.$$.fragment,ee),ee&&($||($=ze(e,wt,{duration:150},!1)),$.run(0)),E=!1},d(ee){ee&&k(e),q(t),I&&I.d(),q(r),U&&U.d(),j&&j.d(),ee&&$&&$.end(),M=!1,De(L)}}}function Q7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=Y("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(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&&(k(e),k(i),k(l)),r=!1,a()}}}function E1(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:[eR,({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:[tR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(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){v(f,e,c),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(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||(O(l.$$.fragment,f),O(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=ze(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=ze(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(l),q(r),f&&a&&a.end()}}}function x7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<span class="txt">Every day at 00:00h</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Every sunday at 00:00h</span>',l=C(),s=b("button"),s.innerHTML='<span class="txt">Every Mon and Wed at 00:00h</span>',o=C(),r=b("button"),r.innerHTML='<span class="txt">Every first day of the month at 00:00h</span>',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){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(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&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r)),a=!1,De(u)}}}function eR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P;return g=new Hn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[x7]},$$scope:{ctx:n}}}),{c(){var R,N;e=b("label"),t=Y("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(),H(g.$$.fragment),_=C(),y=b("div"),S=b("p"),T=Y(`Supports numeric list, steps, ranges or
                                                 `),$=b("span"),$.textContent="macros",E=Y(`.
@@ -179,13 +180,13 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function
 @weekly
 @daily
 @midnight
-@hourly`))],A=!0)},p(R,N){var j,V;(!I||N[1]&1&&i!==(i=R[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=R[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((V=(j=R[0])==null?void 0:j.backups)!=null&&V.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==R[1].backups.cron&&ce(s,R[1].backups.cron);const U={};N[0]&2|N[1]&2&&(U.$$scope={dirty:N,ctx:R}),g.$set(U)},i(R){I||(O(g.$$.fragment,R),I=!0)},o(R){D(g.$$.fragment,R),I=!1},d(R){R&&(k(e),k(l),k(s),k(a),k(u),k(_),k(y)),q(g),A=!1,De(P)}}}function tR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[1].backups.cronMaxKeep&&ce(s,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function M1(n){let e;function t(s,o){return s[7]?lR:s[8]?iR:nR}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function nR(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function iR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Me(t=He.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Rt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&k(e),i=!1,l()}}}function lR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function D1(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){v(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&&k(e),l=!1,s()}}}function sR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R;m=new Au({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new Z7({props:{class:"btn-sm"}}),g.$on("success",n[13]);let N={};y=new R7({props:N}),n[15](y);function U(J,ee){return J[6]?X7:G7}let j=U(n),V=j(n),K=n[6]&&!n[4]&&O1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=Y(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(),H(m.$$.fragment),h=C(),H(g.$$.fragment),_=C(),H(y.$$.fragment),S=C(),T=b("hr"),$=C(),E=b("button"),M=b("span"),M.textContent="Backups options",L=C(),V.c(),I=C(),K&&K.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(E,"type","button"),p(E,"class","btn btn-secondary"),E.disabled=n[4],x(E,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,ee){v(J,e,ee),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(J,r,ee),v(J,a,ee),w(a,u),w(u,f),w(f,c),w(f,d),F(m,f,null),w(f,h),F(g,f,null),w(u,_),F(y,u,null),w(u,S),w(u,T),w(u,$),w(u,E),w(E,M),w(E,L),V.m(E,null),w(u,I),K&&K.m(u,null),A=!0,P||(R=[B(E,"click",n[16]),B(u,"submit",tt(n[11]))],P=!0)},p(J,ee){(!A||ee[0]&1024)&&ue(o,J[10]);const X={};y.$set(X),j!==(j=U(J))&&(V.d(1),V=j(J),V&&(V.c(),V.m(E,null))),(!A||ee[0]&16)&&(E.disabled=J[4]),(!A||ee[0]&16)&&x(E,"btn-loading",J[4]),J[6]&&!J[4]?K?(K.p(J,ee),ee[0]&80&&O(K,1)):(K=O1(J),K.c(),O(K,1),K.m(u,null)):K&&(re(),D(K,1,1,()=>{K=null}),ae())},i(J){A||(O(m.$$.fragment,J),O(g.$$.fragment,J),O(y.$$.fragment,J),O(K),A=!0)},o(J){D(m.$$.fragment,J),D(g.$$.fragment,J),D(y.$$.fragment,J),D(K),A=!1},d(J){J&&(k(e),k(r),k(a)),q(m),q(g),n[15](null),q(y),V.d(),K&&K.d(),P=!1,De(R)}}}function oR(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[sR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(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||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function rR(n,e,t){let i,l;Qe(n,cn,ee=>t(10,l=ee)),Nn(cn,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;g();async function g(){t(4,a=!0);try{const ee=await me.settings.getAll()||{};y(ee)}catch(ee){me.error(ee)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const ee=await me.settings.update(z.filterRedactedProps(r));Wt({}),await T(),y(ee),tn("Successfully saved application settings.")}catch(ee){me.error(ee)}t(5,u=!1)}}function y(ee={}){t(1,r={backups:(ee==null?void 0:ee.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(ee){ie[ee?"unshift":"push"](()=>{s=ee,t(3,s)})}const E=()=>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)},R=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=yt(this.value),t(1,r),t(2,c)}function U(ee){n.$$.not_equal(r.backups.s3,ee)&&(r.backups.s3=ee,t(1,r),t(2,c))}function j(ee){m=ee,t(7,m)}function V(ee){h=ee,t(8,h)}const K=()=>S(),J=()=>_();return n.$$.update=()=>{var ee;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(ee=r==null?void 0:r.backups)!=null&&ee.cron&&(fi("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,_,S,T,f,$,E,M,L,I,A,P,R,N,U,j,V,K,J]}class aR extends ye{constructor(e){super(),be(this,e,rR,oR,_e,{},null,[-1,-1])}}function I1(n,e,t){const i=n.slice();return i[22]=e[t],i}function uR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U;o=new fe({props:{class:"form-field",$$slots:{default:[cR,({uniqueId:K})=>({12:K}),({uniqueId:K})=>K?4096:0]},$$scope:{ctx:n}}});let j=pe(n[0]);const V=K=>K[22].id;for(let K=0;K<j.length;K+=1){let J=I1(n,j,K),ee=V(J);u.set(ee,a[K]=L1(ee,J))}return{c(){e=b("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
-                        another PocketBase environment.</p>`,t=C(),i=b("div"),l=b("div"),s=b("div"),H(o.$$.fragment),r=C();for(let K=0;K<a.length;K+=1)a[K].c();f=C(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",g=C(),_=b("pre"),y=Y(n[6]),S=C(),T=b("div"),$=b("div"),E=C(),M=b("button"),L=b("i"),I=C(),A=b("span"),A.textContent="Download as JSON",p(e,"class","content txt-xl m-b-base"),p(s,"class","list-item list-item-section"),p(l,"class","export-list"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","btn btn-sm btn-transparent fade copy-schema"),d.disabled=h=!n[2],p(_,"class","code-wrapper"),p(c,"tabindex","0"),p(c,"class","export-preview"),p(i,"class","export-panel"),p($,"class","flex-fill"),p(L,"class","ri-download-line"),p(A,"class","txt"),p(M,"type","button"),p(M,"class","btn btn-expanded"),M.disabled=P=!n[2],p(T,"class","flex m-t-base")},m(K,J){v(K,e,J),v(K,t,J),v(K,i,J),w(i,l),w(l,s),F(o,s,null),w(l,r);for(let ee=0;ee<a.length;ee+=1)a[ee]&&a[ee].m(l,null);w(i,f),w(i,c),w(c,d),w(d,m),w(c,g),w(c,_),w(_,y),n[16](c),v(K,S,J),v(K,T,J),w(T,$),w(T,E),w(T,M),w(M,L),w(M,I),w(M,A),R=!0,N||(U=[B(d,"click",n[15]),B(c,"keydown",n[17]),B(M,"click",n[18])],N=!0)},p(K,J){const ee={};J&33558561&&(ee.$$scope={dirty:J,ctx:K}),o.$set(ee),J&6147&&(j=pe(K[0]),re(),a=kt(a,J,V,1,K,j,u,l,zt,L1,null,I1),ae()),(!R||J&4&&h!==(h=!K[2]))&&(d.disabled=h),(!R||J&64)&&ue(y,K[6]),(!R||J&4&&P!==(P=!K[2]))&&(M.disabled=P)},i(K){if(!R){O(o.$$.fragment,K);for(let J=0;J<j.length;J+=1)O(a[J]);R=!0}},o(K){D(o.$$.fragment,K);for(let J=0;J<a.length;J+=1)D(a[J]);R=!1},d(K){K&&(k(e),k(t),k(i),k(S),k(T)),q(o);for(let J=0;J<a.length;J+=1)a[J].d();n[16](null),N=!1,De(U)}}}function fR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function cR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=Y("Select all"),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.disabled=i=!n[0].length,e.checked=n[5],p(s,"for",r=n[12])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=B(e,"change",n[13]),a=!0)},p(f,c){c&4096&&t!==(t=f[12])&&p(e,"id",t),c&1&&i!==(i=!f[0].length)&&(e.disabled=i),c&32&&(e.checked=f[5]),c&4096&&r!==(r=f[12])&&p(s,"for",r)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function dR(n){let e,t,i,l,s,o=n[22].name+"",r,a,u,f,c;function d(){return n[14](n[22])}return{c(){e=b("input"),l=C(),s=b("label"),r=Y(o),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.checked=i=n[1][n[22].id],p(s,"for",a=n[12]),p(s,"title",u=n[22].name)},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),f||(c=B(e,"change",d),f=!0)},p(m,h){n=m,h&4096&&t!==(t=n[12])&&p(e,"id",t),h&3&&i!==(i=n[1][n[22].id])&&(e.checked=i),h&1&&o!==(o=n[22].name+"")&&ue(r,o),h&4096&&a!==(a=n[12])&&p(s,"for",a),h&1&&u!==(u=n[22].name)&&p(s,"title",u)},d(m){m&&(k(e),k(l),k(s)),f=!1,c()}}}function L1(n,e){let t,i,l,s;return i=new fe({props:{class:"form-field",$$slots:{default:[dR,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),F(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||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),q(i)}}}function pR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[fR,uR],h=[];function g(_,y){return _[4]?0:1}return f=g(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=Y(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(_,y){v(_,e,y),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,y),v(_,a,y),w(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y&128)&&ue(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,y):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=m[f](_),c.c()),O(c,1),c.m(u,null))},i(_){d||(O(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function mR(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[pR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function hR(n,e,t){let i,l,s,o;Qe(n,cn,A=>t(7,o=A)),Nn(cn,o="Export collections",o);const r="export_"+z.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=z.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;y()}catch(P){me.error(P)}t(4,c=!1)}function m(){z.downloadJson(Object.values(f),"pb_schema")}function h(){z.copyToClipboard(i),Ys("The configuration was copied to your clipboard!",3e3)}function g(){s?_():y()}function _(){t(1,f={})}function y(){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=()=>g(),$=A=>S(A),E=()=>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(),R=document.createRange();R.selectNodeContents(a),P.removeAllRanges(),P.addRange(R)}},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,g,S,r,T,$,E,M,L,I]}class _R extends ye{constructor(e){super(),be(this,e,hR,mR,_e,{})}}function A1(n,e,t){const i=n.slice();return i[14]=e[t],i}function P1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function N1(n,e,t){const i=n.slice();return i[14]=e[t],i}function R1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}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[30]=e[t],i}function gR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&j1(),a=n[0].name!==n[1].name&&z1(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),l=b("strong"),o=Y(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){v(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=j1(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=z1(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&ue(o,s)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function bR(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=Y(l),p(e,"class","label label-danger")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&ue(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function yR(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=Y(l),p(e,"class","label label-success")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&ue(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function j1(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function z1(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=Y(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){v(o,e,r),w(e,i),v(o,l,r),v(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&ue(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function U1(n){var _,y;let e,t,i,l=n[30]+"",s,o,r,a,u=n[12]((_=n[0])==null?void 0:_[n[30]])+"",f,c,d,m,h=n[12]((y=n[1])==null?void 0:y[n[30]])+"",g;return{c(){var S,T,$,E,M,L;e=b("tr"),t=b("td"),i=b("span"),s=Y(l),o=C(),r=b("td"),a=b("pre"),f=Y(u),c=C(),d=b("td"),m=b("pre"),g=Y(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),x(r,"changed-old-col",!n[11]&&An((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),x(d,"changed-new-col",!n[5]&&An(($=n[0])==null?void 0:$[n[30]],(E=n[1])==null?void 0:E[n[30]])),x(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),x(e,"txt-primary",An((M=n[0])==null?void 0:M[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,T){v(S,e,T),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,g)},p(S,T){var $,E,M,L,I,A,P,R;T[0]&512&&l!==(l=S[30]+"")&&ue(s,l),T[0]&513&&u!==(u=S[12](($=S[0])==null?void 0:$[S[30]])+"")&&ue(f,u),T[0]&2563&&x(r,"changed-old-col",!S[11]&&An((E=S[0])==null?void 0:E[S[30]],(M=S[1])==null?void 0:M[S[30]])),T[0]&2048&&x(r,"changed-none-col",S[11]),T[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&ue(g,h),T[0]&547&&x(d,"changed-new-col",!S[5]&&An((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),T[0]&32&&x(d,"changed-none-col",S[5]),T[0]&515&&x(e,"txt-primary",An((P=S[0])==null?void 0:P[S[30]],(R=S[1])==null?void 0:R[S[30]]))},d(S){S&&k(e)}}}function V1(n){let e,t=pe(n[6]),i=[];for(let l=0;l<t.length;l+=1)i[l]=W1(F1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s[0]&4160){t=pe(l[6]);let o;for(o=0;o<t.length;o+=1){const r=F1(l,t,o);i[o]?i[o].p(r,s):(i[o]=W1(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function B1(n){let e,t,i=n[17]+"",l,s,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),r=b("pre"),u=Y(a),f=C(),c=b("td"),d=C(),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-qs0w8h"),p(c,"class","changed-none-col svelte-qs0w8h"),p(e,"class","txt-primary svelte-qs0w8h")},m(m,h){v(m,e,h),w(e,t),w(t,l),w(e,s),w(e,o),w(o,r),w(r,u),w(e,f),w(e,c),w(e,d)},p(m,h){h[0]&64&&i!==(i=m[17]+"")&&ue(l,i),h[0]&64&&a!==(a=m[12](m[18])+"")&&ue(u,a)},d(m){m&&k(e)}}}function W1(n){let e,t,i,l,s=n[14].name+"",o,r,a,u,f,c,d,m=n[14].name+"",h,g,_,y,S=pe(Object.entries(n[14])),T=[];for(let $=0;$<S.length;$+=1)T[$]=B1(q1(n,S,$));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Y("field: "),o=Y(s),r=C(),a=b("span"),u=Y("Deleted - "),f=b("small"),c=Y("All stored data related to "),d=b("strong"),h=Y(m),g=Y(" will be deleted!"),_=C();for(let $=0;$<T.length;$+=1)T[$].c();y=ge(),p(i,"class","txt"),p(a,"class","label label-danger m-l-5 svelte-qs0w8h"),p(t,"class","min-width svelte-qs0w8h"),p(t,"colspan","3"),p(e,"class","svelte-qs0w8h")},m($,E){v($,e,E),w(e,t),w(t,i),w(i,l),w(i,o),w(t,r),w(t,a),w(a,u),w(a,f),w(f,c),w(f,d),w(d,h),w(f,g),v($,_,E);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m($,E);v($,y,E)},p($,E){if(E[0]&64&&s!==(s=$[14].name+"")&&ue(o,s),E[0]&64&&m!==(m=$[14].name+"")&&ue(h,m),E[0]&4160){S=pe(Object.entries($[14]));let M;for(M=0;M<S.length;M+=1){const L=q1($,S,M);T[M]?T[M].p(L,E):(T[M]=B1(L),T[M].c(),T[M].m(y.parentNode,y))}for(;M<T.length;M+=1)T[M].d(1);T.length=S.length}},d($){$&&(k(e),k(_),k(y)),pt(T,$)}}}function Y1(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning m-l-5 svelte-qs0w8h")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function K1(n){var g;let e,t,i=n[17]+"",l,s,o,r,a=n[12]((g=Jn(n[3],n[14].id))==null?void 0:g[n[17]])+"",u,f,c,d,m=n[12](n[23])+"",h;return{c(){var _,y,S;e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),r=b("pre"),u=Y(a),f=C(),c=b("td"),d=b("pre"),h=Y(m),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(r,"class","txt"),p(o,"class","svelte-qs0w8h"),x(o,"changed-old-col",An((_=Jn(n[3],n[14].id))==null?void 0:_[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-qs0w8h"),x(c,"changed-new-col",An((y=Jn(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-qs0w8h"),x(e,"txt-primary",An((S=Jn(n[3],n[14].id))==null?void 0:S[n[17]],n[23]))},m(_,y){v(_,e,y),w(e,t),w(t,l),w(e,s),w(e,o),w(o,r),w(r,u),w(e,f),w(e,c),w(c,d),w(d,h)},p(_,y){var S,T,$,E;y[0]&128&&i!==(i=_[17]+"")&&ue(l,i),y[0]&136&&a!==(a=_[12]((S=Jn(_[3],_[14].id))==null?void 0:S[_[17]])+"")&&ue(u,a),y[0]&136&&x(o,"changed-old-col",An((T=Jn(_[3],_[14].id))==null?void 0:T[_[17]],_[23])),y[0]&128&&m!==(m=_[12](_[23])+"")&&ue(h,m),y[0]&136&&x(c,"changed-new-col",An(($=Jn(_[3],_[14].id))==null?void 0:$[_[17]],_[23])),y[0]&136&&x(e,"txt-primary",An((E=Jn(_[3],_[14].id))==null?void 0:E[_[17]],_[23]))},d(_){_&&k(e)}}}function J1(n){let e,t,i,l,s=n[14].name+"",o,r,a=An(Jn(n[3],n[14].id),Jn(n[4],n[14].id)),u,f,c=a&&Y1(),d=pe(Object.entries(n[14])),m=[];for(let h=0;h<d.length;h+=1)m[h]=K1(R1(n,d,h));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Y("field: "),o=Y(s),r=C(),c&&c.c(),u=C();for(let h=0;h<m.length;h+=1)m[h].c();f=ge(),p(i,"class","txt"),p(t,"class","min-width svelte-qs0w8h"),p(t,"colspan","3"),p(e,"class","svelte-qs0w8h")},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,o),w(t,r),c&&c.m(t,null),v(h,u,g);for(let _=0;_<m.length;_+=1)m[_]&&m[_].m(h,g);v(h,f,g)},p(h,g){if(g[0]&128&&s!==(s=h[14].name+"")&&ue(o,s),g[0]&152&&(a=An(Jn(h[3],h[14].id),Jn(h[4],h[14].id))),a?c||(c=Y1(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),g[0]&4232){d=pe(Object.entries(h[14]));let _;for(_=0;_<d.length;_+=1){const y=R1(h,d,_);m[_]?m[_].p(y,g):(m[_]=K1(y),m[_].c(),m[_].m(f.parentNode,f))}for(;_<m.length;_+=1)m[_].d(1);m.length=d.length}},d(h){h&&(k(e),k(u),k(f)),c&&c.d(),pt(m,h)}}}function Z1(n){let e,t,i=n[17]+"",l,s,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),r=C(),a=b("td"),u=b("pre"),c=Y(f),d=C(),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(o,"class","changed-none-col svelte-qs0w8h"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-qs0w8h"),p(e,"class","txt-primary svelte-qs0w8h")},m(m,h){v(m,e,h),w(e,t),w(t,l),w(e,s),w(e,o),w(e,r),w(e,a),w(a,u),w(u,c),w(e,d)},p(m,h){h[0]&256&&i!==(i=m[17]+"")&&ue(l,i),h[0]&256&&f!==(f=m[12](m[18])+"")&&ue(c,f)},d(m){m&&k(e)}}}function G1(n){let e,t,i,l,s=n[14].name+"",o,r,a,u,f,c=pe(Object.entries(n[14])),d=[];for(let m=0;m<c.length;m+=1)d[m]=Z1(P1(n,c,m));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Y("field: "),o=Y(s),r=C(),a=b("span"),a.textContent="Added",u=C();for(let m=0;m<d.length;m+=1)d[m].c();f=ge(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-qs0w8h"),p(t,"class","min-width svelte-qs0w8h"),p(t,"colspan","3"),p(e,"class","svelte-qs0w8h")},m(m,h){v(m,e,h),w(e,t),w(t,i),w(i,l),w(i,o),w(t,r),w(t,a),v(m,u,h);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(m,h);v(m,f,h)},p(m,h){if(h[0]&256&&s!==(s=m[14].name+"")&&ue(o,s),h[0]&4352){c=pe(Object.entries(m[14]));let g;for(g=0;g<c.length;g+=1){const _=P1(m,c,g);d[g]?d[g].p(_,h):(d[g]=Z1(_),d[g].c(),d[g].m(f.parentNode,f))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&(k(e),k(u),k(f)),pt(d,m)}}}function kR(n){let e,t,i,l,s,o,r,a,u;function f($,E){var M,L;return(M=$[0])!=null&&M.id?(L=$[1])!=null&&L.id?gR:bR:yR}let c=f(n),d=c(n),m=pe(n[9]),h=[];for(let $=0;$<m.length;$+=1)h[$]=U1(H1(n,m,$));let g=(n[2]||n[5])&&V1(n),_=pe(n[7]),y=[];for(let $=0;$<_.length;$+=1)y[$]=J1(N1(n,_,$));let S=pe(n[8]),T=[];for(let $=0;$<S.length;$+=1)T[$]=G1(A1(n,S,$));return{c(){e=b("div"),d.c(),t=C(),i=b("table"),l=b("thead"),l.innerHTML='<tr class="svelte-qs0w8h"><th class="svelte-qs0w8h">Props</th> <th width="10%" class="svelte-qs0w8h">Old</th> <th width="10%" class="svelte-qs0w8h">New</th></tr>',s=C(),o=b("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=C(),g&&g.c(),a=C();for(let $=0;$<y.length;$+=1)y[$].c();u=C();for(let $=0;$<T.length;$+=1)T[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-qs0w8h")},m($,E){v($,e,E),d.m(e,null),v($,t,E),v($,i,E),w(i,l),w(i,s),w(i,o);for(let M=0;M<h.length;M+=1)h[M]&&h[M].m(o,null);w(o,r),g&&g.m(o,null),w(o,a);for(let M=0;M<y.length;M+=1)y[M]&&y[M].m(o,null);w(o,u);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(o,null)},p($,E){if(c===(c=f($))&&d?d.p($,E):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),E[0]&6691){m=pe($[9]);let M;for(M=0;M<m.length;M+=1){const L=H1($,m,M);h[M]?h[M].p(L,E):(h[M]=U1(L),h[M].c(),h[M].m(o,r))}for(;M<h.length;M+=1)h[M].d(1);h.length=m.length}if($[2]||$[5]?g?g.p($,E):(g=V1($),g.c(),g.m(o,a)):g&&(g.d(1),g=null),E[0]&4248){_=pe($[7]);let M;for(M=0;M<_.length;M+=1){const L=N1($,_,M);y[M]?y[M].p(L,E):(y[M]=J1(L),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=_.length}if(E[0]&4352){S=pe($[8]);let M;for(M=0;M<S.length;M+=1){const L=A1($,S,M);T[M]?T[M].p(L,E):(T[M]=G1(L),T[M].c(),T[M].m(o,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=S.length}},i:te,o:te,d($){$&&(k(e),k(t),k(i)),d.d(),pt(h,$),g&&g.d(),pt(y,$),pt(T,$)}}}function Jn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function An(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function vR(n,e,t){let i,l,s,o,{collectionA:r={}}=e,{collectionB:a={}}=e,{deleteMissing:u=!1}=e,f=[],c=[],d=[],m=[],h=[];function g(){t(4,c=Array.isArray(a==null?void 0:a.fields)?a==null?void 0:a.fields.concat():[]),u||t(4,c=c.concat(f.filter(y=>!c.find(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":z.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,r=y.collectionA),"collectionB"in y&&t(1,a=y.collectionB),"deleteMissing"in y&&t(2,u=y.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")&&g(),n.$$.dirty[0]&24&&t(6,d=f.filter(y=>!c.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(10,s=z.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=z.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(y=>!["fields","created","updated"].includes(y)))},[r,a,u,f,c,i,d,m,h,o,s,l,_]}class wR extends ye{constructor(e){super(),be(this,e,vR,kR,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function X1(n,e,t){const i=n.slice();return i[17]=e[t],i}function Q1(n){let e,t;return e=new wR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function SR(n){let e,t,i=pe(n[2]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Q1(X1(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ge()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);v(o,e,r),t=!0},p(o,r){if(r&12){i=pe(o[2]);let a;for(a=0;a<i.length;a+=1){const u=X1(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=Q1(u),l[a].c(),O(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function TR(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function $R(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=Y("Close"),i=C(),l=b("button"),s=b("span"),s.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=n[4],x(l,"btn-loading",n[4])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(a,l,u),w(l,s),o||(r=[B(e,"click",n[0]),B(l,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(l.disabled=a[4]),u&16&&x(l,"btn-loading",a[4])},d(a){a&&(k(e),k(i),k(l)),o=!1,De(r)}}}function CR(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[$R],header:[TR],default:[SR]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&1048604&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}function OR(n,e,t){const i=_t();let l,s=[],o=[],r=[],a=!1,u=!1;function f($,E,M=!1){t(7,s=$),t(8,o=E),t(3,a=M),l==null||l.show()}function c(){return l==null?void 0:l.hide()}function d(){t(2,r=[]);for(const $ of s){const E=z.findByKey(o,"id",$.id)||null;(a&&!(E!=null&&E.id)||E!=null&&E.id&&z.hasCollectionChanges($,E,a))&&r.push({old:$,new:E})}for(const $ of o){const E=z.findByKey(s,"id",$.id)||null;E!=null&&E.id||r.push({old:E,new:$})}}function m(){const $=[];if(a)for(const E of s){const M=z.findByKey(o,"id",E.id);if(!M)$.push(E.name+".*");else{const L=Array.isArray(E.fields)?E.fields:[];for(const I of L)z.findByKey(M.fields,"id",I.id)||$.push(`${E.name}.${I.name} (${I.id})`)}}$.length?pn(`Do you really want to delete the following collection fields and their related records data:
+@hourly`))],A=!0)},p(R,N){var j,V;(!I||N[1]&1&&i!==(i=R[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=R[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((V=(j=R[0])==null?void 0:j.backups)!=null&&V.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==R[1].backups.cron&&ce(s,R[1].backups.cron);const U={};N[0]&2|N[1]&2&&(U.$$scope={dirty:N,ctx:R}),g.$set(U)},i(R){I||(O(g.$$.fragment,R),I=!0)},o(R){D(g.$$.fragment,R),I=!1},d(R){R&&(k(e),k(l),k(s),k(a),k(u),k(_),k(y)),q(g),A=!1,De(P)}}}function tR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[1].backups.cronMaxKeep&&ce(s,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function M1(n){let e;function t(s,o){return s[7]?lR:s[8]?iR:nR}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function nR(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function iR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Me(t=He.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Rt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&k(e),i=!1,l()}}}function lR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function D1(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){v(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&&k(e),l=!1,s()}}}function sR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R;m=new Au({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new Z7({props:{class:"btn-sm"}}),g.$on("success",n[13]);let N={};y=new R7({props:N}),n[15](y);function U(J,ee){return J[6]?X7:G7}let j=U(n),V=j(n),K=n[6]&&!n[4]&&O1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=Y(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(),H(m.$$.fragment),h=C(),H(g.$$.fragment),_=C(),H(y.$$.fragment),S=C(),T=b("hr"),$=C(),E=b("button"),M=b("span"),M.textContent="Backups options",L=C(),V.c(),I=C(),K&&K.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(E,"type","button"),p(E,"class","btn btn-secondary"),E.disabled=n[4],x(E,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,ee){v(J,e,ee),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(J,r,ee),v(J,a,ee),w(a,u),w(u,f),w(f,c),w(f,d),F(m,f,null),w(f,h),F(g,f,null),w(u,_),F(y,u,null),w(u,S),w(u,T),w(u,$),w(u,E),w(E,M),w(E,L),V.m(E,null),w(u,I),K&&K.m(u,null),A=!0,P||(R=[B(E,"click",n[16]),B(u,"submit",tt(n[11]))],P=!0)},p(J,ee){(!A||ee[0]&1024)&&ue(o,J[10]);const X={};y.$set(X),j!==(j=U(J))&&(V.d(1),V=j(J),V&&(V.c(),V.m(E,null))),(!A||ee[0]&16)&&(E.disabled=J[4]),(!A||ee[0]&16)&&x(E,"btn-loading",J[4]),J[6]&&!J[4]?K?(K.p(J,ee),ee[0]&80&&O(K,1)):(K=O1(J),K.c(),O(K,1),K.m(u,null)):K&&(re(),D(K,1,1,()=>{K=null}),ae())},i(J){A||(O(m.$$.fragment,J),O(g.$$.fragment,J),O(y.$$.fragment,J),O(K),A=!0)},o(J){D(m.$$.fragment,J),D(g.$$.fragment,J),D(y.$$.fragment,J),D(K),A=!1},d(J){J&&(k(e),k(r),k(a)),q(m),q(g),n[15](null),q(y),V.d(),K&&K.d(),P=!1,De(R)}}}function oR(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[sR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(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||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function rR(n,e,t){let i,l;Qe(n,cn,ee=>t(10,l=ee)),Nn(cn,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;g();async function g(){t(4,a=!0);try{const ee=await me.settings.getAll()||{};y(ee)}catch(ee){me.error(ee)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const ee=await me.settings.update(z.filterRedactedProps(r));Wt({}),await T(),y(ee),tn("Successfully saved application settings.")}catch(ee){me.error(ee)}t(5,u=!1)}}function y(ee={}){t(1,r={backups:(ee==null?void 0:ee.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(ee){ie[ee?"unshift":"push"](()=>{s=ee,t(3,s)})}const E=()=>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)},R=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=_t(this.value),t(1,r),t(2,c)}function U(ee){n.$$.not_equal(r.backups.s3,ee)&&(r.backups.s3=ee,t(1,r),t(2,c))}function j(ee){m=ee,t(7,m)}function V(ee){h=ee,t(8,h)}const K=()=>S(),J=()=>_();return n.$$.update=()=>{var ee;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(ee=r==null?void 0:r.backups)!=null&&ee.cron&&(fi("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,_,S,T,f,$,E,M,L,I,A,P,R,N,U,j,V,K,J]}class aR extends ye{constructor(e){super(),be(this,e,rR,oR,_e,{},null,[-1,-1])}}function I1(n,e,t){const i=n.slice();return i[22]=e[t],i}function uR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I,A,P,R,N,U;o=new fe({props:{class:"form-field",$$slots:{default:[cR,({uniqueId:K})=>({12:K}),({uniqueId:K})=>K?4096:0]},$$scope:{ctx:n}}});let j=pe(n[0]);const V=K=>K[22].id;for(let K=0;K<j.length;K+=1){let J=I1(n,j,K),ee=V(J);u.set(ee,a[K]=L1(ee,J))}return{c(){e=b("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
+                        another PocketBase environment.</p>`,t=C(),i=b("div"),l=b("div"),s=b("div"),H(o.$$.fragment),r=C();for(let K=0;K<a.length;K+=1)a[K].c();f=C(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",g=C(),_=b("pre"),y=Y(n[6]),S=C(),T=b("div"),$=b("div"),E=C(),M=b("button"),L=b("i"),I=C(),A=b("span"),A.textContent="Download as JSON",p(e,"class","content txt-xl m-b-base"),p(s,"class","list-item list-item-section"),p(l,"class","export-list"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","btn btn-sm btn-transparent fade copy-schema"),d.disabled=h=!n[2],p(_,"class","code-wrapper"),p(c,"tabindex","0"),p(c,"class","export-preview"),p(i,"class","export-panel"),p($,"class","flex-fill"),p(L,"class","ri-download-line"),p(A,"class","txt"),p(M,"type","button"),p(M,"class","btn btn-expanded"),M.disabled=P=!n[2],p(T,"class","flex m-t-base")},m(K,J){v(K,e,J),v(K,t,J),v(K,i,J),w(i,l),w(l,s),F(o,s,null),w(l,r);for(let ee=0;ee<a.length;ee+=1)a[ee]&&a[ee].m(l,null);w(i,f),w(i,c),w(c,d),w(d,m),w(c,g),w(c,_),w(_,y),n[16](c),v(K,S,J),v(K,T,J),w(T,$),w(T,E),w(T,M),w(M,L),w(M,I),w(M,A),R=!0,N||(U=[B(d,"click",n[15]),B(c,"keydown",n[17]),B(M,"click",n[18])],N=!0)},p(K,J){const ee={};J&33558561&&(ee.$$scope={dirty:J,ctx:K}),o.$set(ee),J&6147&&(j=pe(K[0]),re(),a=kt(a,J,V,1,K,j,u,l,zt,L1,null,I1),ae()),(!R||J&4&&h!==(h=!K[2]))&&(d.disabled=h),(!R||J&64)&&ue(y,K[6]),(!R||J&4&&P!==(P=!K[2]))&&(M.disabled=P)},i(K){if(!R){O(o.$$.fragment,K);for(let J=0;J<j.length;J+=1)O(a[J]);R=!0}},o(K){D(o.$$.fragment,K);for(let J=0;J<a.length;J+=1)D(a[J]);R=!1},d(K){K&&(k(e),k(t),k(i),k(S),k(T)),q(o);for(let J=0;J<a.length;J+=1)a[J].d();n[16](null),N=!1,De(U)}}}function fR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function cR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=Y("Select all"),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.disabled=i=!n[0].length,e.checked=n[5],p(s,"for",r=n[12])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=B(e,"change",n[13]),a=!0)},p(f,c){c&4096&&t!==(t=f[12])&&p(e,"id",t),c&1&&i!==(i=!f[0].length)&&(e.disabled=i),c&32&&(e.checked=f[5]),c&4096&&r!==(r=f[12])&&p(s,"for",r)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function dR(n){let e,t,i,l,s,o=n[22].name+"",r,a,u,f,c;function d(){return n[14](n[22])}return{c(){e=b("input"),l=C(),s=b("label"),r=Y(o),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.checked=i=n[1][n[22].id],p(s,"for",a=n[12]),p(s,"title",u=n[22].name)},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),f||(c=B(e,"change",d),f=!0)},p(m,h){n=m,h&4096&&t!==(t=n[12])&&p(e,"id",t),h&3&&i!==(i=n[1][n[22].id])&&(e.checked=i),h&1&&o!==(o=n[22].name+"")&&ue(r,o),h&4096&&a!==(a=n[12])&&p(s,"for",a),h&1&&u!==(u=n[22].name)&&p(s,"title",u)},d(m){m&&(k(e),k(l),k(s)),f=!1,c()}}}function L1(n,e){let t,i,l,s;return i=new fe({props:{class:"form-field",$$slots:{default:[dR,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),F(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||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),q(i)}}}function pR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[fR,uR],h=[];function g(_,y){return _[4]?0:1}return f=g(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=Y(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(_,y){v(_,e,y),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,y),v(_,a,y),w(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y&128)&&ue(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,y):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=m[f](_),c.c()),O(c,1),c.m(u,null))},i(_){d||(O(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function mR(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[pR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}function hR(n,e,t){let i,l,s,o;Qe(n,cn,A=>t(7,o=A)),Nn(cn,o="Export collections",o);const r="export_"+z.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=z.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;y()}catch(P){me.error(P)}t(4,c=!1)}function m(){z.downloadJson(Object.values(f),"pb_schema")}function h(){z.copyToClipboard(i),Ys("The configuration was copied to your clipboard!",3e3)}function g(){s?_():y()}function _(){t(1,f={})}function y(){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=()=>g(),$=A=>S(A),E=()=>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(),R=document.createRange();R.selectNodeContents(a),P.removeAllRanges(),P.addRange(R)}},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,g,S,r,T,$,E,M,L,I]}class _R extends ye{constructor(e){super(),be(this,e,hR,mR,_e,{})}}function A1(n,e,t){const i=n.slice();return i[14]=e[t],i}function P1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function N1(n,e,t){const i=n.slice();return i[14]=e[t],i}function R1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}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[30]=e[t],i}function gR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&j1(),a=n[0].name!==n[1].name&&z1(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),l=b("strong"),o=Y(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){v(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=j1(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=z1(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&ue(o,s)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function bR(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=Y(l),p(e,"class","label label-danger")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&ue(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function yR(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=Y(l),p(e,"class","label label-success")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&ue(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function j1(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function z1(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=Y(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){v(o,e,r),w(e,i),v(o,l,r),v(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&ue(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function U1(n){var _,y;let e,t,i,l=n[30]+"",s,o,r,a,u=n[12]((_=n[0])==null?void 0:_[n[30]])+"",f,c,d,m,h=n[12]((y=n[1])==null?void 0:y[n[30]])+"",g;return{c(){var S,T,$,E,M,L;e=b("tr"),t=b("td"),i=b("span"),s=Y(l),o=C(),r=b("td"),a=b("pre"),f=Y(u),c=C(),d=b("td"),m=b("pre"),g=Y(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),x(r,"changed-old-col",!n[11]&&An((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),x(d,"changed-new-col",!n[5]&&An(($=n[0])==null?void 0:$[n[30]],(E=n[1])==null?void 0:E[n[30]])),x(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),x(e,"txt-primary",An((M=n[0])==null?void 0:M[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,T){v(S,e,T),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,g)},p(S,T){var $,E,M,L,I,A,P,R;T[0]&512&&l!==(l=S[30]+"")&&ue(s,l),T[0]&513&&u!==(u=S[12](($=S[0])==null?void 0:$[S[30]])+"")&&ue(f,u),T[0]&2563&&x(r,"changed-old-col",!S[11]&&An((E=S[0])==null?void 0:E[S[30]],(M=S[1])==null?void 0:M[S[30]])),T[0]&2048&&x(r,"changed-none-col",S[11]),T[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&ue(g,h),T[0]&547&&x(d,"changed-new-col",!S[5]&&An((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),T[0]&32&&x(d,"changed-none-col",S[5]),T[0]&515&&x(e,"txt-primary",An((P=S[0])==null?void 0:P[S[30]],(R=S[1])==null?void 0:R[S[30]]))},d(S){S&&k(e)}}}function V1(n){let e,t=pe(n[6]),i=[];for(let l=0;l<t.length;l+=1)i[l]=W1(F1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s[0]&4160){t=pe(l[6]);let o;for(o=0;o<t.length;o+=1){const r=F1(l,t,o);i[o]?i[o].p(r,s):(i[o]=W1(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&k(e),pt(i,l)}}}function B1(n){let e,t,i=n[17]+"",l,s,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),r=b("pre"),u=Y(a),f=C(),c=b("td"),d=C(),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-qs0w8h"),p(c,"class","changed-none-col svelte-qs0w8h"),p(e,"class","txt-primary svelte-qs0w8h")},m(m,h){v(m,e,h),w(e,t),w(t,l),w(e,s),w(e,o),w(o,r),w(r,u),w(e,f),w(e,c),w(e,d)},p(m,h){h[0]&64&&i!==(i=m[17]+"")&&ue(l,i),h[0]&64&&a!==(a=m[12](m[18])+"")&&ue(u,a)},d(m){m&&k(e)}}}function W1(n){let e,t,i,l,s=n[14].name+"",o,r,a,u,f,c,d,m=n[14].name+"",h,g,_,y,S=pe(Object.entries(n[14])),T=[];for(let $=0;$<S.length;$+=1)T[$]=B1(q1(n,S,$));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Y("field: "),o=Y(s),r=C(),a=b("span"),u=Y("Deleted - "),f=b("small"),c=Y("All stored data related to "),d=b("strong"),h=Y(m),g=Y(" will be deleted!"),_=C();for(let $=0;$<T.length;$+=1)T[$].c();y=ge(),p(i,"class","txt"),p(a,"class","label label-danger m-l-5 svelte-qs0w8h"),p(t,"class","min-width svelte-qs0w8h"),p(t,"colspan","3"),p(e,"class","svelte-qs0w8h")},m($,E){v($,e,E),w(e,t),w(t,i),w(i,l),w(i,o),w(t,r),w(t,a),w(a,u),w(a,f),w(f,c),w(f,d),w(d,h),w(f,g),v($,_,E);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m($,E);v($,y,E)},p($,E){if(E[0]&64&&s!==(s=$[14].name+"")&&ue(o,s),E[0]&64&&m!==(m=$[14].name+"")&&ue(h,m),E[0]&4160){S=pe(Object.entries($[14]));let M;for(M=0;M<S.length;M+=1){const L=q1($,S,M);T[M]?T[M].p(L,E):(T[M]=B1(L),T[M].c(),T[M].m(y.parentNode,y))}for(;M<T.length;M+=1)T[M].d(1);T.length=S.length}},d($){$&&(k(e),k(_),k(y)),pt(T,$)}}}function Y1(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning m-l-5 svelte-qs0w8h")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function K1(n){var g;let e,t,i=n[17]+"",l,s,o,r,a=n[12]((g=Jn(n[3],n[14].id))==null?void 0:g[n[17]])+"",u,f,c,d,m=n[12](n[23])+"",h;return{c(){var _,y,S;e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),r=b("pre"),u=Y(a),f=C(),c=b("td"),d=b("pre"),h=Y(m),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(r,"class","txt"),p(o,"class","svelte-qs0w8h"),x(o,"changed-old-col",An((_=Jn(n[3],n[14].id))==null?void 0:_[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-qs0w8h"),x(c,"changed-new-col",An((y=Jn(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-qs0w8h"),x(e,"txt-primary",An((S=Jn(n[3],n[14].id))==null?void 0:S[n[17]],n[23]))},m(_,y){v(_,e,y),w(e,t),w(t,l),w(e,s),w(e,o),w(o,r),w(r,u),w(e,f),w(e,c),w(c,d),w(d,h)},p(_,y){var S,T,$,E;y[0]&128&&i!==(i=_[17]+"")&&ue(l,i),y[0]&136&&a!==(a=_[12]((S=Jn(_[3],_[14].id))==null?void 0:S[_[17]])+"")&&ue(u,a),y[0]&136&&x(o,"changed-old-col",An((T=Jn(_[3],_[14].id))==null?void 0:T[_[17]],_[23])),y[0]&128&&m!==(m=_[12](_[23])+"")&&ue(h,m),y[0]&136&&x(c,"changed-new-col",An(($=Jn(_[3],_[14].id))==null?void 0:$[_[17]],_[23])),y[0]&136&&x(e,"txt-primary",An((E=Jn(_[3],_[14].id))==null?void 0:E[_[17]],_[23]))},d(_){_&&k(e)}}}function J1(n){let e,t,i,l,s=n[14].name+"",o,r,a=An(Jn(n[3],n[14].id),Jn(n[4],n[14].id)),u,f,c=a&&Y1(),d=pe(Object.entries(n[14])),m=[];for(let h=0;h<d.length;h+=1)m[h]=K1(R1(n,d,h));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Y("field: "),o=Y(s),r=C(),c&&c.c(),u=C();for(let h=0;h<m.length;h+=1)m[h].c();f=ge(),p(i,"class","txt"),p(t,"class","min-width svelte-qs0w8h"),p(t,"colspan","3"),p(e,"class","svelte-qs0w8h")},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,o),w(t,r),c&&c.m(t,null),v(h,u,g);for(let _=0;_<m.length;_+=1)m[_]&&m[_].m(h,g);v(h,f,g)},p(h,g){if(g[0]&128&&s!==(s=h[14].name+"")&&ue(o,s),g[0]&152&&(a=An(Jn(h[3],h[14].id),Jn(h[4],h[14].id))),a?c||(c=Y1(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),g[0]&4232){d=pe(Object.entries(h[14]));let _;for(_=0;_<d.length;_+=1){const y=R1(h,d,_);m[_]?m[_].p(y,g):(m[_]=K1(y),m[_].c(),m[_].m(f.parentNode,f))}for(;_<m.length;_+=1)m[_].d(1);m.length=d.length}},d(h){h&&(k(e),k(u),k(f)),c&&c.d(),pt(m,h)}}}function Z1(n){let e,t,i=n[17]+"",l,s,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=b("tr"),t=b("td"),l=Y(i),s=C(),o=b("td"),r=C(),a=b("td"),u=b("pre"),c=Y(f),d=C(),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(o,"class","changed-none-col svelte-qs0w8h"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-qs0w8h"),p(e,"class","txt-primary svelte-qs0w8h")},m(m,h){v(m,e,h),w(e,t),w(t,l),w(e,s),w(e,o),w(e,r),w(e,a),w(a,u),w(u,c),w(e,d)},p(m,h){h[0]&256&&i!==(i=m[17]+"")&&ue(l,i),h[0]&256&&f!==(f=m[12](m[18])+"")&&ue(c,f)},d(m){m&&k(e)}}}function G1(n){let e,t,i,l,s=n[14].name+"",o,r,a,u,f,c=pe(Object.entries(n[14])),d=[];for(let m=0;m<c.length;m+=1)d[m]=Z1(P1(n,c,m));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Y("field: "),o=Y(s),r=C(),a=b("span"),a.textContent="Added",u=C();for(let m=0;m<d.length;m+=1)d[m].c();f=ge(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-qs0w8h"),p(t,"class","min-width svelte-qs0w8h"),p(t,"colspan","3"),p(e,"class","svelte-qs0w8h")},m(m,h){v(m,e,h),w(e,t),w(t,i),w(i,l),w(i,o),w(t,r),w(t,a),v(m,u,h);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(m,h);v(m,f,h)},p(m,h){if(h[0]&256&&s!==(s=m[14].name+"")&&ue(o,s),h[0]&4352){c=pe(Object.entries(m[14]));let g;for(g=0;g<c.length;g+=1){const _=P1(m,c,g);d[g]?d[g].p(_,h):(d[g]=Z1(_),d[g].c(),d[g].m(f.parentNode,f))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&(k(e),k(u),k(f)),pt(d,m)}}}function kR(n){let e,t,i,l,s,o,r,a,u;function f($,E){var M,L;return(M=$[0])!=null&&M.id?(L=$[1])!=null&&L.id?gR:bR:yR}let c=f(n),d=c(n),m=pe(n[9]),h=[];for(let $=0;$<m.length;$+=1)h[$]=U1(H1(n,m,$));let g=(n[2]||n[5])&&V1(n),_=pe(n[7]),y=[];for(let $=0;$<_.length;$+=1)y[$]=J1(N1(n,_,$));let S=pe(n[8]),T=[];for(let $=0;$<S.length;$+=1)T[$]=G1(A1(n,S,$));return{c(){e=b("div"),d.c(),t=C(),i=b("table"),l=b("thead"),l.innerHTML='<tr class="svelte-qs0w8h"><th class="svelte-qs0w8h">Props</th> <th width="10%" class="svelte-qs0w8h">Old</th> <th width="10%" class="svelte-qs0w8h">New</th></tr>',s=C(),o=b("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=C(),g&&g.c(),a=C();for(let $=0;$<y.length;$+=1)y[$].c();u=C();for(let $=0;$<T.length;$+=1)T[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-qs0w8h")},m($,E){v($,e,E),d.m(e,null),v($,t,E),v($,i,E),w(i,l),w(i,s),w(i,o);for(let M=0;M<h.length;M+=1)h[M]&&h[M].m(o,null);w(o,r),g&&g.m(o,null),w(o,a);for(let M=0;M<y.length;M+=1)y[M]&&y[M].m(o,null);w(o,u);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(o,null)},p($,E){if(c===(c=f($))&&d?d.p($,E):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),E[0]&6691){m=pe($[9]);let M;for(M=0;M<m.length;M+=1){const L=H1($,m,M);h[M]?h[M].p(L,E):(h[M]=U1(L),h[M].c(),h[M].m(o,r))}for(;M<h.length;M+=1)h[M].d(1);h.length=m.length}if($[2]||$[5]?g?g.p($,E):(g=V1($),g.c(),g.m(o,a)):g&&(g.d(1),g=null),E[0]&4248){_=pe($[7]);let M;for(M=0;M<_.length;M+=1){const L=N1($,_,M);y[M]?y[M].p(L,E):(y[M]=J1(L),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=_.length}if(E[0]&4352){S=pe($[8]);let M;for(M=0;M<S.length;M+=1){const L=A1($,S,M);T[M]?T[M].p(L,E):(T[M]=G1(L),T[M].c(),T[M].m(o,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=S.length}},i:te,o:te,d($){$&&(k(e),k(t),k(i)),d.d(),pt(h,$),g&&g.d(),pt(y,$),pt(T,$)}}}function Jn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function An(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function vR(n,e,t){let i,l,s,o,{collectionA:r={}}=e,{collectionB:a={}}=e,{deleteMissing:u=!1}=e,f=[],c=[],d=[],m=[],h=[];function g(){t(4,c=Array.isArray(a==null?void 0:a.fields)?a==null?void 0:a.fields.concat():[]),u||t(4,c=c.concat(f.filter(y=>!c.find(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":z.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,r=y.collectionA),"collectionB"in y&&t(1,a=y.collectionB),"deleteMissing"in y&&t(2,u=y.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")&&g(),n.$$.dirty[0]&24&&t(6,d=f.filter(y=>!c.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(10,s=z.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=z.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(y=>!["fields","created","updated"].includes(y)))},[r,a,u,f,c,i,d,m,h,o,s,l,_]}class wR extends ye{constructor(e){super(),be(this,e,vR,kR,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function X1(n,e,t){const i=n.slice();return i[17]=e[t],i}function Q1(n){let e,t;return e=new wR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function SR(n){let e,t,i=pe(n[2]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Q1(X1(n,i,o));const s=o=>D(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ge()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);v(o,e,r),t=!0},p(o,r){if(r&12){i=pe(o[2]);let a;for(a=0;a<i.length;a+=1){const u=X1(o,i,a);l[a]?(l[a].p(u,r),O(l[a],1)):(l[a]=Q1(u),l[a].c(),O(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)O(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)D(l[r]);t=!1},d(o){o&&k(e),pt(l,o)}}}function TR(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function $R(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=Y("Close"),i=C(),l=b("button"),s=b("span"),s.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=n[4],x(l,"btn-loading",n[4])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(a,l,u),w(l,s),o||(r=[B(e,"click",n[0]),B(l,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(l.disabled=a[4]),u&16&&x(l,"btn-loading",a[4])},d(a){a&&(k(e),k(i),k(l)),o=!1,De(r)}}}function CR(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[$R],header:[TR],default:[SR]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(l,s){F(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&1048604&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),q(e,l)}}}function OR(n,e,t){const i=gt();let l,s=[],o=[],r=[],a=!1,u=!1;function f($,E,M=!1){t(7,s=$),t(8,o=E),t(3,a=M),l==null||l.show()}function c(){return l==null?void 0:l.hide()}function d(){t(2,r=[]);for(const $ of s){const E=z.findByKey(o,"id",$.id)||null;(a&&!(E!=null&&E.id)||E!=null&&E.id&&z.hasCollectionChanges($,E,a))&&r.push({old:$,new:E})}for(const $ of o){const E=z.findByKey(s,"id",$.id)||null;E!=null&&E.id||r.push({old:E,new:$})}}function m(){const $=[];if(a)for(const E of s){const M=z.findByKey(o,"id",E.id);if(!M)$.push(E.name+".*");else{const L=Array.isArray(E.fields)?E.fields:[];for(const I of L)z.findByKey(M.fields,"id",I.id)||$.push(`${E.name}.${I.name} (${I.id})`)}}$.length?pn(`Do you really want to delete the following collection fields and their related records data:
 - ${$.join(`
 - `)}`,()=>{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($){me.error($)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function y($){ie[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Pe.call(this,n,$)}function T($){Pe.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,y,S,T]}class ER extends ye{constructor(e){super(),be(this,e,OR,CR,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function x1(n,e,t){const i=n.slice();return i[33]=e[t],i}function eb(n,e,t){const i=n.slice();return i[36]=e[t],i}function tb(n,e,t){const i=n.slice();return i[33]=e[t],i}function MR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$,E,M,L,I;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[IR,({uniqueId:V})=>({41:V}),({uniqueId:V})=>[0,V?1024:0]]},$$scope:{ctx:n}}});let A=n[1].length&&ib(n),P=!1,R=n[6]&&n[1].length&&!n[7]&&lb(),N=n[6]&&n[1].length&&n[7]&&sb(n),U=n[13].length&&_b(n),j=!!n[0]&&gb(n);return{c(){e=b("input"),t=C(),i=b("div"),l=b("p"),s=Y(`Paste below the collections configuration you want to import or
                         `),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=C(),H(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),R&&R.c(),d=C(),N&&N.c(),m=C(),U&&U.c(),h=C(),g=b("div"),j&&j.c(),_=C(),y=b("div"),S=C(),T=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p($,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-expanded btn-warning m-l-auto"),T.disabled=E=!n[14],p(g,"class","flex m-t-base")},m(V,K){v(V,e,K),n[21](e),v(V,t,K),v(V,i,K),w(i,l),w(l,s),w(l,o),v(V,r,K),F(a,V,K),v(V,u,K),A&&A.m(V,K),v(V,f,K),v(V,c,K),R&&R.m(V,K),v(V,d,K),N&&N.m(V,K),v(V,m,K),U&&U.m(V,K),v(V,h,K),v(V,g,K),j&&j.m(g,null),w(g,_),w(g,y),w(g,S),w(g,T),w(T,$),M=!0,L||(I=[B(e,"change",n[22]),B(o,"click",n[23]),B(T,"click",n[19])],L=!0)},p(V,K){(!M||K[0]&4096)&&x(o,"btn-loading",V[12]);const J={};K[0]&64&&(J.class="form-field "+(V[6]?"":"field-error")),K[0]&65|K[1]&3072&&(J.$$scope={dirty:K,ctx:V}),a.$set(J),V[1].length?A?(A.p(V,K),K[0]&2&&O(A,1)):(A=ib(V),A.c(),O(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),V[6]&&V[1].length&&!V[7]?R||(R=lb(),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),V[6]&&V[1].length&&V[7]?N?N.p(V,K):(N=sb(V),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),V[13].length?U?U.p(V,K):(U=_b(V),U.c(),U.m(h.parentNode,h)):U&&(U.d(1),U=null),V[0]?j?j.p(V,K):(j=gb(V),j.c(),j.m(g,_)):j&&(j.d(1),j=null),(!M||K[0]&16384&&E!==(E=!V[14]))&&(T.disabled=E)},i(V){M||(O(a.$$.fragment,V),O(A),O(P),M=!0)},o(V){D(a.$$.fragment,V),D(A),D(P),M=!1},d(V){V&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(m),k(h),k(g)),n[21](null),q(a,V),A&&A.d(V),R&&R.d(V),N&&N.d(V),U&&U.d(V),j&&j.d(),L=!1,De(I)}}}function DR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function nb(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function IR(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&nb();return{c(){e=b("label"),t=Y("Collections"),l=C(),s=b("textarea"),r=C(),c&&c.c(),a=ge(),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){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),ce(s,n[0]),v(d,r,m),c&&c.m(d,m),v(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=nb(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(l),k(s),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function ib(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[LR,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(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||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function LR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=Y("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){v(f,e,c),e.checked=n[5],v(f,l,c),v(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&&(k(e),k(l),k(s)),a=!1,u()}}}function lb(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><string>Your collections configuration is already up-to-date!</string></div>',p(e,"class","alert alert-info")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function sb(n){let e,t,i,l,s,o=n[9].length&&ob(n),r=n[3].length&&ub(n),a=n[8].length&&pb(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){v(u,e,f),v(u,t,f),v(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=ob(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=ub(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=pb(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function ob(n){let e=[],t=new Map,i,l=pe(n[9]);const s=o=>o[33].id;for(let o=0;o<l.length;o+=1){let r=tb(n,l,o),a=s(r);t.set(a,e[o]=ab(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r[0]&512&&(l=pe(o[9]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,ab,i,tb))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function rb(n){let e,t=n[33].id+"",i;return{c(){e=b("small"),i=Y(t),p(e,"class","txt-hint")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&512&&t!==(t=l[33].id+"")&&ue(i,t)},d(l){l&&k(e)}}}function ab(n,e){let t,i,l,s,o,r=e[33].name+"",a,u,f,c=e[33].id&&rb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",l=C(),s=b("div"),o=b("strong"),a=Y(r),u=C(),c&&c.c(),f=C(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(s,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(d,m){v(d,t,m),w(t,i),w(t,l),w(t,s),w(s,o),w(o,a),w(s,u),c&&c.m(s,null),w(t,f)},p(d,m){e=d,m[0]&512&&r!==(r=e[33].name+"")&&ue(a,r),e[33].id?c?c.p(e,m):(c=rb(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&k(t),c&&c.d()}}}function ub(n){let e=[],t=new Map,i,l=pe(n[3]);const s=o=>o[36].old.id+o[36].new.id;for(let o=0;o<l.length;o+=1){let r=eb(n,l,o),a=s(r);t.set(a,e[o]=db(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r[0]&8&&(l=pe(o[3]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,db,i,eb))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function fb(n){let e,t=n[36].old.name+"",i,l,s;return{c(){e=b("strong"),i=Y(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){v(o,e,r),w(e,i),v(o,l,r),v(o,s,r)},p(o,r){r[0]&8&&t!==(t=o[36].old.name+"")&&ue(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function cb(n){let e,t=n[36].new.id+"",i;return{c(){e=b("small"),i=Y(t),p(e,"class","txt-hint")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&8&&t!==(t=l[36].new.id+"")&&ue(i,t)},d(l){l&&k(e)}}}function db(n,e){let t,i,l,s,o,r,a=e[36].new.name+"",u,f,c,d=e[36].old.name!==e[36].new.name&&fb(e),m=e[36].new.id&&cb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",l=C(),s=b("div"),d&&d.c(),o=C(),r=b("strong"),u=Y(a),f=C(),m&&m.c(),c=C(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(s,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,g){v(h,t,g),w(t,i),w(t,l),w(t,s),d&&d.m(s,null),w(s,o),w(s,r),w(r,u),w(s,f),m&&m.m(s,null),w(t,c)},p(h,g){e=h,e[36].old.name!==e[36].new.name?d?d.p(e,g):(d=fb(e),d.c(),d.m(s,o)):d&&(d.d(1),d=null),g[0]&8&&a!==(a=e[36].new.name+"")&&ue(u,a),e[36].new.id?m?m.p(e,g):(m=cb(e),m.c(),m.m(s,null)):m&&(m.d(1),m=null)},d(h){h&&k(t),d&&d.d(),m&&m.d()}}}function pb(n){let e=[],t=new Map,i,l=pe(n[8]);const s=o=>o[33].id;for(let o=0;o<l.length;o+=1){let r=x1(n,l,o),a=s(r);t.set(a,e[o]=hb(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ge()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);v(o,i,r)},p(o,r){r[0]&256&&(l=pe(o[8]),e=kt(e,r,s,1,o,l,t,i.parentNode,ci,hb,i,x1))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function mb(n){let e,t=n[33].id+"",i;return{c(){e=b("small"),i=Y(t),p(e,"class","txt-hint")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&256&&t!==(t=l[33].id+"")&&ue(i,t)},d(l){l&&k(e)}}}function hb(n,e){let t,i,l,s,o,r=e[33].name+"",a,u,f,c=e[33].id&&mb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",l=C(),s=b("div"),o=b("strong"),a=Y(r),u=C(),c&&c.c(),f=C(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(s,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(d,m){v(d,t,m),w(t,i),w(t,l),w(t,s),w(s,o),w(o,a),w(s,u),c&&c.m(s,null),w(t,f)},p(d,m){e=d,m[0]&256&&r!==(r=e[33].name+"")&&ue(a,r),e[33].id?c?c.p(e,m):(c=mb(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&k(t),c&&c.d()}}}function _b(n){let e,t,i,l,s,o,r,a;return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=C(),l=b("div"),l.innerHTML=`<string>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.</string>`,s=C(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',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){v(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&&k(e),r=!1,a()}}}function gb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[28]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function AR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[DR,MR],h=[];function g(_,y){return _[4]?0:1}return f=g(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=Y(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(_,y){v(_,e,y),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,y),v(_,a,y),w(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&ue(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,y):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=m[f](_),c.c()),O(c,1),c.m(u,null))},i(_){d||(O(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function PR(n){let e,t,i,l,s,o;e=new ps({}),i=new di({props:{$$slots:{default:[AR]},$$scope:{ctx:n}}});let r={};return s=new ER({props:r}),n[29](s),s.$on("submit",n[18]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),v(a,l,u),F(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||(O(e.$$.fragment,a),O(i.$$.fragment,a),O(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),q(e,a),q(i,a),n[29](null),q(s,a)}}}function NR(n,e,t){let i,l,s,o,r,a,u;Qe(n,cn,oe=>t(15,u=oe)),Nn(cn,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,y=[],S=!1,T=!1;$();async function $(){var oe;t(4,S=!0);try{t(20,g=await me.collections.getFullList(200));for(let Se of g)delete Se.created,delete Se.updated,(oe=Se.oauth2)==null||delete oe.providers}catch(Se){me.error(Se)}t(4,S=!1)}function E(){if(t(3,y=[]),!!i)for(let oe of h){const Se=z.findByKey(g,"id",oe.id);!(Se!=null&&Se.id)||!z.hasCollectionChanges(Se,oe,_)||y.push({new:oe,old:Se})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=z.filterDuplicatesByKey(h)):t(1,h=[]);for(let oe of h)delete oe.created,delete oe.updated,oe.fields=z.filterDuplicatesByKey(oe.fields)}function L(){for(let oe of h){const Se=z.findByKey(g,"name",oe.name)||z.findByKey(g,"id",oe.id);if(!Se)continue;const ke=oe.id,Ce=Se.id;oe.id=Ce;const We=Array.isArray(Se.fields)?Se.fields:[],st=Array.isArray(oe.fields)?oe.fields:[];for(const et of st){const Be=z.findByKey(We,"name",et.name);Be&&Be.id&&(et.id=Be.id)}for(let et of h)if(Array.isArray(et.fields))for(let Be of et.fields)Be.collectionId&&Be.collectionId===ke&&(Be.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function I(oe){t(12,m=!0);const Se=new FileReader;Se.onload=async ke=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ke.target.result),await fn(),h.length||($i("Invalid collections configuration."),A())},Se.onerror=ke=>{console.warn(ke),$i("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),Wt({})}function P(){const oe=T?z.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,oe,_)}function R(oe){ie[oe?"unshift":"push"](()=>{f=oe,t(10,f)})}const N=()=>{f.files.length&&I(f.files[0])},U=()=>{f.click()};function j(){d=this.value,t(0,d)}function V(){T=this.checked,t(5,T)}function K(){_=this.checked,t(2,_)}const J=()=>L(),ee=()=>A();function X(oe){ie[oe?"unshift":"push"](()=>{c=oe,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==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=g.filter(oe=>i&&!T&&_&&!z.findByKey(h,"id",oe.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(oe=>i&&!z.findByKey(g,"id",oe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&E(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(oe=>{let Se=z.findByKey(g,"name",oe.name)||z.findByKey(g,"id",oe.id);if(!Se)return!1;if(Se.id!=oe.id)return!0;const ke=Array.isArray(Se.fields)?Se.fields:[],Ce=Array.isArray(oe.fields)?oe.fields:[];for(const We of Ce){if(z.findByKey(ke,"id",We.id))continue;const et=z.findByKey(ke,"name",We.name);if(et&&We.id!=et.id)return!0}return!1}))},[d,h,_,y,S,T,i,o,s,l,f,c,m,a,r,u,L,I,A,P,g,R,N,U,j,V,K,J,ee,X]}class RR extends ye{constructor(e){super(),be(this,e,NR,PR,_e,{},null,[-1,-1])}}function FR(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:[HR,({uniqueId:T})=>({33:T}),({uniqueId:T})=>[0,T?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[jR,({uniqueId:T})=>({33:T}),({uniqueId:T})=>[0,T?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[zR,({uniqueId:T})=>({33:T}),({uniqueId:T})=>[0,T?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&bb(n);function _(T,$){return T[6]?QR:XR}let y=_(n),S=y(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),g&&g.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,$){v(T,e,$),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),v(T,r,$),F(a,T,$),v(T,u,$),g&&g.m(T,$),v(T,f,$),v(T,c,$),w(c,d),w(c,m),S.m(c,null),h=!0},p(T,$){const E={};$[0]&1|$[1]&12&&(E.$$scope={dirty:$,ctx:T}),i.$set(E);const M={};$[0]&1|$[1]&12&&(M.$$scope={dirty:$,ctx:T}),o.$set(M);const L={};$[0]&1|$[1]&12&&(L.$$scope={dirty:$,ctx:T}),a.$set(L),T[0].smtp.enabled?g?(g.p(T,$),$[0]&1&&O(g,1)):(g=bb(T),g.c(),O(g,1),g.m(f.parentNode,f)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),y===(y=_(T))&&S?S.p(T,$):(S.d(1),S=y(T),S&&(S.c(),S.m(c,null)))},i(T){h||(O(i.$$.fragment,T),O(o.$$.fragment,T),O(a.$$.fragment,T),O(g),h=!0)},o(T){D(i.$$.fragment,T),D(o.$$.fragment,T),D(a.$$.fragment,T),D(g),h=!1},d(T){T&&(k(e),k(r),k(u),k(f),k(c)),q(i),q(o),q(a,T),g&&g.d(T),S.d()}}}function qR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function HR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function jR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function zR(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 <strong>(recommended)</strong>",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){v(c,e,d),e.checked=n[0].smtp.enabled,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[16]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function bb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$;l=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[UR,({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:[VR,({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:[BR,({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:[WR,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function E(A,P){return A[5]?KR:YR}let M=E(n),L=M(n),I=n[5]&&yb(n);return{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),g=b("button"),L.c(),_=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(g,"type","button"),p(g,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){v(A,e,P),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(r,o,null),w(t,a),w(t,u),F(f,u,null),w(t,c),w(t,d),F(m,d,null),w(e,h),w(e,g),L.m(g,null),w(e,_),I&&I.m(e,null),S=!0,T||($=B(g,"click",tt(n[22])),T=!0)},p(A,P){const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),l.$set(R);const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),r.$set(N);const U={};P[0]&1|P[1]&12&&(U.$$scope={dirty:P,ctx:A}),f.$set(U);const j={};P[0]&17|P[1]&12&&(j.$$scope={dirty:P,ctx:A}),m.$set(j),M!==(M=E(A))&&(L.d(1),L=M(A),L&&(L.c(),L.m(g,null))),A[5]?I?(I.p(A,P),P[0]&32&&O(I,1)):(I=yb(A),I.c(),O(I,1),I.m(e,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae())},i(A){S||(O(l.$$.fragment,A),O(r.$$.fragment,A),O(f.$$.fragment,A),O(m.$$.fragment,A),O(I),A&&nt(()=>{S&&(y||(y=ze(e,wt,{duration:150},!0)),y.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&&(y||(y=ze(e,wt,{duration:150},!1)),y.run(0)),S=!1},d(A){A&&k(e),q(l),q(r),q(f),q(m),L.d(),I&&I.d(),A&&y&&y.end(),T=!1,$()}}}function UR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function VR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&yt(s.value)!==u[0].smtp.port&&ce(s,u[0].smtp.port)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function BR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function WR(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(()=>ve(s,"mask",u)),ie.push(()=>ve(s,"value",f)),{c(){e=b("label"),t=Y("Password"),l=C(),H(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function YR(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function KR(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function yb(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:[JR,({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:[ZR,({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:[GR,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(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,g){v(h,e,g),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),m=!0},p(h,g){const _={};g[0]&1|g[1]&12&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g[0]&1|g[1]&12&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const S={};g[0]&1|g[1]&12&&(S.$$scope={dirty:g,ctx:h}),u.$set(S)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),h&&nt(()=>{m&&(d||(d=ze(e,wt,{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=ze(e,wt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&k(e),q(i),q(o),q(u),h&&d&&d.end()}}}function JR(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 xn({props:u}),ie.push(()=>ve(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("TLS encryption"),l=C(),H(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function ZR(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 xn({props:u}),ie.push(()=>ve(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("AUTH method"),l=C(),H(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function GR(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){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),ce(r,n[0].smtp.localName),u||(f=[Me(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&&(k(e),k(o),k(r)),u=!1,De(f)}}}function XR(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-check-line"></i> <span class="txt">Send test email</span>',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[28]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function QR(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],x(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(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&&x(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,De(a)}}}function xR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[qR,FR],S=[];function T($,E){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=Y(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",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($,E){v($,e,E),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v($,r,E),v($,a,E),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=B(u,"submit",tt(n[29])),g=!0)},p($,E){(!h||E[0]&128)&&ue(o,$[7]);let M=d;d=T($),d===M?S[d].p($,E):(re(),D(S[M],1,1,()=>{S[M]=null}),ae(),m=S[d],m?m.p($,E):(m=S[d]=y[d]($),m.c()),O(m,1),m.m(u,null))},i($){h||(O(m),h=!0)},o($){D(m),h=!1},d($){$&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function eF(n){let e,t,i,l,s,o;e=new ps({}),i=new di({props:{$$slots:{default:[xR]},$$scope:{ctx:n}}});let r={};return s=new tk({props:r}),n[30](s),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),v(a,l,u),F(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||(O(e.$$.fragment,a),O(i.$$.fragment,a),O(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),q(e,a),q(i,a),n[30](null),q(s,a)}}}function tF(n,e,t){let i,l,s;Qe(n,cn,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"}];Nn(cn,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;g();async function g(){t(2,c=!0);try{const oe=await me.settings.getAll()||{};y(oe)}catch(oe){me.error(oe)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const oe=await me.settings.update(z.filterRedactedProps(f));y(oe),Wt({}),tn("Successfully saved mail settings.")}catch(oe){me.error(oe)}t(3,d=!1)}}function y(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 T(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function E(){f.smtp.enabled=this.checked,t(0,f)}function M(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=yt(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 R=()=>{t(5,h=!h)};function N(oe){n.$$.not_equal(f.smtp.tls,oe)&&(f.smtp.tls=oe,t(0,f))}function U(oe){n.$$.not_equal(f.smtp.authMethod,oe)&&(f.smtp.authMethod=oe,t(0,f))}function j(){f.smtp.localName=this.value,t(0,f)}const V=()=>S(),K=()=>_(),J=()=>a==null?void 0:a.show(),ee=()=>_();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,_,S,u,i,T,$,E,M,L,I,A,P,R,N,U,j,V,K,J,ee,X]}class nF extends ye{constructor(e){super(),be(this,e,tF,eF,_e,{},null,[-1,-1])}}function iF(n){var L;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[sF]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new uk({props:$}),ie.push(()=>ve(e,"config",y)),ie.push(()=>ve(e,"isTesting",S)),ie.push(()=>ve(e,"testError",T));let E=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&vb(n),M=n[6]&&wb(n);return{c(){H(e.$$.fragment),s=C(),o=b("div"),r=b("div"),a=C(),E&&E.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],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){F(e,I,A),v(I,s,A),v(I,o,A),w(o,r),w(o,a),E&&E.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]),g=!0)},p(I,A){var R;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,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],$e(()=>l=!1)),e.$set(P),(R=I[1].s3)!=null&&R.enabled&&!I[6]&&!I[3]?E?E.p(I,A):(E=vb(I),E.c(),E.m(o,u)):E&&(E.d(1),E=null),I[6]?M?M.p(I,A):(M=wb(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)&&x(c,"btn-loading",I[3])},i(I){h||(O(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(k(s),k(o)),q(e,I),E&&E.d(),M&&M.d(),g=!1,_()}}}function lF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function kb(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,_,y,S,T,$,E,M,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',l=C(),s=b("div"),o=Y(`If you have existing uploaded files, you'll have to migrate them manually
+                                to.</string>`,s=C(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',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){v(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&&k(e),r=!1,a()}}}function gb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[28]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function AR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[DR,MR],h=[];function g(_,y){return _[4]?0:1}return f=g(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=Y(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(_,y){v(_,e,y),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,y),v(_,a,y),w(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&ue(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,y):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=m[f](_),c.c()),O(c,1),c.m(u,null))},i(_){d||(O(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function PR(n){let e,t,i,l,s,o;e=new ps({}),i=new di({props:{$$slots:{default:[AR]},$$scope:{ctx:n}}});let r={};return s=new ER({props:r}),n[29](s),s.$on("submit",n[18]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),v(a,l,u),F(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||(O(e.$$.fragment,a),O(i.$$.fragment,a),O(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),q(e,a),q(i,a),n[29](null),q(s,a)}}}function NR(n,e,t){let i,l,s,o,r,a,u;Qe(n,cn,oe=>t(15,u=oe)),Nn(cn,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,y=[],S=!1,T=!1;$();async function $(){var oe;t(4,S=!0);try{t(20,g=await me.collections.getFullList(200));for(let Se of g)delete Se.created,delete Se.updated,(oe=Se.oauth2)==null||delete oe.providers}catch(Se){me.error(Se)}t(4,S=!1)}function E(){if(t(3,y=[]),!!i)for(let oe of h){const Se=z.findByKey(g,"id",oe.id);!(Se!=null&&Se.id)||!z.hasCollectionChanges(Se,oe,_)||y.push({new:oe,old:Se})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=z.filterDuplicatesByKey(h)):t(1,h=[]);for(let oe of h)delete oe.created,delete oe.updated,oe.fields=z.filterDuplicatesByKey(oe.fields)}function L(){for(let oe of h){const Se=z.findByKey(g,"name",oe.name)||z.findByKey(g,"id",oe.id);if(!Se)continue;const ke=oe.id,Ce=Se.id;oe.id=Ce;const We=Array.isArray(Se.fields)?Se.fields:[],st=Array.isArray(oe.fields)?oe.fields:[];for(const et of st){const Be=z.findByKey(We,"name",et.name);Be&&Be.id&&(et.id=Be.id)}for(let et of h)if(Array.isArray(et.fields))for(let Be of et.fields)Be.collectionId&&Be.collectionId===ke&&(Be.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function I(oe){t(12,m=!0);const Se=new FileReader;Se.onload=async ke=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ke.target.result),await fn(),h.length||($i("Invalid collections configuration."),A())},Se.onerror=ke=>{console.warn(ke),$i("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),Wt({})}function P(){const oe=T?z.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,oe,_)}function R(oe){ie[oe?"unshift":"push"](()=>{f=oe,t(10,f)})}const N=()=>{f.files.length&&I(f.files[0])},U=()=>{f.click()};function j(){d=this.value,t(0,d)}function V(){T=this.checked,t(5,T)}function K(){_=this.checked,t(2,_)}const J=()=>L(),ee=()=>A();function X(oe){ie[oe?"unshift":"push"](()=>{c=oe,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==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=g.filter(oe=>i&&!T&&_&&!z.findByKey(h,"id",oe.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(oe=>i&&!z.findByKey(g,"id",oe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&E(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(oe=>{let Se=z.findByKey(g,"name",oe.name)||z.findByKey(g,"id",oe.id);if(!Se)return!1;if(Se.id!=oe.id)return!0;const ke=Array.isArray(Se.fields)?Se.fields:[],Ce=Array.isArray(oe.fields)?oe.fields:[];for(const We of Ce){if(z.findByKey(ke,"id",We.id))continue;const et=z.findByKey(ke,"name",We.name);if(et&&We.id!=et.id)return!0}return!1}))},[d,h,_,y,S,T,i,o,s,l,f,c,m,a,r,u,L,I,A,P,g,R,N,U,j,V,K,J,ee,X]}class RR extends ye{constructor(e){super(),be(this,e,NR,PR,_e,{},null,[-1,-1])}}function FR(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:[HR,({uniqueId:T})=>({33:T}),({uniqueId:T})=>[0,T?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[jR,({uniqueId:T})=>({33:T}),({uniqueId:T})=>[0,T?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[zR,({uniqueId:T})=>({33:T}),({uniqueId:T})=>[0,T?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&bb(n);function _(T,$){return T[6]?QR:XR}let y=_(n),S=y(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),g&&g.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,$){v(T,e,$),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),v(T,r,$),F(a,T,$),v(T,u,$),g&&g.m(T,$),v(T,f,$),v(T,c,$),w(c,d),w(c,m),S.m(c,null),h=!0},p(T,$){const E={};$[0]&1|$[1]&12&&(E.$$scope={dirty:$,ctx:T}),i.$set(E);const M={};$[0]&1|$[1]&12&&(M.$$scope={dirty:$,ctx:T}),o.$set(M);const L={};$[0]&1|$[1]&12&&(L.$$scope={dirty:$,ctx:T}),a.$set(L),T[0].smtp.enabled?g?(g.p(T,$),$[0]&1&&O(g,1)):(g=bb(T),g.c(),O(g,1),g.m(f.parentNode,f)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),y===(y=_(T))&&S?S.p(T,$):(S.d(1),S=y(T),S&&(S.c(),S.m(c,null)))},i(T){h||(O(i.$$.fragment,T),O(o.$$.fragment,T),O(a.$$.fragment,T),O(g),h=!0)},o(T){D(i.$$.fragment,T),D(o.$$.fragment,T),D(a.$$.fragment,T),D(g),h=!1},d(T){T&&(k(e),k(r),k(u),k(f),k(c)),q(i),q(o),q(a,T),g&&g.d(T),S.d()}}}function qR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function HR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function jR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function zR(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 <strong>(recommended)</strong>",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){v(c,e,d),e.checked=n[0].smtp.enabled,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[B(e,"change",n[16]),Me(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&&(k(e),k(i),k(l)),u=!1,De(f)}}}function bb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,T,$;l=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[UR,({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:[VR,({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:[BR,({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:[WR,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function E(A,P){return A[5]?KR:YR}let M=E(n),L=M(n),I=n[5]&&yb(n);return{c(){e=b("div"),t=b("div"),i=b("div"),H(l.$$.fragment),s=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),g=b("button"),L.c(),_=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(g,"type","button"),p(g,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){v(A,e,P),w(e,t),w(t,i),F(l,i,null),w(t,s),w(t,o),F(r,o,null),w(t,a),w(t,u),F(f,u,null),w(t,c),w(t,d),F(m,d,null),w(e,h),w(e,g),L.m(g,null),w(e,_),I&&I.m(e,null),S=!0,T||($=B(g,"click",tt(n[22])),T=!0)},p(A,P){const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),l.$set(R);const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),r.$set(N);const U={};P[0]&1|P[1]&12&&(U.$$scope={dirty:P,ctx:A}),f.$set(U);const j={};P[0]&17|P[1]&12&&(j.$$scope={dirty:P,ctx:A}),m.$set(j),M!==(M=E(A))&&(L.d(1),L=M(A),L&&(L.c(),L.m(g,null))),A[5]?I?(I.p(A,P),P[0]&32&&O(I,1)):(I=yb(A),I.c(),O(I,1),I.m(e,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae())},i(A){S||(O(l.$$.fragment,A),O(r.$$.fragment,A),O(f.$$.fragment,A),O(m.$$.fragment,A),O(I),A&&nt(()=>{S&&(y||(y=ze(e,wt,{duration:150},!0)),y.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&&(y||(y=ze(e,wt,{duration:150},!1)),y.run(0)),S=!1},d(A){A&&k(e),q(l),q(r),q(f),q(m),L.d(),I&&I.d(),A&&y&&y.end(),T=!1,$()}}}function UR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function VR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&_t(s.value)!==u[0].smtp.port&&ce(s,u[0].smtp.port)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function BR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function WR(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(()=>ve(s,"mask",u)),ie.push(()=>ve(s,"value",f)),{c(){e=b("label"),t=Y("Password"),l=C(),H(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),F(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],$e(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),q(s,d)}}}function YR(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function KR(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){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(k(e),k(t),k(i))}}}function yb(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:[JR,({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:[ZR,({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:[GR,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),l=C(),s=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(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,g){v(h,e,g),w(e,t),F(i,t,null),w(e,l),w(e,s),F(o,s,null),w(e,r),w(e,a),F(u,a,null),w(e,f),w(e,c),m=!0},p(h,g){const _={};g[0]&1|g[1]&12&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g[0]&1|g[1]&12&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const S={};g[0]&1|g[1]&12&&(S.$$scope={dirty:g,ctx:h}),u.$set(S)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),h&&nt(()=>{m&&(d||(d=ze(e,wt,{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=ze(e,wt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&k(e),q(i),q(o),q(u),h&&d&&d.end()}}}function JR(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 xn({props:u}),ie.push(()=>ve(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("TLS encryption"),l=C(),H(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function ZR(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 xn({props:u}),ie.push(()=>ve(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("AUTH method"),l=C(),H(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),F(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,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),q(s,f)}}}function GR(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){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),ce(r,n[0].smtp.localName),u||(f=[Me(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&&(k(e),k(o),k(r)),u=!1,De(f)}}}function XR(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-check-line"></i> <span class="txt">Send test email</span>',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){v(l,e,s),t||(i=B(e,"click",n[28]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function QR(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],x(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(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&&x(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,De(a)}}}function xR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[qR,FR],S=[];function T($,E){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=Y(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",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($,E){v($,e,E),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v($,r,E),v($,a,E),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=B(u,"submit",tt(n[29])),g=!0)},p($,E){(!h||E[0]&128)&&ue(o,$[7]);let M=d;d=T($),d===M?S[d].p($,E):(re(),D(S[M],1,1,()=>{S[M]=null}),ae(),m=S[d],m?m.p($,E):(m=S[d]=y[d]($),m.c()),O(m,1),m.m(u,null))},i($){h||(O(m),h=!0)},o($){D(m),h=!1},d($){$&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function eF(n){let e,t,i,l,s,o;e=new ps({}),i=new di({props:{$$slots:{default:[xR]},$$scope:{ctx:n}}});let r={};return s=new tk({props:r}),n[30](s),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(a,u){F(e,a,u),v(a,t,u),F(i,a,u),v(a,l,u),F(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||(O(e.$$.fragment,a),O(i.$$.fragment,a),O(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),q(e,a),q(i,a),n[30](null),q(s,a)}}}function tF(n,e,t){let i,l,s;Qe(n,cn,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"}];Nn(cn,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;g();async function g(){t(2,c=!0);try{const oe=await me.settings.getAll()||{};y(oe)}catch(oe){me.error(oe)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const oe=await me.settings.update(z.filterRedactedProps(f));y(oe),Wt({}),tn("Successfully saved mail settings.")}catch(oe){me.error(oe)}t(3,d=!1)}}function y(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 T(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function E(){f.smtp.enabled=this.checked,t(0,f)}function M(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=_t(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 R=()=>{t(5,h=!h)};function N(oe){n.$$.not_equal(f.smtp.tls,oe)&&(f.smtp.tls=oe,t(0,f))}function U(oe){n.$$.not_equal(f.smtp.authMethod,oe)&&(f.smtp.authMethod=oe,t(0,f))}function j(){f.smtp.localName=this.value,t(0,f)}const V=()=>S(),K=()=>_(),J=()=>a==null?void 0:a.show(),ee=()=>_();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,_,S,u,i,T,$,E,M,L,I,A,P,R,N,U,j,V,K,J,ee,X]}class nF extends ye{constructor(e){super(),be(this,e,tF,eF,_e,{},null,[-1,-1])}}function iF(n){var L;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[sF]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new uk({props:$}),ie.push(()=>ve(e,"config",y)),ie.push(()=>ve(e,"isTesting",S)),ie.push(()=>ve(e,"testError",T));let E=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&vb(n),M=n[6]&&wb(n);return{c(){H(e.$$.fragment),s=C(),o=b("div"),r=b("div"),a=C(),E&&E.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],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){F(e,I,A),v(I,s,A),v(I,o,A),w(o,r),w(o,a),E&&E.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]),g=!0)},p(I,A){var R;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,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],$e(()=>l=!1)),e.$set(P),(R=I[1].s3)!=null&&R.enabled&&!I[6]&&!I[3]?E?E.p(I,A):(E=vb(I),E.c(),E.m(o,u)):E&&(E.d(1),E=null),I[6]?M?M.p(I,A):(M=wb(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)&&x(c,"btn-loading",I[3])},i(I){h||(O(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(k(s),k(o)),q(e,I),E&&E.d(),M&&M.d(),g=!1,_()}}}function lF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function kb(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,_,y,S,T,$,E,M,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',l=C(),s=b("div"),o=Y(`If you have existing uploaded files, you'll have to migrate them manually
                                     from the
                                     `),r=b("strong"),u=Y(a),f=Y(`
                                     to the
@@ -197,4 +198,4 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function
                                     `),T=b("a"),T.textContent=`s5cmd
                                     `,$=Y(", etc."),E=C(),M=b("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,R){v(P,e,R),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,g),w(s,_),w(s,y),w(s,S),w(s,T),w(s,$),w(e,E),w(e,M),I=!0},p(P,R){var N;(!I||R&1)&&a!==(a=(N=P[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&ue(u,a),(!I||R&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&ue(m,d)},i(P){I||(P&&nt(()=>{I&&(L||(L=ze(e,wt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=ze(e,wt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&k(e),P&&L&&L.end()}}}function sF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&kb(n);return{c(){t&&t.c(),e=ge()},m(l,s){t&&t.m(l,s),v(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&&O(t,1)):(t=kb(l),t.c(),O(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&k(e),t&&t.d(l)}}}function vb(n){let e;function t(s,o){return s[4]?aF:s[5]?rF:oF}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),v(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&&k(e),l.d(s)}}}function oF(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function rF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Me(t=He.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Rt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&k(e),i=!1,l()}}}function aF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function wb(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){v(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&&k(e),i=!1,l()}}}function uF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[lF,iF],S=[];function T($,E){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=Y(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>By default PocketBase uses the local file system to store uploaded files.</p> <p>If you have limited disk space, you could optionally connect to an S3 compatible storage.</p>",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($,E){v($,e,E),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v($,r,E),v($,a,E),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=B(u,"submit",tt(n[16])),g=!0)},p($,E){(!h||E&128)&&ue(o,$[7]);let M=d;d=T($),d===M?S[d].p($,E):(re(),D(S[M],1,1,()=>{S[M]=null}),ae(),m=S[d],m?m.p($,E):(m=S[d]=y[d]($),m.c()),O(m,1),m.m(u,null))},i($){h||(O(m),h=!0)},o($){D(m),h=!1},d($){$&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function fF(n){let e,t,i,l;return e=new ps({}),i=new di({props:{$$slots:{default:[uF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){F(e,s,o),v(s,t,o),F(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),q(e,s),q(i,s)}}}const cF="s3_test_request";function dF(n,e,t){let i,l,s;Qe(n,cn,M=>t(7,s=M)),Nn(cn,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(cF);const M=await me.settings.update(z.filterRedactedProps(r));Wt({}),await h(M),Ds(),c?lw("Successfully saved but failed to establish S3 connection."):tn("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 g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function y(M){f=M,t(4,f)}function S(M){c=M,t(5,c)}const T=()=>g(),$=()=>m(),E=()=>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,g,i,_,y,S,T,$,E]}class pF extends ye{constructor(e){super(),be(this,e,dF,fF,_e,{})}}function Sb(n){let e,t,i,l,s;return{c(){e=Y("("),t=Y(n[1]),i=Y("/"),l=Y(n[2]),s=Y(")")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p(o,r){r&2&&ue(t,o[1]),r&4&&ue(l,o[2])},d(o){o&&(k(e),k(t),k(i),k(l),k(s))}}}function mF(n){let e,t,i,l;const s=[bF,gF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function hF(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:[vF,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[wF,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=Y(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"),x(o,"btn-disabled",n[7]),x(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),F(t,e,null),w(e,i),F(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",tt(n[13])),m=!0)},p(g,_){const y={};_&100663329&&(y.$$scope={dirty:_,ctx:g}),t.$set(y);const S={};_&100663360&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&ue(u,a),(!d||_&128)&&x(o,"btn-disabled",g[7]),(!d||_&128)&&x(o,"btn-loading",g[7])},i(g){d||(O(t.$$.fragment,g),O(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&k(e),q(t),q(l),m=!1,h()}}}function _F(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function gF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[11]&&Tb(n);return i=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[yF,({uniqueId:h})=>({25:h}),({uniqueId:h})=>h?33554432:0]},$$scope:{ctx:n}}}),{c(){m&&m.c(),e=C(),t=b("form"),H(i.$$.fragment),l=C(),s=b("button"),s.innerHTML='<span class="txt">Login</span> <i class="ri-arrow-right-line"></i>',o=C(),r=b("div"),a=b("button"),u=Y("Request another OTP"),p(s,"type","submit"),p(s,"class","btn btn-lg btn-block btn-next"),x(s,"btn-disabled",n[9]),x(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,g){m&&m.m(h,g),v(h,e,g),v(h,t,g),F(i,t,null),w(t,l),w(t,s),v(h,o,g),v(h,r,g),w(r,a),w(a,u),f=!0,c||(d=[B(t,"submit",tt(n[15])),B(a,"click",n[20])],c=!0)},p(h,g){h[11]?m?m.p(h,g):(m=Tb(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null);const _={};g&100667392&&(_.$$scope={dirty:g,ctx:h}),i.$set(_),(!f||g&512)&&x(s,"btn-disabled",h[9]),(!f||g&512)&&x(s,"btn-loading",h[9]),(!f||g&512)&&(a.disabled=h[9])},i(h){f||(O(i.$$.fragment,h),f=!0)},o(h){D(i.$$.fragment,h),f=!1},d(h){h&&(k(e),k(t),k(o),k(r)),m&&m.d(h),q(i),c=!1,De(d)}}}function bF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[kF,({uniqueId:a})=>({25:a}),({uniqueId:a})=>a?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),l=b("button"),l.innerHTML='<i class="ri-mail-send-line"></i> <span class="txt">Send OTP</span>',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),x(l,"btn-disabled",n[8]),x(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),F(t,e,null),w(e,i),w(e,l),s=!0,o||(r=B(e,"submit",tt(n[14])),o=!0)},p(a,u){const f={};u&100665344&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&x(l,"btn-disabled",a[8]),(!s||u&256)&&x(l,"btn-loading",a[8])},i(a){s||(O(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&k(e),q(t),o=!1,r()}}}function Tb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=Y("Check your "),l=b("strong"),s=Y(n[11]),o=Y(` 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){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&2048&&ue(s,r[11])},d(r){r&&k(e)}}}function yF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function kF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("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){v(u,e,f),w(e,t),v(u,l,f),v(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&&(k(e),k(l),k(s)),r=!1,a()}}}function vF(n){let e,t=z.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=Y(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){v(c,e,d),w(e,i),v(c,s,d),v(c,o,d),o.focus(),u||(f=B(o,"input",n[16]),u=!0)},p(c,d){d&1&&t!==(t=z.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&ue(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&&(k(e),k(s),k(o)),u=!1,f()}}}function wF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("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){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),ce(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[B(s,"input",n[17]),Me(Un.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&&(k(e),k(l),k(s),k(r),k(a)),f=!1,De(c)}}}function SF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&Sb(n);const f=[_F,hF,mF],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=Y(`Superuser login
-            `),u&&u.c(),l=C(),o&&o.c(),r=ge(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=Sb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),O(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(O(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(k(e),k(l),k(r)),u&&u.d(),~s&&c[s].d(m)}}}function TF(n){let e,t;return e=new ty({props:{$$slots:{default:[SF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&67117055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function $F(n,e,t){let i;Qe(n,Lu,N=>t(22,i=N));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="",_="",y="",S="";T();async function T(){if(!m){t(10,m=!0);try{t(0,r=await me.collection("_superusers").listAuthMethods())}catch(N){me.error(N)}t(10,m=!1)}}async function $(){var N,U;if(!f){t(7,f=!0);try{await me.collection("_superusers").authWithPassword(s,o),Ds(),Wt({}),Il("/")}catch(j){j.status==401?(t(3,h=j.response.mfaId),((U=(N=r==null?void 0:r.password)==null?void 0:N.identityFields)==null?void 0:U.length)==1&&r.password.identityFields[0]=="email"?(t(11,y=s),await E()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(11,y=s)):j.status!=400?me.error(j):$i("Invalid login credentials.")}t(7,f=!1)}}async function E(){if(!c){t(8,c=!0);try{const N=await me.collection("_superusers").requestOTP(y);t(4,g=N.otpId),_=g,Ds(),Wt({})}catch(N){N.status==429&&t(4,g=_),me.error(N)}t(8,c=!1)}}async function M(){if(!d){t(9,d=!0);try{await me.collection("_superusers").authWithOTP(g,S,{mfaId:h}),Ds(),Wt({}),Il("/")}catch(N){me.error(N)}t(9,d=!1)}}const L=N=>{t(5,s=N.target.value)};function I(){o=this.value,t(6,o)}function A(){y=this.value,t(11,y)}function P(){S=this.value,t(12,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var N,U;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(N=r==null?void 0:r.mfa)!=null&&N.enabled&&t(2,u++,u),(U=r==null?void 0:r.otp)!=null&&U.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,y,S,$,E,M,L,I,A,P,R]}class CF extends ye{constructor(e){super(),be(this,e,$F,TF,_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<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const on=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("pbinstal")?Il("/"):!0}],OF={"/login":Qt({component:CF,conditions:on.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Qt({asyncComponent:()=>Ot(()=>import("./PageSuperuserRequestPasswordReset-DkL8JGq2.js"),[],import.meta.url),conditions:on.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageSuperuserConfirmPasswordReset-g9lrmmbf.js"),[],import.meta.url),conditions:on.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Qt({component:vN,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Qt({component:g5,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Qt({component:h7,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Qt({component:nF,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Qt({component:pF,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Qt({component:_R,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Qt({component:RR,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Qt({component:aR,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmPasswordReset-Dt6q5hoH.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmPasswordReset-Dt6q5hoH.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmVerification-CvRAamHy.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmVerification-CvRAamHy.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmEmailChange-BNkhd6Kl.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmEmailChange-BNkhd6Kl.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Qt({asyncComponent:()=>Ot(()=>import("./PageOAuth2RedirectSuccess-dU_MeWIo.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Qt({asyncComponent:()=>Ot(()=>import("./PageOAuth2RedirectFailure-2gnIEHBl.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"*":Qt({component:r3,userData:{showAppSidebar:!1}})};function EF(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){v(t,e,i)},d(t){t&&k(e)}}}function $b(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=z.getInitials(n[0].email)+"",h,g,_,y,S,T,$;return _=new Hn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[MF]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=C(),l=b("nav"),s=b("a"),s.innerHTML='<i class="ri-database-2-line"></i>',o=C(),r=b("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=C(),u=b("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=C(),c=b("div"),d=b("span"),h=Y(m),g=C(),H(_.$$.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",y=n[0].email),p(e,"class","app-sidebar")},m(E,M){v(E,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,g),F(_,c,null),S=!0,T||($=[Me(Un.call(null,t)),Me(Un.call(null,s)),Me(Ri.call(null,s,{path:"/collections/?.*",className:"current-route"})),Me(He.call(null,s,{text:"Collections",position:"right"})),Me(Un.call(null,r)),Me(Ri.call(null,r,{path:"/logs/?.*",className:"current-route"})),Me(He.call(null,r,{text:"Logs",position:"right"})),Me(Un.call(null,u)),Me(Ri.call(null,u,{path:"/settings/?.*",className:"current-route"})),Me(He.call(null,u,{text:"Settings",position:"right"}))],T=!0)},p(E,M){(!S||M&1)&&m!==(m=z.getInitials(E[0].email)+"")&&ue(h,m);const L={};M&4097&&(L.$$scope={dirty:M,ctx:E}),_.$set(L),(!S||M&1&&y!==(y=E[0].email))&&p(c,"title",y)},i(E){S||(O(_.$$.fragment,E),S=!0)},o(E){D(_.$$.fragment,E),S=!1},d(E){E&&k(e),q(_),T=!1,De($)}}}function MF(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=Y(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML='<i class="ri-shield-user-line" aria-hidden="true"></i> <span class="txt">Manage superusers</span>',u=C(),f=b("button"),f.innerHTML='<i class="ri-logout-circle-line" aria-hidden="true"></i> <span class="txt">Logout</span>',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collectionId=_pbc_3323866339"),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){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Me(Un.call(null,a)),B(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&ue(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(k(e),k(s),k(o),k(r),k(a),k(u),k(f)),c=!1,De(d)}}}function Cb(n){let e,t,i;return t=new Tu({props:{conf:z.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p:te,i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function DF(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=z.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&EF(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&$b(n);r=new Fw({props:{routes:OF}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new cw({}),c=new G2({});let y=n[1]&&!n[2]&&Cb(n);return{c(){g&&g.c(),t=ge(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),H(c.$$.fragment),d=C(),y&&y.c(),m=ge(),p(o,"class","app-body"),p(l,"class","app-layout")},m(T,$){g&&g.m(document.head,null),w(document.head,t),v(T,i,$),v(T,l,$),_&&_.m(l,null),w(l,s),w(l,o),F(r,o,null),w(o,a),F(u,o,null),v(T,f,$),F(c,T,$),v(T,d,$),y&&y.m(T,$),v(T,m,$),h=!0},p(T,[$]){var E;(!h||$&24)&&e!==(e=z.joinNonEmpty([T[4],T[3],"PocketBase"]," - "))&&(document.title=e),(E=T[0])!=null&&E.id&&T[1]?_?(_.p(T,$),$&3&&O(_,1)):(_=$b(T),_.c(),O(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),T[1]&&!T[2]?y?(y.p(T,$),$&6&&O(y,1)):(y=Cb(T),y.c(),O(y,1),y.m(m.parentNode,m)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(T){h||(O(_),O(r.$$.fragment,T),O(u.$$.fragment,T),O(c.$$.fragment,T),O(y),h=!0)},o(T){D(_),D(r.$$.fragment,T),D(u.$$.fragment,T),D(c.$$.fragment,T),D(y),h=!1},d(T){T&&(k(i),k(l),k(f),k(d),k(m)),g&&g.d(T),k(t),_&&_.d(),q(r),q(u),q(c,T),y&&y.d(T)}}}function IF(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Fr,g=>t(0,s=g)),Qe(n,cn,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,y,S,T;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=g==null?void 0:g.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,Nn(cn,o="",o),Wt({}),V0())}function c(){Il("/")}async function d(){var g,_;if(s!=null&&s.id)try{const y=await me.settings.getAll({$cancelKey:"initialAppSettings"});Nn(_r,l=((g=y==null?void 0:y.meta)==null?void 0:g.appName)||"",l),Nn(Dl,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}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 LF extends ye{constructor(e){super(),be(this,e,IF,DF,_e,{})}}new LF({target:document.getElementById("app")});export{De as A,tn as B,z as C,Il as D,ge as E,ty as F,fo as G,xl as H,Cu as I,Qe as J,Nn as K,Yt as L,cn as M,En as N,_t as O,ie as P,fP as Q,Qu as R,ye as S,pe as T,kt as U,ci as V,zt as W,pt as X,jt as Y,Sk as Z,D as a,C as b,H as c,q as d,b as e,p as f,v as g,w as h,be as i,Me as j,re as k,Un as l,F as m,ae as n,k as o,me as p,fe as q,x as r,_e as s,O as t,B as u,tt as v,Y as w,ue as x,te as y,ce as z};
+            `),u&&u.c(),l=C(),o&&o.c(),r=ge(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=Sb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),O(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(O(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(k(e),k(l),k(r)),u&&u.d(),~s&&c[s].d(m)}}}function TF(n){let e,t;return e=new ty({props:{$$slots:{default:[SF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,l){F(e,i,l),t=!0},p(i,[l]){const s={};l&67117055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function $F(n,e,t){let i;Qe(n,Lu,N=>t(22,i=N));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="",_="",y="",S="";T();async function T(){if(!m){t(10,m=!0);try{t(0,r=await me.collection("_superusers").listAuthMethods())}catch(N){me.error(N)}t(10,m=!1)}}async function $(){var N,U;if(!f){t(7,f=!0);try{await me.collection("_superusers").authWithPassword(s,o),Ds(),Wt({}),Il("/")}catch(j){j.status==401?(t(3,h=j.response.mfaId),((U=(N=r==null?void 0:r.password)==null?void 0:N.identityFields)==null?void 0:U.length)==1&&r.password.identityFields[0]=="email"?(t(11,y=s),await E()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(11,y=s)):j.status!=400?me.error(j):$i("Invalid login credentials.")}t(7,f=!1)}}async function E(){if(!c){t(8,c=!0);try{const N=await me.collection("_superusers").requestOTP(y);t(4,g=N.otpId),_=g,Ds(),Wt({})}catch(N){N.status==429&&t(4,g=_),me.error(N)}t(8,c=!1)}}async function M(){if(!d){t(9,d=!0);try{await me.collection("_superusers").authWithOTP(g,S,{mfaId:h}),Ds(),Wt({}),Il("/")}catch(N){me.error(N)}t(9,d=!1)}}const L=N=>{t(5,s=N.target.value)};function I(){o=this.value,t(6,o)}function A(){y=this.value,t(11,y)}function P(){S=this.value,t(12,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var N,U;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(N=r==null?void 0:r.mfa)!=null&&N.enabled&&t(2,u++,u),(U=r==null?void 0:r.otp)!=null&&U.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,y,S,$,E,M,L,I,A,P,R]}class CF extends ye{constructor(e){super(),be(this,e,$F,TF,_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<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const on=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("pbinstal")?Il("/"):!0}],OF={"/login":Qt({component:CF,conditions:on.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Qt({asyncComponent:()=>Ot(()=>import("./PageSuperuserRequestPasswordReset-BNXIAEy4.js"),[],import.meta.url),conditions:on.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageSuperuserConfirmPasswordReset-K6Q1jQaB.js"),[],import.meta.url),conditions:on.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Qt({component:vN,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Qt({component:g5,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Qt({component:h7,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Qt({component:nF,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Qt({component:pF,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Qt({component:_R,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Qt({component:RR,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Qt({component:aR,conditions:on.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmPasswordReset-B-qLfTWn.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmPasswordReset-B-qLfTWn.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmVerification-BPX_PYBc.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmVerification-BPX_PYBc.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmEmailChange-D2B5r6kI.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Qt({asyncComponent:()=>Ot(()=>import("./PageRecordConfirmEmailChange-D2B5r6kI.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Qt({asyncComponent:()=>Ot(()=>import("./PageOAuth2RedirectSuccess-D88pwV_a.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Qt({asyncComponent:()=>Ot(()=>import("./PageOAuth2RedirectFailure-CDTl1tTq.js"),[],import.meta.url),conditions:on,userData:{showAppSidebar:!1}}),"*":Qt({component:r3,userData:{showAppSidebar:!1}})};function EF(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){v(t,e,i)},d(t){t&&k(e)}}}function $b(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=z.getInitials(n[0].email)+"",h,g,_,y,S,T,$;return _=new Hn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[MF]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=C(),l=b("nav"),s=b("a"),s.innerHTML='<i class="ri-database-2-line"></i>',o=C(),r=b("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=C(),u=b("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=C(),c=b("div"),d=b("span"),h=Y(m),g=C(),H(_.$$.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",y=n[0].email),p(e,"class","app-sidebar")},m(E,M){v(E,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,g),F(_,c,null),S=!0,T||($=[Me(Un.call(null,t)),Me(Un.call(null,s)),Me(Ri.call(null,s,{path:"/collections/?.*",className:"current-route"})),Me(He.call(null,s,{text:"Collections",position:"right"})),Me(Un.call(null,r)),Me(Ri.call(null,r,{path:"/logs/?.*",className:"current-route"})),Me(He.call(null,r,{text:"Logs",position:"right"})),Me(Un.call(null,u)),Me(Ri.call(null,u,{path:"/settings/?.*",className:"current-route"})),Me(He.call(null,u,{text:"Settings",position:"right"}))],T=!0)},p(E,M){(!S||M&1)&&m!==(m=z.getInitials(E[0].email)+"")&&ue(h,m);const L={};M&4097&&(L.$$scope={dirty:M,ctx:E}),_.$set(L),(!S||M&1&&y!==(y=E[0].email))&&p(c,"title",y)},i(E){S||(O(_.$$.fragment,E),S=!0)},o(E){D(_.$$.fragment,E),S=!1},d(E){E&&k(e),q(_),T=!1,De($)}}}function MF(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=Y(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML='<i class="ri-shield-user-line" aria-hidden="true"></i> <span class="txt">Manage superusers</span>',u=C(),f=b("button"),f.innerHTML='<i class="ri-logout-circle-line" aria-hidden="true"></i> <span class="txt">Logout</span>',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collectionId=_pbc_3323866339"),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){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Me(Un.call(null,a)),B(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&ue(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(k(e),k(s),k(o),k(r),k(a),k(u),k(f)),c=!1,De(d)}}}function Cb(n){let e,t,i;return t=new Tu({props:{conf:z.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),F(t,e,null),i=!0},p:te,i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),q(t)}}}function DF(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=z.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&EF(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&$b(n);r=new Fw({props:{routes:OF}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new cw({}),c=new G2({});let y=n[1]&&!n[2]&&Cb(n);return{c(){g&&g.c(),t=ge(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),H(c.$$.fragment),d=C(),y&&y.c(),m=ge(),p(o,"class","app-body"),p(l,"class","app-layout")},m(T,$){g&&g.m(document.head,null),w(document.head,t),v(T,i,$),v(T,l,$),_&&_.m(l,null),w(l,s),w(l,o),F(r,o,null),w(o,a),F(u,o,null),v(T,f,$),F(c,T,$),v(T,d,$),y&&y.m(T,$),v(T,m,$),h=!0},p(T,[$]){var E;(!h||$&24)&&e!==(e=z.joinNonEmpty([T[4],T[3],"PocketBase"]," - "))&&(document.title=e),(E=T[0])!=null&&E.id&&T[1]?_?(_.p(T,$),$&3&&O(_,1)):(_=$b(T),_.c(),O(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),T[1]&&!T[2]?y?(y.p(T,$),$&6&&O(y,1)):(y=Cb(T),y.c(),O(y,1),y.m(m.parentNode,m)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(T){h||(O(_),O(r.$$.fragment,T),O(u.$$.fragment,T),O(c.$$.fragment,T),O(y),h=!0)},o(T){D(_),D(r.$$.fragment,T),D(u.$$.fragment,T),D(c.$$.fragment,T),D(y),h=!1},d(T){T&&(k(i),k(l),k(f),k(d),k(m)),g&&g.d(T),k(t),_&&_.d(),q(r),q(u),q(c,T),y&&y.d(T)}}}function IF(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Fr,g=>t(0,s=g)),Qe(n,cn,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,y,S,T;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=g==null?void 0:g.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,Nn(cn,o="",o),Wt({}),V0())}function c(){Il("/")}async function d(){var g,_;if(s!=null&&s.id)try{const y=await me.settings.getAll({$cancelKey:"initialAppSettings"});Nn(_r,l=((g=y==null?void 0:y.meta)==null?void 0:g.appName)||"",l),Nn(Dl,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}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 LF extends ye{constructor(e){super(),be(this,e,IF,DF,_e,{})}}new LF({target:document.getElementById("app")});export{De as A,tn as B,z as C,Il as D,ge as E,ty as F,fo as G,xl as H,Cu as I,Qe as J,Nn as K,Yt as L,cn as M,En as N,gt as O,ie as P,fP as Q,Qu as R,ye as S,pe as T,kt as U,ci as V,zt as W,pt as X,jt as Y,Sk as Z,D as a,C as b,H as c,q as d,b as e,p as f,v as g,w as h,be as i,Me as j,re as k,Un as l,F as m,ae as n,k as o,me as p,fe as q,x as r,_e as s,O as t,B as u,tt as v,Y as w,ue as x,te as y,ce as z};
diff --git a/ui/dist/index.html b/ui/dist/index.html
index 2abeb7c2..cd557bfd 100644
--- a/ui/dist/index.html
+++ b/ui/dist/index.html
@@ -41,7 +41,7 @@
         window.Prism = window.Prism || {};
         window.Prism.manual = true;
     </script>
-  <script type="module" crossorigin src="./assets/index-CN4euoX9.js"></script>
+  <script type="module" crossorigin src="./assets/index-BaIGfIip.js"></script>
   <link rel="stylesheet" crossorigin href="./assets/index-Cwj4Cw5-.css">
 </head>
 <body>
diff --git a/ui/src/components/collections/CollectionQueryTab.svelte b/ui/src/components/collections/CollectionQueryTab.svelte
index 63232cfe..f253d596 100644
--- a/ui/src/components/collections/CollectionQueryTab.svelte
+++ b/ui/src/components/collections/CollectionQueryTab.svelte
@@ -92,8 +92,12 @@
                 <code>(ROW_NUMBER() OVER()) as id</code>.
             </li>
             <li>
-                Expressions must be aliased with a valid formatted field name (eg.
-                <code>MAX(balance) as maxBalance</code>).
+                Expressions must be aliased with a valid formatted field name, e.g.
+                <code>MAX(balance) as maxBalance</code>.
+            </li>
+            <li>
+                Combined/multi-spaced expressions must be wrapped in parenthesis, e.g.
+                <code>(MAX(balance) + 1) as maxBalance</code>.
             </li>
         </ul>
     </div>
diff --git a/ui/src/components/collections/CollectionsSidebar.svelte b/ui/src/components/collections/CollectionsSidebar.svelte
index afd17216..74d12a13 100644
--- a/ui/src/components/collections/CollectionsSidebar.svelte
+++ b/ui/src/components/collections/CollectionsSidebar.svelte
@@ -29,7 +29,7 @@
     }
 
     $: filtered = $collections.filter((c) => {
-        return c.id == searchTerm || c.name.replace(/\s+/g, "").toLowerCase().includes(normalizedSearch);
+        return c.id == searchTerm || c.name?.replace(/\s+/g, "")?.toLowerCase()?.includes(normalizedSearch);
     });
 
     $: pinnedCollections = filtered.filter((c) => pinnedIds.includes(c.id));
diff --git a/ui/src/components/collections/OTPAccordion.svelte b/ui/src/components/collections/OTPAccordion.svelte
index 233e5eef..2a1a3e37 100644
--- a/ui/src/components/collections/OTPAccordion.svelte
+++ b/ui/src/components/collections/OTPAccordion.svelte
@@ -85,7 +85,14 @@
         <div class="col-sm-6">
             <Field class="form-field form-field-toggle required" name="otp.length" let:uniqueId>
                 <label for={uniqueId}>Generated password length</label>
-                <input type="number" id={uniqueId} bind:value={collection.otp.length} required />
+                <input
+                    type="number"
+                    min="0"
+                    step="1"
+                    id={uniqueId}
+                    bind:value={collection.otp.length}
+                    required
+                />
             </Field>
         </div>
     </div>
diff --git a/ui/src/components/collections/providers/AppleSecretPopup.svelte b/ui/src/components/collections/providers/AppleSecretPopup.svelte
index c8779dad..bdd25f0d 100644
--- a/ui/src/components/collections/providers/AppleSecretPopup.svelte
+++ b/ui/src/components/collections/providers/AppleSecretPopup.svelte
@@ -49,7 +49,7 @@
                 teamId,
                 keyId,
                 privateKey.trim(),
-                duration
+                duration,
             );
 
             isSubmitting = false;
@@ -114,7 +114,7 @@
                             }}
                         />
                     </label>
-                    <input type="text" id={uniqueId} max={maxDuration} bind:value={duration} required />
+                    <input type="number" id={uniqueId} max={maxDuration} bind:value={duration} required />
                 </Field>
             </div>